Interface EventStoreAsync<AID extends AggregateId,A extends Aggregate<A,AID>,E extends Event<AID>>
-
- Type Parameters:
AID- Aggregate ID type / 集約IDの型A- Aggregate type / 集約の型E- Event type / イベントの型
- All Superinterfaces:
EventStoreOptions<EventStoreAsync<AID,A,E>,AID,A,E>
- All Known Implementing Classes:
EventStoreAsyncForDynamoDB
public interface EventStoreAsync<AID extends AggregateId,A extends Aggregate<A,AID>,E extends Event<AID>> extends EventStoreOptions<EventStoreAsync<AID,A,E>,AID,A,E>
Asynchronous version ofEventStore. /EventStoreの非同期版。
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.concurrent.CompletableFuture<java.util.List<E>>getEventsByIdSinceSequenceNumber(java.lang.Class<E> clazz, AID aggregateId, long sequenceNumber)Gets the events by the aggregate id and since the sequence number.java.util.concurrent.CompletableFuture<java.util.Optional<A>>getLatestSnapshotById(java.lang.Class<A> clazz, AID aggregateId)Gets the latest snapshot by the aggregate id.static <AID extends AggregateId,A extends Aggregate<A,AID>,E extends Event<AID>>
EventStoreAsync<AID,A,E>ofDynamoDB(software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient dynamoDbAsyncClient, java.lang.String journalTableName, java.lang.String snapshotTableName, java.lang.String journalAidIndexName, java.lang.String snapshotAidIndexName, long shardCount)java.util.concurrent.CompletableFuture<java.lang.Void>persistEvent(E event, long version)Persists an event only.java.util.concurrent.CompletableFuture<java.lang.Void>persistEventAndSnapshot(E event, A aggregate)Persists an event and a snapshot.-
Methods inherited from interface com.github.j5ik2o.event.store.adapter.java.EventStoreOptions
withDeleteTtl, withEventSerializer, withKeepSnapshotCount, withKeyResolver, withSnapshotSerializer
-
-
-
-
Method Detail
-
ofDynamoDB
static <AID extends AggregateId,A extends Aggregate<A,AID>,E extends Event<AID>> EventStoreAsync<AID,A,E> ofDynamoDB(@Nonnull software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient dynamoDbAsyncClient, @Nonnull java.lang.String journalTableName, @Nonnull java.lang.String snapshotTableName, @Nonnull java.lang.String journalAidIndexName, @Nonnull java.lang.String snapshotAidIndexName, long shardCount)
-
getLatestSnapshotById
@Nonnull java.util.concurrent.CompletableFuture<java.util.Optional<A>> getLatestSnapshotById(@Nonnull java.lang.Class<A> clazz, @Nonnull AID aggregateId)
Gets the latest snapshot by the aggregate id. / 集約IDによる最新のスナップショットを取得します。
-
getEventsByIdSinceSequenceNumber
@Nonnull java.util.concurrent.CompletableFuture<java.util.List<E>> getEventsByIdSinceSequenceNumber(@Nonnull java.lang.Class<E> clazz, @Nonnull AID aggregateId, long sequenceNumber)
Gets the events by the aggregate id and since the sequence number. / 集約IDとシーケンス番号以降のイベントを取得します。
-
persistEvent
@Nonnull java.util.concurrent.CompletableFuture<java.lang.Void> persistEvent(@Nonnull E event, long version)Persists an event only. / イベントのみを永続化します。- Parameters:
event-Event/ イベントversion- version / バージョン- Returns:
CompletableFuturewithout result / 結果を持たないCompletableFuture
-
-