ePOST API

rice.pastry.routing
Class RouteMessage

java.lang.Object
  extended by rice.pastry.messaging.Message
      extended by rice.pastry.routing.RouteMessage
All Implemented Interfaces:
java.io.Serializable, RouteMessage

public class RouteMessage
extends Message
implements java.io.Serializable, RouteMessage

A route message contains a pastry message that has been wrapped to be sent to another pastry node.

Version:
$Id: RouteMessage.java 3175 2006-03-24 12:45:46Z jeffh $
Author:
Andrew Ladd
See Also:
Serialized Form

Field Summary
 NodeHandle nextHop
           
 
Fields inherited from class rice.pastry.messaging.Message
DEFAULT_PRIORITY_LEVEL
 
Constructor Summary
RouteMessage(Id target, Message msg, Credentials cred)
          Constructor.
RouteMessage(Id target, Message msg, Credentials cred, Address aux)
          Constructor.
RouteMessage(Id target, Message msg, Credentials cred, SendOptions opts)
          Constructor.
RouteMessage(Id target, Message msg, Credentials cred, SendOptions opts, Address aux)
          Constructor.
RouteMessage(Id target, Message msg, NodeHandle firstHop, Address aux)
          Constructor.
RouteMessage(NodeHandle dest, Message msg, Credentials cred, SendOptions opts, Address aux)
          Constructor.
 
Method Summary
 Address getDestination()
          Get receiver address.
 Id getDestinationId()
          Returns the destination Id for this message
 Message getMessage()
          Returns the enclosed message inside of this message
 NodeHandle getNextHop()
           
 NodeHandle getNextHopHandle()
          Returns the next hop handle for this message
 SendOptions getOptions()
          Get transmission options.
 NodeHandle getPrevNode()
           
 int getPriority()
          Get priority
 Id getTarget()
          Gets the target node id of this message.
 boolean routeMessage(NodeHandle localHandle)
          Routes the messages if the next hop has been set up.
 void setDestinationId(Id id)
          Sets the destination Id for this message
 void setMessage(Message message)
          Sets the internal message for this message
 void setNextHop(NodeHandle nh)
           
 void setNextHopHandle(NodeHandle nextHop)
          Sets the next hop handle for this message
 void setPrevNode(NodeHandle n)
           
 java.lang.String toString()
           
 Message unwrap()
          The wrapped message.
 
Methods inherited from class rice.pastry.messaging.Message
getCredentials, getDate, getSender, getSenderId, setPriority, setSender, stamp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

nextHop

public transient NodeHandle nextHop
Constructor Detail

RouteMessage

public RouteMessage(Id target,
                    Message msg,
                    Credentials cred)
Constructor.

Parameters:
target - this is id of the node the message will be routed to.
msg - the wrapped message.
cred - the credentials for the message.

RouteMessage

public RouteMessage(Id target,
                    Message msg,
                    Credentials cred,
                    SendOptions opts)
Constructor.

Parameters:
target - this is id of the node the message will be routed to.
msg - the wrapped message.
cred - the credentials for the message.
opts - the send options for the message.

RouteMessage

public RouteMessage(NodeHandle dest,
                    Message msg,
                    Credentials cred,
                    SendOptions opts,
                    Address aux)
Constructor.

Parameters:
dest - the node this message will be routed to
msg - the wrapped message.
cred - the credentials for the message.
opts - the send options for the message.
aux - an auxilary address which the message after each hop.

RouteMessage

public RouteMessage(Id target,
                    Message msg,
                    Credentials cred,
                    Address aux)
Constructor.

Parameters:
target - this is id of the node the message will be routed to.
msg - the wrapped message.
cred - the credentials for the message.
aux - an auxilary address which the message after each hop.

RouteMessage

public RouteMessage(Id target,
                    Message msg,
                    Credentials cred,
                    SendOptions opts,
                    Address aux)
Constructor.

Parameters:
target - this is id of the node the message will be routed to.
msg - the wrapped message.
cred - the credentials for the message.
opts - the send options for the message.
aux - an auxilary address which the message after each hop.

RouteMessage

public RouteMessage(Id target,
                    Message msg,
                    NodeHandle firstHop,
                    Address aux)
Constructor.

Parameters:
target - this is id of the node the message will be routed to.
msg - the wrapped message.
firstHop - the nodeHandle of the first hop destination
aux - an auxilary address which the message after each hop.
Method Detail

routeMessage

public boolean routeMessage(NodeHandle localHandle)
Routes the messages if the next hop has been set up.

Parameters:
localId - the node id of the local node.
Returns:
true if the message got routed, false otherwise.

getTarget

public Id getTarget()
Gets the target node id of this message.

Returns:
the target node id.

getPrevNode

public NodeHandle getPrevNode()

setPrevNode

public void setPrevNode(NodeHandle n)

getNextHop

public NodeHandle getNextHop()

setNextHop

public void setNextHop(NodeHandle nh)

getPriority

public int getPriority()
Get priority

Overrides:
getPriority in class Message
Returns:
the priority of this message.

getDestination

public Address getDestination()
Get receiver address.

Overrides:
getDestination in class Message
Returns:
the address.

unwrap

public Message unwrap()
The wrapped message.

Returns:
the wrapped message.

getOptions

public SendOptions getOptions()
Get transmission options.

Returns:
the options.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getDestinationId

public Id getDestinationId()
Description copied from interface: RouteMessage
Returns the destination Id for this message

Specified by:
getDestinationId in interface RouteMessage
Returns:
The destination Id

getNextHopHandle

public NodeHandle getNextHopHandle()
Description copied from interface: RouteMessage
Returns the next hop handle for this message

Specified by:
getNextHopHandle in interface RouteMessage
Returns:
The next hop

getMessage

public Message getMessage()
Description copied from interface: RouteMessage
Returns the enclosed message inside of this message

Specified by:
getMessage in interface RouteMessage
Returns:
The enclosed message

setDestinationId

public void setDestinationId(Id id)
Description copied from interface: RouteMessage
Sets the destination Id for this message

Specified by:
setDestinationId in interface RouteMessage
Parameters:
id - The destination Id

setNextHopHandle

public void setNextHopHandle(NodeHandle nextHop)
Description copied from interface: RouteMessage
Sets the next hop handle for this message

Specified by:
setNextHopHandle in interface RouteMessage
Parameters:
nextHop - The next hop for this handle

setMessage

public void setMessage(Message message)
Description copied from interface: RouteMessage
Sets the internal message for this message

Specified by:
setMessage in interface RouteMessage
Parameters:
message - The internal message

ePOST API

Copyright © 2001-2005 - Rice Pastry.