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 |
resultRevision |
protected String |
resultType |
protected byte[] |
serializedResult |
protected boolean |
success |
Modifier | Constructor and Description |
---|---|
protected |
ReplyMessage()
Default constructor required for de-/serialization of extending classes.
|
|
ReplyMessage(String commandIdentifier,
boolean success,
Object returnValue,
Serializer serializer)
Initializes a ReplyMessage containing a reply to the command with given {commandIdentifier} and given
returnValue . |
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.
|
Throwable |
getError(Serializer serializer)
Returns the error of the command processing.
|
String |
getResultRevision()
Returns the result revision of the serialized result for which this message is a reply.
|
String |
getResultType()
Returns the result type of the serialized result for which this message is a reply.
|
Object |
getReturnValue(Serializer serializer)
Returns the returnValue of the command processing.
|
byte[] |
getSerializedResult()
Returns the serialized result for which this message is a reply.
|
int |
hashCode() |
boolean |
isSuccess()
Whether the reply message represents a successfully executed command.
|
String |
toString() |
protected String commandIdentifier
protected boolean success
protected String resultType
protected String resultRevision
protected byte[] serializedResult
protected ReplyMessage()
public ReplyMessage(String commandIdentifier, boolean success, Object returnValue, Serializer serializer)
returnValue
. 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 notreturnValue
- The return value of command process
the given returnValue
is ignored.serializer
- The serializer to serialize the message contents withpublic Object getReturnValue(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()
String
public boolean isSuccess()
true
if this reply contains a return value, false
if it contains an error.public String getResultType()
String
public String getResultRevision()
String
public byte[] getSerializedResult()
byte[]
Copyright © 2010–2017. All rights reserved.