Package fr.gouv.vitam.processing.distributor.core

# Class ProcessDistributorImpl

java.lang.Object
fr.gouv.vitam.processing.distributor.core.ProcessDistributorImpl

All Implemented Interfaces:
  `ProcessDistributor`

public class ProcessDistributorImpl extends Object implements ProcessDistributor
The Process Distributor call the workers and intercept the response for manage a post actions step

     - handle listing of items through a limited arraylist (memory) and through iterative (async) listing from
     Workspace
     - handle result in FATAL mode from one distributed item to stop the distribution in FATAL mode (do not
     continue)
     - try to handle distribution on 1 or on many as the same loop (so using a default arrayList of 1)
     - handle error level using order in enum in ProcessResponse.getGlobalProcessStatusCode instead of manually comparing:

- ## Field Summary

  ### Fields inherited from interface fr.gouv.vitam.processing.distributor.api.ProcessDistributor

  `ELEMENT_UNITS, EXCEPTION_MESSAGE, JSON_EXTENSION, NOLEVEL, OBJECTS_LIST_EMPTY`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ProcessDistributorImpl(IWorkerManager workerManager, AsyncResourcesMonitor asyncResourcesMonitor, AsyncResourceCleaner asyncResourceCleaner, ServerConfiguration serverConfiguration)`
  Empty constructor
  `ProcessDistributorImpl(IWorkerManager workerManager, AsyncResourcesMonitor asyncResourcesMonitor, AsyncResourceCleaner asyncResourceCleaner, ServerConfiguration serverConfiguration, ProcessDataManagement processDataManagement, WorkspaceClientFactory workspaceClientFactory, MetaDataClientFactory metaDataClientFactory, WorkerClientFactory workerClientFactory)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `ItemStatus`
  `distribute(WorkerParameters workParams, Step step, String operationId)`
  Temporary method for distribution supporting multi-list
  `ProcessDataManagement`
  `getProcessDataManagement()`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### ProcessDistributorImpl

    public ProcessDistributorImpl(IWorkerManager workerManager, AsyncResourcesMonitor asyncResourcesMonitor, AsyncResourceCleaner asyncResourceCleaner, ServerConfiguration serverConfiguration)
    Empty constructor
    Parameters:
      `workerManager` - a WorkerManager instance
      `serverConfiguration` - distributor server configuration

  - ### ProcessDistributorImpl

    public ProcessDistributorImpl(IWorkerManager workerManager, AsyncResourcesMonitor asyncResourcesMonitor, AsyncResourceCleaner asyncResourceCleaner, ServerConfiguration serverConfiguration, ProcessDataManagement processDataManagement, WorkspaceClientFactory workspaceClientFactory, MetaDataClientFactory metaDataClientFactory, WorkerClientFactory workerClientFactory)

- ## Method Details

  - ### distribute

    public ItemStatus distribute(WorkerParameters workParams, Step step, String operationId)
    Temporary method for distribution supporting multi-list
    Specified by:
      `distribute` in interface `ProcessDistributor`
    Parameters:
      `workParams` - of type `WorkerParameters`
      `step` - the execution step
      `operationId` - the operation id
    Returns:
      the final step status

  - ### getProcessDataManagement

    public ProcessDataManagement getProcessDataManagement()
    Specified by:
      `getProcessDataManagement` in interface `ProcessDistributor`