public class WorkerManager extends Object implements IWorkerManager
Modifier and Type | Field and Description |
---|---|
static int |
QUEUE_SIZE
Default queue size
|
WORKER_DB_PATH
Constructor and Description |
---|
WorkerManager()
Constructor
|
WorkerManager(WorkerClientFactory workerClientFactory) |
Modifier and Type | Method and Description |
---|---|
boolean |
checkStatusWorker(String serverHost,
int serverPort) |
WorkerFamilyManager |
findWorkerBy(String workerFamily)
Find a worker by its family
|
File |
getWorkerDbFile() |
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 workerFamily,
String worker)
To unregister a worker in the processing
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
initialize, loadWorkerList
public static final int QUEUE_SIZE
public WorkerManager()
public WorkerManager(WorkerClientFactory workerClientFactory)
public void marshallToDB()
IWorkerManager
marshallToDB
in interface IWorkerManager
public void registerWorker(String familyId, String workerId, String workerInformation) throws ProcessingBadRequestException
IWorkerManager
registerWorker
in interface IWorkerManager
familyId
- : family of this workerworkerId
- : ID of the workerworkerInformation
- : Worker Json representationProcessingBadRequestException
- if cannot register worker to familypublic void registerWorker(WorkerBean workerBean)
IWorkerManager
registerWorker
in interface IWorkerManager
workerBean
- the worker description as a WorkerBean objectpublic void unregisterWorker(String workerFamily, String worker) throws WorkerFamilyNotFoundException
IWorkerManager
unregisterWorker
in interface IWorkerManager
workerFamily
- : family of this workerworker
- : ID of the workerWorkerFamilyNotFoundException
- : when the family is unknownpublic boolean checkStatusWorker(String serverHost, int serverPort)
checkStatusWorker
in interface IWorkerManager
public WorkerFamilyManager findWorkerBy(String workerFamily)
IWorkerManager
findWorkerBy
in interface IWorkerManager
workerFamily
- the worker familypublic File getWorkerDbFile()
getWorkerDbFile
in interface IWorkerManager
Copyright © 2019 Vitam. All rights reserved.