org.axonframework.upcasting
Class SerializedDomainEventUpcastingContext

java.lang.Object
  extended by org.axonframework.upcasting.SerializedDomainEventUpcastingContext
All Implemented Interfaces:
UpcastingContext

public class SerializedDomainEventUpcastingContext
extends Object
implements UpcastingContext

Implementation of UpcastingContext that builds a context based on the information of a serialized domain event

Since:
2.0
Author:
Allard Buijze

Constructor Summary
SerializedDomainEventUpcastingContext(SerializedDomainEventData domainEventData, Serializer serializer)
          Initializes the UpcastingContext using given serialized domainEventData.
 
Method Summary
 Object getAggregateIdentifier()
          Returns the Identifier of the Aggregate to which the Event owning the object to upcast, was applied.
 String getMessageIdentifier()
          Returns the identifier of the message wrapping the object to upcast.
 MetaData getMetaData()
          Returns the meta data of the message wrapping the object being upcast.
 Long getSequenceNumber()
          Returns the sequence number of the event in the aggregate, or null if the message wrapping the object being upcast does not contain a sequence number.
 LazyDeserializingObject<MetaData> getSerializedMetaData()
          Returns the wrapper containing the serialized MetaData.
 org.joda.time.DateTime getTimestamp()
          Returns the timestamp at which the event was first created.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SerializedDomainEventUpcastingContext

public SerializedDomainEventUpcastingContext(SerializedDomainEventData domainEventData,
                                             Serializer serializer)
Initializes the UpcastingContext using given serialized domainEventData. Deserialization of the meta data contained in the domainEventData is done on first access of the meta data.

Parameters:
domainEventData - the object containing information about the domain event from which an object is being upcast
serializer - The serializer that can be used to deserialize the meta data
Method Detail

getMessageIdentifier

public String getMessageIdentifier()
Description copied from interface: UpcastingContext
Returns the identifier of the message wrapping the object to upcast.

Specified by:
getMessageIdentifier in interface UpcastingContext
Returns:
the identifier of the message wrapping the object to upcast, if available

getAggregateIdentifier

public Object getAggregateIdentifier()
Description copied from interface: UpcastingContext
Returns the Identifier of the Aggregate to which the Event owning the object to upcast, was applied. This will return null if the object being upcast was not contained in a DomainEventMessage.

Specified by:
getAggregateIdentifier in interface UpcastingContext
Returns:
the Identifier of the Aggregate to which the Event was applied, or null if not applicable

getSequenceNumber

public Long getSequenceNumber()
Description copied from interface: UpcastingContext
Returns the sequence number of the event in the aggregate, or null if the message wrapping the object being upcast does not contain a sequence number.

Specified by:
getSequenceNumber in interface UpcastingContext
Returns:
the sequence number of the event in the aggregate, if available

getTimestamp

public org.joda.time.DateTime getTimestamp()
Description copied from interface: UpcastingContext
Returns the timestamp at which the event was first created. Will return null if the object being upcast

Specified by:
getTimestamp in interface UpcastingContext
Returns:
the timestamp at which the event was first created, if available

getMetaData

public MetaData getMetaData()
Description copied from interface: UpcastingContext
Returns the meta data of the message wrapping the object being upcast. If the meta data is not available, or is in fact the subject of being upcast itself, this method returns null.

Specified by:
getMetaData in interface UpcastingContext
Returns:
the MetaData of the message wrapping the object to upcast, if available

getSerializedMetaData

public LazyDeserializingObject<MetaData> getSerializedMetaData()
Returns the wrapper containing the serialized MetaData.

Returns:
the wrapper containing the serialized MetaData


Copyright © 2010-2016. All Rights Reserved.