mail.node
Class RemoteNode
java.lang.Object
mail.node.Node
mail.node.RemoteNode
public class RemoteNode
- extends Node
- Author:
- Arne Müller
Fields inherited from class mail.node.Node |
crypt |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
comm
private Communicator comm
address
private java.util.Collection<Address> address
RemoteNode
public RemoteNode(Communicator c,
java.util.Collection<Address> addr,
java.lang.String key)
throws CryptCreationException
- Throws:
CryptCreationException
RemoteNode
public RemoteNode(Communicator c,
Node local)
debug_print
private void debug_print(java.lang.Exception ex)
debug_print
private void debug_print(java.lang.String s)
addNeighbor
public void addNeighbor(Node n)
- Description copied from class:
Node
- add's another neighbor to the node's list of neighbors
- Specified by:
addNeighbor
in class Node
makeRequestID
private static java.lang.String makeRequestID()
getClosest
public java.util.ArrayList<Node> getClosest(ID nodeid)
throws RequestFailedException
- Description copied from class:
Node
- returns the neighbors of this node sorted by distance.
the closest node will be first
- Specified by:
getClosest
in class Node
- Parameters:
nodeid
- the id of the node to which distance should be measured to
- Returns:
- neighbors sorted by distance
- Throws:
RequestFailedException
getNode
public Node getNode(ID id)
throws RequestFailedException
- Specified by:
getNode
in class Node
- Throws:
RequestFailedException
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in class Node
getName
public ID getName(NameID nameid)
throws RequestFailedException
- Description copied from class:
Node
- fetches the ID that registered the name with the given ID
- Specified by:
getName
in class Node
- Returns:
-
- Throws:
RequestFailedException
storeName
public void storeName(NameID nameid,
ID user)
throws RequestFailedException
- Specified by:
storeName
in class Node
- Throws:
RequestFailedException
getNeighbors
public java.util.Collection<Node> getNeighbors()
throws RequestFailedException
- Description copied from class:
Node
- returns all the neighbors of this Node
- Specified by:
getNeighbors
in class Node
- Returns:
-
- Throws:
RequestFailedException
getMail
public java.util.Collection<Mail> getMail(ID receiver)
throws RequestFailedException
- Specified by:
getMail
in class Node
- Throws:
RequestFailedException
store
public void store(Mail m)
throws RequestFailedException
- Specified by:
store
in class Node
- Throws:
RequestFailedException
getAddress
public java.util.Collection<Address> getAddress()
addAddress
public void addAddress(java.util.Collection<Address> a)
toString
public java.lang.String toString()
- Overrides:
toString
in class Node