Class ReplyMessage

java.lang.Object
org.axonframework.commandhandling.distributed.ReplyMessage
All Implemented Interfaces:
Serializable

public abstract class ReplyMessage extends Object implements Serializable
Base class for reply messages which may be used in the CommandBusConnector for replying on received commands from other nodes.
See Also:
  • Field Details

    • commandIdentifier

      protected String commandIdentifier
    • serializedMetaData

      protected byte[] serializedMetaData
    • payloadType

      protected String payloadType
    • payloadRevision

      protected String payloadRevision
    • serializedPayload

      protected byte[] serializedPayload
    • exceptionType

      protected String exceptionType
    • exceptionRevision

      protected String exceptionRevision
    • serializedException

      protected byte[] serializedException
  • Constructor Details

    • ReplyMessage

      protected ReplyMessage()
      Default constructor required for de-/serialization of extending classes. Do not use directly.
    • ReplyMessage

      public ReplyMessage(String commandIdentifier, CommandResultMessage<?> commandResultMessage, Serializer serializer)
      Initializes a ReplyMessage containing a reply to the command with given {commandIdentifier} and given commandResultMessage.
      Parameters:
      commandIdentifier - the identifier of the command to which the message is a reply
      commandResultMessage - the result message of command process
      serializer - the serializer to serialize the message contents with
  • Method Details

    • getCommandResultMessage

      public CommandResultMessage<?> getCommandResultMessage(Serializer serializer)
      Returns a CommandResultMessage containing the result of command processing.
      Parameters:
      serializer - the serializer to deserialize the result with
      Returns:
      a CommandResultMessage containing the return value of command processing
    • getCommandIdentifier

      public String getCommandIdentifier()
      Returns the identifier of the command for which this message is a reply.
      Returns:
      the identifier of the command for which this message is a reply as a String
    • getPayloadType

      public String getPayloadType()
      Returns the payload type of the serialized reply message.
      Returns:
      the payload type of the serialized reply message as a String
    • getPayloadRevision

      public String getPayloadRevision()
      Returns the payload revision of the serialized reply message.
      Returns:
      the payload revision of the serialized reply message as a String
    • getSerializedPayload

      public byte[] getSerializedPayload()
      Returns the serialized payload of the serialized reply message.
      Returns:
      the serialized payload of the serialized reply message as a byte[]
    • getExceptionType

      public String getExceptionType()
      Returns the exception type of the serialized reply message.
      Returns:
      the exception type of the serialized reply message as a String
    • getExceptionRevision

      public String getExceptionRevision()
      Returns the exception revision of the serialized reply message.
      Returns:
      the exception revision of the serialized reply message as a String
    • getSerializedException

      public byte[] getSerializedException()
      Returns the serialized exception of the serialized reply message.
      Returns:
      the serialized exception of the serialized reply message as byte[]
    • getSerializedMetaData

      public byte[] getSerializedMetaData()
      Returns the serialized meta data of the serialized reply message.
      Returns:
      the serialized meta data of the serialized reply message as a byte[]
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object