}
List<ConnBundleTO> connectorBundleTOs = new ArrayList<ConnBundleTO>();
if (bundles != null) {
for (ConnectorInfo bundle : bundles) {
ConnBundleTO connectorBundleTO = new ConnBundleTO();
connectorBundleTO.setDisplayName(bundle.getConnectorDisplayName());
ConnectorKey key = bundle.getConnectorKey();
LOG.debug("\nBundle name: {}" + "\nBundle version: {}" + "\nBundle class: {}", new Object[]{
key.getBundleName(), key.getBundleVersion(), key.getConnectorName()});
connectorBundleTO.setBundleName(key.getBundleName());
connectorBundleTO.setConnectorName(key.getConnectorName());
connectorBundleTO.setVersion(key.getBundleVersion());
ConfigurationProperties properties = bundleManager.getConfigurationProperties(bundle);
for (String propName : properties.getPropertyNames()) {
ConnConfPropSchema connConfPropSchema = new ConnConfPropSchema();
ConfigurationPropertyImpl configurationProperty =
(ConfigurationPropertyImpl) properties.getProperty(propName);
// set name
connConfPropSchema.setName(configurationProperty.getName());
// set display name
connConfPropSchema.setDisplayName(configurationProperty.getDisplayName(propName));
// set help message
connConfPropSchema.setHelpMessage(configurationProperty.getHelpMessage(propName));
// set if mandatory
connConfPropSchema.setRequired(configurationProperty.isRequired());
// set type
connConfPropSchema.setType(configurationProperty.getType().getName());
// set order
connConfPropSchema.setOrder(configurationProperty.getOrder());
// set confidential
connConfPropSchema.setConfidential(configurationProperty.isConfidential());
connectorBundleTO.addProperty(connConfPropSchema);
}
LOG.debug("Bundle properties: {}", connectorBundleTO.getProperties());
connectorBundleTOs.add(connectorBundleTO);
}
}