use of org.apache.camel.spi.HasId in project syndesis by syndesisio.
the class SwaggerConnectorConnectorAutoConfiguration method postConstructSwaggerConnectorComponent.
@PostConstruct
public void postConstructSwaggerConnectorComponent() {
Map<String, Object> parameters = new HashMap<>();
for (Map.Entry<String, SwaggerConnectorConnectorConfigurationCommon> entry : configuration.getConfigurations().entrySet()) {
parameters.clear();
SwaggerConnectorComponent connector = new SwaggerConnectorComponent(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<SwaggerConnectorComponent> customizer : customizers) {
boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator.evaluate(applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.swagger-operation." + entry.getKey() + ".customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator.evaluate(applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.swagger-operation." + 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 org.apache.camel.spi.HasId in project syndesis by syndesisio.
the class ODataCreateEntityConnectorAutoConfiguration method postConstructODataCreateEntityComponent.
@PostConstruct
public void postConstructODataCreateEntityComponent() {
Map<String, Object> parameters = new HashMap<>();
for (Map.Entry<String, ODataCreateEntityConnectorConfigurationCommon> entry : configuration.getConfigurations().entrySet()) {
parameters.clear();
ODataCreateEntityComponent connector = new ODataCreateEntityComponent(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<ODataCreateEntityComponent> customizer : customizers) {
boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator.evaluate(applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.odata-create-entity." + entry.getKey() + ".customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator.evaluate(applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.odata-create-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 org.apache.camel.spi.HasId in project syndesis by syndesisio.
the class ODataCreateEntityConnectorAutoConfiguration method configureODataCreateEntityComponent.
@Lazy
@Bean(name = "odata-create-entity-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean
public ODataCreateEntityComponent configureODataCreateEntityComponent() throws Exception {
ODataCreateEntityComponent connector = new ODataCreateEntityComponent();
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<ODataCreateEntityComponent> customizer : customizers) {
boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator.evaluate(applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.odata-create-entity.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator.evaluate(applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.odata-create-entity.customizer");
if (useCustomizer) {
LOGGER.debug("Configure connector {}, with customizer {}", connector, customizer);
customizer.customize(connector);
}
}
}
return connector;
}
use of org.apache.camel.spi.HasId 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 org.apache.camel.spi.HasId in project syndesis by syndesisio.
the class ODataRetrieveEntityConnectorAutoConfiguration method configureODataRetrieveEntityComponent.
@Lazy
@Bean(name = "odata-retrieve-entity-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean
public ODataRetrieveEntityComponent configureODataRetrieveEntityComponent() throws Exception {
ODataRetrieveEntityComponent connector = new ODataRetrieveEntityComponent();
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<ODataRetrieveEntityComponent> customizer : customizers) {
boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator.evaluate(applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.odata-retrieve-entity.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator.evaluate(applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.odata-retrieve-entity.customizer");
if (useCustomizer) {
LOGGER.debug("Configure connector {}, with customizer {}", connector, customizer);
customizer.customize(connector);
}
}
}
return connector;
}
Aggregations