Class NotificationHistoryStore

java.lang.Object
ecmwf.common.database.NotificationHistoryStore

public final class NotificationHistoryStore extends Object
Persistent notification history. The singleton state row serializes all writers and retention.
  • Constructor Details

    • NotificationHistoryStore

      public NotificationHistoryStore(DataBase database)
  • Method Details

    • currentSequence

      public long currentSequence()
    • append

      public void append(String destination, String target, String event, long retentionMillis, long maxBytes)
    • append

      public void append(String destination, String target, String event, long retentionMillis, long maxBytes, NotificationOutboxStore.Request outbox)
    • appendWithTransfer

      public void appendWithTransfer(DataTransfer transfer, String event, long retentionMillis, long maxBytes)
      Commit a transfer update and notification atomically, without checking for stale transfer state.
    • appendWithTransfer

      public void appendWithTransfer(DataTransfer transfer, String event, long retentionMillis, long maxBytes, NotificationOutboxStore.Request outbox)
    • appendWithTransfer

      public void appendWithTransfer(DataTransfer transfer, DataTransfer expected, String event, long retentionMillis, long maxBytes, NotificationOutboxStore.Request outbox)
      Commit a staged transfer only if its persisted fields still match a separate, unchanged snapshot. This precondition does not fence writes made after this transaction.
    • appendWithTransferFenced

      public boolean appendWithTransferFenced(DataTransfer transfer, String event, long retentionMillis, long maxBytes, NotificationOutboxStore.Request outbox)
      Commit a transfer update and notification atomically, guarded by its persisted revision.
    • appendWithTransferFenced

      public boolean appendWithTransferFenced(DataTransfer transfer, DataTransfer expected, String event, long retentionMillis, long maxBytes, NotificationOutboxStore.Request outbox)
      Commit a transfer update and notification atomically, guarded by its revision and an unchanged snapshot.
    • validateTransferRevisionSchema

      public void validateTransferRevisionSchema()
    • prune

      public void prune(long retentionMillis, long maxBytes)
    • checkpoint

      public Long checkpoint(String user, String destination, String consumer, String operation, Long sequence, int maxConsumers, long retentionMillis)
      Read, acknowledge or delete one named checkpoint. Acknowledgements never move backwards.
    • pruneCheckpoints

      public void pruneCheckpoints(long retentionMillis)
      Remove a bounded batch of expired checkpoint groups.
    • replayAviso

      public NotificationHistoryStore.Page replayAviso(String destination, long after, Long upper, Long fromTime, Long toTime, int limit, long retentionMillis)
      Reads one Aviso page in global sequence order with a fixed replay ceiling.