ISharedObjectpublic class SharedObject extends Object implements ISharedObject
| Modifier and Type | Field | Description |
|---|---|---|
static int |
READACCESS |
|
static int |
WRITEACCESS |
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 | Description |
|---|---|
SharedObject(String name) |
Create new shared object
|
SharedObject(String name,
boolean isPersistent,
String storageDir) |
Create new shared object
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
acquire() |
Increment the reference count to this shared object.
|
void |
addClient(IClient client) |
Add a client to this shared object.
|
void |
addSlotListener(ISharedObjectSlotNotify slotListener) |
Add a slot listener.
|
void |
clear() |
Clear all properties from a shared object
|
void |
close() |
Force close this shared object (not implemented)
|
boolean |
containsProperty(String slotName) |
Returns true is slot/property name exists
|
boolean |
containsSlot(String slotName) |
Returns true is slot/property name exists
|
void |
deleteSlot(IClient client,
String slotName) |
Remove a slot (property)
|
void |
deleteSlot(String slotName) |
Remove slot (property)
|
void |
disconnect(IClient client) |
Disconnect client from shared object.
|
void |
flush() |
Flush (write to disk) shared object
|
static boolean[] |
getAccess(IClient client,
String soName) |
|
java.util.List<com.wowza.wms.sharedobject.SharedObjectClient> |
getClients() |
Get a list of client that are connected to this shared object.
|
void |
getClientUpdates(IClient client) |
|
String |
getName() |
Get shared object name
|
ISharedObjects |
getParent() |
Get the shared object container to which this shared object belongs.
|
AMFData |
getProperty(String slotName) |
Get slot (property) value.
|
int |
getRefCount() |
Get the current reference (clients) connected to this shared object.
|
ISharedObjectSlot |
getSlot(String name) |
Get ISharedObjectSlot interface to a slot (property) by name
|
java.util.List<String> |
getSlotNames() |
Get a list of slot (property) names
|
java.util.List<ISharedObjectSlot> |
getSlots() |
Get a list of active slots
|
String |
getStorageDir() |
Get path used to store shared object.
|
int |
getVersion() |
Get the internval version number.
|
boolean |
isClient(IClient client) |
Is this client connected to shared object
|
boolean |
isPersistent() |
Is this shared object being persisted.
|
void |
load() |
|
void |
lock() |
Lock a shared object for write access
|
void |
notifySlotDelete(ISharedObjectSlot slot) |
|
void |
notifySlotSetValue(ISharedObjectSlot slot) |
|
int |
purge(int version) |
Purge all deleted properties older than the version number
|
void |
putSlot(String name,
ISharedObjectSlot slot) |
Add a new slot (property) to a shared object.
|
void |
release() |
Descrement the reference count to this shared object.
|
void |
removeClient(IClient client) |
Remove a client from this shared object.
|
void |
removeSlotListener(ISharedObjectSlotNotify slotListener) |
Remove slot listener
|
void |
send(String handlerName) |
Call client side handler attached to shared object (no parameters).
|
void |
send(String handlerName,
Object... params) |
Call client side handler attached to shared object.
|
void |
sendInternal(IClient client,
String handlerName,
byte[] msgBytes) |
|
void |
sendInternal(IClient client,
String handlerName,
byte[] msgBytes,
AMFDataContextDeserialize context) |
|
void |
sendInternal(String handlerName,
AMFData[] params) |
|
void |
setName(String name) |
Set shared object name
|
void |
setParent(ISharedObjects parent) |
|
void |
setPersistent(boolean isPersistent) |
Set is shared object persisted.
|
void |
setProperty(String slotName,
boolean value) |
Set slot (property) value as a boolean value (will be wrapped in an AMFDataItem object)
|
void |
setProperty(String slotName,
double value) |
Set slot (property) value as a double value (will be wrapped in an AMFDataItem object)
|
void |
setProperty(String slotName,
int value) |
Set slot (property) value as a int value (will be wrapped in an AMFDataItem object)
|
void |
setProperty(String slotName,
long value) |
Set slot (property) value as a long value (will be wrapped in an AMFDataItem object)
|
void |
setProperty(String slotName,
AMFData data) |
Set slot (property) value as AMFData object.
|
void |
setProperty(String slotName,
String value) |
Set slot (property) value as a string value (will be wrapped in an AMFDataItem object)
|
void |
setProperty(String slotName,
java.util.Date value) |
Set slot (property) value as a date value (will be wrapped in an AMFDataItem object)
|
void |
setSlotValue(IClient client,
String slotName,
byte[] byteData) |
|
void |
setSlotValue(IClient client,
String slotName,
byte[] byteData,
AMFData amfData) |
|
void |
setSlotValue(IClient client,
String slotName,
byte[] byteData,
AMFDataContextDeserialize context) |
|
void |
setSlotValue(IClient client,
String slotName,
byte[] byteData,
AMFData amfData,
AMFDataContextDeserialize context) |
|
void |
setSlotValue(IClient client,
String slotName,
AMFData amfData) |
|
void |
setStorageDir(String storageDir) |
Set path used to store shared object.
|
void |
setVersion(int version) |
Set the internal version number.
|
int |
size() |
Get the number of active slot (properties).
|
void |
unlock() |
Unlock a shared object for write access
|
void |
writeDeleteError(IClient client,
String soName,
boolean isPersistent,
String slotName,
String errorMsg) |
Write an delete error message back to the client
|
static void |
writeError(IClient client,
String soName,
boolean isPersistent,
String errorMsg,
boolean isConnect) |
|
void |
writeSetValueError(IClient client,
String soName,
boolean isPersistent,
String slotName,
String errorMsg) |
Write an set value error message back to the client
|
public static final int READACCESS
public static final int WRITEACCESS
public SharedObject(String name)
name - shared object namepublic SharedObject(String name,
boolean isPersistent,
String storageDir)
name - shared object nameisPersistent - is persistentstorageDir - storage directory for persistent shared objectpublic void acquire()
ISharedObjectacquire in interface ISharedObjectpublic void addClient(IClient client)
ISharedObjectaddClient in interface ISharedObjectclient - clientpublic void addSlotListener(ISharedObjectSlotNotify slotListener)
ISharedObjectaddSlotListener in interface ISharedObjectslotListener - slot listenerpublic void clear()
ISharedObjectclear in interface ISharedObjectpublic void close()
ISharedObjectclose in interface ISharedObjectpublic boolean containsProperty(String slotName)
ISharedObjectcontainsProperty in interface ISharedObjectslotName - slot/property namepublic boolean containsSlot(String slotName)
ISharedObjectcontainsSlot in interface ISharedObjectslotName - slot/property namepublic void deleteSlot(IClient client, String slotName)
ISharedObjectdeleteSlot in interface ISharedObjectclient - client removing slot or null if server side codeslotName - slot (property) namepublic void deleteSlot(String slotName)
ISharedObjectdeleteSlot in interface ISharedObjectslotName - slot (property) namepublic void disconnect(IClient client)
ISharedObjectdisconnect in interface ISharedObjectclient - client to disconnectpublic void flush()
ISharedObjectflush in interface ISharedObjectpublic static boolean[] getAccess(IClient client, String soName)
public java.util.List<com.wowza.wms.sharedobject.SharedObjectClient> getClients()
ISharedObjectgetClients in interface ISharedObjectpublic void getClientUpdates(IClient client)
public String getName()
ISharedObjectgetName in interface ISharedObjectpublic ISharedObjects getParent()
ISharedObjectgetParent in interface ISharedObjectpublic AMFData getProperty(String slotName)
ISharedObjectgetProperty in interface ISharedObjectslotName - slot (property) namepublic int getRefCount()
ISharedObjectgetRefCount in interface ISharedObjectpublic ISharedObjectSlot getSlot(String name)
ISharedObjectgetSlot in interface ISharedObjectname - slot (property) namepublic java.util.List<String> getSlotNames()
ISharedObjectgetSlotNames in interface ISharedObjectpublic java.util.List<ISharedObjectSlot> getSlots()
ISharedObjectgetSlots in interface ISharedObjectpublic String getStorageDir()
ISharedObjectgetStorageDir in interface ISharedObjectpublic int getVersion()
ISharedObjectgetVersion in interface ISharedObjectpublic boolean isClient(IClient client)
ISharedObjectisClient in interface ISharedObjectclient - clientpublic boolean isPersistent()
ISharedObjectisPersistent in interface ISharedObjectpublic void load()
public void lock()
ISharedObjectlock in interface ISharedObjectpublic void notifySlotDelete(ISharedObjectSlot slot)
public void notifySlotSetValue(ISharedObjectSlot slot)
public int purge(int version)
ISharedObjectpurge in interface ISharedObjectpublic void putSlot(String name,
ISharedObjectSlot slot)
ISharedObjectputSlot in interface ISharedObjectname - slot (property) nameslot - new slotpublic void release()
ISharedObjectrelease in interface ISharedObjectpublic void removeClient(IClient client)
ISharedObjectremoveClient in interface ISharedObjectclient - clientpublic void removeSlotListener(ISharedObjectSlotNotify slotListener)
ISharedObjectremoveSlotListener in interface ISharedObjectslotListener - slot listenerpublic void send(String handlerName)
ISharedObjectsend in interface ISharedObjecthandlerName - handler namepublic void send(String handlerName,
Object... params)
ISharedObjectsend in interface ISharedObjecthandlerName - handler nameparams - variable argument list of parameterspublic void sendInternal(IClient client, String handlerName, byte[] msgBytes)
public void sendInternal(IClient client, String handlerName, byte[] msgBytes, AMFDataContextDeserialize context)
public void sendInternal(String handlerName,
AMFData[] params)
public void setName(String name)
ISharedObjectsetName in interface ISharedObjectname - shared object namepublic void setParent(ISharedObjects parent)
public void setPersistent(boolean isPersistent)
ISharedObjectsetPersistent in interface ISharedObjectisPersistent - true if shared object is being persistedpublic void setProperty(String slotName,
boolean value)
ISharedObjectsetProperty in interface ISharedObjectslotName - slot (property) namevalue - boolean valuepublic void setProperty(String slotName,
double value)
ISharedObjectsetProperty in interface ISharedObjectslotName - slot (property) namevalue - double valuepublic void setProperty(String slotName,
int value)
ISharedObjectsetProperty in interface ISharedObjectslotName - slot (property) namevalue - int valuepublic void setProperty(String slotName,
long value)
ISharedObjectsetProperty in interface ISharedObjectslotName - slot (property) namevalue - long valuepublic void setProperty(String slotName,
AMFData data)
ISharedObjectsetProperty in interface ISharedObjectslotName - slot (property) namedata - slot value as AMFData object. Example: new AMFDataItem((double)1.234) or new AMFDataItem()public void setProperty(String slotName,
String value)
ISharedObjectsetProperty in interface ISharedObjectslotName - slot (property) namevalue - string valuepublic void setProperty(String slotName,
java.util.Date value)
ISharedObjectsetProperty in interface ISharedObjectslotName - slot (property) namevalue - date valuepublic void setSlotValue(IClient client, String slotName, byte[] byteData)
public void setSlotValue(IClient client, String slotName, byte[] byteData, AMFData amfData)
public void setSlotValue(IClient client, String slotName, byte[] byteData, AMFDataContextDeserialize context)
public void setSlotValue(IClient client, String slotName, byte[] byteData, AMFData amfData, AMFDataContextDeserialize context)
public void setStorageDir(String storageDir)
ISharedObjectsetStorageDir in interface ISharedObjectstorageDir - path used to store shared objectpublic void setVersion(int version)
ISharedObjectsetVersion in interface ISharedObjectversion - internal version numberpublic int size()
ISharedObjectsize in interface ISharedObjectpublic void unlock()
ISharedObjectunlock in interface ISharedObjectpublic void writeDeleteError(IClient client, String soName, boolean isPersistent, String slotName, String errorMsg)
ISharedObjectwriteDeleteError in interface ISharedObjectclient - client removing slot or null if server side codesoName - sharedObject nameisPersistent - is persistentslotName - slot nameerrorMsg - error messagepublic static void writeError(IClient client, String soName, boolean isPersistent, String errorMsg, boolean isConnect)
public void writeSetValueError(IClient client, String soName, boolean isPersistent, String slotName, String errorMsg)
ISharedObjectwriteSetValueError in interface ISharedObjectclient - client removing slot or null if server side codesoName - sharedObject nameisPersistent - is persistentslotName - slot nameerrorMsg - error message