Class WorkerManager
- java.lang.Object
-
- fr.gouv.vitam.processing.distributor.core.WorkerManager
-
- All Implemented Interfaces:
IWorkerManager
public class WorkerManager extends java.lang.Object implements IWorkerManager
WorkerManager class contains methods to manage workers
-
-
Field Summary
Fields Modifier and Type Field Description static intQUEUE_SIZEDefault queue size FIXME : why 15 ? Why not configurable-
Fields inherited from interface fr.gouv.vitam.processing.distributor.api.IWorkerManager
WORKER_DB_PATH
-
-
Constructor Summary
Constructors Constructor Description WorkerManager()ConstructorWorkerManager(WorkerClientFactory workerClientFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancheckStatusWorker(java.lang.String serverHost, int serverPort)WorkerFamilyManagerfindWorkerBy(java.lang.String workerFamily)Find a worker by its familyjava.io.FilegetWorkerDbFile()voidmarshallToDB()Marshall to DatabasevoidregisterWorker(WorkerBean workerBean)Register a workervoidregisterWorker(java.lang.String familyId, java.lang.String workerId, WorkerBean workerInformation)To register a worker in the processingvoidunregisterWorker(java.lang.String workerFamily, java.lang.String worker)To unregister a worker in the processing-
Methods 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 Detail
-
QUEUE_SIZE
public static final int QUEUE_SIZE
Default queue size FIXME : why 15 ? Why not configurable- See Also:
- Constant Field Values
-
-
Constructor Detail
-
WorkerManager
public WorkerManager()
Constructor
-
WorkerManager
public WorkerManager(WorkerClientFactory workerClientFactory)
-
-
Method Detail
-
marshallToDB
public void marshallToDB() throws java.io.IOExceptionDescription copied from interface:IWorkerManagerMarshall to Database- Specified by:
marshallToDBin interfaceIWorkerManager- Throws:
java.io.IOException
-
registerWorker
public void registerWorker(java.lang.String familyId, java.lang.String workerId, WorkerBean workerInformation) throws ProcessingBadRequestException, java.io.IOExceptionDescription copied from interface:IWorkerManagerTo register a worker in the processing- Specified by:
registerWorkerin interfaceIWorkerManager- Parameters:
familyId- : family of this workerworkerId- : ID of the workerworkerInformation- : Worker Json representation- Throws:
ProcessingBadRequestException- if cannot register worker to familyjava.io.IOException
-
registerWorker
public void registerWorker(WorkerBean workerBean) throws java.io.IOException
Description copied from interface:IWorkerManagerRegister a worker- Specified by:
registerWorkerin interfaceIWorkerManager- Parameters:
workerBean- the worker description as a WorkerBean object- Throws:
java.io.IOException- thrown when IOException occurs while read/save worker backup file
-
unregisterWorker
public void unregisterWorker(java.lang.String workerFamily, java.lang.String worker) throws WorkerFamilyNotFoundException, java.io.IOExceptionDescription copied from interface:IWorkerManagerTo unregister a worker in the processing- Specified by:
unregisterWorkerin interfaceIWorkerManager- Parameters:
workerFamily- : family of this workerworker- : ID of the worker- Throws:
WorkerFamilyNotFoundException- : when the family is unknownjava.io.IOException- if IOException occurs
-
checkStatusWorker
public boolean checkStatusWorker(java.lang.String serverHost, int serverPort)- Specified by:
checkStatusWorkerin interfaceIWorkerManager
-
findWorkerBy
public WorkerFamilyManager findWorkerBy(java.lang.String workerFamily)
Description copied from interface:IWorkerManagerFind a worker by its family- Specified by:
findWorkerByin interfaceIWorkerManager- Parameters:
workerFamily- the worker family- Returns:
- a WorkerFamilyManager object
-
getWorkerDbFile
public java.io.File getWorkerDbFile()
- Specified by:
getWorkerDbFilein interfaceIWorkerManager
-
-