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 TypeMethodDescriptionvoiddeleteRecord(String idempotencyKey) Remove item from persistence storeRetrieve item from persistence store using idempotency key and return it as a DataRecord instance.voidputRecord(DataRecord record, Instant now) Add a DataRecord to persistence store if it does not already exist with that keyvoidupdateRecord(DataRecord record) Update item in persistence store
-
Method Details
-
getRecord
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
Add a DataRecord to persistence store if it does not already exist with that key- Parameters:
record- DataRecord instancenow-- Throws:
IdempotencyItemAlreadyExistsException- if a non-expired entry already exists.
-
updateRecord
Update item in persistence store- Parameters:
record- DataRecord instance
-
deleteRecord
Remove item from persistence store- Parameters:
idempotencyKey- the key of the record
-