Class WorkerManager
java.lang.Object
fr.gouv.vitam.processing.distributor.core.WorkerManager
- All Implemented Interfaces:
IWorkerManager
WorkerManager class contains methods to manage workers
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Default queue size FIXME : why 15 ? Why not configurableFields inherited from interface fr.gouv.vitam.processing.distributor.api.IWorkerManager
WORKER_DB_PATH
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
checkStatusWorker
(String serverHost, int serverPort) findWorkerBy
(String workerFamily) Find a worker by its familyvoid
Marshall to Databasevoid
registerWorker
(WorkerBean workerBean) Register a workervoid
registerWorker
(String familyId, String workerId, WorkerBean workerInformation) To register a worker in the processingvoid
unregisterWorker
(String workerFamily, String worker) To unregister a worker in the processingMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface fr.gouv.vitam.processing.distributor.api.IWorkerManager
initialize, loadWorkerList
-
Field Details
-
QUEUE_SIZE
public static final int QUEUE_SIZEDefault queue size FIXME : why 15 ? Why not configurable- See Also:
-
-
Constructor Details
-
WorkerManager
public WorkerManager()Constructor -
WorkerManager
-
-
Method Details
-
marshallToDB
Description copied from interface:IWorkerManager
Marshall to Database- Specified by:
marshallToDB
in interfaceIWorkerManager
- Throws:
IOException
-
registerWorker
public void registerWorker(String familyId, String workerId, WorkerBean workerInformation) throws ProcessingBadRequestException, IOException Description copied from interface:IWorkerManager
To register a worker in the processing- Specified by:
registerWorker
in interfaceIWorkerManager
- Parameters:
familyId
- : family of this workerworkerId
- : ID of the workerworkerInformation
- : Worker Json representation- Throws:
ProcessingBadRequestException
- if cannot register worker to familyIOException
-
registerWorker
Description copied from interface:IWorkerManager
Register a worker- Specified by:
registerWorker
in interfaceIWorkerManager
- Parameters:
workerBean
- the worker description as a WorkerBean object- Throws:
IOException
- thrown when IOException occurs while read/save worker backup file
-
unregisterWorker
public void unregisterWorker(String workerFamily, String worker) throws WorkerFamilyNotFoundException, IOException Description copied from interface:IWorkerManager
To unregister a worker in the processing- Specified by:
unregisterWorker
in interfaceIWorkerManager
- Parameters:
workerFamily
- : family of this workerworker
- : ID of the worker- Throws:
WorkerFamilyNotFoundException
- : when the family is unknownIOException
- if IOException occurs
-
checkStatusWorker
- Specified by:
checkStatusWorker
in interfaceIWorkerManager
-
findWorkerBy
Description copied from interface:IWorkerManager
Find a worker by its family- Specified by:
findWorkerBy
in interfaceIWorkerManager
- Parameters:
workerFamily
- the worker family- Returns:
- a WorkerFamilyManager object
-
getWorkerDbFile
- Specified by:
getWorkerDbFile
in interfaceIWorkerManager
-