connInstance.getBundleName(), connInstance.getVersion(), connInstance.getConnectorName());
// create default configuration
APIConfiguration apiConfig = info.createDefaultAPIConfiguration();
if (apiConfig == null) {
throw new NotFoundException("Default API configuration");
}
// retrieve the ConfigurationProperties
final ConfigurationProperties properties = apiConfig.getConfigurationProperties();
if (properties == null) {
throw new NotFoundException("Configuration properties");
}
// set all of the ConfigurationProperties needed by the connector.
for (ConnConfProperty property : connInstance.getConfiguration()) {
if (property.getValues() != null && !property.getValues().isEmpty()) {
properties.setPropertyValue(property.getSchema().getName(),
getPropertyValue(property.getSchema().getType(), property.getValues()));
}
}
// use the ConnectorFacadeFactory's newInstance() method to get a new connector.
connector = ConnectorFacadeFactory.getInstance().newInstance(apiConfig);
if (connector == null) {
throw new NotFoundException("Connector");
}
// make sure we have set up the Configuration properly
connector.validate();
}