Interface PersistenceStore

All Known Implementing Classes:
BasePersistenceStore

public interface PersistenceStore
Persistence layer that will store the idempotency result. In order to provide another implementation, extends BasePersistenceStore.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    deleteRecord(String idempotencyKey)
    Remove item from persistence store
    getRecord(String idempotencyKey)
    Retrieve item from persistence store using idempotency key and return it as a DataRecord instance.
    void
    Add a DataRecord to persistence store if it does not already exist with that key
    void
    Update item in persistence store
  • Method Details

    • getRecord

      DataRecord getRecord(String idempotencyKey) throws IdempotencyItemNotFoundException
      Retrieve item from persistence store using idempotency key and return it as a DataRecord instance.
      Parameters:
      idempotencyKey - the key of the record
      Returns:
      DataRecord representation of existing record found in persistence store
      Throws:
      IdempotencyItemNotFoundException - Exception thrown if no record exists in persistence store with the idempotency key
    • putRecord

      void putRecord(DataRecord record, Instant now) throws IdempotencyItemAlreadyExistsException
      Add a DataRecord to persistence store if it does not already exist with that key
      Parameters:
      record - DataRecord instance
      now -
      Throws:
      IdempotencyItemAlreadyExistsException - if a non-expired entry already exists.
    • updateRecord

      void updateRecord(DataRecord record)
      Update item in persistence store
      Parameters:
      record - DataRecord instance
    • deleteRecord

      void deleteRecord(String idempotencyKey)
      Remove item from persistence store
      Parameters:
      idempotencyKey - the key of the record