planet.trivialp2p.behaviours
Class DataBehaviour

java.lang.Object
  extended byplanet.trivialp2p.behaviours.DataBehaviour
All Implemented Interfaces:
Behaviour, java.io.Serializable

public class DataBehaviour
extends java.lang.Object
implements Behaviour

This behaviour is available for application level messages. It routes to the successor (in a clockwise proximity) up to the destination node, where the message is delivered.

Author:
Jordi Pujol 03-jun-2005
See Also:
Serialized Form

Constructor Summary
DataBehaviour()
           
 
Method Summary
 java.lang.String getName()
          Gets the behaviour name.
 void onMessage(RouteMessage msg, Node node)
          This method treat any application level message, the only available ones in this TrivialP2P overlay implementation.
 java.lang.String toString()
          Returns the behaviour name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DataBehaviour

public DataBehaviour()
Method Detail

getName

public java.lang.String getName()
Gets the behaviour name.

Specified by:
getName in interface Behaviour
Returns:
The behaviour name.
See Also:
Behaviour.getName()

toString

public java.lang.String toString()
Returns the behaviour name.

Specified by:
toString in interface Behaviour
Returns:
The behaviour name.
See Also:
Object.toString()

onMessage

public void onMessage(RouteMessage msg,
                      Node node)
This method treat any application level message, the only available ones in this TrivialP2P overlay implementation.

Specified by:
onMessage in interface Behaviour
Parameters:
msg - A RouteMessage that contains an application level message.
node - The local node.
See Also:
Behaviour.onMessage(planet.commonapi.RouteMessage, planet.commonapi.Node)