Class DispatchMessage
java.lang.Object
org.axonframework.commandhandling.distributed.DispatchMessage
Base class for dispatch messages which may be used in the
CommandBusConnector upon dispatching a command
to other nodes.-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDefault constructor required for de-/serialization of extending classes.protectedDispatchMessage(CommandMessage<?> commandMessage, Serializer serializer, boolean expectReply) Initialized a DispatchMessage for the givencommandMessage, which uses the givenserializerto deserialize its contents. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the identifier of the command carried by this instance.getCommandMessage(Serializer serializer) Returns the CommandMessage wrapped in this Message.Returns the command name of the command carried by this instance.Returns the payload revision of the serialized payload of the command carried by this instance.Returns the payload type of the serialized payload of the command carried by this instance.byte[]Returns the serialized metadata of the command carried by this instance.byte[]Returns the serialized payload of the command carried by this instance.inthashCode()booleanIndicates whether the sender of this message requests a reply.toString()
-
Field Details
-
commandIdentifier
-
serializedMetaData
protected byte[] serializedMetaData -
payloadType
-
payloadRevision
-
serializedPayload
protected byte[] serializedPayload -
commandName
-
expectReply
protected boolean expectReply
-
-
Constructor Details
-
DispatchMessage
protected DispatchMessage()Default constructor required for de-/serialization of extending classes. Do not use directly. -
DispatchMessage
protected DispatchMessage(CommandMessage<?> commandMessage, Serializer serializer, boolean expectReply) Initialized a DispatchMessage for the givencommandMessage, which uses the givenserializerto deserialize its contents.expectReplyindicates whether the sender will be expecting a reply.- Parameters:
commandMessage- The message to send to the remote segmentserializer- The serialize to serialize the message payload and metadata withexpectReply- whether or not the sender is waiting for a reply.
-
-
Method Details
-
getCommandMessage
Returns the CommandMessage wrapped in this Message.- Parameters:
serializer- The serializer to deserialize message contents with- Returns:
- the CommandMessage wrapped in this Message
-
getCommandIdentifier
Returns the identifier of the command carried by this instance.- Returns:
- the identifier of the command carried by this instance as a
String
-
getSerializedMetaData
public byte[] getSerializedMetaData()Returns the serialized metadata of the command carried by this instance.- Returns:
- the serialized metadata of the command carried by this instance as a
byte[]
-
getPayloadType
Returns the payload type of the serialized payload of the command carried by this instance.- Returns:
- the payload type of the serialized payload of the the command carried by this instance as a
String
-
getPayloadRevision
Returns the payload revision of the serialized payload of the command carried by this instance.- Returns:
- the payload revision of the serialized payload of the command carried by this instance as a
String
-
getSerializedPayload
public byte[] getSerializedPayload()Returns the serialized payload of the command carried by this instance.- Returns:
- the serialized payload of the command carried by this instance as a
byte[]
-
getCommandName
Returns the command name of the command carried by this instance.- Returns:
- the command name of the command carried by this instance as a
String
-
isExpectReply
public boolean isExpectReply()Indicates whether the sender of this message requests a reply.- Returns:
trueif a reply is expected, otherwisefalse.
-
hashCode
public int hashCode() -
equals
-
toString
-