|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.axonframework.eventstore.jpa.DefaultEventEntryFactory
public final class DefaultEventEntryFactory
Implementation of the EventEntryFactory that provides the default Axon entities, which store payload and meta data of Events as byte arrays. This implementation also supports converting TimeZone of event timestamps to UTC before storing them.
Constructor Summary | |
---|---|
DefaultEventEntryFactory()
Creates a new instance of the factory which stores the timestamps with the original timezone of the event messages. |
|
DefaultEventEntryFactory(boolean forceUtc)
Creates a new instance of the factory which, when forceUtc true , stores the timestamps
converted to UTC timezone. |
Method Summary | |
---|---|
Object |
createDomainEventEntry(String aggregateType,
DomainEventMessage event,
SerializedObject<byte[]> serializedPayload,
SerializedObject<byte[]> serializedMetaData)
Creates an entity representing a Domain Event, which contains the data provided in the parameters, which can be stored using the JPA Entity Manager configured on the JpaEventStore using this factory. |
Object |
createSnapshotEventEntry(String aggregateType,
DomainEventMessage snapshotEvent,
SerializedObject<byte[]> serializedPayload,
SerializedObject<byte[]> serializedMetaData)
Creates an entity representing a Snapshot Event, which contains the data provided in the parameters, which can be stored using the JPA Entity Manager configured on the JpaEventStore using this factory. |
Class<byte[]> |
getDataType()
Returns the type used to store serialized payloads. |
String |
getDomainEventEntryEntityName()
Returns the entity name of the Domain Event Entry provided by this factory. |
String |
getSnapshotEventEntryEntityName()
Returns the entity name of the Snapshot Event Entry provided by this factory. |
String |
resolveDateTimeValue(org.joda.time.DateTime dateTime)
Returns the representation used for the given dateTime in the event entry. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultEventEntryFactory()
public DefaultEventEntryFactory(boolean forceUtc)
forceUtc
true
, stores the timestamps
converted to UTC timezone.
forceUtc
- whether to convert timestamps to the UTC time zone.Method Detail |
---|
public Class<byte[]> getDataType()
EventEntryFactory
EventEntryFactory.createSnapshotEventEntry(String,
org.axonframework.domain.DomainEventMessage, org.axonframework.serializer.SerializedObject,
org.axonframework.serializer.SerializedObject)
and EventEntryFactory.createDomainEventEntry(String,
org.axonframework.domain.DomainEventMessage, org.axonframework.serializer.SerializedObject,
org.axonframework.serializer.SerializedObject)
respectively.
getDataType
in interface EventEntryFactory<byte[]>
public Object createDomainEventEntry(String aggregateType, DomainEventMessage event, SerializedObject<byte[]> serializedPayload, SerializedObject<byte[]> serializedMetaData)
EventEntryFactory
createDomainEventEntry
in interface EventEntryFactory<byte[]>
aggregateType
- The type identifier of the aggregate that generated the domain eventevent
- The DomainEventMessage containing the data to storeserializedPayload
- The serialized payloadserializedMetaData
- The serialized meta data
public Object createSnapshotEventEntry(String aggregateType, DomainEventMessage snapshotEvent, SerializedObject<byte[]> serializedPayload, SerializedObject<byte[]> serializedMetaData)
EventEntryFactory
createSnapshotEventEntry
in interface EventEntryFactory<byte[]>
aggregateType
- The type identifier of the aggregate that generated the domain eventsnapshotEvent
- The DomainEventMessage containing the data to storeserializedPayload
- The serialized payloadserializedMetaData
- The serialized meta data
public String getDomainEventEntryEntityName()
EventEntryFactory
getDomainEventEntryEntityName
in interface EventEntryFactory<byte[]>
public String getSnapshotEventEntryEntityName()
EventEntryFactory
getSnapshotEventEntryEntityName
in interface EventEntryFactory<byte[]>
public String resolveDateTimeValue(org.joda.time.DateTime dateTime)
dateTime
in the event entry.
For example, if the date is stored as an ISO-8601 String, this methods return the dateTime.toString().
This implementation returns the a String containing a ISO-8601 representation of the given date.
resolveDateTimeValue
in interface EventEntryFactory<byte[]>
dateTime
- The date to return the representation for
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |