public abstract class BasePersistenceStore extends java.lang.Object implements PersistenceStore
DynamoDBPersistenceStore for an implementation (default one)
Extends this class to use your own implementation (DocumentDB, Elasticache, ...)| Modifier and Type | Field and Description |
|---|---|
protected boolean |
payloadValidationEnabled |
| Constructor and Description |
|---|
BasePersistenceStore() |
| Modifier and Type | Method and Description |
|---|---|
void |
configure(IdempotencyConfig config,
java.lang.String functionName)
Initialize the base persistence layer from the configuration settings
|
void |
deleteRecord(com.fasterxml.jackson.databind.JsonNode data,
java.lang.Throwable throwable)
Delete record from the persistence store
|
DataRecord |
getRecord(com.fasterxml.jackson.databind.JsonNode data,
java.time.Instant now)
Retrieve idempotency key for data provided, fetch from persistence store, and convert to DataRecord.
|
void |
saveInProgress(com.fasterxml.jackson.databind.JsonNode data,
java.time.Instant now,
java.util.OptionalInt remainingTimeInMs)
Save record of function's execution being in progress
|
void |
saveSuccess(com.fasterxml.jackson.databind.JsonNode data,
java.lang.Object result,
java.time.Instant now)
Save record of function's execution completing successfully
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdeleteRecord, getRecord, putRecord, updateRecordpublic void configure(IdempotencyConfig config, java.lang.String functionName)
config - Idempotency configuration settingsfunctionName - The name of the function being decoratedpublic void saveSuccess(com.fasterxml.jackson.databind.JsonNode data,
java.lang.Object result,
java.time.Instant now)
data - Payloadresult - the response from the functionpublic void saveInProgress(com.fasterxml.jackson.databind.JsonNode data,
java.time.Instant now,
java.util.OptionalInt remainingTimeInMs)
throws IdempotencyItemAlreadyExistsException
data - Payloadnow - IdempotencyItemAlreadyExistsExceptionpublic void deleteRecord(com.fasterxml.jackson.databind.JsonNode data,
java.lang.Throwable throwable)
data - Payloadthrowable - The throwable thrown by the functionpublic DataRecord getRecord(com.fasterxml.jackson.databind.JsonNode data, java.time.Instant now) throws IdempotencyValidationException, IdempotencyItemNotFoundException
data - PayloadIdempotencyValidationException - Payload doesn't match the stored record for the given idempotency keyIdempotencyItemNotFoundException - Exception thrown if no record exists in persistence store with the idempotency keyCopyright © 2023. All rights reserved.