Interface SnapshotChannel

  • All Known Implementing Classes:
    SnapshotChannelImpl

    public interface SnapshotChannel
    Communication channel for Snapshot-related interactions with AxonServer. This interface provides operations for managing snapshots, including adding, deleting, listing, and retrieving snapshots.
    • Method Detail

      • addSnapshot

        CompletableFuture<AddSnapshotResponse> addSnapshot​(AddSnapshotRequest request)
        Adds a snapshot to the store. If a snapshot with the same key and sequence already exists, it will be replaced. When the prune flag is set to true, all snapshots with the same key and a sequence number less than the provided sequence will be removed.
        Parameters:
        request - The request containing the snapshot to add, including key, sequence, prune flag, and snapshot data
        Returns:
        A CompletableFuture that resolves to an AddSnapshotResponse when the operation completes
      • deleteSnapshots

        CompletableFuture<DeleteSnapshotsResponse> deleteSnapshots​(DeleteSnapshotsRequest request)
        Deletes snapshots within a specified sequence range for a given key. The range is inclusive at the lower bound (fromSequence) and exclusive at the upper bound (toSequence).
        Parameters:
        request - The request containing the key and sequence range to delete
        Returns:
        A CompletableFuture that resolves to a DeleteSnapshotsResponse when the operation completes
      • listSnapshots

        ResultStream<ListSnapshotsResponse> listSnapshots​(ListSnapshotsRequest request)
        Lists snapshots for a given key within a specified sequence range. The range is inclusive at the lower bound (fromSequence) and exclusive at the upper bound (toSequence). Snapshots are returned in ascending order by sequence number.
        Parameters:
        request - The request containing the key and sequence range to list
        Returns:
        A ResultStream of ListSnapshotsResponse objects containing the matching snapshots
      • getLastSnapshot

        CompletableFuture<GetLastSnapshotResponse> getLastSnapshot​(GetLastSnapshotRequest request)
        Retrieves the snapshot with the highest sequence number for a given key. If no snapshots exist for the key, the response will not contain a snapshot.
        Parameters:
        request - The request containing the key to get the last snapshot for
        Returns:
        A CompletableFuture that resolves to a GetLastSnapshotResponse when the operation completes