oogp2p.pastry
Class PastryNode
java.lang.Object
oogp2p.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
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
myLocation
private PastryLocation myLocation
myRoutingTable
protected RoutingTable myRoutingTable
myLeafSet
protected LeafSet myLeafSet
clAdmin
private ClientAdministrator clAdmin
leafSetSize
public static int leafSetSize
PastryNode
public PastryNode()
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