Class AxonServerSnapshotStore
java.lang.Object
org.axonframework.axonserver.connector.snapshot.AxonServerSnapshotStore
- All Implemented Interfaces:
SnapshotStore
An Axon Server based implementation of
SnapshotStore.
This store stores snapshots in Axon Server and is thread-safe.
- Since:
- 5.1.0
- Author:
- John Hendrikx
-
Constructor Summary
ConstructorsConstructorDescriptionAxonServerSnapshotStore(io.axoniq.axonserver.connector.AxonServerConnection connection, Converter converter) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionCompletableFuture<@Nullable Snapshot> load(QualifiedName qualifiedName, Object identifier) Loads the latest snapshot for a given name and identifier.store(QualifiedName qualifiedName, Object identifier, Snapshot snapshot) Persists a snapshot under the given name and identifier.
-
Constructor Details
-
Method Details
-
store
public CompletableFuture<Void> store(QualifiedName qualifiedName, Object identifier, Snapshot snapshot) Description copied from interface:SnapshotStorePersists a snapshot under the given name and identifier. This replaces any previous snapshot(s) with the same name and identifier.This method is asynchronous and returns a
CompletableFuturethat completes when the snapshot has been durably stored.- Specified by:
storein interfaceSnapshotStore- Parameters:
qualifiedName- the name of the snapshot to persist, cannot benullidentifier- the identifier of the snapshot to persist, cannot benullsnapshot- the snapshot to persist, cannot benull- Returns:
- a
CompletableFuturethat completes when the snapshot has been stored
-
load
Description copied from interface:SnapshotStoreLoads the latest snapshot for a given name and identifier.The returned snapshot may have an older or newer version relative to what is expected. The caller is responsible for handling version compatibility or ignoring unusable snapshots.
This method is asynchronous and returns a
CompletableFuturethat completes with the snapshot if one exists, ornullif no snapshot is available.- Specified by:
loadin interfaceSnapshotStore- Parameters:
qualifiedName- the name of the snapshot, cannot benullidentifier- the identifier of the snapshot, cannot benull- Returns:
- a
CompletableFuturecontaining the snapshot, or containingnullif no matching snapshot exists
-