|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.axonframework.domain.GenericMessage<T> org.axonframework.domain.GenericEventMessage<T> org.axonframework.domain.GenericDomainEventMessage<T>
T
- The type of payload contained in this Messagepublic class GenericDomainEventMessage<T>
Generic implementation of the DomainEventMessage interface. It simply keeps a reference to the payload and MetaData, as well as the aggregate identifier and sequence number.
Constructor Summary | |
---|---|
GenericDomainEventMessage(Object aggregateIdentifier,
long sequenceNumber,
T payload)
Initialize a DomainEventMessage originating from an Aggregate with the given aggregateIdentifier ,
with given sequenceNumber and payload . |
|
GenericDomainEventMessage(Object aggregateIdentifier,
long sequenceNumber,
T payload,
Map<String,?> metaData)
Initialize a DomainEventMessage originating from an Aggregate with the given aggregateIdentifier ,
with given sequenceNumber , metaData and payload . |
|
GenericDomainEventMessage(String identifier,
org.joda.time.DateTime timestamp,
Object aggregateIdentifier,
long sequenceNumber,
T payload,
Map<String,?> metaData)
Constructor to reconstruct a DomainEventMessage using existing data. |
Method Summary | |
---|---|
GenericDomainEventMessage<T> |
andMetaData(Map<String,?> additionalMetaData)
Returns a copy of this Message with it MetaData merged with the given metaData . |
Object |
getAggregateIdentifier()
Returns the identifier of the Aggregate that generated this DomainEvent. |
long |
getSequenceNumber()
Returns the sequence number that allows DomainEvents originating from the same Aggregate to be placed in the order of generation. |
String |
toString()
|
GenericDomainEventMessage<T> |
withMetaData(Map<String,?> newMetaData)
Returns a copy of this Message with the given metaData . |
Methods inherited from class org.axonframework.domain.GenericEventMessage |
---|
asEventMessage, getTimestamp |
Methods inherited from class org.axonframework.domain.GenericMessage |
---|
getIdentifier, getMetaData, getPayload, getPayloadType |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.axonframework.domain.EventMessage |
---|
getIdentifier, getTimestamp |
Methods inherited from interface org.axonframework.domain.Message |
---|
getMetaData, getPayload, getPayloadType |
Constructor Detail |
---|
public GenericDomainEventMessage(Object aggregateIdentifier, long sequenceNumber, T payload)
aggregateIdentifier
,
with given sequenceNumber
and payload
. The MetaData of the message is empty.
aggregateIdentifier
- The identifier of the aggregate generating this messagesequenceNumber
- The message's sequence numberpayload
- The application-specific payload of the messagepublic GenericDomainEventMessage(Object aggregateIdentifier, long sequenceNumber, T payload, Map<String,?> metaData)
aggregateIdentifier
,
with given sequenceNumber
, metaData
and payload
.
aggregateIdentifier
- The identifier of the aggregate generating this messagesequenceNumber
- The message's sequence numberpayload
- The application-specific payload of the messagemetaData
- The MetaData to attach to the messagepublic GenericDomainEventMessage(String identifier, org.joda.time.DateTime timestamp, Object aggregateIdentifier, long sequenceNumber, T payload, Map<String,?> metaData)
identifier
- The identifier of the Messagetimestamp
- The timestamp of the Message creationaggregateIdentifier
- The identifier of the aggregate from which the message originatessequenceNumber
- The sequence number of the message withing the originating aggregatepayload
- The payload of the messagemetaData
- The meta data of the messageMethod Detail |
---|
public long getSequenceNumber()
DomainEventMessage
getSequenceNumber
in interface DomainEventMessage<T>
public Object getAggregateIdentifier()
DomainEventMessage
getAggregateIdentifier
in interface DomainEventMessage<T>
public GenericDomainEventMessage<T> withMetaData(Map<String,?> newMetaData)
Message
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.
withMetaData
in interface DomainEventMessage<T>
withMetaData
in interface EventMessage<T>
withMetaData
in interface Message<T>
withMetaData
in class GenericEventMessage<T>
newMetaData
- The new MetaData for the Message
public GenericDomainEventMessage<T> andMetaData(Map<String,?> additionalMetaData)
Message
metaData
. The payload
remains unchanged.
andMetaData
in interface DomainEventMessage<T>
andMetaData
in interface EventMessage<T>
andMetaData
in interface Message<T>
andMetaData
in class GenericEventMessage<T>
additionalMetaData
- The MetaData to merge with
public String toString()
toString
in class GenericEventMessage<T>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |