final MetadataReader metadataReader = metadataReaderFactory.getMetadataReader(resource);
final Class<?> clazz = Class.forName(metadataReader.getClassMetadata().getClassName());
if (clazz.isAnnotationPresent(Component.class)
&& AbstractController.class.isAssignableFrom(clazz)) {
final EventCategoryTO eventCategoryTO = new EventCategoryTO();
eventCategoryTO.setCategory(clazz.getSimpleName());
for (Method method : clazz.getDeclaredMethods()) {
if (Modifier.isPublic(method.getModifiers())) {
eventCategoryTO.getEvents().add(method.getName());
}
}
events.add(eventCategoryTO);
}
}
}
events.add(new EventCategoryTO(EventCategoryType.PROPAGATION));
events.add(new EventCategoryTO(EventCategoryType.SYNCHRONIZATION));
events.add(new EventCategoryTO(EventCategoryType.PUSH));
for (AttributableType attributableType : AttributableType.values()) {
for (ExternalResource resource : resourceDAO.findAll()) {
final EventCategoryTO propEventCategoryTO = new EventCategoryTO(EventCategoryType.PROPAGATION);
final EventCategoryTO syncEventCategoryTO = new EventCategoryTO(EventCategoryType.SYNCHRONIZATION);
final EventCategoryTO pushEventCategoryTO = new EventCategoryTO(EventCategoryType.PUSH);
propEventCategoryTO.setCategory(attributableType.name().toLowerCase());
propEventCategoryTO.setSubcategory(resource.getName());
syncEventCategoryTO.setCategory(attributableType.name().toLowerCase());
pushEventCategoryTO.setCategory(attributableType.name().toLowerCase());
syncEventCategoryTO.setSubcategory(resource.getName());
pushEventCategoryTO.setSubcategory(resource.getName());
for (ResourceOperation resourceOperation : ResourceOperation.values()) {
propEventCategoryTO.getEvents().add(resourceOperation.name().toLowerCase());
syncEventCategoryTO.getEvents().add(resourceOperation.name().toLowerCase());
pushEventCategoryTO.getEvents().add(resourceOperation.name().toLowerCase());
}
events.add(propEventCategoryTO);
events.add(syncEventCategoryTO);
events.add(pushEventCategoryTO);
}
}
for (SchedTask task : taskDAO.findAll(SchedTask.class)) {
final EventCategoryTO eventCategoryTO = new EventCategoryTO(EventCategoryType.TASK);
eventCategoryTO.setCategory(Class.forName(task.getJobClassName()).getSimpleName());
events.add(eventCategoryTO);
}
for (SyncTask task : taskDAO.findAll(SyncTask.class)) {
final EventCategoryTO eventCategoryTO = new EventCategoryTO(EventCategoryType.TASK);
eventCategoryTO.setCategory(Class.forName(task.getJobClassName()).getSimpleName());
events.add(eventCategoryTO);
}
} catch (Exception e) {
LOG.error("Failure retrieving audit/notification events", e);
}