Class DefaultIdempotentPersistenceNotificationConsumptionService
java.lang.Object
com.broadleafcommerce.promotion.offer.service.persistence.DefaultIdempotentPersistenceNotificationConsumptionService
- All Implemented Interfaces:
IdempotentPersistenceNotificationConsumptionService
public class DefaultIdempotentPersistenceNotificationConsumptionService
extends Object
implements IdempotentPersistenceNotificationConsumptionService
Service responsible for enforcing idempotency checks on a message before executing an operation
against the message.
- Author:
- Chris Kittrell (ckittrell)
-
Field Summary
Modifier and TypeFieldDescriptionprotected final com.broadleafcommerce.common.messaging.repository.ResourceLockRepository<?,
?> -
Constructor Summary
ConstructorDescriptionDefaultIdempotentPersistenceNotificationConsumptionService
(com.broadleafcommerce.common.messaging.repository.ResourceLockRepository<?, ?> resourceLockRepository) -
Method Summary
Modifier and TypeMethodDescriptionvoid
consumeNotification
(@NonNull com.fasterxml.jackson.databind.JsonNode entityJson, @NonNull String handlerName, @NonNull Consumer<com.fasterxml.jackson.databind.JsonNode> operation) Executes the provided operation if theJsonNode's
idempotency check passes.protected com.broadleafcommerce.common.messaging.repository.ResourceLockRepository<?,
?>
-
Field Details
-
resourceLockRepository
protected final com.broadleafcommerce.common.messaging.repository.ResourceLockRepository<?,?> resourceLockRepository
-
-
Constructor Details
-
DefaultIdempotentPersistenceNotificationConsumptionService
public DefaultIdempotentPersistenceNotificationConsumptionService(com.broadleafcommerce.common.messaging.repository.ResourceLockRepository<?, ?> resourceLockRepository)
-
-
Method Details
-
consumeNotification
public void consumeNotification(@NonNull @NonNull com.fasterxml.jackson.databind.JsonNode entityJson, @NonNull @NonNull String handlerName, @NonNull @NonNull Consumer<com.fasterxml.jackson.databind.JsonNode> operation) Description copied from interface:IdempotentPersistenceNotificationConsumptionService
Executes the provided operation if theJsonNode's
idempotency check passes. If the check fails the idempotency check, then we'll quietly return to the caller without executing the operation.- Specified by:
consumeNotification
in interfaceIdempotentPersistenceNotificationConsumptionService
- Parameters:
entityJson
- The JsonNode that is to be processed.handlerName
- The name of the persistence notification handler. This value can be used to distinguish this notification consumption from that of a different handler.operation
- The operation that is to be executed, without a return value
-
getResourceLockRepository
protected com.broadleafcommerce.common.messaging.repository.ResourceLockRepository<?,?> getResourceLockRepository()
-