public interface IWorkerManager
Modifier and Type | Field and Description |
---|---|
static VitamLogger |
LOGGER
VitamLogger
|
static String |
WORKER_DB_PATH
Path to database
|
Modifier and Type | Method and 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(String familyId,
String workerId,
String workerInformation)
To register a worker in the processing
|
void |
registerWorker(WorkerBean workerBean)
Register a worker
|
void |
unregisterWorker(String familyId,
String workerId)
To unregister a worker in the processing
|
static final VitamLogger LOGGER
static final String WORKER_DB_PATH
default void initialize()
default void loadWorkerList(File registerWorkerFile)
registerWorkerFile
- the register worker fileboolean checkStatusWorker(String serverHost, int serverPort)
void registerWorker(String familyId, String workerId, String workerInformation) throws WorkerAlreadyExistsException, ProcessingBadRequestException, InvalidParseOperationException
familyId
- : family of this workerworkerId
- : ID of the workerworkerInformation
- : Worker Json representationWorkerAlreadyExistsException
- : when the worker is already registeredProcessingBadRequestException
- if cannot register worker to familyInvalidParseOperationException
- if worker description is not well-formedvoid registerWorker(WorkerBean workerBean) throws WorkerAlreadyExistsException
workerBean
- the worker description as a WorkerBean objectWorkerAlreadyExistsException
- thrown if the worker already existsvoid unregisterWorker(String familyId, String workerId) throws WorkerFamilyNotFoundException, WorkerNotFoundException, InterruptedException
familyId
- : family of this workerworkerId
- : ID of the workerWorkerFamilyNotFoundException
- : when the family is unknownWorkerNotFoundException
- : when the ID of the worker is unknown in the familyInterruptedException
- if error in stopping threadvoid marshallToDB()
WorkerFamilyManager findWorkerBy(String workerFamily)
workerFamily
- the worker familyFile getWorkerDbFile()
Copyright © 2019 Vitam. All rights reserved.