for (String toBeRemoved : eventSelectionChanged.getToBeRemoved()) {
if (events.contains(toBeRemoved)) {
final Map.Entry<EventCategoryTO, Result> eventCategory =
LoggerEventUtils.parseEventCategory(toBeRemoved);
final AuditLoggerName auditLoggerName = new AuditLoggerName(
eventCategory.getKey().getType(),
eventCategory.getKey().getCategory(),
eventCategory.getKey().getSubcategory(),
CollectionUtils.isEmpty(eventCategory.getKey().getEvents())
? null : eventCategory.getKey().getEvents().iterator().next(),
eventCategory.getValue());
loggerRestClient.disableAudit(auditLoggerName);
events.remove(toBeRemoved);
}
}
for (String toBeAdded : eventSelectionChanged.getToBeAdded()) {
if (!events.contains(toBeAdded)) {
final Map.Entry<EventCategoryTO, Result> eventCategory =
LoggerEventUtils.parseEventCategory(toBeAdded);
final AuditLoggerName auditLoggerName = new AuditLoggerName(
eventCategory.getKey().getType(),
eventCategory.getKey().getCategory(),
eventCategory.getKey().getSubcategory(),
CollectionUtils.isEmpty(eventCategory.getKey().getEvents())
? null : eventCategory.getKey().getEvents().iterator().next(),