public class ClusterMessage
extends java.lang.Object
Constructor and Description |
---|
ClusterMessage(NodeId sender,
MessageSubject subject,
byte[] payload)
Creates a cluster message.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
static ClusterMessage |
fromBytes(byte[] bytes)
Decodes a new ClusterMessage from raw bytes.
|
byte[] |
getBytes()
Serializes this instance.
|
int |
hashCode() |
byte[] |
payload()
Returns the message payload.
|
void |
respond(byte[] data)
Records the response to be sent to the sender.
|
byte[] |
response()
Returns the response to be sent to the sender.
|
NodeId |
sender()
Returns the id of the controller sending this message.
|
MessageSubject |
subject()
Returns the message subject indicator.
|
java.lang.String |
toString() |
public ClusterMessage(NodeId sender, MessageSubject subject, byte[] payload)
sender
- message sendersubject
- message subjectpayload
- message payloadpublic NodeId sender()
public MessageSubject subject()
public byte[] payload()
public void respond(byte[] data)
data
- response payloadpublic byte[] response()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public byte[] getBytes()
public static ClusterMessage fromBytes(byte[] bytes)
bytes
- raw bytespublic int hashCode()
hashCode
in class java.lang.Object