ePOST API

rice.pastry.standard
Class StandardJoinProtocol

java.lang.Object
  extended by rice.pastry.client.PastryAppl
      extended by rice.pastry.standard.StandardJoinProtocol
All Implemented Interfaces:
MessageReceiver
Direct Known Subclasses:
ConsistentJoinProtocol

public class StandardJoinProtocol
extends PastryAppl

An implementation of a simple join protocol.

Version:
$Id: StandardJoinProtocol.java 3095 2006-02-23 20:14:55Z jstewart $
Author:
Peter Druschel, Andrew Ladd, Rongmei Zhang, Y. Charlie Hu

Field Summary
protected  Credentials cred
           
protected  LeafSet leafSet
           
protected  NodeHandle localHandle
           
protected  RoutingTable routeTable
           
protected  PastrySecurityManager security
           
 
Fields inherited from class rice.pastry.client.PastryAppl
address, instance, logger, thePastryNode
 
Constructor Summary
StandardJoinProtocol(PastryNode ln, NodeHandle lh, PastrySecurityManager sm, RoutingTable rt, LeafSet ls)
          Constructor.
 
Method Summary
 void broadcastRows(JoinRequest jr)
          Broadcasts the route table rows.
 boolean deliverWhenNotReady()
          We always want to receive messages.
 Address getAddress()
          Get address.
 Credentials getCredentials()
          Returns the credentials of this application.
 void messageForAppl(Message msg)
          Should not be called becasue we are overriding the receiveMessage() interface anyway.
 void receiveMessage(Message msg)
          Receives a message from the outside world.
protected  void setReady()
          Can be overloaded to do additional things before going ready.
 
Methods inherited from class rice.pastry.client.PastryAppl
destroy, enrouteMessage, getLeafSet, getNodeHandle, getNodeId, getRoutingTable, isClosest, leafSetChange, notifyReady, register, registerReceiver, routeMsg, routeMsgDirect, routeSetChange, sendMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

localHandle

protected NodeHandle localHandle

security

protected PastrySecurityManager security

routeTable

protected RoutingTable routeTable

leafSet

protected LeafSet leafSet

cred

protected Credentials cred
Constructor Detail

StandardJoinProtocol

public StandardJoinProtocol(PastryNode ln,
                            NodeHandle lh,
                            PastrySecurityManager sm,
                            RoutingTable rt,
                            LeafSet ls)
Constructor.

Parameters:
lh - the local node handle.
sm - the Pastry security manager.
Method Detail

getAddress

public Address getAddress()
Get address.

Overrides:
getAddress in class PastryAppl
Returns:
gets the address.

receiveMessage

public void receiveMessage(Message msg)
Receives a message from the outside world.

Specified by:
receiveMessage in interface MessageReceiver
Overrides:
receiveMessage in class PastryAppl
Parameters:
msg - the message that was received.

setReady

protected void setReady()
Can be overloaded to do additional things before going ready. For example, verifying that other nodes are aware of us, so that consistent routing is guaranteed.


broadcastRows

public void broadcastRows(JoinRequest jr)
Broadcasts the route table rows.

Parameters:
jr - the join row.

messageForAppl

public void messageForAppl(Message msg)
Should not be called becasue we are overriding the receiveMessage() interface anyway.

Specified by:
messageForAppl in class PastryAppl
Parameters:
msg - the message that is arriving.

getCredentials

public Credentials getCredentials()
Description copied from class: PastryAppl
Returns the credentials of this application.

Specified by:
getCredentials in class PastryAppl
Returns:
the credentials.

deliverWhenNotReady

public boolean deliverWhenNotReady()
We always want to receive messages.

Overrides:
deliverWhenNotReady in class PastryAppl
Returns:
false unless the node is a service

ePOST API

Copyright © 2001-2005 - Rice Pastry.