org.hopto.pentaj.jexin.node
Class NodeManagerImpl

java.lang.Object
  extended by org.hopto.pentaj.jexin.node.NodeManagerImpl
All Implemented Interfaces:
NodeManager

public class NodeManagerImpl
extends java.lang.Object
implements NodeManager

Default implementation of NodeManager


Constructor Summary
NodeManagerImpl(StackTraceManager stackTraceManager)
           
 
Method Summary
 boolean connect(NodeAddress address)
           
 boolean createNode(NodeAddress address)
          Creates a new Node with the specified address
 void deleteNode(NodeAddress address)
          Deletes the node associated with the address.
 boolean disconnect(NodeAddress address)
           
 Node getNode(NodeAddress address)
           
 java.util.Collection<Node> getNodes()
           
 void setTraceClientFactory(TraceClientFactory traceClientFactory)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodeManagerImpl

public NodeManagerImpl(StackTraceManager stackTraceManager)
Method Detail

setTraceClientFactory

public void setTraceClientFactory(TraceClientFactory traceClientFactory)
Parameters:
traceClientFactory - the traceClientFactory to set

createNode

public boolean createNode(NodeAddress address)
Description copied from interface: NodeManager
Creates a new Node with the specified address

Specified by:
createNode in interface NodeManager
Returns:
True if a node was created, false if there was already a node with the specified address
See Also:
NodeManager.createNode(org.hopto.pentaj.jexin.node.NodeAddress)

deleteNode

public void deleteNode(NodeAddress address)
Description copied from interface: NodeManager
Deletes the node associated with the address. If there is no node then no action is taken. If the node is currently connected it is disconnected then deleted.

Specified by:
deleteNode in interface NodeManager
See Also:
NodeManager.deleteNode(org.hopto.pentaj.jexin.node.NodeAddress)

getNode

public Node getNode(NodeAddress address)
Specified by:
getNode in interface NodeManager
Returns:
The node with the specified address. Null if there isn't one
See Also:
NodeManager.getNode(org.hopto.pentaj.jexin.node.NodeAddress)

getNodes

public java.util.Collection<Node> getNodes()
Specified by:
getNodes in interface NodeManager
Returns:
All nodes, sorted by address
See Also:
NodeManager.getNodes()

connect

public boolean connect(NodeAddress address)
                throws java.net.UnknownHostException,
                       java.io.IOException
Specified by:
connect in interface NodeManager
Parameters:
address - The address of the node to connect
Returns:
True if connection succeeds. False if the node for the specified address is not found.
Throws:
java.net.UnknownHostException
java.io.IOException
See Also:
NodeManager.connect(org.hopto.pentaj.jexin.node.NodeAddress)

disconnect

public boolean disconnect(NodeAddress address)
Specified by:
disconnect in interface NodeManager
Parameters:
address - The address of the node to disconnect
Returns:
True if disconnection succeeds or the node was not connected. False if the node for the specified address is not found.
See Also:
NodeManager.disconnect(org.hopto.pentaj.jexin.node.NodeAddress)