}).forEachOrdered(entry -> { entry.getValue().getConnectorInfos().forEach(connInfo -> { LOG.debug("\t{}", connInfo.getConnectorDisplayName()); }); });
@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; }