Package fr.gouv.vitam.processing.distributor.api

# Interface IWorkerManager

All Known Implementing Classes:
  `WorkerManager`

public interface IWorkerManager
Manage the parallelism calls to worker in the same distributor

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final VitamLogger`
  `LOGGER`
  VitamLogger
  `static final String`
  `WORKER_DB_PATH`
  Path to database

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `checkStatusWorker(String serverHost, int serverPort)`
  `WorkerFamilyManager`
  `findWorkerBy(String workerFamily)`
  Find a worker by its family
  `File`
  `getWorkerDbFile()`
  `default void`
  `initialize()`
  Do the initialization Load worker from worker.db
  `default void`
  `loadWorkerList(File registerWorkerFile)`
  To load a registered worker list
  `void`
  `marshallToDB()`
  Marshall to Database
  `void`
  `registerWorker(WorkerBean workerBean)`
  Register a worker
  `void`
  `registerWorker(String familyId, String workerId, WorkerBean workerInformation)`
  To register a worker in the processing
  `void`
  `unregisterWorker(String familyId, String workerId)`
  To unregister a worker in the processing

- ## Field Details

  - ### LOGGER

    static final VitamLogger LOGGER
    VitamLogger

  - ### WORKER_DB_PATH

    static final String WORKER_DB_PATH
    Path to database
    See Also:
      - Constant Field Values

- ## Method Details

  - ### initialize

    default void initialize() throws IOException
    Do the initialization Load worker from worker.db
    Throws:
      `IOException`

  - ### loadWorkerList

    default void loadWorkerList(File registerWorkerFile) throws IOException
    To load a registered worker list
    Parameters:
      `registerWorkerFile` - the register worker file
    Throws:
      `IOException`

  - ### checkStatusWorker

    boolean checkStatusWorker(String serverHost, int serverPort)

  - ### registerWorker

    void registerWorker(String familyId, String workerId, WorkerBean workerInformation) throws ProcessingBadRequestException, IOException
    To register a worker in the processing
    Parameters:
      `familyId` - : family of this worker
      `workerId` - : ID of the worker
      `workerInformation` - : Worker Json representation
    Throws:
      `ProcessingBadRequestException` - if cannot register worker to family
      `InvalidParseOperationException` - if worker description is not well-formed
      `IOException`

  - ### registerWorker

    void registerWorker(WorkerBean workerBean) throws IOException
    Register a worker
    Parameters:
      `workerBean` - the worker description as a WorkerBean object
    Throws:
      `IOException` - thrown when IOException occurs while read/save worker backup file

  - ### unregisterWorker

    void unregisterWorker(String familyId, String workerId) throws WorkerFamilyNotFoundException, IOException
    To unregister a worker in the processing
    Parameters:
      `familyId` - : family of this worker
      `workerId` - : ID of the worker
    Throws:
      `WorkerFamilyNotFoundException` - : when the family is unknown
      `IOException` - if IOException occurs

  - ### marshallToDB

    void marshallToDB() throws IOException
    Marshall to Database
    Throws:
      `IOException`

  - ### findWorkerBy

    WorkerFamilyManager findWorkerBy(String workerFamily)
    Find a worker by its family
    Parameters:
      `workerFamily` - the worker family
    Returns:
      a WorkerFamilyManager object

  - ### getWorkerDbFile

    File getWorkerDbFile()