|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object rice.pastry.messaging.Message rice.pastry.messaging.PRawMessage rice.pastry.routing.RouteMessage
public class RouteMessage
A route message contains a pastry message that has been wrapped to be sent to another pastry node.
Field Summary | |
---|---|
Message |
internalMsg
|
int |
numRetries
This is used by the Rerouter to keep track of how many attempted reroutes of the message. |
static short |
TYPE
|
Fields inherited from class rice.pastry.messaging.Message |
---|
DEFAULT_PRIORITY_LEVEL |
Fields inherited from interface rice.p2p.commonapi.Message |
---|
DEFAULT_PRIORITY, HIGH_PRIORITY, LOW_PRIORITY, LOWEST_PRIORITY, MAX_PRIORITY, MEDIUM_HIGH_PRIORITY, MEDIUM_LOW_PRIORITY, MEDIUM_PRIORITY |
Constructor Summary | |
---|---|
RouteMessage(Id target,
int auxAddress,
NodeHandle prev,
InputBuffer buf,
byte priority,
PastryNode pn,
NodeHandle destinationHandle,
byte serializeVersion)
|
|
RouteMessage(Id target,
Message msg,
byte serializeVersion)
Constructor. |
|
RouteMessage(Id target,
Message msg,
NodeHandle firstHop,
byte serializeVersion)
Constructor. |
|
RouteMessage(Id target,
Message msg,
NodeHandle firstHop,
SendOptions opts,
byte serializeVersion)
Constructor. |
|
RouteMessage(Id target,
Message msg,
SendOptions opts,
byte serializeVersion)
Constructor. |
|
RouteMessage(Id target,
PRawMessage msg,
NodeHandle firstHop,
SendOptions opts,
byte serializeVersion)
|
|
RouteMessage(NodeHandle dest,
Message msg,
SendOptions opts,
byte serializeVersion)
Constructor. |
Method Summary | |
---|---|
static RouteMessage |
build(InputBuffer buf,
byte priority,
PastryNode pn,
NodeHandle prev,
byte outputVersion)
version 1: +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + int auxAddress + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + bool hasHndle + // if it has a destinationHandle instead of an Id +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + Id target + + (only existis if the hasHandle boolean is false + + + + + + + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + NodeHandle destinationHandle + + (used if the RouteMessage is intended for a specific node) + + (only exists if the hasHandle boolean is true) + ... |
boolean |
cancel()
|
int |
getAuxAddress()
|
NodeHandle |
getDestinationHandle()
|
Id |
getDestinationId()
Returns the destination Id for this message |
short |
getInternalType()
|
Message |
getMessage()
Deprecated. use getMessage(MessageDeserializer) |
Message |
getMessage(MessageDeserializer md)
|
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. |
java.util.Map<java.lang.String,java.lang.Object> |
getTLOptions()
|
short |
getType()
|
boolean |
sendFailed(java.lang.Exception e)
Return true if it notified a higher layer. |
void |
sendSuccess(NodeHandle nextHop)
|
void |
serialize(OutputBuffer buf)
|
void |
setDestinationHandle(NodeHandle handle)
|
void |
setDestinationId(Id id)
Sets the destination Id for this message |
void |
setMessage(Message message)
Sets the internal message for this message |
void |
setMessage(RawMessage message)
Sets the internal message for this message Does the same as setMessage(Message) but with better performance, because it doesn't have to introspect if the message is a RawMessage |
void |
setNextHop(NodeHandle nh)
|
void |
setNextHopHandle(NodeHandle nextHop)
Sets the next hop handle for this message |
void |
setPrevNode(NodeHandle n)
|
void |
setRouteMessageNotification(RouteMessageNotification notification)
|
void |
setTLCancellable(Cancellable c)
|
void |
setTLOptions(java.util.Map<java.lang.String,java.lang.Object> options)
|
java.lang.String |
toString()
|
Message |
unwrap()
Deprecated. use unwrap(MessageDeserializer) |
Message |
unwrap(MessageDeserializer md)
|
Methods inherited from class rice.pastry.messaging.Message |
---|
getDate, getDestination, getSender, getSenderId, setPriority, setSender, stamp |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final short TYPE
public Message internalMsg
public transient int numRetries
Constructor Detail |
---|
public RouteMessage(Id target, Message msg, byte serializeVersion)
target
- this is id of the node the message will be routed to.msg
- the wrapped message.cred
- the credentials for the message.public RouteMessage(Id target, Message msg, SendOptions opts, byte serializeVersion)
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.public RouteMessage(NodeHandle dest, Message msg, SendOptions opts, byte serializeVersion)
dest
- the node this message will be routed tomsg
- 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.public RouteMessage(Id target, Message msg, NodeHandle firstHop, byte serializeVersion)
target
- this is id of the node the message will be routed to.msg
- the wrapped message.firstHop
- the nodeHandle of the first hop destinationaux
- an auxilary address which the message after each hop.public RouteMessage(Id target, PRawMessage msg, NodeHandle firstHop, SendOptions opts, byte serializeVersion)
public RouteMessage(Id target, Message msg, NodeHandle firstHop, SendOptions opts, byte serializeVersion)
target
- this is id of the node the message will be routed to.msg
- the wrapped message.firstHop
- the nodeHandle of the first hop destinationopts
- the send options for the message.aux
- an auxiliary address which the message after each hop.public RouteMessage(Id target, int auxAddress, NodeHandle prev, InputBuffer buf, byte priority, PastryNode pn, NodeHandle destinationHandle, byte serializeVersion) throws java.io.IOException
java.io.IOException
Method Detail |
---|
public Id getTarget()
public NodeHandle getPrevNode()
public void setPrevNode(NodeHandle n)
public NodeHandle getNextHop()
public void setNextHop(NodeHandle nh)
public int getPriority()
getPriority
in interface Message
getPriority
in class Message
public Message unwrap()
public SendOptions getOptions()
public java.lang.String toString()
toString
in class java.lang.Object
public Id getDestinationId()
RouteMessage
getDestinationId
in interface RouteMessage
public NodeHandle getNextHopHandle()
RouteMessage
getNextHopHandle
in interface RouteMessage
public Message getMessage()
RouteMessage
getMessage
in interface RouteMessage
public Message getMessage(MessageDeserializer md) throws java.io.IOException
getMessage
in interface RouteMessage
java.io.IOException
public void setDestinationId(Id id)
RouteMessage
setDestinationId
in interface RouteMessage
id
- The destination Idpublic void setNextHopHandle(NodeHandle nextHop)
RouteMessage
setNextHopHandle
in interface RouteMessage
nextHop
- The next hop for this handlepublic void setMessage(Message message)
RouteMessage
setMessage
in interface RouteMessage
message
- The internal messagepublic void setMessage(RawMessage message)
RouteMessage
setMessage
in interface RouteMessage
message
- The internal messagepublic static RouteMessage build(InputBuffer buf, byte priority, PastryNode pn, NodeHandle prev, byte outputVersion) throws java.io.IOException
buf
-
java.io.IOException
public void serialize(OutputBuffer buf) throws java.io.IOException
serialize
in interface RawSerializable
java.io.IOException
public Message unwrap(MessageDeserializer md) throws java.io.IOException
java.io.IOException
public short getType()
getType
in interface RawMessage
public int getAuxAddress()
public short getInternalType()
public void setDestinationHandle(NodeHandle handle)
public NodeHandle getDestinationHandle()
public java.util.Map<java.lang.String,java.lang.Object> getTLOptions()
public void setTLOptions(java.util.Map<java.lang.String,java.lang.Object> options)
public void setTLCancellable(Cancellable c)
public boolean cancel()
public void setRouteMessageNotification(RouteMessageNotification notification)
public void sendSuccess(NodeHandle nextHop)
public boolean sendFailed(java.lang.Exception e)
e
-
|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |