org.axonframework.eventstore.jpa
Class SimpleSerializedDomainEventData

java.lang.Object
  extended by org.axonframework.eventstore.jpa.SimpleSerializedDomainEventData
All Implemented Interfaces:
SerializedDomainEventData

public class SimpleSerializedDomainEventData
extends Object
implements SerializedDomainEventData

Simple implementation of the SerializedDomainEventData class, used to reduce memory consumptions by queries accessing Event Entries. Querying from them directly will cause the EntityManager to keep a reference to them, preventing them from being garbage collected.

Since:
2.0
Author:
Allard Buijze

Constructor Summary
SimpleSerializedDomainEventData(String eventIdentifier, String aggregateIdentifier, long sequenceNumber, Object timestamp, String payloadType, String payloadRevision, byte[] payload, byte[] metaData)
          Initialize an instance using given properties.
 
Method Summary
 Object getAggregateIdentifier()
          Returns the Identifier of the Aggregate to which the Event was applied.
 String getEventIdentifier()
          Returns the identifier of the serialized event.
 SerializedObject getMetaData()
          Returns the serialized data of the MetaData of the serialized Event.
 SerializedObject getPayload()
          Returns the serialized data of the Event Message's payload.
 long getSequenceNumber()
          Returns the sequence number of the event in the aggregate.
 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

SimpleSerializedDomainEventData

public SimpleSerializedDomainEventData(String eventIdentifier,
                                       String aggregateIdentifier,
                                       long sequenceNumber,
                                       Object timestamp,
                                       String payloadType,
                                       String payloadRevision,
                                       byte[] payload,
                                       byte[] metaData)
Initialize an instance using given properties. Note that the given timestamp must be in a format supported by DateTime#DateTime(Object)}.

Parameters:
eventIdentifier - The identifier of the event
aggregateIdentifier - The identifier of the aggregate
sequenceNumber - The sequence number of the event
timestamp - The timestamp of the event (format must be supported by DateTime.DateTime(Object))
payloadType - The type identifier of the serialized payload
payloadRevision - The revision of the serialized payload
payload - The serialized representation of the event
metaData - The serialized representation of the meta data
Method Detail

getEventIdentifier

public String getEventIdentifier()
Description copied from interface: SerializedDomainEventData
Returns the identifier of the serialized event.

Specified by:
getEventIdentifier in interface SerializedDomainEventData
Returns:
the identifier of the serialized event

getAggregateIdentifier

public Object getAggregateIdentifier()
Description copied from interface: SerializedDomainEventData
Returns the Identifier of the Aggregate to which the Event was applied.

Specified by:
getAggregateIdentifier in interface SerializedDomainEventData
Returns:
the Identifier of the Aggregate to which the Event was applied

getSequenceNumber

public long getSequenceNumber()
Description copied from interface: SerializedDomainEventData
Returns the sequence number of the event in the aggregate.

Specified by:
getSequenceNumber in interface SerializedDomainEventData
Returns:
the sequence number of the event in the aggregate

getTimestamp

public org.joda.time.DateTime getTimestamp()
Description copied from interface: SerializedDomainEventData
Returns the timestamp at which the event was first created.

Specified by:
getTimestamp in interface SerializedDomainEventData
Returns:
the timestamp at which the event was first created

getMetaData

public SerializedObject getMetaData()
Description copied from interface: SerializedDomainEventData
Returns the serialized data of the MetaData of the serialized Event.

Specified by:
getMetaData in interface SerializedDomainEventData
Returns:
the serialized data of the MetaData of the serialized Event

getPayload

public SerializedObject getPayload()
Description copied from interface: SerializedDomainEventData
Returns the serialized data of the Event Message's payload.

Specified by:
getPayload in interface SerializedDomainEventData
Returns:
the serialized data of the Event Message's payload


Copyright © 2010-2012. All Rights Reserved.