ist.palcom.services.overview
Class PalOverviewBrowserDeviceContext

java.lang.Object
  extended by ist.palcom.services.overview.PalOverviewBrowserDeviceContext
All Implemented Interfaces:
DeviceContext, IHgraphNode

public class PalOverviewBrowserDeviceContext
extends java.lang.Object
implements DeviceContext


Field Summary
 
Fields inherited from interface ist.palcom.hgraph.IHgraphNode
CHILD_NAME_CLASH, CIRCULARITY_CLASH, COMMAND_OR_NODE_MISSING, ERROR, HANDLER_MISSING, INVOKATOR_MISSING, LISTENER_MISSING, NODE_NOT_CHILD, PATH_MISSING, SIBLING_ALREADY_EXISTS, SIBLING_NONEXISTENT, SIBLING_REFERENCE_ALREADY_EXISTS, SIBLING_REFERENCE_NONEXISTENT, STATUS_OK, VALUE_ALREADY_EXISTS, VALUE_NOT_PRESENT
 
Constructor Summary
PalOverviewBrowserDeviceContext(DeviceContext context)
           
 
Method Summary
 void addListOfServicesAtDeviceLevel(java.util.ArrayList newServices, PRDSubList subList)
          Adds subList to the service list located at the highest level, direct under the device.
 void addListOfServicesToList(LocalSID listLocalSID, java.util.ArrayList services, PRDSubList subList)
          Adds subList to the service list idenfitied by listLocalSID.
 int addNodeChild(IHgraphNode node, Path callerPath)
          Adds a child to the node's private list of children.
 void addServiceAtDeviceLevel(Service service)
          Adds a service to the device.
 void addServiceToList(Service service, LocalSID listLocalSID)
          Adds a service to a service list identified by listLocalSID.
 IAssemblyManager getAssemblyManager()
           
 java.util.Iterator getChildIterator()
           
 CommunicationManager getCommunicationManager()
           
 ConnectionsManager getConnectionsManager()
           
 PRDDevice getDeviceInfo()
           
 IDeviceIO getDeviceIO()
           
 DiscoveryManager getDiscoveryManager()
           
 FuncFunc getFuncFunc()
           
 HgraphManager getHgraphManager()
           
 java.util.ArrayList getMediaManagers()
           
 java.lang.String getName()
           
 java.lang.String getNewInstanceNumber(ServiceID serviceID)
           
 LocalSID getNewLocalSID()
           
 java.lang.String getNewLocalSIDString()
           
 java.lang.String getNodeName()
          hgraph impl below
 IHgraphNode getNodeParent()
           
 Path getPath()
           
 PointToPointManager getPointToPointManager()
           
 PubSubManager getPubSubManager()
           
 RemoteConnectManager getRemoteConnectManager()
           
 ResourceAddressingManager getResourceAddressingManager()
           
 IResourceManager getResourceManager()
           
 ResourceManager getResourceManager2()
           
 ResourceMonitor getResourceMonitor()
           
 RoutingManager getRoutingManager()
           
 PalcomScheduler getScheduler()
           
 SiblingFunc getSiblingFunc()
           
 ValueFunc getValueFunc()
           
 Path getVisualizationManagerPath()
           
 boolean hasChildNamed(java.lang.String name)
          Checks whether the node has a child with a given name
 boolean isAncestorOf(IHgraphNode node)
          Checks whether this node is an ancestor of the parameter node.
 int removeNodeChild(java.lang.String name, Path callerPath)
          Removes a child based on its name.
 void removeService(Service service)
          EXPERIMENTAL!
 void removeSubList(PRDSubList subList)
          Remove subList from announcement information.
 java.util.Iterator serviceIterator()
           
 void setAssemblyManager(IAssemblyManager m)
           
 void setDeviceIO(IDeviceIO io)
           
 void setHeartBeatPeriod(long period)
          Set the time interval between heartbeats.
 void setName(java.lang.String name)
           
 int setNodeName(java.lang.String name, Path callerPath)
          Sets the name of the node.
 int setNodeParent(IHgraphNode newParent, Path callerPath)
          Sets the parent of the HgraphNode.
 void setResourceManager(IResourceManager m)
           
 java.lang.String toXML()
           
 java.lang.String toXMLFull()
           
 java.lang.String toXMLFullRecursively()
           
 java.lang.String toXMLRecursively()
           
 void updatePath()
          Updates the path of the H-Graph node along with its offspring recursively.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PalOverviewBrowserDeviceContext

public PalOverviewBrowserDeviceContext(DeviceContext context)
Method Detail

getVisualizationManagerPath

public Path getVisualizationManagerPath()

setAssemblyManager

public void setAssemblyManager(IAssemblyManager m)

getAssemblyManager

public IAssemblyManager getAssemblyManager()

setResourceManager

public void setResourceManager(IResourceManager m)

getResourceManager

public IResourceManager getResourceManager()

addListOfServicesAtDeviceLevel

public void addListOfServicesAtDeviceLevel(java.util.ArrayList newServices,
                                           PRDSubList subList)
Description copied from interface: DeviceContext
Adds subList to the service list located at the highest level, direct under the device. ArrayList services is a list containing objects of Service. A PRDServiceList will be created pointing at subList and the services will be added to it.

Specified by:
addListOfServicesAtDeviceLevel in interface DeviceContext

addListOfServicesToList

public void addListOfServicesToList(LocalSID listLocalSID,
                                    java.util.ArrayList services,
                                    PRDSubList subList)
Description copied from interface: DeviceContext
Adds subList to the service list idenfitied by listLocalSID. ArrayList services is a list containing objects of Service. A PRDServiceList will be created pointing at subList and the services will be added to it. Use a listLocalSID with deviceID and null as servicePartID to get the top level list. If there are no list with listLocalSID nothing happens.

Specified by:
addListOfServicesToList in interface DeviceContext

addServiceAtDeviceLevel

public void addServiceAtDeviceLevel(Service service)
Description copied from interface: DeviceContext
Adds a service to the device. Will add info about the service to the info of the device. The DiscoveryManager will be notified if the service is active.

Specified by:
addServiceAtDeviceLevel in interface DeviceContext

addServiceToList

public void addServiceToList(Service service,
                             LocalSID listLocalSID)
Description copied from interface: DeviceContext
Adds a service to a service list identified by listLocalSID. Will add info about the service to the info of the device. The DiscoveryManager will be notified if the service is active. If there are no list with listLocalSID nothing happens.

Specified by:
addServiceToList in interface DeviceContext

getNewInstanceNumber

public java.lang.String getNewInstanceNumber(ServiceID serviceID)
Specified by:
getNewInstanceNumber in interface DeviceContext
Returns:
A, for this serviceID, unique instance number.

getNewLocalSID

public LocalSID getNewLocalSID()
Specified by:
getNewLocalSID in interface DeviceContext
Returns:
A new unique LocalSID.

getNewLocalSIDString

public java.lang.String getNewLocalSIDString()
Specified by:
getNewLocalSIDString in interface DeviceContext
Returns:
A new unique string.

setHeartBeatPeriod

public void setHeartBeatPeriod(long period)
Description copied from interface: DeviceContext
Set the time interval between heartbeats. This method has to be called in order for the device to send out heartbeats requesting answers, otherwise it will only send out heartbeats in reply to other devices.

Specified by:
setHeartBeatPeriod in interface DeviceContext

getConnectionsManager

public ConnectionsManager getConnectionsManager()
Specified by:
getConnectionsManager in interface DeviceContext

getDeviceIO

public IDeviceIO getDeviceIO()
Specified by:
getDeviceIO in interface DeviceContext

getDeviceInfo

public PRDDevice getDeviceInfo()
Specified by:
getDeviceInfo in interface DeviceContext

getDiscoveryManager

public DiscoveryManager getDiscoveryManager()
Specified by:
getDiscoveryManager in interface DeviceContext

getResourceManager2

public ResourceManager getResourceManager2()
Specified by:
getResourceManager2 in interface DeviceContext

getMediaManagers

public java.util.ArrayList getMediaManagers()
Specified by:
getMediaManagers in interface DeviceContext

getName

public java.lang.String getName()
Specified by:
getName in interface DeviceContext

getPointToPointManager

public PointToPointManager getPointToPointManager()
Specified by:
getPointToPointManager in interface DeviceContext

getPubSubManager

public PubSubManager getPubSubManager()
Specified by:
getPubSubManager in interface DeviceContext

getRemoteConnectManager

public RemoteConnectManager getRemoteConnectManager()
Specified by:
getRemoteConnectManager in interface DeviceContext

getScheduler

public PalcomScheduler getScheduler()
Specified by:
getScheduler in interface DeviceContext

removeService

public void removeService(Service service)
Description copied from interface: DeviceContext
EXPERIMENTAL! Removes a service from the device, and notify the DiscoveryManager.

Specified by:
removeService in interface DeviceContext

serviceIterator

public java.util.Iterator serviceIterator()
Specified by:
serviceIterator in interface DeviceContext
Returns:
An iterator over the AbstractServices on the device.

removeSubList

public void removeSubList(PRDSubList subList)
Description copied from interface: DeviceContext
Remove subList from announcement information. Important! Remove services in the subList with removeService first.

Specified by:
removeSubList in interface DeviceContext
See Also:
DeviceContext.removeService(Service)

setDeviceIO

public void setDeviceIO(IDeviceIO io)
Specified by:
setDeviceIO in interface DeviceContext

setName

public void setName(java.lang.String name)
Specified by:
setName in interface DeviceContext

getHgraphManager

public HgraphManager getHgraphManager()
Specified by:
getHgraphManager in interface DeviceContext

getCommunicationManager

public CommunicationManager getCommunicationManager()
Specified by:
getCommunicationManager in interface DeviceContext

getRoutingManager

public RoutingManager getRoutingManager()
Specified by:
getRoutingManager in interface DeviceContext

getResourceAddressingManager

public ResourceAddressingManager getResourceAddressingManager()
Specified by:
getResourceAddressingManager in interface DeviceContext

getResourceMonitor

public ResourceMonitor getResourceMonitor()
Specified by:
getResourceMonitor in interface DeviceContext

getNodeName

public java.lang.String getNodeName()
hgraph impl below

Specified by:
getNodeName in interface IHgraphNode
Returns:
The name of the node.

setNodeName

public int setNodeName(java.lang.String name,
                       Path callerPath)
Description copied from interface: IHgraphNode
Sets the name of the node. If a sibling already has the name, an error control message is returned

Specified by:
setNodeName in interface IHgraphNode
Parameters:
name - The new name
Returns:
IHgraphNode.STATUS_OK if the change succeeded. IHgraphNode.CHILD_NAME_CLASH if a sibling with the given name already exists.

getPath

public Path getPath()
Specified by:
getPath in interface IHgraphNode
Returns:
the Path object pertaining to the path of the node

updatePath

public void updatePath()
Description copied from interface: IHgraphNode
Updates the path of the H-Graph node along with its offspring recursively. The path is updated when the node name and the node parent is sat.

Specified by:
updatePath in interface IHgraphNode

hasChildNamed

public boolean hasChildNamed(java.lang.String name)
Description copied from interface: IHgraphNode
Checks whether the node has a child with a given name

Specified by:
hasChildNamed in interface IHgraphNode
Parameters:
name - The name to check
Returns:
True iff the node has an actual child with the given name. False if not.

isAncestorOf

public boolean isAncestorOf(IHgraphNode node)
Description copied from interface: IHgraphNode
Checks whether this node is an ancestor of the parameter node. It does so with a depth-first sharch of its offspring (children etc.)

Specified by:
isAncestorOf in interface IHgraphNode
Returns:
true if this node is an ancestor of the parameter node. false if not.

removeNodeChild

public int removeNodeChild(java.lang.String name,
                           Path callerPath)
Description copied from interface: IHgraphNode
Removes a child based on its name.

Specified by:
removeNodeChild in interface IHgraphNode
Parameters:
name - The name of the child to be removed
Returns:
IHgraphNode.STATUS_OK if the operation succeeds

toXML

public java.lang.String toXML()
Specified by:
toXML in interface IHgraphNode
Returns:
A simple xml'ified String of the node (type, name, path, children)

toXMLFull

public java.lang.String toXMLFull()
Specified by:
toXMLFull in interface IHgraphNode
Returns:
A complete xml'ified String of the node (same as simple + handlers, invokators, listeners, values)

toXMLRecursively

public java.lang.String toXMLRecursively()
Specified by:
toXMLRecursively in interface IHgraphNode
Returns:
A simple recursive xml'ified String of the node (type, name, path, children)

toXMLFullRecursively

public java.lang.String toXMLFullRecursively()
Specified by:
toXMLFullRecursively in interface IHgraphNode
Returns:
A complete recursive xml'ified String of the node (same as simple + handlers, invokators, listeners, values) HEAVY!!!

setNodeParent

public int setNodeParent(IHgraphNode newParent,
                         Path callerPath)
Description copied from interface: IHgraphNode
Sets the parent of the HgraphNode. This triggers a recalculation of the path of the node and its offspring

Specified by:
setNodeParent in interface IHgraphNode
Parameters:
newParent - the new parent
Returns:
IHgraphNode.STATUS_OK if the operation succeeds. IHgraphNode.CIRCULARITY_CLASH if the operation causes a circularity.

addNodeChild

public int addNodeChild(IHgraphNode node,
                        Path callerPath)
Description copied from interface: IHgraphNode
Adds a child to the node's private list of children. Ensures that names amongst children are unique

Specified by:
addNodeChild in interface IHgraphNode
Parameters:
node - The new child to be added
Returns:
IHgraphNode.STATUS_OK if the change succeeded. IHgraphNode.CHILD_NAME_CLASH if a sibling with the given name already exists.

getSiblingFunc

public SiblingFunc getSiblingFunc()
Specified by:
getSiblingFunc in interface IHgraphNode
Returns:
The SiblingFunc Sibling functionality object for the given node.

getValueFunc

public ValueFunc getValueFunc()
Specified by:
getValueFunc in interface IHgraphNode
Returns:
The ValueFunc Value functionality object for the given node.

getFuncFunc

public FuncFunc getFuncFunc()
Specified by:
getFuncFunc in interface IHgraphNode
Returns:
The FuncFunc functional functionality (ie. handlers, invokators and listeners) object for the given node.

getNodeParent

public IHgraphNode getNodeParent()
Specified by:
getNodeParent in interface IHgraphNode
Returns:
The parent of the node. null if the parent is root

getChildIterator

public java.util.Iterator getChildIterator()
Specified by:
getChildIterator in interface IHgraphNode
Returns:
An Iterator over the children of the node