org.hopto.pentaj.jexin.node
Interface NodeManager

All Known Implementing Classes:
NodeManagerImpl

public interface NodeManager

Manages Nodes. The MVC layer should use this to interact with nodes.


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()
           
 

Method Detail

getNodes

java.util.Collection<Node> getNodes()
Returns:
All nodes, sorted by address

getNode

Node getNode(NodeAddress address)
Parameters:
address -
Returns:
The node with the specified address. Null if there isn't one

createNode

boolean createNode(NodeAddress address)
Creates a new Node with the specified address

Parameters:
address -
Returns:
True if a node was created, false if there was already a node with the specified address

deleteNode

void deleteNode(NodeAddress address)
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.

Parameters:
address -

connect

boolean connect(NodeAddress address)
                throws java.net.UnknownHostException,
                       java.io.IOException
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

disconnect

boolean disconnect(NodeAddress address)
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.