Package com.wowza.wms.sharedobject
Class SharedObject
Object
com.wowza.wms.sharedobject.SharedObject
- All Implemented Interfaces:
ISharedObject
-
Field Summary
FieldsFields inherited from interface com.wowza.wms.sharedobject.ISharedObject
FILEEXTENSION, SHAREDOBJECT_CMD_CONNECT, SHAREDOBJECT_CMD_CONNECTSUCCESS, SHAREDOBJECT_CMD_DELETE, SHAREDOBJECT_CMD_DISCONNECT, SHAREDOBJECT_CMD_ERROR, SHAREDOBJECT_CMD_SEND, SHAREDOBJECT_CMD_SETVALUE, SHAREDOBJECT_STATUS_CHANGE, SHAREDOBJECT_STATUS_CLEAR, SHAREDOBJECT_STATUS_DELETE, SHAREDOBJECT_STATUS_SUCCESS -
Constructor Summary
ConstructorsConstructorDescriptionSharedObject(String name) Create new shared objectSharedObject(String name, boolean isPersistent, String storageDir) Create new shared object -
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 objectstatic boolean[]List<com.wowza.wms.sharedobject.SharedObjectClient>Get a list of client that are connected to this shared object.voidgetClientUpdates(IClient client) 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.voidload()voidlock()Lock a shared object for write accessvoidvoidintpurge(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.voidsendInternal(IClient client, String handlerName, byte[] msgBytes) voidsendInternal(IClient client, String handlerName, byte[] msgBytes, AMFDataContextDeserialize context) voidsendInternal(String handlerName, AMFData[] params) voidSet shared object namevoidsetParent(ISharedObjects parent) voidsetPersistent(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)voidsetSlotValue(IClient client, String slotName, byte[] byteData) voidsetSlotValue(IClient client, String slotName, byte[] byteData, AMFData amfData) voidsetSlotValue(IClient client, String slotName, byte[] byteData, AMFDataContextDeserialize context) voidsetSlotValue(IClient client, String slotName, byte[] byteData, AMFData amfData, AMFDataContextDeserialize context) voidsetSlotValue(IClient client, String slotName, AMFData amfData) 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 clientstatic voidwriteError(IClient client, String soName, boolean isPersistent, String errorMsg, boolean isConnect) voidwriteSetValueError(IClient client, String soName, boolean isPersistent, String slotName, String errorMsg) Write an set value error message back to the client
-
Field Details
-
READACCESS
public static final int READACCESS- See Also:
-
WRITEACCESS
public static final int WRITEACCESS- See Also:
-
-
Constructor Details
-
SharedObject
Create new shared object- Parameters:
name- shared object name
-
SharedObject
Create new shared object- Parameters:
name- shared object nameisPersistent- is persistentstorageDir- storage directory for persistent shared object
-
-
Method Details
-
size
public int size()Description copied from interface:ISharedObjectGet the number of active slot (properties). Deleted slots are not counted.- Specified by:
sizein interfaceISharedObject- Returns:
- number of active slot (properties). Deleted slots are not counted
-
purge
public int purge(int version) Description copied from interface:ISharedObjectPurge all deleted properties older than the version number- Specified by:
purgein interfaceISharedObject- Returns:
- number of slots purged
-
clear
public void clear()Description copied from interface:ISharedObjectClear all properties from a shared object- Specified by:
clearin interfaceISharedObject
-
getSlots
Description copied from interface:ISharedObjectGet a list of active slots- Specified by:
getSlotsin interfaceISharedObject- Returns:
- list of active slots
-
getSlotNames
Description copied from interface:ISharedObjectGet a list of slot (property) names- Specified by:
getSlotNamesin interfaceISharedObject- Returns:
- list of slot (property) names
-
getSlot
Description copied from interface:ISharedObjectGet ISharedObjectSlot interface to a slot (property) by name- Specified by:
getSlotin interfaceISharedObject- Parameters:
name- slot (property) name- Returns:
- ISharedObjectSlot interface
-
getClients
Description copied from interface:ISharedObjectGet a list of client that are connected to this shared object.- Specified by:
getClientsin interfaceISharedObject- Returns:
- list of client that are connected to this shared object
-
isClient
Description copied from interface:ISharedObjectIs this client connected to shared object- Specified by:
isClientin interfaceISharedObject- Parameters:
client- client- Returns:
- true if client is conencted to shared object
-
addClient
Description copied from interface:ISharedObjectAdd a client to this shared object.- Specified by:
addClientin interfaceISharedObject- Parameters:
client- client
-
removeClient
Description copied from interface:ISharedObjectRemove a client from this shared object.- Specified by:
removeClientin interfaceISharedObject- Parameters:
client- client
-
acquire
public void acquire()Description copied from interface:ISharedObjectIncrement the reference count to this shared object.- Specified by:
acquirein interfaceISharedObject
-
release
public void release()Description copied from interface:ISharedObjectDescrement the reference count to this shared object.- Specified by:
releasein interfaceISharedObject
-
getRefCount
public int getRefCount()Description copied from interface:ISharedObjectGet the current reference (clients) connected to this shared object. Includes unbalanced count of calls to acquire.- Specified by:
getRefCountin interfaceISharedObject- Returns:
- the current reference (clients) connected to this shared object
-
isPersistent
public boolean isPersistent()Description copied from interface:ISharedObjectIs this shared object being persisted.- Specified by:
isPersistentin interfaceISharedObject- Returns:
- true if shared object is being persisted
-
setPersistent
public void setPersistent(boolean isPersistent) Description copied from interface:ISharedObjectSet is shared object persisted.- Specified by:
setPersistentin interfaceISharedObject- Parameters:
isPersistent- true if shared object is being persisted
-
getVersion
public int getVersion()Description copied from interface:ISharedObjectGet the internval version number.- Specified by:
getVersionin interfaceISharedObject- Returns:
- internval version number
-
setVersion
public void setVersion(int version) Description copied from interface:ISharedObjectSet the internal version number.- Specified by:
setVersionin interfaceISharedObject- Parameters:
version- internal version number
-
deleteSlot
Description copied from interface:ISharedObjectRemove slot (property)- Specified by:
deleteSlotin interfaceISharedObject- Parameters:
slotName- slot (property) name
-
containsProperty
Description copied from interface:ISharedObjectReturns true is slot/property name exists- Specified by:
containsPropertyin interfaceISharedObject- Parameters:
slotName- slot/property name- Returns:
- true is slot/property name exists
-
containsSlot
Description copied from interface:ISharedObjectReturns true is slot/property name exists- Specified by:
containsSlotin interfaceISharedObject- Parameters:
slotName- slot/property name- Returns:
- true is slot/property name exists
-
deleteSlot
Description copied from interface:ISharedObjectRemove a slot (property)- Specified by:
deleteSlotin interfaceISharedObject- Parameters:
client- client removing slot or null if server side codeslotName- slot (property) name
-
getProperty
Description copied from interface:ISharedObjectGet slot (property) value.- Specified by:
getPropertyin interfaceISharedObject- Parameters:
slotName- slot (property) name- Returns:
- slot (property) value as AMFData object
-
setProperty
Description copied from interface:ISharedObjectSet slot (property) value as a boolean value (will be wrapped in an AMFDataItem object)- Specified by:
setPropertyin interfaceISharedObject- Parameters:
slotName- slot (property) namevalue- boolean value
-
setProperty
Description copied from interface:ISharedObjectSet slot (property) value as a date value (will be wrapped in an AMFDataItem object)- Specified by:
setPropertyin interfaceISharedObject- Parameters:
slotName- slot (property) namevalue- date value
-
setProperty
Description copied from interface:ISharedObjectSet slot (property) value as a double value (will be wrapped in an AMFDataItem object)- Specified by:
setPropertyin interfaceISharedObject- Parameters:
slotName- slot (property) namevalue- double value
-
setProperty
Description copied from interface:ISharedObjectSet slot (property) value as a long value (will be wrapped in an AMFDataItem object)- Specified by:
setPropertyin interfaceISharedObject- Parameters:
slotName- slot (property) namevalue- long value
-
setProperty
Description copied from interface:ISharedObjectSet slot (property) value as a int value (will be wrapped in an AMFDataItem object)- Specified by:
setPropertyin interfaceISharedObject- Parameters:
slotName- slot (property) namevalue- int value
-
setProperty
Description copied from interface:ISharedObjectSet slot (property) value as a string value (will be wrapped in an AMFDataItem object)- Specified by:
setPropertyin interfaceISharedObject- Parameters:
slotName- slot (property) namevalue- string value
-
setProperty
Description copied from interface:ISharedObjectSet slot (property) value as AMFData object.- Specified by:
setPropertyin interfaceISharedObject- Parameters:
slotName- slot (property) namedata- slot value as AMFData object. Example: new AMFDataItem((double)1.234) or new AMFDataItem()
-
setSlotValue
-
setSlotValue
-
setSlotValue
public void setSlotValue(IClient client, String slotName, byte[] byteData, AMFDataContextDeserialize context) -
setSlotValue
-
setSlotValue
public void setSlotValue(IClient client, String slotName, byte[] byteData, AMFData amfData, AMFDataContextDeserialize context) -
writeError
-
writeSetValueError
public void writeSetValueError(IClient client, String soName, boolean isPersistent, String slotName, String errorMsg) Description copied from interface:ISharedObjectWrite an set value error message back to the client- Specified by:
writeSetValueErrorin interfaceISharedObject- Parameters:
client- client removing slot or null if server side codesoName- sharedObject nameisPersistent- is persistentslotName- slot nameerrorMsg- error message
-
writeDeleteError
public void writeDeleteError(IClient client, String soName, boolean isPersistent, String slotName, String errorMsg) Description copied from interface:ISharedObjectWrite an delete error message back to the client- Specified by:
writeDeleteErrorin interfaceISharedObject- Parameters:
client- client removing slot or null if server side codesoName- sharedObject nameisPersistent- is persistentslotName- slot nameerrorMsg- error message
-
getClientUpdates
-
disconnect
Description copied from interface:ISharedObjectDisconnect client from shared object.- Specified by:
disconnectin interfaceISharedObject- Parameters:
client- client to disconnect
-
getName
Description copied from interface:ISharedObjectGet shared object name- Specified by:
getNamein interfaceISharedObject- Returns:
- shared object name
-
setName
Description copied from interface:ISharedObjectSet shared object name- Specified by:
setNamein interfaceISharedObject- Parameters:
name- shared object name
-
send
Description copied from interface:ISharedObjectCall client side handler attached to shared object.- Specified by:
sendin interfaceISharedObject- Parameters:
handlerName- handler nameparams- variable argument list of parameters
-
send
Description copied from interface:ISharedObjectCall client side handler attached to shared object (no parameters).- Specified by:
sendin interfaceISharedObject- Parameters:
handlerName- handler name
-
sendInternal
-
sendInternal
-
sendInternal
public void sendInternal(IClient client, String handlerName, byte[] msgBytes, AMFDataContextDeserialize context) -
getStorageDir
Description copied from interface:ISharedObjectGet path used to store shared object.- Specified by:
getStorageDirin interfaceISharedObject- Returns:
- path used to store shared object
-
setStorageDir
Description copied from interface:ISharedObjectSet path used to store shared object.- Specified by:
setStorageDirin interfaceISharedObject- Parameters:
storageDir- path used to store shared object
-
flush
public void flush()Description copied from interface:ISharedObjectFlush (write to disk) shared object- Specified by:
flushin interfaceISharedObject
-
load
public void load() -
close
public void close()Description copied from interface:ISharedObjectForce close this shared object (not implemented)- Specified by:
closein interfaceISharedObject
-
lock
public void lock()Description copied from interface:ISharedObjectLock a shared object for write access- Specified by:
lockin interfaceISharedObject
-
unlock
public void unlock()Description copied from interface:ISharedObjectUnlock a shared object for write access- Specified by:
unlockin interfaceISharedObject
-
getParent
Description copied from interface:ISharedObjectGet the shared object container to which this shared object belongs.- Specified by:
getParentin interfaceISharedObject- Returns:
- shared object container
-
getAccess
-