Package com.wowza.wms.sharedobject
Interface ISharedObject
- All Known Implementing Classes:
SharedObject
public interface ISharedObject
ISharedObject: public interface to SharedObject class.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final byteshared object command: connectstatic final byteshared object command: clearstatic final byteshared object command: deletestatic final byteshared object command: disconnectstatic final byteshared object command: errorstatic final byteshared object command: sendstatic final byteshared object command: setvaluestatic final byteshared object status: changestatic final byteshared object status: clearstatic final byteshared object status: deletestatic final byteshared object status: success -
Method Summary
Modifier and TypeMethodDescriptionvoidacquire()Increment the reference count to this shared object.voidAdd a client to this shared object.voidaddSlotListener(ISharedObjectSlotNotify slotListener) Add a slot listener.voidclear()Clear all properties from a shared objectvoidclose()Force close this shared object (not implemented)booleancontainsProperty(String slotName) Returns true is slot/property name existsbooleancontainsSlot(String slotName) Returns true is slot/property name existsvoiddeleteSlot(IClient client, String slotName) Remove a slot (property)voiddeleteSlot(String slotName) Remove slot (property)voiddisconnect(IClient client) Disconnect client from shared object.voidflush()Flush (write to disk) shared objectList<com.wowza.wms.sharedobject.SharedObjectClient>Get a list of client that are connected to this shared object.getName()Get shared object nameGet the shared object container to which this shared object belongs.getProperty(String slotName) Get slot (property) value.intGet the current reference (clients) connected to this shared object.Get ISharedObjectSlot interface to a slot (property) by nameGet a list of slot (property) namesgetSlots()Get a list of active slotsGet path used to store shared object.intGet the internval version number.booleanIs this client connected to shared objectbooleanIs this shared object being persisted.voidlock()Lock a shared object for write accessintpurge(int version) Purge all deleted properties older than the version numbervoidputSlot(String name, ISharedObjectSlot slot) Add a new slot (property) to a shared object.voidrelease()Descrement the reference count to this shared object.voidremoveClient(IClient client) Remove a client from this shared object.voidremoveSlotListener(ISharedObjectSlotNotify slotListener) Remove slot listenervoidCall client side handler attached to shared object (no parameters).voidCall client side handler attached to shared object.voidSet shared object namevoidsetPersistent(boolean isPersistent) Set is shared object persisted.voidsetProperty(String slotName, boolean value) Set slot (property) value as a boolean value (will be wrapped in an AMFDataItem object)voidsetProperty(String slotName, double value) Set slot (property) value as a double value (will be wrapped in an AMFDataItem object)voidsetProperty(String slotName, int value) Set slot (property) value as a int value (will be wrapped in an AMFDataItem object)voidsetProperty(String slotName, long value) Set slot (property) value as a long value (will be wrapped in an AMFDataItem object)voidsetProperty(String slotName, AMFData data) Set slot (property) value as AMFData object.voidsetProperty(String slotName, String value) Set slot (property) value as a string value (will be wrapped in an AMFDataItem object)voidsetProperty(String slotName, Date value) Set slot (property) value as a date value (will be wrapped in an AMFDataItem object)voidsetStorageDir(String storageDir) Set path used to store shared object.voidsetVersion(int version) Set the internal version number.intsize()Get the number of active slot (properties).voidunlock()Unlock a shared object for write accessvoidwriteDeleteError(IClient client, String soName, boolean isPersistent, String slotName, String errorMsg) Write an delete error message back to the clientvoidwriteSetValueError(IClient client, String soName, boolean isPersistent, String slotName, String errorMsg) Write an set value error message back to the client
-
Field Details
-
FILEEXTENSION
- See Also:
-
SHAREDOBJECT_CMD_CONNECT
static final byte SHAREDOBJECT_CMD_CONNECTshared object command: connect- See Also:
-
SHAREDOBJECT_CMD_DISCONNECT
static final byte SHAREDOBJECT_CMD_DISCONNECTshared object command: disconnect- See Also:
-
SHAREDOBJECT_CMD_SETVALUE
static final byte SHAREDOBJECT_CMD_SETVALUEshared object command: setvalue- See Also:
-
SHAREDOBJECT_CMD_SEND
static final byte SHAREDOBJECT_CMD_SENDshared object command: send- See Also:
-
SHAREDOBJECT_CMD_ERROR
static final byte SHAREDOBJECT_CMD_ERRORshared object command: error- See Also:
-
SHAREDOBJECT_CMD_DELETE
static final byte SHAREDOBJECT_CMD_DELETEshared object command: delete- See Also:
-
SHAREDOBJECT_CMD_CONNECTSUCCESS
static final byte SHAREDOBJECT_CMD_CONNECTSUCCESSshared object command: clear- See Also:
-
SHAREDOBJECT_STATUS_CHANGE
static final byte SHAREDOBJECT_STATUS_CHANGEshared object status: change- See Also:
-
SHAREDOBJECT_STATUS_SUCCESS
static final byte SHAREDOBJECT_STATUS_SUCCESSshared object status: success- See Also:
-
SHAREDOBJECT_STATUS_CLEAR
static final byte SHAREDOBJECT_STATUS_CLEARshared object status: clear- See Also:
-
SHAREDOBJECT_STATUS_DELETE
static final byte SHAREDOBJECT_STATUS_DELETEshared object status: delete- See Also:
-
-
Method Details
-
getSlotNames
Get a list of slot (property) names- Returns:
- list of slot (property) names
-
getSlot
Get ISharedObjectSlot interface to a slot (property) by name- Parameters:
name- slot (property) name- Returns:
- ISharedObjectSlot interface
-
getClients
List<com.wowza.wms.sharedobject.SharedObjectClient> getClients()Get a list of client that are connected to this shared object.- Returns:
- list of client that are connected to this shared object
-
isClient
Is this client connected to shared object- Parameters:
client- client- Returns:
- true if client is conencted to shared object
-
addClient
Add a client to this shared object.- Parameters:
client- client
-
removeClient
Remove a client from this shared object.- Parameters:
client- client
-
size
int size()Get the number of active slot (properties). Deleted slots are not counted.- Returns:
- number of active slot (properties). Deleted slots are not counted
-
acquire
void acquire()Increment the reference count to this shared object. -
release
void release()Descrement the reference count to this shared object. -
close
void close()Force close this shared object (not implemented) -
getRefCount
int getRefCount()Get the current reference (clients) connected to this shared object. Includes unbalanced count of calls to acquire.- Returns:
- the current reference (clients) connected to this shared object
-
isPersistent
boolean isPersistent()Is this shared object being persisted.- Returns:
- true if shared object is being persisted
-
setPersistent
void setPersistent(boolean isPersistent) Set is shared object persisted.- Parameters:
isPersistent- true if shared object is being persisted
-
getVersion
int getVersion()Get the internval version number.- Returns:
- internval version number
-
setVersion
void setVersion(int version) Set the internal version number.- Parameters:
version- internal version number
-
flush
void flush()Flush (write to disk) shared object -
deleteSlot
Remove a slot (property)- Parameters:
client- client removing slot or null if server side codeslotName- slot (property) name
-
deleteSlot
Remove slot (property)- Parameters:
slotName- slot (property) name
-
getProperty
Get slot (property) value.- Parameters:
slotName- slot (property) name- Returns:
- slot (property) value as AMFData object
-
setProperty
Set slot (property) value as a string value (will be wrapped in an AMFDataItem object)- Parameters:
slotName- slot (property) namevalue- string value
-
setProperty
Set slot (property) value as a double value (will be wrapped in an AMFDataItem object)- Parameters:
slotName- slot (property) namevalue- double value
-
setProperty
Set slot (property) value as a int value (will be wrapped in an AMFDataItem object)- Parameters:
slotName- slot (property) namevalue- int value
-
setProperty
Set slot (property) value as a long value (will be wrapped in an AMFDataItem object)- Parameters:
slotName- slot (property) namevalue- long value
-
setProperty
Set slot (property) value as a date value (will be wrapped in an AMFDataItem object)- Parameters:
slotName- slot (property) namevalue- date value
-
setProperty
Set slot (property) value as a boolean value (will be wrapped in an AMFDataItem object)- Parameters:
slotName- slot (property) namevalue- boolean value
-
setProperty
Set slot (property) value as AMFData object.- Parameters:
slotName- slot (property) namedata- slot value as AMFData object. Example: new AMFDataItem((double)1.234) or new AMFDataItem()
-
disconnect
Disconnect client from shared object.- Parameters:
client- client to disconnect
-
getName
String getName()Get shared object name- Returns:
- shared object name
-
setName
Set shared object name- Parameters:
name- shared object name
-
send
Call client side handler attached to shared object.- Parameters:
handlerName- handler nameparams- variable argument list of parameters
-
send
Call client side handler attached to shared object (no parameters).- Parameters:
handlerName- handler name
-
getStorageDir
String getStorageDir()Get path used to store shared object.- Returns:
- path used to store shared object
-
setStorageDir
Set path used to store shared object.- Parameters:
storageDir- path used to store shared object
-
writeSetValueError
void writeSetValueError(IClient client, String soName, boolean isPersistent, String slotName, String errorMsg) Write an set value error message back to the client- Parameters:
client- client removing slot or null if server side codesoName- sharedObject nameisPersistent- is persistentslotName- slot nameerrorMsg- error message
-
writeDeleteError
void writeDeleteError(IClient client, String soName, boolean isPersistent, String slotName, String errorMsg) Write an delete error message back to the client- Parameters:
client- client removing slot or null if server side codesoName- sharedObject nameisPersistent- is persistentslotName- slot nameerrorMsg- error message
-
clear
void clear()Clear all properties from a shared object -
purge
int purge(int version) Purge all deleted properties older than the version number- Returns:
- number of slots purged
-
getSlots
List<ISharedObjectSlot> getSlots()Get a list of active slots- Returns:
- list of active slots
-
containsProperty
Returns true is slot/property name exists- Parameters:
slotName- slot/property name- Returns:
- true is slot/property name exists
-
containsSlot
Returns true is slot/property name exists- Parameters:
slotName- slot/property name- Returns:
- true is slot/property name exists
-
lock
void lock()Lock a shared object for write access -
unlock
void unlock()Unlock a shared object for write access -
getParent
ISharedObjects getParent()Get the shared object container to which this shared object belongs.- Returns:
- shared object container
-