mail.node
Class FriendNode

java.lang.Object
  extended by mail.node.Node
      extended by mail.node.FriendNode
All Implemented Interfaces:
java.lang.Comparable<FriendNode>

public class FriendNode
extends Node
implements java.lang.Comparable<FriendNode>


Nested Class Summary
 
Nested classes/interfaces inherited from class mail.node.Node
Node.IDComparator, Node.InvertedIDComparator
 
Field Summary
private  java.lang.String alias
           
 
Fields inherited from class mail.node.Node
crypt
 
Constructor Summary
FriendNode(org.w3c.dom.Element e)
           
FriendNode(ID id)
           
FriendNode(ID id, java.lang.String alias)
           
FriendNode(java.lang.String pubkey)
           
 
Method Summary
 void addNeighbor(Node n)
          add's another neighbor to the node's list of neighbors
 org.w3c.dom.Element build(org.w3c.dom.Document d)
           
 int compareTo(FriendNode o)
           
 java.lang.String getAlias()
           
 java.util.ArrayList<Node> getClosest(ID nodeid)
          returns the neighbors of this node sorted by distance.
 java.util.Collection<Mail> getMail(ID receiver)
           
 ID getName(NameID nameid)
          fetches the ID that registered the name with the given ID
 java.util.Collection<Node> getNeighbors()
          returns all the neighbors of this Node
 Node getNode(ID id)
           
 void setAlias(java.lang.String alias)
           
 void setKey(java.lang.String key)
           
 void store(Mail m)
           
 void storeName(NameID nameid, ID user)
           
 java.lang.String toString()
           
 
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
 

Field Detail

alias

private java.lang.String alias
Constructor Detail

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
Method Detail

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