Class AxonServerSnapshotStore

java.lang.Object
org.axonframework.axonserver.connector.snapshot.AxonServerSnapshotStore
All Implemented Interfaces:
SnapshotStore

public class AxonServerSnapshotStore extends Object implements 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 Details

    • AxonServerSnapshotStore

      public AxonServerSnapshotStore(io.axoniq.axonserver.connector.AxonServerConnection connection, Converter converter)
      Creates a new instance.
      Parameters:
      connection - a AxonServerConnection, cannot be null
      converter - a Converter for identifiers and payloads, cannot be null
  • Method Details

    • store

      public CompletableFuture<Void> store(QualifiedName qualifiedName, Object identifier, Snapshot snapshot)
      Description copied from interface: SnapshotStore
      Persists 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 CompletableFuture that completes when the snapshot has been durably stored.

      Specified by:
      store in interface SnapshotStore
      Parameters:
      qualifiedName - the name of the snapshot to persist, cannot be null
      identifier - the identifier of the snapshot to persist, cannot be null
      snapshot - the snapshot to persist, cannot be null
      Returns:
      a CompletableFuture that completes when the snapshot has been stored
    • load

      public CompletableFuture<@Nullable Snapshot> load(QualifiedName qualifiedName, Object identifier)
      Description copied from interface: SnapshotStore
      Loads 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 CompletableFuture that completes with the snapshot if one exists, or null if no snapshot is available.

      Specified by:
      load in interface SnapshotStore
      Parameters:
      qualifiedName - the name of the snapshot, cannot be null
      identifier - the identifier of the snapshot, cannot be null
      Returns:
      a CompletableFuture containing the snapshot, or containing null if no matching snapshot exists