Rice Pastry API

rice.pastry.routing
Class RouteMessage

java.lang.Object
  |
  +--rice.pastry.messaging.Message
        |
        +--rice.pastry.routing.RouteMessage
All Implemented Interfaces:
RouteMessage, java.io.Serializable

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,v 1.22 2003/10/22 03:28:12 amislove Exp $
Author:
Andrew Ladd
See Also:
Serialized Form

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

Field Detail

nextHop

public transient rice.pastry.NodeHandle nextHop
Constructor Detail

RouteMessage

public RouteMessage(rice.pastry.Id target,
                    rice.pastry.messaging.Message msg,
                    rice.pastry.security.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(rice.pastry.Id target,
                    rice.pastry.messaging.Message msg,
                    rice.pastry.security.Credentials cred,
                    rice.pastry.routing.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(rice.pastry.NodeHandle dest,
                    rice.pastry.messaging.Message msg,
                    rice.pastry.security.Credentials cred,
                    rice.pastry.routing.SendOptions opts,
                    rice.pastry.messaging.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(rice.pastry.Id target,
                    rice.pastry.messaging.Message msg,
                    rice.pastry.security.Credentials cred,
                    rice.pastry.messaging.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(rice.pastry.Id target,
                    rice.pastry.messaging.Message msg,
                    rice.pastry.security.Credentials cred,
                    rice.pastry.routing.SendOptions opts,
                    rice.pastry.messaging.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(rice.pastry.Id target,
                    rice.pastry.messaging.Message msg,
                    rice.pastry.NodeHandle firstHop,
                    rice.pastry.messaging.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(rice.pastry.NodeId localId)
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 rice.pastry.Id getTarget()
Gets the target node id of this message.

Returns:
the target node id.

getPrevNode

public rice.pastry.NodeHandle getPrevNode()

setPrevNode

public void setPrevNode(rice.pastry.NodeHandle n)

getNextHop

public rice.pastry.NodeHandle getNextHop()

setNextHop

public void setNextHop(rice.pastry.NodeHandle nh)

hasPriority

public boolean hasPriority()
Get priority

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

getDestination

public rice.pastry.messaging.Address getDestination()
Get receiver address.

Overrides:
getDestination in class Message
Returns:
the address.

unwrap

public rice.pastry.messaging.Message unwrap()
The wrapped message.

Returns:
the wrapped message.

getOptions

public rice.pastry.routing.SendOptions getOptions()
Get transmission options.

Returns:
the options.

toString

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

getDestinationId

public rice.p2p.commonapi.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 rice.p2p.commonapi.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 rice.p2p.commonapi.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(rice.p2p.commonapi.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(rice.p2p.commonapi.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(rice.p2p.commonapi.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

Rice Pastry API

Copyright © 2001 - Rice Pastry.


Imprint-Dataprotection