use of org.identityconnectors.framework.api.ConnectorInfoManagerFactory in project CzechIdMng by bcvsolutions.
the class ConnIdIcConfigurationService method findAllLocalConnectorManagers.
private List<ConnectorInfoManager> findAllLocalConnectorManagers() {
if (managers == null) {
managers = new ArrayList<>();
List<Class<?>> annotated = new ArrayList<>();
// Find all class with annotation IcConnectorClass under specific
// packages
localConnectorsPackages.forEach(packageWithConnectors -> {
Reflections reflections = new Reflections(packageWithConnectors);
annotated.addAll(reflections.getTypesAnnotatedWith(ConnectorClass.class));
});
LOG.info(MessageFormat.format("Found annotated classes with IcConnectorClass [{0}]", annotated));
for (Class<?> clazz : annotated) {
URL url = clazz.getProtectionDomain().getCodeSource().getLocation();
ConnectorInfoManagerFactory fact = ConnectorInfoManagerFactory.getInstance();
ConnectorInfoManager manager = fact.getLocalManager(url);
managers.add(manager);
}
LOG.info(MessageFormat.format("Found all local connector managers [{0}]", managers.toString()));
}
return managers;
}
Aggregations