|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpeersim.pastry.Message
public class Message
Message class provide all functionalities to magage the various messages, principally LOOKUP
messages (messages from application level sender destinated to another application level).
Types Of messages:
(application messages)
- MSG_LOOKUP: indicates that the body Object containes information to application level of the
recipient
(service internal protocol messages)
- MSG_JOINREQUEST: message containing a join request of a node, the message is passed between
many pastry nodes accorting to the protocol
- MSG_JOINREPLY: according to protocol, the body transport information related to a join reply message
- MSG_LSPROBEREQUEST:according to protocol, the body transport information related to a probe request message
- MSG_LSPROBEREPLY: not used in the current implementation
- MSG_SERVICEPOLL: internal message used to provide cyclic cleaning service of dead nodes
The body for message types MSG_JOINREQUEST and MSG_JOINREPLY if defined by the class
Message.BodyJoinRequestReply
Title: MSPASTRY
Description: MsPastry implementation for PeerSim
Copyright: Copyright (c) 2007
Company: The Pastry Group
Nested Class Summary | |
---|---|
static class |
Message.BodyJoinRequestReply
|
Field Summary | |
---|---|
java.lang.Object |
body
This Object contains the body of the message, no matter what it contains |
java.math.BigInteger |
dest
Recipient address of the message |
long |
id
ID of the message. |
static int |
MAX_TRACK
Tha trace vector has this limit size |
int |
messageType
Identify the type of this message |
static int |
MSG_JOINREPLY
Message Type |
static int |
MSG_JOINREQUEST
Message Type |
static int |
MSG_LOOKUP
Message Type |
static int |
MSG_LSPROBEREPLY
Message Type |
static int |
MSG_LSPROBEREQUEST
Message Type |
static int |
MSG_SERVICEPOLL
Internal Message: polling cleaner |
protected int |
nrHops
Available to conunt the number of hops the message did. |
java.math.BigInteger |
src
Source address of the message: has to be filled ad application level |
protected long |
timestamp
Available to contains the timestamp of the (creation date of the) message |
protected java.math.BigInteger[] |
tracks
Available to contains the path of the message |
protected int |
trackSize
current size of the tracks vector |
Constructor Summary | |
---|---|
Message()
Creates an empty message by using default values (message type = MSG_LOOKUP and new String("") value for the body of the message) |
|
Message(int messageType,
java.lang.Object body)
Creates an empty message by using default values (message messageType = MSG_LOOKUP and null value for the body of the message) |
|
Message(java.lang.Object body)
Creates a lookup message with the specified body |
Method Summary | |
---|---|
Message |
copy()
|
static Message |
makeJoinRequest(java.lang.Object body)
Encapsulates the creation of a join request |
static Message |
makeLookUp(java.lang.Object body)
Encapsulates the creation of a join request |
java.lang.String |
messageTypetoString()
|
java.lang.String |
toString()
|
java.lang.String |
traceToString()
returns a ";" separated list of the tracks vector |
java.lang.String |
traceToString(boolean header)
returns a ";" separated list of the tracks vector |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int MAX_TRACK
public static final int MSG_LOOKUP
public static final int MSG_JOINREQUEST
public static final int MSG_JOINREPLY
public static final int MSG_LSPROBEREQUEST
public static final int MSG_LSPROBEREPLY
public static final int MSG_SERVICEPOLL
public int messageType
public java.lang.Object body
public long id
public java.math.BigInteger dest
public java.math.BigInteger src
protected int nrHops
protected int trackSize
protected java.math.BigInteger[] tracks
protected long timestamp
Constructor Detail |
---|
public Message(java.lang.Object body)
body
- Object body to assign (shallow copy)public Message()
new String("")
value for the body of the message)
public Message(int messageType, java.lang.Object body)
messageType
- int type of the messagebody
- Object body to assign (shallow copy)Method Detail |
---|
public static final Message makeJoinRequest(java.lang.Object body)
body
- Object
public static final Message makeLookUp(java.lang.Object body)
body
- Object
public java.lang.String traceToString(boolean header)
header
- boolean if true, even an initial information header is printed
public java.lang.String traceToString()
public java.lang.String toString()
toString
in class java.lang.Object
public Message copy()
public java.lang.String messageTypetoString()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |