Rice Pastry API

rice.pastry.standard
Class StandardLeafSetProtocol

java.lang.Object
  |
  +--rice.pastry.standard.StandardLeafSetProtocol
All Implemented Interfaces:
MessageReceiver

public class StandardLeafSetProtocol
extends java.lang.Object
implements MessageReceiver

An implementation of a simple leaf set protocol.

Version:
$Id: StandardLeafSetProtocol.java,v 1.25 2003/05/06 15:11:43 druschel Exp $
Author:
Peter Druschel, Andrew Ladd

Constructor Summary
StandardLeafSetProtocol(rice.pastry.PastryNode ln, rice.pastry.NodeHandle local, rice.pastry.security.PastrySecurityManager sm, rice.pastry.leafset.LeafSet ls, rice.pastry.routing.RoutingTable rt)
           
 
Method Summary
protected  void broadcast()
          Broadcast the leaf set to all members of the local leaf set.
protected  void broadcast(int type)
          Broadcast the leaf set to all members of the local leaf set.
protected  void broadcast(rice.pastry.leafset.LeafSet ls, rice.pastry.NodeHandle from)
          Broadcast the local leaf set to all members of the given leaf set, plus the node from which the leaf set was received.
protected  boolean checkLeafSet(rice.pastry.leafset.LeafSet remotels, rice.pastry.NodeHandle from, boolean notifyMissing)
          Checks a received leafset advertisement for missing nodes
 rice.pastry.messaging.Address getAddress()
          Gets the address.
 void maintainLeafSet()
          Maintain the leaf set.
protected  boolean mergeLeafSet(rice.pastry.leafset.LeafSet remotels, rice.pastry.NodeHandle from)
          Merge a remote leafset into our own
 void receiveMessage(rice.pastry.messaging.Message msg)
          Receives messages.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StandardLeafSetProtocol

public StandardLeafSetProtocol(rice.pastry.PastryNode ln,
                               rice.pastry.NodeHandle local,
                               rice.pastry.security.PastrySecurityManager sm,
                               rice.pastry.leafset.LeafSet ls,
                               rice.pastry.routing.RoutingTable rt)
Method Detail

getAddress

public rice.pastry.messaging.Address getAddress()
Gets the address.

Returns:
the address.

receiveMessage

public void receiveMessage(rice.pastry.messaging.Message msg)
Receives messages.

Specified by:
receiveMessage in interface MessageReceiver
Parameters:
msg - the message.

checkLeafSet

protected boolean checkLeafSet(rice.pastry.leafset.LeafSet remotels,
                               rice.pastry.NodeHandle from,
                               boolean notifyMissing)
Checks a received leafset advertisement for missing nodes

Parameters:
remotels - the remote leafset
from - the node from which we received the leafset
notifyMissing - if true, notify missing nodes
Returns:
true if any nodes where found missing in the received leafset

mergeLeafSet

protected boolean mergeLeafSet(rice.pastry.leafset.LeafSet remotels,
                               rice.pastry.NodeHandle from)
Merge a remote leafset into our own

Parameters:
remotels - the remote leafset
from - the node from which we received the leafset
Returns:
true if the leafset changed

broadcast

protected void broadcast()
Broadcast the leaf set to all members of the local leaf set.


broadcast

protected void broadcast(int type)
Broadcast the leaf set to all members of the local leaf set.

Parameters:
type - the type of broadcast message used

broadcast

protected void broadcast(rice.pastry.leafset.LeafSet ls,
                         rice.pastry.NodeHandle from)
Broadcast the local leaf set to all members of the given leaf set, plus the node from which the leaf set was received.

Parameters:
ls - the leafset whose members we send to local leaf set
from - the node from which ls was received

maintainLeafSet

public void maintainLeafSet()
Maintain the leaf set. This method checks for dead leafset entries and replaces them as needed. It is assumed that this method be invoked periodically.


Rice Pastry API

Copyright © 2001 - Rice Pastry.


Imprint-Dataprotection