List of usage examples for org.apache.commons.collections4 MultiValuedMap removeMapping
boolean removeMapping(Object key, Object item);
From source file:com.evolveum.midpoint.task.quartzimpl.work.workers.WorkersManager.java
/** * The easiest step: we just match current workers with the 'should be' state. Matching items are deleted from both sides. *//* w w w . j ava 2s . c o m*/ private int matchWorkers(List<Task> currentWorkers, MultiValuedMap<String, WorkerKey> shouldBeWorkers) { int count = 0; for (Task currentWorker : new ArrayList<>(currentWorkers)) { WorkerKey currentWorkerKey = new WorkerKey(currentWorker); if (shouldBeWorkers.containsValue(currentWorkerKey)) { shouldBeWorkers.removeMapping(currentWorkerKey.group, currentWorkerKey); currentWorkers.remove(currentWorker); count++; } } LOGGER.trace("After matchWorkers (result: {}):\nCurrent workers: {}\nShould be workers: {}", count, currentWorkers, shouldBeWorkers); return count; }