public abstract class ReplyMessage extends Object
CommandBusConnector for replying on received
commands from other nodes.| Modifier and Type | Field and Description |
|---|---|
protected String |
commandIdentifier |
protected String |
payloadRevision |
protected String |
payloadType |
protected byte[] |
serializedMetaData |
protected byte[] |
serializedPayload |
protected boolean |
success |
| Modifier | Constructor and Description |
|---|---|
protected |
ReplyMessage()
Default constructor required for de-/serialization of extending classes.
|
|
ReplyMessage(String commandIdentifier,
boolean success,
CommandResultMessage<?> commandResultMessage,
Serializer serializer)
Initializes a ReplyMessage containing a reply to the command with given {commandIdentifier} and given
commandResultMessage. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
String |
getCommandIdentifier()
Returns the identifier of the command for which this message is a reply.
|
CommandResultMessage<?> |
getCommandResultMessage(Serializer serializer)
Returns the returnValue of the command processing.
|
Throwable |
getError(Serializer serializer)
Returns the error of the command processing.
|
String |
getPayloadRevision()
Returns the payload revision of the serialized reply message.
|
String |
getPayloadType()
Returns the payload type of the serialized reply message.
|
byte[] |
getSerializedMetaData()
Returns the serialized meta data of the serialized reply message.
|
byte[] |
getSerializedPayload()
Returns the serialized payload of the serialized reply message.
|
int |
hashCode() |
boolean |
isSuccess()
Whether the reply message represents a successfully executed command.
|
String |
toString() |
protected String commandIdentifier
protected boolean success
protected byte[] serializedMetaData
protected String payloadType
protected String payloadRevision
protected byte[] serializedPayload
protected ReplyMessage()
public ReplyMessage(String commandIdentifier, boolean success, CommandResultMessage<?> commandResultMessage, Serializer serializer)
commandResultMessage. The parameter success determines whether the was executed successfully or
not.commandIdentifier - The identifier of the command to which the message is a replysuccess - Whether or not the command executed successfully or notcommandResultMessage - The result message of command processserializer - The serializer to serialize the message contents withpublic CommandResultMessage<?> getCommandResultMessage(Serializer serializer)
isSuccess() return false, this
method returns null. This method also returns null if response processing returned
a null value.serializer - The serializer to deserialize the result withpublic Throwable getError(Serializer serializer)
serializer - The serializer to deserialize the result withpublic String getCommandIdentifier()
Stringpublic boolean isSuccess()
true if this reply contains a return value, false if it contains an error.public String getPayloadType()
Stringpublic String getPayloadRevision()
Stringpublic byte[] getSerializedPayload()
byte[]public byte[] getSerializedMetaData()
byte[]Copyright © 2010–2018. All rights reserved.