planet.symphony.behaviours
Class CloseNeighbourConnectBehaviour

java.lang.Object
  extended byplanet.symphony.behaviours.CloseNeighbourConnectBehaviour
All Implemented Interfaces:
Behaviour, java.io.Serializable

public class CloseNeighbourConnectBehaviour
extends java.lang.Object
implements Behaviour

The CloseNeighbourConnectBehaviour is used to close a neighbour connection on the neighbour's set. When a node wants to make a voluntary depart, it sends a CLOSE_NEIGHBOUR_CONNECT to all neighbours in order to notify them it is departing and the connection is going down.

Author:
Marc Sanchez , Helio Tejedor
See Also:
Serialized Form

Constructor Summary
CloseNeighbourConnectBehaviour()
           
 
Method Summary
 java.lang.String getName()
           
 void onMessage(RouteMessage msg, Node node)
          Given a RouteMessage and a Node as input, onMessage's method do execution steps for the behaviour.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CloseNeighbourConnectBehaviour

public CloseNeighbourConnectBehaviour()
Method Detail

onMessage

public void onMessage(RouteMessage msg,
                      Node node)
Given a RouteMessage and a Node as input, onMessage's method do execution steps for the behaviour. Node should be casted to Node's class in order to manage data structures and protocol of designed overlay.

Specified by:
onMessage in interface Behaviour
Parameters:
msg - RouteMessage taken as input.
node - Node taken as input.
See Also:
RouteMessagePoolImpl

getName

public java.lang.String getName()
Specified by:
getName in interface Behaviour
Returns:
Returns the name of behaviour.

toString

public java.lang.String toString()
Specified by:
toString in interface Behaviour
Returns:
Returns a string representation of the behaviour. In general, the toString method returns a string that "textually represents" this behaviour. The result should be a concise but informative representation that is easy for a person to read.