Class AsyncResourcesMonitor
java.lang.Object
fr.gouv.vitam.processing.distributor.core.AsyncResourcesMonitor
Global processing service monitoring regularly the status of asynchronous resources from storage engine. This service is used for all workflows who need to read a resource on a tape offer.
-
Constructor Summary
ConstructorsConstructorDescriptionAsyncResourcesMonitor
(ServerConfiguration serverConfiguration) AsyncResourcesMonitor
(ServerConfiguration serverConfiguration, StorageClientFactory storageClientFactory, ScheduledExecutorService scheduledExecutorService) -
Method Summary
Modifier and TypeMethodDescriptionvoid
watchAsyncResourcesForBulk
(Map<String, AccessRequestContext> asyncResources, String requestId, String taskId, WorkflowInterruptionChecker workflowInterruptionChecker, AsyncResourceCallback callback) Add all the async resources of a bulk to monitor its statuses until it's either available or its accessRequest needs to be re-created.
-
Constructor Details
-
AsyncResourcesMonitor
-
AsyncResourcesMonitor
public AsyncResourcesMonitor(ServerConfiguration serverConfiguration, StorageClientFactory storageClientFactory, ScheduledExecutorService scheduledExecutorService)
-
-
Method Details
-
watchAsyncResourcesForBulk
public void watchAsyncResourcesForBulk(Map<String, AccessRequestContext> asyncResources, String requestId, String taskId, WorkflowInterruptionChecker workflowInterruptionChecker, AsyncResourceCallback callback) Add all the async resources of a bulk to monitor its statuses until it's either available or its accessRequest needs to be re-created.- Parameters:
asyncResources
- map of accessRequestIds with it couple strategyId/OfferId for eachrequestId
- request id of the workflow waiting for the resources availabilitytaskId
- distribution task idworkflowInterruptionChecker
- a non-blocking / stateless function that check workflow interruption status.callback
- callback function called to notify the workflow execution waiting for the resource of its availability (or need to re-create)
-