Class PollingService
java.lang.Object
com.persequor.saga.modules.compliance.subscription.PollingService
- All Implemented Interfaces:
IPollingService
-
Constructor Summary
ConstructorsConstructorDescriptionPollingService
(IQueueEventRepository repository, ExtraDetailsSerializer serializer, javax.inject.Provider<ComplianceRepositoryReply> replyProvider, StorageService storageService, com.persequor.extension.eventservice.IEventService eventService, com.persequor.extension.lock.ILockService lockService, ComplianceModuleConfig config, com.persequor.extension.util.Dates dates, List<IPollingAdapter> adapters, List<IPollingHooks> hooks) -
Method Summary
Modifier and TypeMethodDescriptionvoid
enqueue
(ComplianceRepositoryReply reply) Add the given compliance reply to the queue.boolean
hasQueuedEvents
(UUID sagaEventId) Check if a given saga event id has related queued events.boolean
queuedEventHasTimedOut
(QueuedEvent queuedEvent) Check if a queued event has timed out.void
resetQueuedEventTimeOut
(UUID sagaEventId, String repositoryId) Reset the timeout of a queued event.void
Run all pending queued events.void
runQueuedEvents
(UUID sagaEventId) Run all related queued events for a given saga event id.void
runQueuedEvents
(UUID sagaEventId, String repositoryId) Run all related queued events for a given saga event id and compliance repository id.
-
Constructor Details
-
PollingService
@Inject public PollingService(IQueueEventRepository repository, ExtraDetailsSerializer serializer, javax.inject.Provider<ComplianceRepositoryReply> replyProvider, StorageService storageService, com.persequor.extension.eventservice.IEventService eventService, com.persequor.extension.lock.ILockService lockService, ComplianceModuleConfig config, com.persequor.extension.util.Dates dates, List<IPollingAdapter> adapters, List<IPollingHooks> hooks)
-
-
Method Details
-
enqueue
Description copied from interface:IPollingService
Add the given compliance reply to the queue.- Specified by:
enqueue
in interfaceIPollingService
- Parameters:
reply
- the reply to be added to the queue
-
hasQueuedEvents
Description copied from interface:IPollingService
Check if a given saga event id has related queued events.- Specified by:
hasQueuedEvents
in interfaceIPollingService
- Parameters:
sagaEventId
- the id of the event- Returns:
- true if there are queued events related to the saga event id, false otherwise
-
runQueuedEvents
Description copied from interface:IPollingService
Run all related queued events for a given saga event id.- Specified by:
runQueuedEvents
in interfaceIPollingService
- Parameters:
sagaEventId
- the id of the event- Throws:
PollingServiceException
-
runQueuedEvents
Description copied from interface:IPollingService
Run all related queued events for a given saga event id and compliance repository id.- Specified by:
runQueuedEvents
in interfaceIPollingService
- Parameters:
sagaEventId
- the id of the eventrepositoryId
- the id of the compliance repository- Throws:
PollingServiceException
-
runAllQueuedEvents
public void runAllQueuedEvents()Description copied from interface:IPollingService
Run all pending queued events.- Specified by:
runAllQueuedEvents
in interfaceIPollingService
-
queuedEventHasTimedOut
Description copied from interface:IPollingService
Check if a queued event has timed out.- Specified by:
queuedEventHasTimedOut
in interfaceIPollingService
- Parameters:
queuedEvent
- the queued event- Returns:
- true if the queued event has timed out, false otherwise
-
resetQueuedEventTimeOut
Description copied from interface:IPollingService
Reset the timeout of a queued event.- Specified by:
resetQueuedEventTimeOut
in interfaceIPollingService
- Parameters:
sagaEventId
- the ID of the eventrepositoryId
- the ID of the compliance repository
-