Package fr.maif.eventsourcing
Class EventEnvelope<E extends Event,Meta,Context>
java.lang.Object
fr.maif.eventsourcing.EventEnvelope<E,Meta,Context>
- Type Parameters:
E-Meta-Context-
The EventEnvelope is a wrapper for event containing metadatas
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classEventEnvelope.Builder<E extends Event,Meta, Context> -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal Contexta Context can be stored allog the eventfinal LocalDateTimeThe date when the event is producedfinal StringThe id of the entityfinal EThe eventfinal StringThe type of the eventfinal UUIDThe unique id of the eventfinal MetaMetadatas can be stored allog the eventfinal IntegerNumber of the current messages in the transaction for this entityfinal BooleanIs the event published to kafkafinal LongThe order num of the eventfinal StringThe id of the system that produces this eventfinal IntegerNumber of messages in the transaction for this entityfinal StringThe id of the transaction if there is more than one event published in the transactionfinal StringThe id of the user that produces this eventfinal LongThe version of the event used to deserialize the event and handle multi versions -
Constructor Summary
ConstructorsConstructorDescriptionEventEnvelope(UUID id, Long sequenceNum, String eventType, LocalDateTime emissionDate, String transactionId, Meta metadata, E event, Context context, Long version, Boolean published, Integer totalMessageInTransaction, Integer numMessageInTransaction, String entityId, String userId, String systemId) -
Method Summary
Modifier and TypeMethodDescriptionstatic <E extends Event,Meta, Context>
EventEnvelope.Builder<E,Meta, Context> builder()static <E extends Event,Meta, Context>
EventEnvelope.Builder<E,Meta, Context> builder(EventEnvelope<E, Meta, Context> envelope) copy()booleanevent()inthashCode()<T> BooleantoString()
-
Field Details
-
id
The unique id of the event -
sequenceNum
The order num of the event -
eventType
The type of the event -
emissionDate
The date when the event is produced -
transactionId
The id of the transaction if there is more than one event published in the transaction -
metadata
Metadatas can be stored allog the event -
event
The event -
context
a Context can be stored allog the event -
version
The version of the event used to deserialize the event and handle multi versions -
published
Is the event published to kafka -
totalMessageInTransaction
Number of messages in the transaction for this entity -
numMessageInTransaction
Number of the current messages in the transaction for this entity -
entityId
The id of the entity -
userId
The id of the user that produces this event -
systemId
The id of the system that produces this event
-
-
Constructor Details
-
EventEnvelope
public EventEnvelope(UUID id, Long sequenceNum, String eventType, LocalDateTime emissionDate, String transactionId, Meta metadata, E event, Context context, Long version, Boolean published, Integer totalMessageInTransaction, Integer numMessageInTransaction, String entityId, String userId, String systemId)
-
-
Method Details
-
builder
-
builder
public static <E extends Event,Meta, EventEnvelope.Builder<E,Context> Meta, builderContext> (EventEnvelope<E, Meta, Context> envelope) -
copy
-
event
-
match
-
toString
-
equals
-
hashCode
public int hashCode()
-