/** * Enables the worker with the given id, allowing it to take jobs again * * @param id the id of the worker to enable */ @Override public void enableWorker(String id) { workerEnabled.put(id, true); }
/** * Disables the worker with the given id, this means that it will not iterate or take any new jobs * until re enabled * * @param id the id of the worker to disable */ @Override public void disableWorker(String id) { workerEnabled.put(id, false); }
/** * Returns the status of whether the worker is enabled or not * * @param id the id of the worker to test * @return true if the worker is enabled, false otherwise */ @Override public boolean workerEnabled(String id) { return workerEnabled.containsKey(id) && workerEnabled.get(id); }