use of io.syndesis.connector.odata.ODataDeleteEntityComponent in project syndesis by syndesisio.
the class ODataDeleteEntityConnectorAutoConfiguration method postConstructODataDeleteEntityComponent.
@PostConstruct
public void postConstructODataDeleteEntityComponent() {
Map<String, Object> parameters = new HashMap<>();
for (Map.Entry<String, ODataDeleteEntityConnectorConfigurationCommon> entry : configuration.getConfigurations().entrySet()) {
parameters.clear();
ODataDeleteEntityComponent connector = new ODataDeleteEntityComponent(entry.getKey());
connector.setCamelContext(camelContext);
try {
IntrospectionSupport.getProperties(entry.getValue(), parameters, null, false);
CamelPropertiesHelper.setCamelProperties(camelContext, connector, parameters, false);
connector.setOptions(parameters);
if (ObjectHelper.isNotEmpty(customizers)) {
for (ConnectorCustomizer<ODataDeleteEntityComponent> customizer : customizers) {
boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator.evaluate(applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.odata-delete-entity." + entry.getKey() + ".customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator.evaluate(applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.odata-delete-entity." + entry.getKey() + ".customizer");
if (useCustomizer) {
LOGGER.debug("Configure connector {}, with customizer {}", connector, customizer);
customizer.customize(connector);
}
}
}
camelContext.addComponent(entry.getKey(), connector);
} catch (Exception e) {
throw new BeanCreationException(entry.getKey(), e.getMessage(), e);
}
}
}
use of io.syndesis.connector.odata.ODataDeleteEntityComponent in project syndesis by syndesisio.
the class ODataDeleteEntityConnectorAutoConfiguration method configureODataDeleteEntityComponent.
@Lazy
@Bean(name = "odata-delete-entity-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean
public ODataDeleteEntityComponent configureODataDeleteEntityComponent() throws Exception {
ODataDeleteEntityComponent connector = new ODataDeleteEntityComponent();
connector.setCamelContext(camelContext);
Map<String, Object> parameters = new HashMap<>();
IntrospectionSupport.getProperties(configuration, parameters, null, false);
CamelPropertiesHelper.setCamelProperties(camelContext, connector, parameters, false);
connector.setOptions(parameters);
if (ObjectHelper.isNotEmpty(customizers)) {
for (ConnectorCustomizer<ODataDeleteEntityComponent> customizer : customizers) {
boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator.evaluate(applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.odata-delete-entity.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator.evaluate(applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.odata-delete-entity.customizer");
if (useCustomizer) {
LOGGER.debug("Configure connector {}, with customizer {}", connector, customizer);
customizer.customize(connector);
}
}
}
return connector;
}
Aggregations