org.axonframework.commandhandling
Interface CommandMessage<T>

Type Parameters:
T - The type of payload contained in the message
All Superinterfaces:
Message<T>, Serializable
All Known Implementing Classes:
GenericCommandMessage

public interface CommandMessage<T>
extends Message<T>

Represents a Message carrying a command as its payload. These messages carry an intention to change application state.

Since:
2.0
Author:
Allard Buijze

Method Summary
 CommandMessage<T> andMetaData(Map<String,?> metaData)
          Returns a copy of this CommandMessage with it MetaData merged with the given metaData.
 String getCommandName()
          Returns the name of the command to execute.
 CommandMessage<T> withMetaData(Map<String,?> metaData)
          Returns a copy of this CommandMessage with the given metaData.
 
Methods inherited from interface org.axonframework.domain.Message
getIdentifier, getMetaData, getPayload, getPayloadType
 

Method Detail

getCommandName

String getCommandName()
Returns the name of the command to execute. This is an indication of what should be done, using the payload as parameter.

Returns:
the name of the command

withMetaData

CommandMessage<T> withMetaData(Map<String,?> metaData)
Returns a copy of this CommandMessage with the given metaData. The payload remains unchanged.

While the implementation returned may be different than the implementation of this, implementations must take special care in returning the same type of Message (e.g. EventMessage, DomainEventMessage) to prevent errors further downstream.

Specified by:
withMetaData in interface Message<T>
Parameters:
metaData - The new MetaData for the Message
Returns:
a copy of this message with the given MetaData

andMetaData

CommandMessage<T> andMetaData(Map<String,?> metaData)
Returns a copy of this CommandMessage with it MetaData merged with the given metaData. The payload remains unchanged.

Specified by:
andMetaData in interface Message<T>
Parameters:
metaData - The MetaData to merge with
Returns:
a copy of this message with the given MetaData


Copyright © 2010-2016. All Rights Reserved.