planet.symphony.behaviours
Class AcceptConnectBehaviour
java.lang.Object
planet.symphony.behaviours.AcceptConnectBehaviour
- All Implemented Interfaces:
- Behaviour
public class AcceptConnectBehaviour
- extends java.lang.Object
- implements Behaviour
AcceptConnectBehaviour agrees to accept a long link connection. Source node calls getLongDistanceConnection()
method while the outcoming connections ratio is less than K. For that, it sends QUERY_CONNECT messages to the
aspirants determined by routing primitive and priori unknown. When an aspirant answers (is immediate successor
of the key on QUERY_CONNECT message got by Symphony pdf function), it sends to originator of the QUERY_CONNECT
message and ACCEPT_CONNECT message. Then the originator checks if the long peer is valid i.e, is not included
on neighbour's set. When enough long valid peers are available they form the new outcommingSet and the long
connections of old outcommingSet must be closed because it can be stale and no longer used for originator peer.
- Author:
- Marc Sanchez , Helio Tejedor
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
AcceptConnectBehaviour
public AcceptConnectBehaviour()
onMessage
public RouteMessage[] 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.
- Returns:
- Returns either an array of RouteMessages or null when no messages
need to transmit this node.
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
- Overrides:
toString
in class java.lang.Object
- 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.