planet.behaviour
Interface Behaviour

All Known Implementing Classes:
AcceptConnectBehaviour, CancelConnectBehaviour, CloseLongConnectBehaviour, CloseNeighbourConnectBehaviour, DataBehaviour, DropBehaviour, QueryConnectBehaviour, QueryJoinBehaviour, RoutingBehaviour, SetInfoBehaviour

public interface Behaviour

This interface provides a method to add functionality to a behvaiour.

Author:
Marc Sanchez

Method Summary
 java.lang.String getName()
           
 RouteMessage[] 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()
           
 

Method Detail

onMessage

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.

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

java.lang.String getName()
Returns:
Returns the name of behaviour.

toString

java.lang.String toString()
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.