@Override public ConnectorInfo findConnectorInfo(final ConnectorKey key) { for (ConnectorInfo info : connectorInfos) { if (info.getConnectorKey().equals(key)) { return info; } } return null; }
}).forEachOrdered(entry -> { entry.getValue().getConnectorInfos().forEach(connInfo -> { LOG.debug("\t{}", connInfo.getConnectorDisplayName()); }); });
public static APIConfiguration getDefaultConfigurationProperties(DataProvider dataProvider, ConnectorInfoManager manager) throws ObjectNotFoundException { String bundleName = (String) dataProvider.getTestSuiteAttribute("bundleName"); String bundleVersion = (String) dataProvider.getTestSuiteAttribute("bundleVersion"); String connectorName = (String) dataProvider.getTestSuiteAttribute("connectorName"); ConnectorKey key = new ConnectorKey(bundleName, bundleVersion, connectorName); ConnectorInfo info = manager.findConnectorInfo(key); final String MSG = "Connector info wasn't found. Check values of bundleName, bundleVersion and connectorName properties." + "\nbundleName:%s\nbundleVersion:%s\nconnectorName:%s"; Assert.assertNotNull(String.format(MSG, bundleName, bundleVersion, connectorName), info); APIConfiguration apiConfig = info.createDefaultAPIConfiguration(); return apiConfig; }
@PreAuthorize("hasRole('" + StandardEntitlement.CONNECTOR_READ + "')") @Transactional(readOnly = true) public List<ConnBundleTO> getBundles(final String lang) { if (StringUtils.isBlank(lang)) { CurrentLocale.set(Locale.ENGLISH); } else { CurrentLocale.set(new Locale(lang)); } List<ConnBundleTO> connectorBundleTOs = new ArrayList<>(); connIdBundleManager.getConnInfoManagers().forEach((uri, cim) -> { connectorBundleTOs.addAll(cim.getConnectorInfos().stream().map(bundle -> { ConnBundleTO connBundleTO = new ConnBundleTO(); connBundleTO.setDisplayName(bundle.getConnectorDisplayName()); connBundleTO.setLocation(uri.toString()); ConnectorKey key = bundle.getConnectorKey(); connBundleTO.setBundleName(key.getBundleName()); connBundleTO.setConnectorName(key.getConnectorName()); connBundleTO.setVersion(key.getBundleVersion()); ConfigurationProperties properties = connIdBundleManager.getConfigurationProperties(bundle); connBundleTO.getProperties().addAll(properties.getPropertyNames().stream(). map(propName -> binder.build(properties.getProperty(propName))).collect(Collectors.toList())); return connBundleTO; }).collect(Collectors.toList())); }); return connectorBundleTOs; }
public static APIConfiguration getDefaultConfigurationProperties(DataProvider dataProvider, ConnectorInfoManager manager) throws ObjectNotFoundException { String bundleName = (String) dataProvider.getTestSuiteAttribute("bundleName"); String bundleVersion = (String) dataProvider.getTestSuiteAttribute("bundleVersion"); String connectorName = (String) dataProvider.getTestSuiteAttribute("connectorName"); ConnectorKey key = new ConnectorKey(bundleName, bundleVersion, connectorName); ConnectorInfo info = manager.findConnectorInfo(key); final String MSG = "Connector info wasn't found. Check values of bundleName, bundleVersion and connectorName properties." + "\nbundleName:%s\nbundleVersion:%s\nconnectorName:%s"; assertNotNull(String.format(MSG, bundleName, bundleVersion, connectorName), info); APIConfiguration apiConfig = info.createDefaultAPIConfiguration(); return apiConfig; }
public ConnectorInfo findConnectorInfo(ConnectorKey key) { for (ConnectorInfo info : _connectorInfo) { if ( info.getConnectorKey().equals(key) ) { return info; } } return null; }
public static APIConfiguration getDefaultConfigurationProperties(DataProvider dataProvider, ConnectorInfoManager manager) throws ObjectNotFoundException { String bundleName = (String) dataProvider.getTestSuiteAttribute("bundleName"); String bundleVersion = (String) dataProvider.getTestSuiteAttribute("bundleVersion"); String connectorName = (String) dataProvider.getTestSuiteAttribute("connectorName"); ConnectorKey key = new ConnectorKey(bundleName, bundleVersion, connectorName); ConnectorInfo info = manager.findConnectorInfo(key); final String MSG = "Connector info wasn't found. Check values of bundleName, bundleVersion and connectorName properties." + "\nbundleName:%s\nbundleVersion:%s\nconnectorName:%s"; assertNotNull(info, String.format(MSG, bundleName, bundleVersion, connectorName)); APIConfiguration apiConfig = info.createDefaultAPIConfiguration(); return apiConfig; }
@Override public ConnectorInfo findConnectorInfo(final ConnectorKey key) { for (ConnectorInfo info : connectorInfos) { if (info.getConnectorKey().equals(key)) { return info; } } return null; }
@Override public ConfigurationProperties getConfigurationProperties(final ConnectorInfo info) { if (info == null) { throw new NotFoundException("Invalid: connector info is null"); } // create default configuration APIConfiguration apiConfig = info.createDefaultAPIConfiguration(); // retrieve the ConfigurationProperties. ConfigurationProperties properties = apiConfig.getConfigurationProperties(); if (properties == null) { throw new NotFoundException("Configuration properties"); } if (LOG.isDebugEnabled()) { properties.getPropertyNames().forEach(propName -> { LOG.debug("Property Name: {}" + "\nProperty Type: {}", properties.getProperty(propName).getName(), properties.getProperty(propName).getType()); }); } return properties; } }
@Override public ConnectorInfo findConnectorInfo(final ConnectorKey key) { for (ConnectorInfo info : _connectorInfo) { if (info.getConnectorKey().equals(key)) { return info; } } return null; }
throws SchemaException, ConfigurationException { APIConfiguration apiConfig = cinfo.createDefaultAPIConfiguration(); ConfigurationProperties configProps = apiConfig.getConfigurationProperties();
@Override public ConnectorInfo findConnectorInfo(ConnectorKey key) { for (Pair<Bundle, List<ConnectorInfo>> bundle : connectorInfoCache.values()) { for (ConnectorInfo info : bundle.second) { if (info.getConnectorKey().equals(key)) { return info; } } } return null; }
APIConfiguration apiConfig = info.createDefaultAPIConfiguration(); if (connInstance.getDisplayName() != null) { apiConfig.setInstanceName(connInstance.getDisplayName());
private String getConnctorDesc(ConnectorInfo connectorInfo) { return connectorInfo.getConnectorKey().getConnectorName(); }
private PrismSchema generateConnectorConfigurationSchema(ConnectorInfo cinfo, ConnectorType connectorType) { APIConfiguration defaultAPIConfiguration = cinfo.createDefaultAPIConfiguration(); ConfigurationProperties icfConfigurationProperties = defaultAPIConfiguration .getConfigurationProperties();
/** * {@inheritDoc} */ @Override public void addConnectorEventHandler(ConnectorEventHandler hook) { if (hook == null) { throw new NullPointerException(); } if (!eventHandlers.contains(hook)) { if (null != connectorInfoList) { connectorInfoList.forEach((connectorInfo) -> { hook.handleEvent(new ConnectorEvent(ConnectorEvent.CONNECTOR_REGISTERED, connectorInfo.getConnectorKey())); }); } eventHandlers.add(hook); } }
@Override public void removingEntries(Bundle bundle, List<ManifestEntry> list) { NullArgumentException.validateNotNull(bundle, "Bundle"); synchronized (connectorInfoCache) { Pair<Bundle, List<ConnectorInfo>> info = connectorInfoCache.remove(bundle.getSymbolicName()); if (null != info) { info.second.forEach((connectorInfo) -> { notifyListeners(buildEvent( ConnectorEvent.CONNECTOR_UNREGISTERING, info.first, connectorInfo.getConnectorKey())); }); } } LOG.info("Remove Connector {}, list: {}", bundle.getSymbolicName(), list); }
/** * {@inheritDoc} */ @Override public void addConnectorEventHandler(ConnectorEventHandler hook) { if (hook == null) { throw new NullPointerException(); } if (!eventHandlers.contains(hook)) { if (null != connectorInfoList) { connectorInfoList.forEach((connectorInfo) -> { hook.handleEvent(new ConnectorEvent(ConnectorEvent.CONNECTOR_REGISTERED, connectorInfo.getConnectorKey())); }); } eventHandlers.add(hook); } }
@Override public ConnectorInfo findConnectorInfo(ConnectorKey key) { for (ConnectorInfo info : getConnectorInfos()) { if (info.getConnectorKey().equals(key)) { return info; } } return null; }
@Override public ConnectorInfo findConnectorInfo(ConnectorKey key) { for (ConnectorInfo info : getConnectorInfos()) { if (info.getConnectorKey().equals(key)) { return info; } } return null; }