com.wowza.wms.sharedobject
Interface ISharedObjects


public interface ISharedObjects

ISharedObjects: public interface to SharedObjects. Represent the list of shared objects managed by IApplicationInstance.


Method Summary
 void addSharedObjectListener(ISharedObjectNotify sharedObjectListener)
          Add a shared object listener.
 void disconnect(IClient client)
          Disconnect client from all shared objects in list.
 boolean exists(ISharedObject sharedObject)
          Is sharedObject in this list (by shared object reference).
 boolean exists(String objectName)
          Is sharedObject in this list (by name).
 void flush()
          Flush all persistent shared objects to disk.
 ISharedObject get(String name)
          Get shared object by name.
 java.util.List<String> getObjectNames()
          Get a list of shared object names.
 ISharedObject getOrCreate(String name)
          Get shared object by name if it does not exist create a new shared object with the given name.
 String getStorageDir()
          Get the storage directory for all shared objects in list.
 boolean isPersistent()
          Are shared objects in list persistent.
 void load()
          Load persistent shared objects from file system.
 void put(String objectName, ISharedObject sharedObject)
          Add or replace a shared object.
 void remove(String objectName)
          Remove a shared object.
 void removeClient(IClient client)
          Remove a client from any shared object that it is connected to in this list.
 void removeSharedObjectListener(ISharedObjectNotify sharedObjectListener)
          Remove a shared object listener.
 void setPersistent(boolean isPersistent)
          Set is shared object in list persistent
 void setStorageDir(String storageDir)
          Set the storage directory for all shared objects in list.
 int size()
          Get number of shared objects.
 

Method Detail

addSharedObjectListener

void addSharedObjectListener(ISharedObjectNotify sharedObjectListener)
Add a shared object listener. The listener will receive the following events: onSharedObjectCreate, onSharedObjectDestroy, onSharedObjectConnect, onSharedObjectDisconnect.

Parameters:
sharedObjectListener -

disconnect

void disconnect(IClient client)
Disconnect client from all shared objects in list.

Parameters:
client - client

exists

boolean exists(ISharedObject sharedObject)
Is sharedObject in this list (by shared object reference).

Parameters:
sharedObject - shared object
Returns:
true if shared object in list

exists

boolean exists(String objectName)
Is sharedObject in this list (by name).

Parameters:
objectName - shared object name
Returns:
true if shared object in list

flush

void flush()
Flush all persistent shared objects to disk.


get

ISharedObject get(String name)
Get shared object by name. If the shared object does not exists null will be returned. (see ISharedObjects.getOrCreate)

Parameters:
name - shared object name
Returns:
shared object

getObjectNames

java.util.List<String> getObjectNames()
Get a list of shared object names.

Returns:
list of shared object names

getOrCreate

ISharedObject getOrCreate(String name)
Get shared object by name if it does not exist create a new shared object with the given name.

Parameters:
name - shared object name
Returns:
shared object

getStorageDir

String getStorageDir()
Get the storage directory for all shared objects in list.

Returns:
storage dir

isPersistent

boolean isPersistent()
Are shared objects in list persistent.

Returns:
true is shared objects in list are persistent

load

void load()
Load persistent shared objects from file system.


put

void put(String objectName,
         ISharedObject sharedObject)
Add or replace a shared object.

Parameters:
objectName - shared object name
sharedObject - shared object

remove

void remove(String objectName)
Remove a shared object.

Parameters:
objectName - shared object name

removeClient

void removeClient(IClient client)
Remove a client from any shared object that it is connected to in this list.

Parameters:
client - client

removeSharedObjectListener

void removeSharedObjectListener(ISharedObjectNotify sharedObjectListener)
Remove a shared object listener.

Parameters:
sharedObjectListener -

setPersistent

void setPersistent(boolean isPersistent)
Set is shared object in list persistent

Parameters:
isPersistent - true is shared objects in list are persistent

setStorageDir

void setStorageDir(String storageDir)
Set the storage directory for all shared objects in list.

Parameters:
storageDir -

size

int size()
Get number of shared objects.

Returns:
number of shared objects