public List<String> getObjectClasses(final String connectorKey) { List<String> result = new ArrayList<>(); ConnectorService service = getService(ConnectorService.class); ConnInstanceTO connInstance = service.read(connectorKey, SyncopeConsoleSession.get().getLocale().getLanguage()); if (connInstance != null) { result.addAll(service.buildObjectClassInfo(connInstance, true).stream(). map(input -> input.getType()).collect(Collectors.toList())); } return result; }
public List<ConnBundleTO> getAllBundles() { List<ConnBundleTO> bundles = Collections.<ConnBundleTO>emptyList(); try { bundles = getService(ConnectorService.class).getBundles(SyncopeConsoleSession.get().getLocale().toString()); } catch (SyncopeClientException e) { LOG.error("While getting connector bundles", e); } return bundles; }
public void reload() { getService(ConnectorService.class).reload(); } }
public List<ConnIdObjectClassTO> buildObjectClassInfo( final ConnInstanceTO connInstanceTO, final boolean includeSpecial) { List<ConnIdObjectClassTO> result = Collections.emptyList(); try { result = getService(ConnectorService.class).buildObjectClassInfo(connInstanceTO, includeSpecial); } catch (Exception e) { LOG.error("While getting supported object classes", e); } return result; }
public List<ConnInstanceTO> getAllConnectors() { List<ConnInstanceTO> connectors = Collections.<ConnInstanceTO>emptyList(); try { connectors = getService(ConnectorService.class).list(SyncopeConsoleSession.get().getLocale().toString()); } catch (Exception e) { LOG.error("While reading connectors", e); } return connectors; }
/** * Load an already existent connector by its name. * * @param key the id * @return ConnInstanceTO */ public ConnInstanceTO read(final String key) { ConnInstanceTO connectorTO = null; try { connectorTO = getService(ConnectorService.class). read(key, SyncopeConsoleSession.get().getLocale().toString()); } catch (SyncopeClientException e) { LOG.error("While reading a connector", e); } return connectorTO; }
public Pair<Boolean, String> check(final ConnInstanceTO connectorTO) { ConnInstanceTO toBeChecked = new ConnInstanceTO(); BeanUtils.copyProperties(connectorTO, toBeChecked, new String[] { "configuration", "configurationMap" }); toBeChecked.getConf().addAll(filterProperties(connectorTO.getConf())); boolean check = false; String errorMessage = null; try { getService(ConnectorService.class).check(toBeChecked); check = true; } catch (Exception e) { LOG.error("While checking {}", toBeChecked, e); errorMessage = e.getMessage(); } return Pair.of(check, errorMessage); }
public void update(final ConnInstanceTO connectorTO) { List<ConnConfProperty> filteredConf = filterProperties(connectorTO.getConf()); connectorTO.getConf().clear(); connectorTO.getConf().addAll(filteredConf); getService(ConnectorService.class).update(connectorTO); }
public ConnInstanceTO create(final ConnInstanceTO connectorTO) { List<ConnConfProperty> filteredConf = filterProperties(connectorTO.getConf()); connectorTO.getConf().clear(); connectorTO.getConf().addAll(filteredConf); ConnectorService service = getService(ConnectorService.class); Response response = service.create(connectorTO); return getObject(service, response.getLocation(), ConnInstanceTO.class); }