planet.commonapi
Interface RouteMessage

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
RouteMessageImpl

public interface RouteMessage
extends java.io.Serializable

Author:
Jordi Pujol

Method Summary
 java.lang.String getApplicationId()
          Returns the application Id for this message
 NodeHandle getDestination()
          Returns the destination NodeHandle for this message
 java.lang.String getKey()
          Gets the identification key of this communication.
 Message getMessage()
          Returns the enclosed message inside of this message
 int getMode()
          Gets the mode of the actual Message.
 NodeHandle getNextHopHandle()
          Returns the next hop handle for this message.
 NodeHandle getSource()
          Returns the source NodeHandle for this message
 int getType()
          Gets the type of the actual Message.
 void setApplicationId(java.lang.String app)
          Sets the destination Id for this message
 void setDestination(NodeHandle handle)
          Sets the destination NodeHandle for this message
 void setKey(java.lang.String key)
          Sets the identification key of this communication.
 void setMessage(Message message)
          Sets the internal message for this message
 void setMode(int mode)
          Sets the mode of the actual Message.
 void setNextHopHandle(NodeHandle nextHop)
          Sets the next hop handle for this message
 void setSource(NodeHandle handle)
          Sets the source NodeHandle for this message
 void setType(int type)
          Sets the type of the actual Message.
 void setValues(java.lang.String appId, NodeHandle to, NodeHandle from, NodeHandle nh, Message msg, java.lang.String key, int type, int mode)
          Sets all values of the actual RouteMessage, before to be sent.
 

Method Detail

getApplicationId

public java.lang.String getApplicationId()
Returns the application Id for this message

Returns:
The application Id

getDestination

public NodeHandle getDestination()
Returns the destination NodeHandle for this message

Returns:
The destination NodeHandle

getSource

public NodeHandle getSource()
Returns the source NodeHandle for this message

Returns:
The source NodeHandle

getNextHopHandle

public NodeHandle getNextHopHandle()
Returns the next hop handle for this message.

Returns:
The next hop

setNextHopHandle

public void setNextHopHandle(NodeHandle nextHop)
Sets the next hop handle for this message

Parameters:
nextHop - The next hop for this handle

getMessage

public Message getMessage()
Returns the enclosed message inside of this message

Returns:
The enclosed message

getKey

public java.lang.String getKey()
Gets the identification key of this communication.

Returns:
Identification key of this communication.

setApplicationId

public void setApplicationId(java.lang.String app)
Sets the destination Id for this message


setDestination

public void setDestination(NodeHandle handle)
Sets the destination NodeHandle for this message

Parameters:
handle - The destination NodeHandle

setSource

public void setSource(NodeHandle handle)
Sets the source NodeHandle for this message

Parameters:
handle - The source NodeHandle

setMessage

public void setMessage(Message message)
Sets the internal message for this message

Parameters:
message - The internal message

setKey

public void setKey(java.lang.String key)
Sets the identification key of this communication.


setMode

public void setMode(int mode)
Sets the mode of the actual Message. It is required for when a destination of any message is unexisting, the message is automatically returned with mode sets to Globlas.ERROR

Parameters:
mode - The mode of the actual Message.
See Also:
Globals, ERROR

getType

public int getType()
Gets the type of the actual Message.

Returns:
The type of the actual Message.

getMode

public int getMode()
Gets the mode of the actual Message.

Returns:
The mode of the actual Message.

setType

public void setType(int type)
Sets the type of the actual Message.

Parameters:
type - The type of the actual Message.

setValues

public void setValues(java.lang.String appId,
                      NodeHandle to,
                      NodeHandle from,
                      NodeHandle nh,
                      Message msg,
                      java.lang.String key,
                      int type,
                      int mode)
Sets all values of the actual RouteMessage, before to be sent.

Parameters:
appId - Identification of the Application which generate this message.
to - Destination Id of this RouteMessage.
from - Source Id of this RouteMessage.
nh - NodeHandle for next hop.
msg - Message wrapped to this RouteMessage.
key - Identification key for this communication with the remote node.
type - Type of this message.
mode - Mode of this message.