@MappedSuperclass @MappedSuperclass public abstract class AbstractEventEntry<T> extends Object implements EventData<T>
Modifier | Constructor and Description |
---|---|
protected |
AbstractEventEntry()
Default constructor required by JPA
|
|
AbstractEventEntry(EventMessage<?> eventMessage,
Serializer serializer,
Class<T> contentType)
Construct a new event entry from a published event message to enable storing the event or sending it to a remote
location.
|
|
AbstractEventEntry(String eventIdentifier,
Object timestamp,
String payloadType,
String payloadRevision,
T payload,
T metaData)
Reconstruct an event entry from a stored object.
|
Modifier and Type | Method and Description |
---|---|
String |
getEventIdentifier()
Returns the identifier of the serialized event.
|
SerializedObject<T> |
getMetaData()
Returns the serialized data of the MetaData of the serialized Event.
|
SerializedObject<T> |
getPayload()
Returns the serialized data of the Event Message's payload.
|
Instant |
getTimestamp()
Returns the timestamp at which the event was first created.
|
public AbstractEventEntry(EventMessage<?> eventMessage, Serializer serializer, Class<T> contentType)
The given serializer
will be used to serialize the payload and metadata in the given eventMessage
.
The type of the serialized data will be the same as the given contentType
.
eventMessage
- The event message to convert to a serialized event entryserializer
- The serializer to convert the eventcontentType
- The data type of the payload and metadata after serializationpublic AbstractEventEntry(String eventIdentifier, Object timestamp, String payloadType, String payloadRevision, T payload, T metaData)
eventIdentifier
- The identifier of the eventtimestamp
- The time at which the event was originally createdpayloadType
- The fully qualified class name or alias of the event payloadpayloadRevision
- The revision of the event payloadpayload
- The serialized payloadmetaData
- The serialized metadataprotected AbstractEventEntry()
public String getEventIdentifier()
EventData
getEventIdentifier
in interface EventData<T>
public Instant getTimestamp()
EventData
getTimestamp
in interface EventData<T>
public SerializedObject<T> getMetaData()
EventData
getMetaData
in interface EventData<T>
public SerializedObject<T> getPayload()
EventData
getPayload
in interface EventData<T>
Copyright © 2010–2024. All rights reserved.