planet.chord
Class ChordNode.FindPredListener

java.lang.Object
  extended byplanet.chord.ChordNode.FindPredListener
All Implemented Interfaces:
MessageListener
Enclosing class:
ChordNode

public class ChordNode.FindPredListener
extends java.lang.Object
implements MessageListener


Field Summary
static int FIND_PRED_FOR_FIX_FINGER
          Flag that shows that this listener type is for a fix finger purposes.
static int FIND_PRED_FOR_JOIN
          Flag that shows that this listener type is for a response on a remote join.
 
Constructor Summary
ChordNode.FindPredListener(ChordNode localNode, int fingerPosition)
          Builds a FindPredListener for a fix finger purposes.
ChordNode.FindPredListener(ChordNode localNode, java.lang.String msgKey)
          Builds a FindPredListener for a join message response.
 
Method Summary
 void onMessage(RouteMessage msg)
          Make a different action using the actual listener purpose.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FIND_PRED_FOR_FIX_FINGER

public static final int FIND_PRED_FOR_FIX_FINGER
Flag that shows that this listener type is for a fix finger purposes.

See Also:
Constant Field Values

FIND_PRED_FOR_JOIN

public static final int FIND_PRED_FOR_JOIN
Flag that shows that this listener type is for a response on a remote join.

See Also:
Constant Field Values
Constructor Detail

ChordNode.FindPredListener

public ChordNode.FindPredListener(ChordNode localNode,
                                  int fingerPosition)
Builds a FindPredListener for a fix finger purposes.

Parameters:
localNode - The local Node.
fingerPosition - The position of the finger to be updated.

ChordNode.FindPredListener

public ChordNode.FindPredListener(ChordNode localNode,
                                  java.lang.String msgKey)
Builds a FindPredListener for a join message response.

Parameters:
localNode - The local node.
msgKey - The RouteMessage key for the response.
Method Detail

onMessage

public void onMessage(RouteMessage msg)
Make a different action using the actual listener purpose. In a first case, it updates the finger position with the incoming information. In a second case, it makes a response for a remote join message.

Specified by:
onMessage in interface MessageListener