if (continueMaintenance) {
Iterator<String> sequenceKeyIterator = sequences.keySet().iterator();
while (sequenceKeyIterator.hasNext()) {
String key = sequenceKeyIterator.next();
final Sequence sequence = sequences.get(key);
if (shouldRemove(sequence)) {
LOGGER.config(LocalizationMessages.WSRM_1152_REMOVING_SEQUENCE(sequence.getId()));
sequenceKeyIterator.remove();
sequences.getReplicationManager().remove(key);
if (boundSequences.containsKey(sequence.getId())) {
boundSequences.remove(sequence.getId());
}
} else if (shouldTeminate(sequence)) {
LOGGER.config(LocalizationMessages.WSRM_1153_TERMINATING_SEQUENCE(sequence.getId()));
tryTerminateSequence(sequence.getId());
}
}
}
return continueMaintenance;