Class DefaultIdempotentPersistenceNotificationConsumptionService
- java.lang.Object
-
- com.broadleafcommerce.promotion.campaign.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
Fields Modifier and Type Field Description protected com.broadleafcommerce.common.messaging.repository.ResourceLockRepository<?,?>
resourceLockRepository
-
Constructor Summary
Constructors Constructor Description DefaultIdempotentPersistenceNotificationConsumptionService(com.broadleafcommerce.common.messaging.repository.ResourceLockRepository<?,?> resourceLockRepository)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
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<?,?>
getResourceLockRepository()
-
-
-
Method Detail
-
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()
-
-