Map<String, Object> determineHeaders(final Map<String, Object> parameters) { final Map<String, Object> headers = new HashMap<>(); final ClassInfo classInfo = IntrospectionSupport.cacheClass(RestSwaggerEndpoint.class); final Set<String> knownParameters = Arrays.stream(classInfo.methods).map(i -> i.getterOrSetterShorthandName) .filter(Objects::nonNull).collect(Collectors.toSet()); for (final Iterator<Entry<String, Object>> i = parameters.entrySet().iterator(); i.hasNext();) { final Entry<String, Object> entry = i.next(); final String name = entry.getKey(); if (!knownParameters.contains(name)) { headers.put(name, entry.getValue()); i.remove(); } } addAuthenticationHeadersTo(headers); return headers; }
@Test public void shouldPassSpecificationToRestSwaggerComponent() throws Exception { final Component component = camelContext.getComponent("swagger-operation"); assertThat(component).isNotNull(); final String specification = IOUtils.toString(SwaggerConnectorComponentTest.class.getResource("/petstore.json"), StandardCharsets.UTF_8); IntrospectionSupport.setProperties(component, new HashMap<>(Collections.singletonMap("specification", specification))); final Endpoint endpoint = component.createEndpoint("swagger-operation://?operationId=addPet"); assertThat(endpoint).isNotNull(); final Optional<RestSwaggerEndpoint> maybeRestSwagger = camelContext.getEndpoints().stream() .filter(RestSwaggerEndpoint.class::isInstance).map(RestSwaggerEndpoint.class::cast).findFirst(); assertThat(maybeRestSwagger).hasValueSatisfying(restSwagger -> { assertThat(restSwagger.getSpecificationUri()).isNotNull(); assertThat(restSwagger.getOperationId()).isEqualTo("addPet"); }); }
@Lazy @Bean(name = "trade-insight-top-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean public TradeInsightTopComponent configureTradeInsightTopComponent() throws Exception { TradeInsightTopComponent connector = new TradeInsightTopComponent(); 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<TradeInsightTopComponent> customizer : customizers) { boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.trade-insight-top.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.trade-insight-top.customizer"); if (useCustomizer) { LOGGER.debug("Configure connector {}, with customizer {}", connector, customizer); customizer.customize(connector); } } } return connector; }
@Lazy @Bean(name = "salesforce-update-sobject-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean public SalesforceUpdateSObjectComponent configureSalesforceUpdateSObjectComponent() throws Exception { SalesforceUpdateSObjectComponent connector = new SalesforceUpdateSObjectComponent(); 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<SalesforceUpdateSObjectComponent> customizer : customizers) { boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator .evaluate( applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.salesforce-update-sobject.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator .evaluate(applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.salesforce-update-sobject.customizer"); if (useCustomizer) { LOGGER.debug("Configure connector {}, with customizer {}", connector, customizer); customizer.customize(connector); } } } return connector; }
@Lazy @Bean(name = "trade-insight-buy-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean public TradeInsightBuyComponent configureTradeInsightBuyComponent() throws Exception { TradeInsightBuyComponent connector = new TradeInsightBuyComponent(); 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<TradeInsightBuyComponent> customizer : customizers) { boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.trade-insight-buy.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.trade-insight-buy.customizer"); if (useCustomizer) { LOGGER.debug("Configure connector {}, with customizer {}", connector, customizer); customizer.customize(connector); } } } return connector; }
@Lazy @Bean(name = "day-trade-place-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean public DayTradePlaceComponent configureDayTradePlaceComponent() throws Exception { DayTradePlaceComponent connector = new DayTradePlaceComponent(); 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<DayTradePlaceComponent> customizer : customizers) { boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.day-trade-place.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.day-trade-place.customizer"); if (useCustomizer) { LOGGER.debug("Configure connector {}, with customizer {}", connector, customizer); customizer.customize(connector); } } } return connector; }
@Lazy @Bean(name = "day-trade-get-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean public DayTradeGetComponent configureDayTradeGetComponent() throws Exception { DayTradeGetComponent connector = new DayTradeGetComponent(); 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<DayTradeGetComponent> customizer : customizers) { boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.day-trade-get.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.day-trade-get.customizer"); if (useCustomizer) { LOGGER.debug("Configure connector {}, with customizer {}", connector, customizer); customizer.customize(connector); } } } return connector; }
@Lazy @Bean(name = "swagger-operation-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean public SwaggerConnectorComponent configureSwaggerConnectorComponent() throws Exception { SwaggerConnectorComponent connector = new SwaggerConnectorComponent(); 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<SwaggerConnectorComponent> customizer : customizers) { boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.swagger-operation.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.swagger-operation.customizer"); if (useCustomizer) { LOGGER.debug("Configure connector {}, with customizer {}", connector, customizer); customizer.customize(connector); } } } return connector; }
@Lazy @Bean(name = "http-get-connector-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean public HttpGetComponent configureHttpGetComponent() throws Exception { HttpGetComponent connector = new HttpGetComponent(); 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<HttpGetComponent> customizer : customizers) { boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator .evaluate( applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.http-get-connector.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator .evaluate(applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.http-get-connector.customizer"); if (useCustomizer) { LOGGER.debug("Configure connector {}, with customizer {}", connector, customizer); customizer.customize(connector); } } } return connector; }
@Lazy @Bean(name = "activemq-subscribe-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean public ActiveMQSubscribeComponent configureActiveMQSubscribeComponent() throws Exception { ActiveMQSubscribeComponent connector = new ActiveMQSubscribeComponent(); 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<ActiveMQSubscribeComponent> customizer : customizers) { boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator .evaluate( applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.activemq-subscribe.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator .evaluate(applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.activemq-subscribe.customizer"); if (useCustomizer) { LOGGER.debug("Configure connector {}, with customizer {}", connector, customizer); customizer.customize(connector); } } } return connector; }
@Lazy @Bean(name = "activemq-publish-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean public ActiveMQPublishComponent configureActiveMQPublishComponent() throws Exception { ActiveMQPublishComponent connector = new ActiveMQPublishComponent(); 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<ActiveMQPublishComponent> customizer : customizers) { boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.activemq-publish.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.activemq-publish.customizer"); if (useCustomizer) { LOGGER.debug("Configure connector {}, with customizer {}", connector, customizer); customizer.customize(connector); } } } return connector; }
@Lazy @Bean(name = "salesforce-on-update-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean public SalesforceOnUpdateComponent configureSalesforceOnUpdateComponent() throws Exception { SalesforceOnUpdateComponent connector = new SalesforceOnUpdateComponent(); 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<SalesforceOnUpdateComponent> customizer : customizers) { boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator .evaluate( applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.salesforce-on-update.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator .evaluate(applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.salesforce-on-update.customizer"); if (useCustomizer) { LOGGER.debug("Configure connector {}, with customizer {}", connector, customizer); customizer.customize(connector); } } } return connector; }
@Lazy @Bean(name = "sql-connector-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean public SqlConnectorComponent configureSqlConnectorComponent() throws Exception { SqlConnectorComponent connector = new SqlConnectorComponent(); 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<SqlConnectorComponent> customizer : customizers) { boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.sql-connector.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator.evaluate( applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.sql-connector.customizer"); if (useCustomizer) { LOGGER.debug("Configure connector {}, with customizer {}", connector, customizer); customizer.customize(connector); } } } return connector; }
@Lazy @Bean(name = "sql-stored-connector-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean public SqlStoredConnectorComponent configureSqlStoredConnectorComponent() throws Exception { SqlStoredConnectorComponent connector = new SqlStoredConnectorComponent(); 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<SqlStoredConnectorComponent> customizer : customizers) { boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator .evaluate( applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.sql-stored-connector.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator .evaluate(applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.sql-stored-connector.customizer"); if (useCustomizer) { LOGGER.debug("Configure connector {}, with customizer {}", connector, customizer); customizer.customize(connector); } } } return connector; }
@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; }
@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; }
@Lazy @Bean(name = "odata-replace-entity-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean public ODataReplaceEntityComponent configureODataReplaceEntityComponent() throws Exception { ODataReplaceEntityComponent connector = new ODataReplaceEntityComponent(); 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<ODataReplaceEntityComponent> customizer : customizers) { boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator .evaluate( applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.odata-replace-entity.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator .evaluate(applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.odata-replace-entity.customizer"); if (useCustomizer) { LOGGER.debug("Configure connector {}, with customizer {}", connector, customizer); customizer.customize(connector); } } } return connector; }
@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; }
@Lazy @Bean(name = "odata-update-entity-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean public ODataUpdateEntityComponent configureODataUpdateEntityComponent() throws Exception { ODataUpdateEntityComponent connector = new ODataUpdateEntityComponent(); 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<ODataUpdateEntityComponent> customizer : customizers) { boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator .evaluate( applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.odata-update-entity.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator .evaluate(applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.odata-update-entity.customizer"); if (useCustomizer) { LOGGER.debug("Configure connector {}, with customizer {}", connector, customizer); customizer.customize(connector); } } } return connector; }
@Lazy @Bean(name = "salesforce-create-sobject-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean public SalesforceCreateSObjectComponent configureSalesforceCreateSObjectComponent() throws Exception { SalesforceCreateSObjectComponent connector = new SalesforceCreateSObjectComponent(); 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<SalesforceCreateSObjectComponent> customizer : customizers) { boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator .evaluate( applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.salesforce-create-sobject.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator .evaluate(applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.salesforce-create-sobject.customizer"); if (useCustomizer) { LOGGER.debug("Configure connector {}, with customizer {}", connector, customizer); customizer.customize(connector); } } } return connector; }
@Lazy @Bean(name = "salesforce-delete-sobject-with-id-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean public SalesforceDeleteSObjectWithIdComponent configureSalesforceDeleteSObjectWithIdComponent() throws Exception { SalesforceDeleteSObjectWithIdComponent connector = new SalesforceDeleteSObjectWithIdComponent(); 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<SalesforceDeleteSObjectWithIdComponent> customizer : customizers) { boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator .evaluate( applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.salesforce-delete-sobject-with-id.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator .evaluate(applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.salesforce-delete-sobject-with-id.customizer"); if (useCustomizer) { LOGGER.debug("Configure connector {}, with customizer {}", connector, customizer); customizer.customize(connector); } } } return connector; }
@Lazy @Bean(name = "http-post-connector-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean public HttpPostComponent configureHttpPostComponent() throws Exception { HttpPostComponent connector = new HttpPostComponent(); 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<HttpPostComponent> customizer : customizers) { boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator .evaluate( applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.http-post-connector.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator .evaluate(applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.http-post-connector.customizer"); if (useCustomizer) { LOGGER.debug("Configure connector {}, with customizer {}", connector, customizer); customizer.customize(connector); } } } return connector; }
@Lazy @Bean(name = "salesforce-get-sobject-with-id-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean public SalesforceGetSObjectWithIdComponent configureSalesforceGetSObjectWithIdComponent() throws Exception { SalesforceGetSObjectWithIdComponent connector = new SalesforceGetSObjectWithIdComponent(); 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<SalesforceGetSObjectWithIdComponent> customizer : customizers) { boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator .evaluate( applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.salesforce-get-sobject-with-id.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator .evaluate(applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.salesforce-get-sobject-with-id.customizer"); if (useCustomizer) { LOGGER.debug("Configure connector {}, with customizer {}", connector, customizer); customizer.customize(connector); } } } return connector; }
@Lazy @Bean(name = "salesforce-get-sobject-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean public SalesforceGetSObjectComponent configureSalesforceGetSObjectComponent() throws Exception { SalesforceGetSObjectComponent connector = new SalesforceGetSObjectComponent(); 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<SalesforceGetSObjectComponent> customizer : customizers) { boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator .evaluate( applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.salesforce-get-sobject.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator .evaluate(applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.salesforce-get-sobject.customizer"); if (useCustomizer) { LOGGER.debug("Configure connector {}, with customizer {}", connector, customizer); customizer.customize(connector); } } } return connector; }
@Lazy @Bean(name = "salesforce-on-delete-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean public SalesforceOnDeleteComponent configureSalesforceOnDeleteComponent() throws Exception { SalesforceOnDeleteComponent connector = new SalesforceOnDeleteComponent(); 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<SalesforceOnDeleteComponent> customizer : customizers) { boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator .evaluate( applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.salesforce-on-delete.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator .evaluate(applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.salesforce-on-delete.customizer"); if (useCustomizer) { LOGGER.debug("Configure connector {}, with customizer {}", connector, customizer); customizer.customize(connector); } } } return connector; }
@Lazy @Bean(name = "salesforce-upsert-sobject-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean public SalesforceUpsertSObjectComponent configureSalesforceUpsertSObjectComponent() throws Exception { SalesforceUpsertSObjectComponent connector = new SalesforceUpsertSObjectComponent(); 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<SalesforceUpsertSObjectComponent> customizer : customizers) { boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator .evaluate( applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.salesforce-upsert-sobject.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator .evaluate(applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.salesforce-upsert-sobject.customizer"); if (useCustomizer) { LOGGER.debug("Configure connector {}, with customizer {}", connector, customizer); customizer.customize(connector); } } } return connector; }
@Lazy @Bean(name = "salesforce-on-create-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean public SalesforceOnCreateComponent configureSalesforceOnCreateComponent() throws Exception { SalesforceOnCreateComponent connector = new SalesforceOnCreateComponent(); 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<SalesforceOnCreateComponent> customizer : customizers) { boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator .evaluate( applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.salesforce-on-create.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator .evaluate(applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.salesforce-on-create.customizer"); if (useCustomizer) { LOGGER.debug("Configure connector {}, with customizer {}", connector, customizer); customizer.customize(connector); } } } return connector; }
@Lazy @Bean(name = "syndesis-http-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(HttpComponent.class) public HttpComponent configureHttpComponent(CamelContext camelContext, HttpComponentConfiguration configuration) throws Exception { HttpComponent component = new HttpComponent(); component.setCamelContext(camelContext); Map<String, Object> parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); for (Map.Entry<String, Object> entry : parameters.entrySet()) { Object value = entry.getValue(); Class<?> paramClass = value.getClass(); if (paramClass.getName().endsWith("NestedConfiguration")) { Class<?> nestedClass = null; try { nestedClass = (Class<?>) paramClass.getDeclaredField( "CAMEL_NESTED_CLASS").get(null); HashMap<String, Object> nestedParameters = new HashMap<>(); IntrospectionSupport.getProperties(value, nestedParameters, null, false); Object nestedProperty = nestedClass.newInstance(); IntrospectionSupport.setProperties(camelContext, camelContext.getTypeConverter(), nestedProperty, nestedParameters); entry.setValue(nestedProperty); } catch (NoSuchFieldException e) { } } } IntrospectionSupport.setProperties(camelContext, camelContext.getTypeConverter(), component, parameters); return component; }
@Lazy @Bean(name = "activemq-publish-text-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean public ActiveMQPublishTextComponent configureActiveMQPublishTextComponent() throws Exception { ActiveMQPublishTextComponent connector = new ActiveMQPublishTextComponent(); 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<ActiveMQPublishTextComponent> customizer : customizers) { boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator .evaluate( applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.activemq-publish-text.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator .evaluate(applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.activemq-publish-text.customizer"); if (useCustomizer) { LOGGER.debug("Configure connector {}, with customizer {}", connector, customizer); customizer.customize(connector); } } } return connector; }
@Lazy @Bean(name = "activemq-request-bytes-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean public ActiveMQRequestBytesComponent configureActiveMQRequestBytesComponent() throws Exception { ActiveMQRequestBytesComponent connector = new ActiveMQRequestBytesComponent(); 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<ActiveMQRequestBytesComponent> customizer : customizers) { boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator .evaluate( applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.activemq-request-bytes.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator .evaluate(applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.activemq-request-bytes.customizer"); if (useCustomizer) { LOGGER.debug("Configure connector {}, with customizer {}", connector, customizer); customizer.customize(connector); } } } return connector; }
@Lazy @Bean(name = "activemq-respond-bytes-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean public ActiveMQRespondBytesComponent configureActiveMQRespondBytesComponent() throws Exception { ActiveMQRespondBytesComponent connector = new ActiveMQRespondBytesComponent(); 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<ActiveMQRespondBytesComponent> customizer : customizers) { boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator .evaluate( applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.activemq-respond-bytes.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator .evaluate(applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.activemq-respond-bytes.customizer"); if (useCustomizer) { LOGGER.debug("Configure connector {}, with customizer {}", connector, customizer); customizer.customize(connector); } } } return connector; }
@Lazy @Bean(name = "salesforce-upsert-contact-connector-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean public SalesforceUpsertContactComponent configureSalesforceUpsertContactComponent() throws Exception { SalesforceUpsertContactComponent connector = new SalesforceUpsertContactComponent(); 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<SalesforceUpsertContactComponent> customizer : customizers) { boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator .evaluate( applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.salesforce-upsert-contact-connector.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator .evaluate(applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.salesforce-upsert-contact-connector.customizer"); if (useCustomizer) { LOGGER.debug("Configure connector {}, with customizer {}", connector, customizer); customizer.customize(connector); } } } return connector; }
@Lazy @Bean(name = "activemq-subscribe-map-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean public ActiveMQSubscribeMapComponent configureActiveMQSubscribeMapComponent() throws Exception { ActiveMQSubscribeMapComponent connector = new ActiveMQSubscribeMapComponent(); 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<ActiveMQSubscribeMapComponent> customizer : customizers) { boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator .evaluate( applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.activemq-subscribe-map.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator .evaluate(applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.activemq-subscribe-map.customizer"); if (useCustomizer) { LOGGER.debug("Configure connector {}, with customizer {}", connector, customizer); customizer.customize(connector); } } } return connector; }
@Lazy @Bean(name = "activemq-publish-bytes-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean public ActiveMQPublishBytesComponent configureActiveMQPublishBytesComponent() throws Exception { ActiveMQPublishBytesComponent connector = new ActiveMQPublishBytesComponent(); 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<ActiveMQPublishBytesComponent> customizer : customizers) { boolean useCustomizer = (customizer instanceof HasId) ? HierarchicalPropertiesEvaluator .evaluate( applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.activemq-publish-bytes.customizer", ((HasId) customizer).getId()) : HierarchicalPropertiesEvaluator .evaluate(applicationContext.getEnvironment(), "camel.connector.customizer", "camel.connector.activemq-publish-bytes.customizer"); if (useCustomizer) { LOGGER.debug("Configure connector {}, with customizer {}", connector, customizer); customizer.customize(connector); } } } return connector; }