livespace.services.entities
Class RoomEntity

java.lang.Object
  extended by dsto.dfc.databeans.AbstractDataObject
      extended by dsto.dfc.databeans.SimpleDataObject
          extended by dsto.dfc.databeans.FancyDataObject
              extended by livespace.services.Entity
                  extended by livespace.services.entities.RoomEntity
All Implemented Interfaces:
IDataObject, IDataObjectChildListener, Cloneable

public class RoomEntity
extends Entity

Defines the default Livespace Room entity.

Author:
Matthew Phillips

Field Summary
 String datastore
          Base URI for room-wide read/write persistent file storage.
static String ENTITY_TYPE
           
 String mediaBaseURL
          Base URI for media such as sound, movies etc.
 SetDataObject serviceTypes
          The names of known service types in this room.
 
Fields inherited from class livespace.services.Entity
container, id, lastTouched, name, unconfirmedUpdates
 
Fields inherited from class dsto.dfc.databeans.AbstractDataObject
listeners
 
Fields inherited from interface dsto.dfc.databeans.IDataObject
OVERRIDE, PERSISTENT, PERSISTENT_OVERRIDE, TRANSIENT, TRANSIENT_OVERRIDE
 
Constructor Summary
RoomEntity()
          Should be protected, but public due to issues with applets under 1.4.2.
RoomEntity(String name)
           
RoomEntity(String id, String name)
           
 
Method Summary
static RoomEntity createLocalRoom(Elvin elvin)
          Find or create a room entity instance.
static void disposeLocalRoom()
          Dispose the client/server container for the local room (if any).
static RoomEntity getLocalRoom(Elvin elvin)
          Find the local room entity instance.
 String getType()
          The type of the object (eg "room", "light", "volume", etc).
 
Methods inherited from class livespace.services.Entity
create, createId, getElvin, getType, getTypeInfo, mutex, sameEntity, shallowClone, waitForProperty, waitForProperty, waitForProperty, waitForProperty
 
Methods inherited from class dsto.dfc.databeans.FancyDataObject
childPropertyChanged, getValue, isTransient, propertyIterator, setValue
 
Methods inherited from class dsto.dfc.databeans.SimpleDataObject
getFieldNames, setValue
 
Methods inherited from class dsto.dfc.databeans.AbstractDataObject
addFirstPropertyListener, addPropertyListener, firePropertyChangedEvent, firePropertyChangedEvent, firePropertyChangedEvent, firePropertyChangedEvent, firePropertyChangedEvent, firePropertyChangedEvent, getBeanValue, getBooleanValue, getBooleanValue, getCharValue, getCharValue, getDoubleValue, getDoubleValue, getFloatValue, getFloatValue, getIntValue, getIntValue, getLongValue, getLongValue, getObjectValue, getPropertyListeners, getShortValue, getStringValue, registerValue, removePropertyListener, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, toString, unregisterValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ENTITY_TYPE

public static final String ENTITY_TYPE
See Also:
Constant Field Values

datastore

public String datastore
Base URI for room-wide read/write persistent file storage. Currently this must be a file: URL, but will be extended to use other backends (eg WebDAV) at some point.


mediaBaseURL

public String mediaBaseURL
Base URI for media such as sound, movies etc. May be undefined.


serviceTypes

public SetDataObject serviceTypes
The names of known service types in this room.

Constructor Detail

RoomEntity

public RoomEntity()
Should be protected, but public due to issues with applets under 1.4.2. This DOES NOT produce a valid room instance.


RoomEntity

public RoomEntity(String name)

RoomEntity

public RoomEntity(String id,
                  String name)
Method Detail

getType

public String getType()
Description copied from class: Entity
The type of the object (eg "room", "light", "volume", etc). This must be unique to the entity class.

NOTE: it is also a good practice to provide a static field that defines the entity type on the class: eg

 public static final String ENTITY_TYPE = "room";
 

Specified by:
getType in class Entity

createLocalRoom

public static RoomEntity createLocalRoom(Elvin elvin)
                                  throws IOException
Find or create a room entity instance. Unlike getLocalRoom(Elvin), if no room has been found/created yet, this will create a default room entity suitable for testing purposes. If you don't know which one you want, then use getLocalRoom(Elvin).

NOTE: this may create an EntityServer to host the room. Clients should call disposeLocalRoom () to ensure proper shutdown.

Parameters:
elvin - The elvin service.
Returns:
The local room.
Throws:
SynchronizationException - if the local room could not be discovered
IOException - if a general IO error occurs.
See Also:
getLocalRoom(Elvin)

getLocalRoom

public static RoomEntity getLocalRoom(Elvin elvin)
                               throws SynchronizationException,
                                      IOException
Find the local room entity instance.

NOTE: this creates an EntityClient to host the room. Clients should call disposeLocalRoom () to ensure proper shutdown.

Parameters:
elvin - The elvin service.
Returns:
The local room.
Throws:
SynchronizationException - if the local room could not be discovered
IOException - if a general IO error occurs.
See Also:
createLocalRoom(Elvin)

disposeLocalRoom

public static void disposeLocalRoom()
Dispose the client/server container for the local room (if any). May be called more than once.

See Also:
getLocalRoom(Elvin), createLocalRoom(Elvin)


Copyright © 2008 Commonwealth of Australia