org.ocap.hn
Class NetManager

java.lang.Object
  extended by org.ocap.hn.NetManager

public abstract class NetManager
extends Object

The NetManager is a singleton class that registers all the Devices and NetModules within a home network. It maintains an implementation dependent database of devices and NetModules.

The NetManager may be used to retrieve list of NetModule and Device in the network. The application can filter the list by specifying a name or by applying filtering rules. For example, "modelNumber = h6315, location = LivingRoom". Application can monitor availability of NetModules by registering as a listener to NetManager instance.


Constructor Summary
NetManager()
           
 
Method Summary
abstract  void addNetModuleEventListener(NetModuleEventListener listener)
          Adds a NetModule event listener to NetManager.
abstract  Device getDevice(String name)
          Returns device by name.
abstract  NetList getDeviceList(PropertyFilter filter)
          Returns devices that match all properties set by a given filter.
static NetManager getInstance()
          Returns the singleton NetManager.
abstract  NetModule getNetModule(String name)
          Returns NetModule by name.
abstract  NetList getNetModuleList(PropertyFilter filter)
          Returns NetModules that match all properties set by a given filter.
abstract  void removeNetModuleEventListener(NetModuleEventListener listener)
          Removes a NetModule event listener from NetManager.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NetManager

public NetManager()
Method Detail

getInstance

public static NetManager getInstance()
Returns the singleton NetManager. This is the entry point for home network. If the calling application is unsigned, this method SHALL return null.

Returns:
Singleton instance of NetManager or null if the calling application is unsigned.

getNetModuleList

public abstract NetList getNetModuleList(PropertyFilter filter)
Returns NetModules that match all properties set by a given filter.

Parameters:
filter - Filter to select out NetModules from all available NetModules
Returns:
List of NetModules satisfying filter

getNetModule

public abstract NetModule getNetModule(String name)
Returns NetModule by name. This name is composed of unique device name and module ID. For example, "LivingRoom:OCAP_HOST1:ContentListing1", where LivingRoom:OCAP_HOST1 is the device name and ContentListing1 is a unique moduleID within this device.

Parameters:
name - NetModule name
Returns:
NetModule with the specified name

getDeviceList

public abstract NetList getDeviceList(PropertyFilter filter)
Returns devices that match all properties set by a given filter.

Parameters:
filter - Filter to select out devices from all connected devices
Returns:
List of devices satisfying filter

getDevice

public abstract Device getDevice(String name)
Returns device by name. This name is unique device name. For example, "BallRoom:DVD_PLAYER1".

Parameters:
name - Device name
Returns:
Device matching the specified name

addNetModuleEventListener

public abstract void addNetModuleEventListener(NetModuleEventListener listener)
Adds a NetModule event listener to NetManager. Listener will receive a NetModuleEvent when a new NetModule is registered or an old NetModule is removed from home network. If listener is already registered, no action is performed.

Parameters:
listener - Listener which listens to NetModule change events on home network
See Also:
removeNetModuleEventListener(org.ocap.hn.NetModuleEventListener)

removeNetModuleEventListener

public abstract void removeNetModuleEventListener(NetModuleEventListener listener)
Removes a NetModule event listener from NetManager. If the listener is not registered yet, no action is performed.

Parameters:
listener - Listener which listens to NetModule change events on home network
See Also:
addNetModuleEventListener(org.ocap.hn.NetModuleEventListener)