BeanUtils.copyProperties(connInstance, connInstanceTO, IGNORE_PROPERTIES);
final Map<String, ConnConfProperty> connInstanceToConfMap = connInstanceTO.getConfigurationMap();
for (String propName : properties.getPropertyNames()) {
ConfigurationPropertyImpl configurationProperty =
(ConfigurationPropertyImpl) properties.getProperty(propName);
if (!connInstanceToConfMap.containsKey(propName)) {
ConnConfPropSchema connConfPropSchema = new ConnConfPropSchema();
connConfPropSchema.setName(configurationProperty.getName());
connConfPropSchema.setDisplayName(configurationProperty.getDisplayName(propName));
connConfPropSchema.setHelpMessage(configurationProperty.getHelpMessage(propName));
connConfPropSchema.setRequired(configurationProperty.isRequired());
connConfPropSchema.setType(configurationProperty.getType().getName());
connConfPropSchema.setConfidential(configurationProperty.isConfidential());
connConfPropSchema.setOrder(configurationProperty.getOrder());
ConnConfProperty property = new ConnConfProperty();
property.setSchema(connConfPropSchema);
connInstanceTO.addConfiguration(property);
} else {
connInstanceToConfMap.get(propName).getSchema().setDisplayName(
configurationProperty.getDisplayName(propName));
}
}
return connInstanceTO;
}