|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectist.palcom.routing.util.AbstractRoutingManager
public abstract class AbstractRoutingManager
This class is work in progress :-)
| Field Summary | |
|---|---|
protected HgraphNode |
_node
|
protected MediaManager |
manager
|
protected RoutingPubSubManager |
pubSubManager
|
protected PalcomThread |
recieverThread
|
protected LinearMap |
registeredThreads
|
protected PalcomScheduler |
scheduler
|
| 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 | |
|---|---|
AbstractRoutingManager(PalcomScheduler scheduler,
MediaManager manager,
RoutingPubSubManager pubSubManager,
URN deviceURN)
Create a new Routing manager. |
|
| Method Summary | |
|---|---|
void |
addErrorHandler(PalcomThread handler)
|
int |
addNodeChild(IHgraphNode node,
Path callerPath)
Adds a child to the node's private list of children. |
java.util.Iterator |
getChildIterator()
|
FuncFunc |
getFuncFunc()
|
java.lang.String |
getLocalDeviceCache()
|
java.lang.String |
getNodeName()
hgraph impl below |
IHgraphNode |
getNodeParent()
|
Path |
getPath()
|
Selector |
getRoutingSelector()
|
URN |
getRoutingURN()
|
SiblingFunc |
getSiblingFunc()
|
ValueFunc |
getValueFunc()
|
protected abstract void |
handleRoutingMessage(AbstractRoutingMessage message)
Method that should be implemented to handle the different routing messages that the specific implementation of a routing manager can handle. |
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. |
void |
registerAsListener(PalcomThread communicationManager)
Registers as a listener to messages received by this manager from the network. |
void |
registerForHeartBeats(PalcomThread resourceManager)
|
int |
removeNodeChild(java.lang.String name,
Path callerPath)
Removes a child based on its name. |
boolean |
send(Message message,
java.lang.String receiverDeviceID)
|
abstract boolean |
send(Message message,
URN senderURN,
Selector senderSelector,
URN receiverURN,
Selector receiverSelector)
|
void |
sendBroadcast(Message message)
|
void |
sendGroupJoinMessage(java.lang.String groupID)
|
void |
sendGroupLeaveMessage(java.lang.String groupID)
|
void |
sendHeartAttack()
|
void |
sendHeartBeat(boolean isHeartBeatAck)
|
void |
setDiscoverySelector(Selector selector)
|
void |
setLocalDeviceCache(java.lang.String localDeviceCache)
|
void |
setLocalDeviceID(java.lang.String localDeviceID)
|
void |
setLocalDiscoveryVersion(java.lang.String discoveryVersion)
|
void |
setLocalStatusFlag(byte statusFlag)
|
void |
setLocalStatusFlag(int statusFlag)
|
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. |
URL |
startReceiving(PalcomThread receiver)
Deprecated. |
protected abstract void |
startRouting()
|
void |
stop()
Stop the manager. |
void |
stopReceiving(PalcomThread receiver)
Stop receiving messages for a receiver. |
void |
stopReceiving(Selector selector)
Stop receiving messages at a selector. |
java.lang.String |
toXML()
|
java.lang.String |
toXMLFull()
|
java.lang.String |
toXMLFullRecursively()
|
java.lang.String |
toXMLRecursively()
|
void |
unregisterDevice(java.lang.String deviceID)
Remove the device with deviceID from the list of registered devices. |
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 |
| Field Detail |
|---|
protected HgraphNode _node
protected final MediaManager manager
protected RoutingPubSubManager pubSubManager
protected PalcomScheduler scheduler
protected PalcomThread recieverThread
protected LinearMap registeredThreads
| Constructor Detail |
|---|
public AbstractRoutingManager(PalcomScheduler scheduler,
MediaManager manager,
RoutingPubSubManager pubSubManager,
URN deviceURN)
scheduler - - the palcom scheduler used in this service.manager - - the mediamanager used in this service, this could be a compound media manager.pubSubManager - - the RoutingPuSubManagerdeviceURN - - information about the device e.g. the URN of the device| Method Detail |
|---|
protected abstract void handleRoutingMessage(AbstractRoutingMessage message)
message - - message send between the nodes in the network to update/establish
routing.protected abstract void startRouting()
public abstract boolean send(Message message,
URN senderURN,
Selector senderSelector,
URN receiverURN,
Selector receiverSelector)
send in interface RoutingManagerpublic URL startReceiving(PalcomThread receiver)
public void stopReceiving(Selector selector)
stopReceiving in interface RoutingManagerpublic void stopReceiving(PalcomThread receiver)
stopReceiving in interface RoutingManagerpublic void stop()
stop in interface RoutingManagerpublic URN getRoutingURN()
public Selector getRoutingSelector()
public boolean send(Message message,
java.lang.String receiverDeviceID)
send in interface RoutingManagerpublic void addErrorHandler(PalcomThread handler)
addErrorHandler in interface RoutingManagerpublic void setLocalDeviceCache(java.lang.String localDeviceCache)
setLocalDeviceCache in interface RoutingManagerpublic java.lang.String getLocalDeviceCache()
getLocalDeviceCache in interface RoutingManagerpublic void setLocalDeviceID(java.lang.String localDeviceID)
setLocalDeviceID in interface RoutingManagerpublic void setLocalStatusFlag(byte statusFlag)
setLocalStatusFlag in interface RoutingManagerpublic void setLocalStatusFlag(int statusFlag)
public void setLocalDiscoveryVersion(java.lang.String discoveryVersion)
setLocalDiscoveryVersion in interface RoutingManagerpublic void setDiscoverySelector(Selector selector)
setDiscoverySelector in interface RoutingManagerpublic void sendBroadcast(Message message)
sendBroadcast in interface RoutingManagerpublic void sendHeartAttack()
sendHeartAttack in interface RoutingManagerpublic void sendGroupJoinMessage(java.lang.String groupID)
sendGroupJoinMessage in interface RoutingManagerpublic void sendGroupLeaveMessage(java.lang.String groupID)
sendGroupLeaveMessage in interface RoutingManagerpublic void registerAsListener(PalcomThread communicationManager)
registerAsListener in interface RoutingManagercommunicationManager - The PalComThread used in CommunicationManagerpublic void registerForHeartBeats(PalcomThread resourceManager)
registerForHeartBeats in interface RoutingManagerpublic void sendHeartBeat(boolean isHeartBeatAck)
sendHeartBeat in interface RoutingManagerpublic void unregisterDevice(java.lang.String deviceID)
unregisterDevice in interface RoutingManagerpublic java.lang.String getNodeName()
getNodeName in interface IHgraphNode
public int setNodeName(java.lang.String name,
Path callerPath)
IHgraphNode
setNodeName in interface IHgraphNodename - The new name
public Path getPath()
getPath in interface IHgraphNodepublic void updatePath()
IHgraphNode
updatePath in interface IHgraphNodepublic boolean hasChildNamed(java.lang.String name)
IHgraphNode
hasChildNamed in interface IHgraphNodename - The name to check
public boolean isAncestorOf(IHgraphNode node)
IHgraphNode
isAncestorOf in interface IHgraphNode
public int removeNodeChild(java.lang.String name,
Path callerPath)
IHgraphNode
removeNodeChild in interface IHgraphNodename - The name of the child to be removed
public java.lang.String toXML()
toXML in interface IHgraphNodepublic java.lang.String toXMLFull()
toXMLFull in interface IHgraphNodepublic java.lang.String toXMLRecursively()
toXMLRecursively in interface IHgraphNodepublic java.lang.String toXMLFullRecursively()
toXMLFullRecursively in interface IHgraphNode
public int setNodeParent(IHgraphNode newParent,
Path callerPath)
IHgraphNode
setNodeParent in interface IHgraphNodenewParent - the new parent
public int addNodeChild(IHgraphNode node,
Path callerPath)
IHgraphNode
addNodeChild in interface IHgraphNodenode - The new child to be added
public SiblingFunc getSiblingFunc()
getSiblingFunc in interface IHgraphNodepublic ValueFunc getValueFunc()
getValueFunc in interface IHgraphNodepublic FuncFunc getFuncFunc()
getFuncFunc in interface IHgraphNodepublic IHgraphNode getNodeParent()
getNodeParent in interface IHgraphNodepublic java.util.Iterator getChildIterator()
getChildIterator in interface IHgraphNode
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||