|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectca.mcgill.cs.postina.scribe.MessageID
public class MessageID
A messageID is a unique identifier of a message. The messageID is used to implement reliability.
| Field Summary | |
|---|---|
private int |
counter
An integer number counting the number of times the messages has already been sent over the network. |
private rice.p2p.commonapi.NodeHandle |
destinationHandle
|
private rice.p2p.commonapi.Id |
destinationId
|
private int |
messageNumber
An integer number. |
private rice.p2p.commonapi.Id |
senderId
The unique identifier of the originator of the message. |
private long |
sendTimeStamp
The system time (milliseconds) at which the message was sent. |
private static long |
serialVersionUID
|
| Constructor Summary | |
|---|---|
MessageID(rice.p2p.commonapi.Id senderId,
rice.p2p.commonapi.Id destinationId,
rice.p2p.commonapi.NodeHandle destinationHandle,
int messageNumber)
The default constructor for a messageID |
|
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object o)
|
int |
getCounter()
This method gets the number of times the message has already been sent. |
rice.p2p.commonapi.NodeHandle |
getDestinationHandle()
|
rice.p2p.commonapi.Id |
getDestinationId()
|
int |
getMessageNumber()
This method gets the number of the message. |
long |
getRemainingTimeOut(long timeout)
This method computes the time that is remaining before the message times out. |
rice.p2p.commonapi.Id |
getSenderId()
This method gets the unique identifier of the sender of the message. |
long |
getSendTimeStamp()
This method gets the Unix time stamp at which the message was sent the last time. |
int |
hashCode()
|
boolean |
hasTimedOut(long timeout)
This method checks if the message is older than the specified time. |
void |
incCounter()
This message increases the counter of the number of times the message has been sent by one. |
void |
resetSendTimeStamp()
This method resets the time stamp of the messageId to the current system time. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private static final long serialVersionUID
private int counter
private final rice.p2p.commonapi.NodeHandle destinationHandle
private final rice.p2p.commonapi.Id destinationId
private final int messageNumber
private final rice.p2p.commonapi.Id senderId
private long sendTimeStamp
| Constructor Detail |
|---|
public MessageID(rice.p2p.commonapi.Id senderId,
rice.p2p.commonapi.Id destinationId,
rice.p2p.commonapi.NodeHandle destinationHandle,
int messageNumber)
senderHandle - The Pastry-nodehandle of the originator of the message.senderId - The unique Id (by Pastry) of the sender of the message.messageNumber - The number of the message.| Method Detail |
|---|
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int getCounter()
public rice.p2p.commonapi.NodeHandle getDestinationHandle()
public rice.p2p.commonapi.Id getDestinationId()
public int getMessageNumber()
public long getRemainingTimeOut(long timeout)
timeout - The timeout after which the message times out.
timeout and the age of the message. If the
message has already timed out (i.e. the return value would be
negative), 0 is returned.public rice.p2p.commonapi.Id getSenderId()
public long getSendTimeStamp()
public int hashCode()
hashCode in class java.lang.Objectpublic boolean hasTimedOut(long timeout)
timeout - The minimum age in milliseconds of the message to return true.
timeout
milliseconds olds, false otherwise.public void incCounter()
public void resetSendTimeStamp()
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||