@Test public void register_existing_worker_ok() throws Exception { final String familyId = "DefaultWorker1"; final String workerId = "NewWorkerId1" + GUIDFactory.newGUID().getId(); workerManager.registerWorker(familyId, workerId, WORKER_DESCRIPTION); workerManager.registerWorker(familyId, workerId, WORKER_DESCRIPTION); }
@Override public void registerWorker(String familyId, String workerId, WorkerBean workerInformation) throws ProcessingBadRequestException, IOException { ParametersChecker.checkParameter("All arguments are required", familyId, workerId, workerInformation); if (!workerInformation.getFamily().equals(familyId)) { throw new ProcessingBadRequestException("Cannot register a worker of another family!"); } else { workerInformation.setWorkerId(workerId); } registerWorker(workerInformation); }
WorkerManager implements IWorkerManager { @Override public void registerWorker(String familyId, String workerId, WorkerBean workerInformation) throws ProcessingBadRequestException, IOException { ParametersChecker.checkParameter("All arguments are required", familyId, workerId, workerInformation); if (!workerInformation.getFamily().equals(familyId)) { throw new ProcessingBadRequestException("Cannot register a worker of another family!"); } else { workerInformation.setWorkerId(workerId); } registerWorker(workerInformation); } }
WorkerManager implements IWorkerManager { @Override public void registerWorker(String familyId, String workerId, WorkerBean workerInformation) throws ProcessingBadRequestException, IOException { ParametersChecker.checkParameter("All arguments are required", familyId, workerId, workerInformation); if (!workerInformation.getFamily().equals(familyId)) { throw new ProcessingBadRequestException("Cannot register a worker of another family!"); } else { workerInformation.setWorkerId(workerId); } registerWorker(workerInformation); } WorkerManager();  WorkerManager(WorkerClientFactory workerClientFactory); }
WorkerManager implements IWorkerManager { @Override public void registerWorker(String familyId, String workerId, WorkerBean workerInformation) throws ProcessingBadRequestException, IOException { ParametersChecker.checkParameter("All arguments are required", familyId, workerId, workerInformation); if (!workerInformation.getFamily().equals(familyId)) { throw new ProcessingBadRequestException("Cannot register a worker of another family!"); } else { workerInformation.setWorkerId(workerId); } registerWorker(workerInformation); } WorkerManager();  WorkerManager(WorkerClientFactory workerClientFactory); @Override synchronized void marshallToDB(); @Override void registerWorker(String familyId, String workerId, WorkerBean workerInformation); @Override void registerWorker(WorkerBean workerBean); @Override void unregisterWorker(String workerFamily, String worker); @Override boolean checkStatusWorker(String serverHost, int serverPort); @Override WorkerFamilyManager findWorkerBy(String workerFamily); @Override File getWorkerDbFile(); }
WorkerManager implements IWorkerManager { @Override public void registerWorker(String familyId, String workerId, WorkerBean workerInformation) throws ProcessingBadRequestException, IOException { ParametersChecker.checkParameter("All arguments are required", familyId, workerId, workerInformation); if (!workerInformation.getFamily().equals(familyId)) { throw new ProcessingBadRequestException("Cannot register a worker of another family!"); } else { workerInformation.setWorkerId(workerId); } registerWorker(workerInformation); } WorkerManager();  WorkerManager(WorkerClientFactory workerClientFactory); @Override synchronized void marshallToDB(); @Override void registerWorker(String familyId, String workerId, WorkerBean workerInformation); @Override void registerWorker(WorkerBean workerBean); @Override void unregisterWorker(String workerFamily, String worker); @Override boolean checkStatusWorker(String serverHost, int serverPort); @Override WorkerFamilyManager findWorkerBy(String workerFamily); @Override File getWorkerDbFile(); static final int QUEUE_SIZE; }