public class TOMMessage extends SystemMessage implements java.io.Externalizable, java.lang.Comparable, java.lang.Cloneable
Modifier and Type | Field and Description |
---|---|
long |
acceptSentTime |
boolean |
alreadyProposed |
long |
consensusStartTime |
long |
decisionTime |
long |
deliveryTime |
int |
destination |
long |
executedTime |
byte[] |
nonces |
long |
proposeReceivedTime |
long |
receptionTime |
boolean |
recvFromClient |
TOMMessage |
reply |
byte[] |
serializedMessage |
byte[] |
serializedMessageMAC |
byte[] |
serializedMessageSignature |
boolean |
signed |
boolean |
timeout |
long |
timestamp |
long |
writeSentTime |
authenticated, sender
Constructor and Description |
---|
TOMMessage() |
TOMMessage(int sender,
int session,
int sequence,
byte[] content,
int view)
Creates a new instance of TOMMessage
|
TOMMessage(int sender,
int session,
int sequence,
byte[] content,
int view,
TOMMessageType type)
Creates a new instance of TOMMessage
|
TOMMessage(int sender,
int session,
int sequence,
int operationId,
byte[] content,
int view,
TOMMessageType type)
Creates a new instance of TOMMessage.
|
Modifier and Type | Method and Description |
---|---|
static TOMMessage |
bytesToMessage(byte[] b) |
java.lang.Object |
clone() |
int |
compareTo(java.lang.Object o) |
boolean |
equals(java.lang.Object o)
Verifies if two TOMMessage are equal.
|
byte[] |
getContent()
Retrieves the content of the message
|
DebugInfo |
getDebugInfo()
Retrieves the debug info from the TOM layer
|
int |
getId()
Retrieves the ID for this message.
|
int |
getOperationId() |
int |
getReplyServer() |
TOMMessageType |
getReqType() |
static int |
getSenderFromId(int id)
Retrieves the process ID of the sender given a message ID
|
int |
getSequence()
Retrieves the sequence number defined by the client
|
int |
getSession()
Retrieves the session id of this message
|
int |
getViewID() |
int |
hashCode() |
static byte[] |
messageToBytes(TOMMessage m) |
void |
rExternal(java.io.DataInput in) |
void |
setDebugInfo(DebugInfo info)
Retrieves the debug info from the TOM layer
|
void |
setReplyServer(int replyServer) |
java.lang.String |
toString() |
void |
wExternal(java.io.DataOutput out) |
getSender, readExternal, writeExternal
public transient long timestamp
public transient byte[] nonces
public transient int destination
public transient boolean signed
public transient long receptionTime
public transient boolean timeout
public transient boolean recvFromClient
public transient byte[] serializedMessage
public transient byte[] serializedMessageSignature
public transient byte[] serializedMessageMAC
public transient long consensusStartTime
public transient long proposeReceivedTime
public transient long writeSentTime
public transient long acceptSentTime
public transient long decisionTime
public transient long deliveryTime
public transient long executedTime
public transient TOMMessage reply
public transient boolean alreadyProposed
public TOMMessage()
public TOMMessage(int sender, int session, int sequence, byte[] content, int view)
sender
- ID of the process which sent the messagesession
- Session id of the sendersequence
- Sequence number defined by the clientcontent
- Content of the messageview
- ViewId of the messagepublic TOMMessage(int sender, int session, int sequence, byte[] content, int view, TOMMessageType type)
sender
- ID of the process which sent the messagesession
- Session id of the sendersequence
- Sequence number defined by the clientcontent
- Content of the messageview
- ViewId of the messagetype
- Type of the requestpublic TOMMessage(int sender, int session, int sequence, int operationId, byte[] content, int view, TOMMessageType type)
sender
- The client idsession
- The session id of the sendersequence
- The sequence number created based on the message typeoperationId
- The operation sequence number disregarding message typecontent
- The command to be executedview
- The view in which the message was senttype
- Ordered or Unordered requestpublic DebugInfo getDebugInfo()
public void setDebugInfo(DebugInfo info)
public int getSession()
public int getSequence()
public int getOperationId()
public int getViewID()
public TOMMessageType getReqType()
public int getId()
public byte[] getContent()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public void wExternal(java.io.DataOutput out) throws java.io.IOException
java.io.IOException
public void rExternal(java.io.DataInput in) throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
public static int getSenderFromId(int id)
id
- Message IDpublic static byte[] messageToBytes(TOMMessage m)
public static TOMMessage bytesToMessage(byte[] b)
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public int getReplyServer()
public void setReplyServer(int replyServer)