oogp2p.pastry
Class PastryNode

java.lang.Object
  extended byoogp2p.pastry.PastryNode

public class PastryNode
extends java.lang.Object

Author:
sjg To change the template for this generated type comment go to Window>Preferences>Java>Code Generation>Code and Comments

Field Summary
private  ClientAdministrator clAdmin
           
static int leafSetSize
           
protected  LeafSet myLeafSet
           
private  PastryLocation myLocation
           
protected  RoutingTable myRoutingTable
           
 
Constructor Summary
PastryNode()
           
 
Method Summary
 void addLocation(PastryLocation pLoc)
          Adds a PastryLocation to the node.
private  void broadcast(java.util.Collection pLocTargets, PastryNettable n)
           
private  void broadcast(PastryLocation[] pLocTargets, PastryNettable n)
           
 java.net.InetAddress getIP()
           
 LeafSet getLeafSet()
           
 PastryLocation getLocation()
           
 RoutingTable getRoutingTable()
           
 boolean isClosest(PastryLocation key)
          Called by the layered Pastry application to check if the local pastry node is the one that is currently closest to the object key id.
 boolean mergeLeafset(LeafSet leafset, PastryLocation from)
           
 boolean networkRoute(PastryLocation pl, PastryNettable n)
           
 void route(PastryNettable n, PastryLocation pl)
           
 boolean sendNettable(java.net.InetAddress target, PastryNettable n)
           
 java.lang.String toString()
           
 void update(PastryNode p)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

myLocation

private PastryLocation myLocation

myRoutingTable

protected RoutingTable myRoutingTable

myLeafSet

protected LeafSet myLeafSet

clAdmin

private ClientAdministrator clAdmin

leafSetSize

public static int leafSetSize
Constructor Detail

PastryNode

public PastryNode()
Method Detail

route

public void route(PastryNettable n,
                  PastryLocation pl)

isClosest

public boolean isClosest(PastryLocation key)
Called by the layered Pastry application to check if the local pastry node is the one that is currently closest to the object key id.

Parameters:
key - -- the object key id
Returns:
true if the local node is currently the closest to the key.

update

public void update(PastryNode p)

networkRoute

public boolean networkRoute(PastryLocation pl,
                            PastryNettable n)

sendNettable

public boolean sendNettable(java.net.InetAddress target,
                            PastryNettable n)

addLocation

public void addLocation(PastryLocation pLoc)
Adds a PastryLocation to the node. First tries LeafSet, then tries routing table.

Parameters:
pLoc - -- node location to add

getLocation

public PastryLocation getLocation()

getRoutingTable

public RoutingTable getRoutingTable()

getLeafSet

public LeafSet getLeafSet()

mergeLeafset

public boolean mergeLeafset(LeafSet leafset,
                            PastryLocation from)

broadcast

private void broadcast(java.util.Collection pLocTargets,
                       PastryNettable n)

broadcast

private void broadcast(PastryLocation[] pLocTargets,
                       PastryNettable n)

toString

public java.lang.String toString()

getIP

public java.net.InetAddress getIP()
Returns:
-- IP of the the node