mail.node
Class FriendNode
java.lang.Object
mail.node.Node
mail.node.FriendNode
- All Implemented Interfaces:
- java.lang.Comparable<FriendNode>
public class FriendNode
- extends Node
- implements java.lang.Comparable<FriendNode>
Field Summary |
private java.lang.String |
alias
|
Fields inherited from class mail.node.Node |
crypt |
Methods inherited from class mail.node.Node |
distance, distance, equals, getCryptEngine, getID, getKey, hashCode, markReachable, searchClosest, searchName, searchNode |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
alias
private java.lang.String alias
FriendNode
public FriendNode(ID id)
FriendNode
public FriendNode(ID id,
java.lang.String alias)
FriendNode
public FriendNode(java.lang.String pubkey)
throws CryptCreationException
- Throws:
CryptCreationException
FriendNode
public FriendNode(org.w3c.dom.Element e)
throws CryptCreationException
- Throws:
CryptCreationException
setAlias
public void setAlias(java.lang.String alias)
getAlias
public java.lang.String getAlias()
getName
public ID getName(NameID nameid)
- Description copied from class:
Node
- fetches the ID that registered the name with the given ID
- Specified by:
getName
in class Node
- Returns:
storeName
public void storeName(NameID nameid,
ID user)
- Specified by:
storeName
in class Node
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
getClosest
public java.util.ArrayList<Node> getClosest(ID nodeid)
- 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
getMail
public java.util.Collection<Mail> getMail(ID receiver)
- Specified by:
getMail
in class Node
getNeighbors
public java.util.Collection<Node> getNeighbors()
- Description copied from class:
Node
- returns all the neighbors of this Node
- Specified by:
getNeighbors
in class Node
- Returns:
getNode
public Node getNode(ID id)
- Specified by:
getNode
in class Node
store
public void store(Mail m)
- Specified by:
store
in class Node
setKey
public void setKey(java.lang.String key)
throws CryptCreationException
- Throws:
CryptCreationException
compareTo
public int compareTo(FriendNode o)
- Specified by:
compareTo
in interface java.lang.Comparable<FriendNode>
build
public org.w3c.dom.Element build(org.w3c.dom.Document d)
toString
public java.lang.String toString()
- Overrides:
toString
in class Node