diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/iggy.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/iggy.json index a02841bf65129..07fc57f7e4b45 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/iggy.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/iggy.json @@ -50,7 +50,11 @@ "lazyStartProducer": { "index": 23, "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing." }, "partitioning": { "index": 24, "kind": "property", "displayName": "Partitioning", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "org.apache.iggy.message.Partitioning", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "balanced", "configurationClass": "org.apache.camel.component.iggy.IggyConfiguration", "configurationField": "configuration", "description": "Partitioning strategy for message distribution" }, "autowiredEnabled": { "index": 25, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc." }, - "username": { "index": 26, "kind": "property", "displayName": "Username", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.iggy.IggyConfiguration", "configurationField": "configuration", "description": "Iggy username" } + "sslContextParameters": { "index": 26, "kind": "property", "displayName": "Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.apache.camel.support.jsse.SSLContextParameters", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.iggy.IggyConfiguration", "configurationField": "configuration", "description": "SSL configuration using an org.apache.camel.support.jsse.SSLContextParameters instance. This takes precedence over tlsEnabled and tlsCertificatePath when configured." }, + "tlsCertificatePath": { "index": 27, "kind": "property", "displayName": "Tls Certificate Path", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.iggy.IggyConfiguration", "configurationField": "configuration", "description": "Path to the TLS certificate file for the connection to the Iggy server" }, + "tlsEnabled": { "index": 28, "kind": "property", "displayName": "Tls Enabled", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.iggy.IggyConfiguration", "configurationField": "configuration", "description": "Whether to enable TLS for the connection to the Iggy server" }, + "useGlobalSslContextParameters": { "index": 29, "kind": "property", "displayName": "Use Global Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Enable usage of global SSL context parameters." }, + "username": { "index": 30, "kind": "property", "displayName": "Username", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.iggy.IggyConfiguration", "configurationField": "configuration", "description": "Iggy username" } }, "properties": { "topicName": { "index": 0, "kind": "path", "displayName": "Topic Name", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Name of the topic" }, @@ -80,6 +84,9 @@ "exchangePattern": { "index": 24, "kind": "parameter", "displayName": "Exchange Pattern", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "enum", "javaType": "org.apache.camel.ExchangePattern", "enum": [ "InOnly", "InOut" ], "deprecated": false, "autowired": false, "secret": false, "description": "Sets the exchange pattern when the consumer creates an exchange." }, "partitioning": { "index": 25, "kind": "parameter", "displayName": "Partitioning", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "org.apache.iggy.message.Partitioning", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "balanced", "configurationClass": "org.apache.camel.component.iggy.IggyConfiguration", "configurationField": "configuration", "description": "Partitioning strategy for message distribution" }, "lazyStartProducer": { "index": 26, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing." }, - "username": { "index": 27, "kind": "parameter", "displayName": "Username", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.iggy.IggyConfiguration", "configurationField": "configuration", "description": "Iggy username" } + "sslContextParameters": { "index": 27, "kind": "parameter", "displayName": "Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.apache.camel.support.jsse.SSLContextParameters", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.iggy.IggyConfiguration", "configurationField": "configuration", "description": "SSL configuration using an org.apache.camel.support.jsse.SSLContextParameters instance. This takes precedence over tlsEnabled and tlsCertificatePath when configured." }, + "tlsCertificatePath": { "index": 28, "kind": "parameter", "displayName": "Tls Certificate Path", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.iggy.IggyConfiguration", "configurationField": "configuration", "description": "Path to the TLS certificate file for the connection to the Iggy server" }, + "tlsEnabled": { "index": 29, "kind": "parameter", "displayName": "Tls Enabled", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.iggy.IggyConfiguration", "configurationField": "configuration", "description": "Whether to enable TLS for the connection to the Iggy server" }, + "username": { "index": 30, "kind": "parameter", "displayName": "Username", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.iggy.IggyConfiguration", "configurationField": "configuration", "description": "Iggy username" } } } diff --git a/components/camel-iggy/src/generated/java/org/apache/camel/component/iggy/IggyComponentConfigurer.java b/components/camel-iggy/src/generated/java/org/apache/camel/component/iggy/IggyComponentConfigurer.java index 30dc2a9d6ca4c..d3476c5b725d8 100644 --- a/components/camel-iggy/src/generated/java/org/apache/camel/component/iggy/IggyComponentConfigurer.java +++ b/components/camel-iggy/src/generated/java/org/apache/camel/component/iggy/IggyComponentConfigurer.java @@ -71,12 +71,20 @@ public boolean configure(CamelContext camelContext, Object obj, String name, Obj case "replicationFactor": getOrCreateConfiguration(target).setReplicationFactor(property(camelContext, java.lang.Short.class, value)); return true; case "shutdowntimeout": case "shutdownTimeout": getOrCreateConfiguration(target).setShutdownTimeout(property(camelContext, int.class, value)); return true; + case "sslcontextparameters": + case "sslContextParameters": getOrCreateConfiguration(target).setSslContextParameters(property(camelContext, org.apache.camel.support.jsse.SSLContextParameters.class, value)); return true; case "startingoffset": case "startingOffset": getOrCreateConfiguration(target).setStartingOffset(property(camelContext, java.lang.Long.class, value)); return true; case "streamid": case "streamId": getOrCreateConfiguration(target).setStreamId(property(camelContext, java.lang.Long.class, value)); return true; case "streamname": case "streamName": getOrCreateConfiguration(target).setStreamName(property(camelContext, java.lang.String.class, value)); return true; + case "tlscertificatepath": + case "tlsCertificatePath": getOrCreateConfiguration(target).setTlsCertificatePath(property(camelContext, java.lang.String.class, value)); return true; + case "tlsenabled": + case "tlsEnabled": getOrCreateConfiguration(target).setTlsEnabled(property(camelContext, boolean.class, value)); return true; + case "useglobalsslcontextparameters": + case "useGlobalSslContextParameters": target.setUseGlobalSslContextParameters(property(camelContext, boolean.class, value)); return true; case "username": getOrCreateConfiguration(target).setUsername(property(camelContext, java.lang.String.class, value)); return true; default: return false; } @@ -126,12 +134,20 @@ public Class getOptionType(String name, boolean ignoreCase) { case "replicationFactor": return java.lang.Short.class; case "shutdowntimeout": case "shutdownTimeout": return int.class; + case "sslcontextparameters": + case "sslContextParameters": return org.apache.camel.support.jsse.SSLContextParameters.class; case "startingoffset": case "startingOffset": return java.lang.Long.class; case "streamid": case "streamId": return java.lang.Long.class; case "streamname": case "streamName": return java.lang.String.class; + case "tlscertificatepath": + case "tlsCertificatePath": return java.lang.String.class; + case "tlsenabled": + case "tlsEnabled": return boolean.class; + case "useglobalsslcontextparameters": + case "useGlobalSslContextParameters": return boolean.class; case "username": return java.lang.String.class; default: return null; } @@ -182,12 +198,20 @@ public Object getOptionValue(Object obj, String name, boolean ignoreCase) { case "replicationFactor": return getOrCreateConfiguration(target).getReplicationFactor(); case "shutdowntimeout": case "shutdownTimeout": return getOrCreateConfiguration(target).getShutdownTimeout(); + case "sslcontextparameters": + case "sslContextParameters": return getOrCreateConfiguration(target).getSslContextParameters(); case "startingoffset": case "startingOffset": return getOrCreateConfiguration(target).getStartingOffset(); case "streamid": case "streamId": return getOrCreateConfiguration(target).getStreamId(); case "streamname": case "streamName": return getOrCreateConfiguration(target).getStreamName(); + case "tlscertificatepath": + case "tlsCertificatePath": return getOrCreateConfiguration(target).getTlsCertificatePath(); + case "tlsenabled": + case "tlsEnabled": return getOrCreateConfiguration(target).isTlsEnabled(); + case "useglobalsslcontextparameters": + case "useGlobalSslContextParameters": return target.isUseGlobalSslContextParameters(); case "username": return getOrCreateConfiguration(target).getUsername(); default: return null; } diff --git a/components/camel-iggy/src/generated/java/org/apache/camel/component/iggy/IggyEndpointConfigurer.java b/components/camel-iggy/src/generated/java/org/apache/camel/component/iggy/IggyEndpointConfigurer.java index 63cc1c3be4e25..a512f61a16d09 100644 --- a/components/camel-iggy/src/generated/java/org/apache/camel/component/iggy/IggyEndpointConfigurer.java +++ b/components/camel-iggy/src/generated/java/org/apache/camel/component/iggy/IggyEndpointConfigurer.java @@ -65,12 +65,18 @@ public boolean configure(CamelContext camelContext, Object obj, String name, Obj case "replicationFactor": target.getConfiguration().setReplicationFactor(property(camelContext, java.lang.Short.class, value)); return true; case "shutdowntimeout": case "shutdownTimeout": target.getConfiguration().setShutdownTimeout(property(camelContext, int.class, value)); return true; + case "sslcontextparameters": + case "sslContextParameters": target.getConfiguration().setSslContextParameters(property(camelContext, org.apache.camel.support.jsse.SSLContextParameters.class, value)); return true; case "startingoffset": case "startingOffset": target.getConfiguration().setStartingOffset(property(camelContext, java.lang.Long.class, value)); return true; case "streamid": case "streamId": target.getConfiguration().setStreamId(property(camelContext, java.lang.Long.class, value)); return true; case "streamname": case "streamName": target.getConfiguration().setStreamName(property(camelContext, java.lang.String.class, value)); return true; + case "tlscertificatepath": + case "tlsCertificatePath": target.getConfiguration().setTlsCertificatePath(property(camelContext, java.lang.String.class, value)); return true; + case "tlsenabled": + case "tlsEnabled": target.getConfiguration().setTlsEnabled(property(camelContext, boolean.class, value)); return true; case "username": target.getConfiguration().setUsername(property(camelContext, java.lang.String.class, value)); return true; default: return false; } @@ -121,12 +127,18 @@ public Class getOptionType(String name, boolean ignoreCase) { case "replicationFactor": return java.lang.Short.class; case "shutdowntimeout": case "shutdownTimeout": return int.class; + case "sslcontextparameters": + case "sslContextParameters": return org.apache.camel.support.jsse.SSLContextParameters.class; case "startingoffset": case "startingOffset": return java.lang.Long.class; case "streamid": case "streamId": return java.lang.Long.class; case "streamname": case "streamName": return java.lang.String.class; + case "tlscertificatepath": + case "tlsCertificatePath": return java.lang.String.class; + case "tlsenabled": + case "tlsEnabled": return boolean.class; case "username": return java.lang.String.class; default: return null; } @@ -178,12 +190,18 @@ public Object getOptionValue(Object obj, String name, boolean ignoreCase) { case "replicationFactor": return target.getConfiguration().getReplicationFactor(); case "shutdowntimeout": case "shutdownTimeout": return target.getConfiguration().getShutdownTimeout(); + case "sslcontextparameters": + case "sslContextParameters": return target.getConfiguration().getSslContextParameters(); case "startingoffset": case "startingOffset": return target.getConfiguration().getStartingOffset(); case "streamid": case "streamId": return target.getConfiguration().getStreamId(); case "streamname": case "streamName": return target.getConfiguration().getStreamName(); + case "tlscertificatepath": + case "tlsCertificatePath": return target.getConfiguration().getTlsCertificatePath(); + case "tlsenabled": + case "tlsEnabled": return target.getConfiguration().isTlsEnabled(); case "username": return target.getConfiguration().getUsername(); default: return null; } diff --git a/components/camel-iggy/src/generated/java/org/apache/camel/component/iggy/IggyEndpointUriFactory.java b/components/camel-iggy/src/generated/java/org/apache/camel/component/iggy/IggyEndpointUriFactory.java index c24043e1976a1..5e27a69432f79 100644 --- a/components/camel-iggy/src/generated/java/org/apache/camel/component/iggy/IggyEndpointUriFactory.java +++ b/components/camel-iggy/src/generated/java/org/apache/camel/component/iggy/IggyEndpointUriFactory.java @@ -23,7 +23,7 @@ public class IggyEndpointUriFactory extends org.apache.camel.support.component.E private static final Set SECRET_PROPERTY_NAMES; private static final Map MULTI_VALUE_PREFIXES; static { - Set props = new HashSet<>(28); + Set props = new HashSet<>(31); props.add("autoCommit"); props.add("autoCreateStream"); props.add("autoCreateTopic"); @@ -47,9 +47,12 @@ public class IggyEndpointUriFactory extends org.apache.camel.support.component.E props.add("port"); props.add("replicationFactor"); props.add("shutdownTimeout"); + props.add("sslContextParameters"); props.add("startingOffset"); props.add("streamId"); props.add("streamName"); + props.add("tlsCertificatePath"); + props.add("tlsEnabled"); props.add("topicName"); props.add("username"); PROPERTY_NAMES = Collections.unmodifiableSet(props); diff --git a/components/camel-iggy/src/generated/resources/META-INF/org/apache/camel/component/iggy/iggy.json b/components/camel-iggy/src/generated/resources/META-INF/org/apache/camel/component/iggy/iggy.json index a02841bf65129..07fc57f7e4b45 100644 --- a/components/camel-iggy/src/generated/resources/META-INF/org/apache/camel/component/iggy/iggy.json +++ b/components/camel-iggy/src/generated/resources/META-INF/org/apache/camel/component/iggy/iggy.json @@ -50,7 +50,11 @@ "lazyStartProducer": { "index": 23, "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing." }, "partitioning": { "index": 24, "kind": "property", "displayName": "Partitioning", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "org.apache.iggy.message.Partitioning", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "balanced", "configurationClass": "org.apache.camel.component.iggy.IggyConfiguration", "configurationField": "configuration", "description": "Partitioning strategy for message distribution" }, "autowiredEnabled": { "index": 25, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc." }, - "username": { "index": 26, "kind": "property", "displayName": "Username", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.iggy.IggyConfiguration", "configurationField": "configuration", "description": "Iggy username" } + "sslContextParameters": { "index": 26, "kind": "property", "displayName": "Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.apache.camel.support.jsse.SSLContextParameters", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.iggy.IggyConfiguration", "configurationField": "configuration", "description": "SSL configuration using an org.apache.camel.support.jsse.SSLContextParameters instance. This takes precedence over tlsEnabled and tlsCertificatePath when configured." }, + "tlsCertificatePath": { "index": 27, "kind": "property", "displayName": "Tls Certificate Path", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.iggy.IggyConfiguration", "configurationField": "configuration", "description": "Path to the TLS certificate file for the connection to the Iggy server" }, + "tlsEnabled": { "index": 28, "kind": "property", "displayName": "Tls Enabled", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.iggy.IggyConfiguration", "configurationField": "configuration", "description": "Whether to enable TLS for the connection to the Iggy server" }, + "useGlobalSslContextParameters": { "index": 29, "kind": "property", "displayName": "Use Global Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Enable usage of global SSL context parameters." }, + "username": { "index": 30, "kind": "property", "displayName": "Username", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.iggy.IggyConfiguration", "configurationField": "configuration", "description": "Iggy username" } }, "properties": { "topicName": { "index": 0, "kind": "path", "displayName": "Topic Name", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Name of the topic" }, @@ -80,6 +84,9 @@ "exchangePattern": { "index": 24, "kind": "parameter", "displayName": "Exchange Pattern", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "enum", "javaType": "org.apache.camel.ExchangePattern", "enum": [ "InOnly", "InOut" ], "deprecated": false, "autowired": false, "secret": false, "description": "Sets the exchange pattern when the consumer creates an exchange." }, "partitioning": { "index": 25, "kind": "parameter", "displayName": "Partitioning", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "org.apache.iggy.message.Partitioning", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "balanced", "configurationClass": "org.apache.camel.component.iggy.IggyConfiguration", "configurationField": "configuration", "description": "Partitioning strategy for message distribution" }, "lazyStartProducer": { "index": 26, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing." }, - "username": { "index": 27, "kind": "parameter", "displayName": "Username", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.iggy.IggyConfiguration", "configurationField": "configuration", "description": "Iggy username" } + "sslContextParameters": { "index": 27, "kind": "parameter", "displayName": "Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.apache.camel.support.jsse.SSLContextParameters", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.iggy.IggyConfiguration", "configurationField": "configuration", "description": "SSL configuration using an org.apache.camel.support.jsse.SSLContextParameters instance. This takes precedence over tlsEnabled and tlsCertificatePath when configured." }, + "tlsCertificatePath": { "index": 28, "kind": "parameter", "displayName": "Tls Certificate Path", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.iggy.IggyConfiguration", "configurationField": "configuration", "description": "Path to the TLS certificate file for the connection to the Iggy server" }, + "tlsEnabled": { "index": 29, "kind": "parameter", "displayName": "Tls Enabled", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.iggy.IggyConfiguration", "configurationField": "configuration", "description": "Whether to enable TLS for the connection to the Iggy server" }, + "username": { "index": 30, "kind": "parameter", "displayName": "Username", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.iggy.IggyConfiguration", "configurationField": "configuration", "description": "Iggy username" } } } diff --git a/components/camel-iggy/src/main/java/org/apache/camel/component/iggy/IggyComponent.java b/components/camel-iggy/src/main/java/org/apache/camel/component/iggy/IggyComponent.java index 0381ddf7101b0..d6e3c0833cf2a 100644 --- a/components/camel-iggy/src/main/java/org/apache/camel/component/iggy/IggyComponent.java +++ b/components/camel-iggy/src/main/java/org/apache/camel/component/iggy/IggyComponent.java @@ -19,16 +19,20 @@ import java.util.Map; import org.apache.camel.Endpoint; +import org.apache.camel.SSLContextParametersAware; import org.apache.camel.spi.Metadata; import org.apache.camel.spi.annotations.Component; import org.apache.camel.support.DefaultComponent; @Component("iggy") -public class IggyComponent extends DefaultComponent { +public class IggyComponent extends DefaultComponent implements SSLContextParametersAware { @Metadata private IggyConfiguration configuration = new IggyConfiguration(); + @Metadata(label = "security", defaultValue = "false") + private boolean useGlobalSslContextParameters; + @Override protected Endpoint createEndpoint(String uri, String remaining, Map parameters) throws Exception { IggyConfiguration config = configuration.copy(); @@ -37,6 +41,10 @@ protected Endpoint createEndpoint(String uri, String remaining, Map pool; - public IggyClientConnectionPool(String host, int port, String username, String password, String transport) { - IggyClientFactory factory = new IggyClientFactory(host, port, username, password, transport); + public IggyClientConnectionPool(String host, int port, String username, String password, String transport, + boolean tlsEnabled, String tlsCertificatePath, + SSLContextParameters sslContextParameters) { + IggyClientFactory factory = new IggyClientFactory( + host, port, username, password, transport, + tlsEnabled, tlsCertificatePath, sslContextParameters); this.pool = new GenericObjectPool<>(factory); } diff --git a/components/camel-iggy/src/main/java/org/apache/camel/component/iggy/client/IggyClientFactory.java b/components/camel-iggy/src/main/java/org/apache/camel/component/iggy/client/IggyClientFactory.java index f0aa85e8126b2..9a65969e12dd9 100644 --- a/components/camel-iggy/src/main/java/org/apache/camel/component/iggy/client/IggyClientFactory.java +++ b/components/camel-iggy/src/main/java/org/apache/camel/component/iggy/client/IggyClientFactory.java @@ -16,6 +16,7 @@ */ package org.apache.camel.component.iggy.client; +import org.apache.camel.support.jsse.SSLContextParameters; import org.apache.commons.pool2.BasePooledObjectFactory; import org.apache.commons.pool2.PooledObject; import org.apache.commons.pool2.impl.DefaultPooledObject; @@ -30,28 +31,72 @@ public class IggyClientFactory extends BasePooledObjectFactory { private final String username; private final String password; private final String transport; + private final boolean tlsEnabled; + private final String tlsCertificatePath; + private final SSLContextParameters sslContextParameters; - public IggyClientFactory(String host, int port, String username, String password, String transport) { + public IggyClientFactory(String host, int port, String username, String password, String transport, + boolean tlsEnabled, String tlsCertificatePath, + SSLContextParameters sslContextParameters) { this.host = host; this.port = port; this.username = username; this.password = password; this.transport = transport; + this.tlsEnabled = tlsEnabled; + this.tlsCertificatePath = tlsCertificatePath; + this.sslContextParameters = sslContextParameters; } @Override public IggyBaseClient create() throws Exception { IggyBaseClient iggyBaseClient; if ("TCP".equalsIgnoreCase(transport)) { - iggyBaseClient = IggyTcpClient.builder().host(host).port(port).credentials(username, password).buildAndLogin(); + var builder = IggyTcpClient.builder().host(host).port(port).credentials(username, password); + configureTls(builder); + iggyBaseClient = builder.buildAndLogin(); } else if ("HTTP".equalsIgnoreCase(transport)) { - iggyBaseClient = IggyHttpClient.builder().host(host).port(port).credentials(username, password).buildAndLogin(); + var builder = IggyHttpClient.builder().host(host).port(port).credentials(username, password); + configureTls(builder); + iggyBaseClient = builder.buildAndLogin(); } else { throw new IllegalArgumentException("Only HTTP or TCP transports are supported"); } return iggyBaseClient; } + private void configureTls( + org.apache.iggy.client.blocking.tcp.IggyTcpClientBuilder builder) { + if (sslContextParameters != null) { + builder.enableTls(); + applyTlsCertificateIfPresent(builder::tlsCertificate); + } else if (tlsEnabled) { + builder.enableTls(); + if (tlsCertificatePath != null) { + builder.tlsCertificate(tlsCertificatePath); + } + } + } + + private void configureTls( + org.apache.iggy.client.blocking.http.IggyHttpClientBuilder builder) { + if (sslContextParameters != null) { + builder.enableTls(); + applyTlsCertificateIfPresent(builder::tlsCertificate); + } else if (tlsEnabled) { + builder.enableTls(); + if (tlsCertificatePath != null) { + builder.tlsCertificate(tlsCertificatePath); + } + } + } + + private void applyTlsCertificateIfPresent(java.util.function.Consumer certificateSetter) { + if (tlsCertificatePath != null) { + certificateSetter.accept(tlsCertificatePath); + } + } + @Override public PooledObject wrap(IggyBaseClient iggyBaseClient) { return new DefaultPooledObject<>(iggyBaseClient); diff --git a/components/camel-iggy/src/test/java/org/apache/camel/component/iggy/IggyConfigurationTest.java b/components/camel-iggy/src/test/java/org/apache/camel/component/iggy/IggyConfigurationTest.java new file mode 100644 index 0000000000000..fc4afb9f3a8fc --- /dev/null +++ b/components/camel-iggy/src/test/java/org/apache/camel/component/iggy/IggyConfigurationTest.java @@ -0,0 +1,120 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.iggy; + +import org.apache.camel.support.jsse.SSLContextParameters; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +public class IggyConfigurationTest { + + @Test + public void testTlsDefaults() { + IggyConfiguration configuration = new IggyConfiguration(); + assertFalse(configuration.isTlsEnabled()); + assertNull(configuration.getTlsCertificatePath()); + } + + @Test + public void testTlsEnabled() { + IggyConfiguration configuration = new IggyConfiguration(); + configuration.setTlsEnabled(true); + assertTrue(configuration.isTlsEnabled()); + } + + @Test + public void testTlsCertificatePath() { + IggyConfiguration configuration = new IggyConfiguration(); + configuration.setTlsCertificatePath("/path/to/cert.pem"); + assertEquals("/path/to/cert.pem", configuration.getTlsCertificatePath()); + } + + @Test + public void testTlsConfigurationCopy() { + IggyConfiguration configuration = new IggyConfiguration(); + configuration.setTlsEnabled(true); + configuration.setTlsCertificatePath("/path/to/cert.pem"); + + IggyConfiguration copy = configuration.copy(); + assertTrue(copy.isTlsEnabled()); + assertEquals("/path/to/cert.pem", copy.getTlsCertificatePath()); + } + + @Test + public void testTlsEndpointUri() throws Exception { + org.apache.camel.impl.DefaultCamelContext context = new org.apache.camel.impl.DefaultCamelContext(); + context.start(); + try { + IggyEndpoint endpoint = context.getEndpoint( + "iggy:myTopic?tlsEnabled=true&tlsCertificatePath=/path/to/cert.pem&streamName=myStream&username=user&password=pass", + IggyEndpoint.class); + assertTrue(endpoint.getConfiguration().isTlsEnabled()); + assertEquals("/path/to/cert.pem", endpoint.getConfiguration().getTlsCertificatePath()); + } finally { + context.stop(); + } + } + + @Test + public void testSslContextParametersDefault() { + IggyConfiguration configuration = new IggyConfiguration(); + assertNull(configuration.getSslContextParameters()); + } + + @Test + public void testSslContextParameters() { + IggyConfiguration configuration = new IggyConfiguration(); + SSLContextParameters sslContextParameters = new SSLContextParameters(); + configuration.setSslContextParameters(sslContextParameters); + assertNotNull(configuration.getSslContextParameters()); + assertEquals(sslContextParameters, configuration.getSslContextParameters()); + } + + @Test + public void testSslContextParametersCopy() { + IggyConfiguration configuration = new IggyConfiguration(); + SSLContextParameters sslContextParameters = new SSLContextParameters(); + configuration.setSslContextParameters(sslContextParameters); + + IggyConfiguration copy = configuration.copy(); + assertNotNull(copy.getSslContextParameters()); + assertEquals(sslContextParameters, copy.getSslContextParameters()); + } + + @Test + public void testSslContextParametersEndpointUri() throws Exception { + org.apache.camel.impl.DefaultCamelContext context = new org.apache.camel.impl.DefaultCamelContext(); + context.start(); + try { + SSLContextParameters sslContextParameters = new SSLContextParameters(); + context.getRegistry().bind("sslContextParameters", sslContextParameters); + + IggyEndpoint endpoint = context.getEndpoint( + "iggy:myTopic?sslContextParameters=#sslContextParameters&streamName=myStream&username=user&password=pass", + IggyEndpoint.class); + assertNotNull(endpoint.getConfiguration().getSslContextParameters()); + assertEquals(sslContextParameters, endpoint.getConfiguration().getSslContextParameters()); + } finally { + context.stop(); + } + } +} diff --git a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/IggyComponentBuilderFactory.java b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/IggyComponentBuilderFactory.java index d6ea3de56b03f..71cef1d3585f4 100644 --- a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/IggyComponentBuilderFactory.java +++ b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/IggyComponentBuilderFactory.java @@ -506,6 +506,75 @@ default IggyComponentBuilder autowiredEnabled(boolean autowiredEnabled) { return this; } + /** + * SSL configuration using an + * org.apache.camel.support.jsse.SSLContextParameters instance. This + * takes precedence over tlsEnabled and tlsCertificatePath when + * configured. + * + * The option is a: + * <code>org.apache.camel.support.jsse.SSLContextParameters</code> type. + * + * Group: security + * + * @param sslContextParameters the value to set + * @return the dsl builder + */ + default IggyComponentBuilder sslContextParameters(org.apache.camel.support.jsse.SSLContextParameters sslContextParameters) { + doSetProperty("sslContextParameters", sslContextParameters); + return this; + } + + /** + * Path to the TLS certificate file for the connection to the Iggy + * server. + * + * The option is a: <code>java.lang.String</code> type. + * + * Group: security + * + * @param tlsCertificatePath the value to set + * @return the dsl builder + */ + default IggyComponentBuilder tlsCertificatePath(java.lang.String tlsCertificatePath) { + doSetProperty("tlsCertificatePath", tlsCertificatePath); + return this; + } + + + /** + * Whether to enable TLS for the connection to the Iggy server. + * + * The option is a: <code>boolean</code> type. + * + * Default: false + * Group: security + * + * @param tlsEnabled the value to set + * @return the dsl builder + */ + default IggyComponentBuilder tlsEnabled(boolean tlsEnabled) { + doSetProperty("tlsEnabled", tlsEnabled); + return this; + } + + + /** + * Enable usage of global SSL context parameters. + * + * The option is a: <code>boolean</code> type. + * + * Default: false + * Group: security + * + * @param useGlobalSslContextParameters the value to set + * @return the dsl builder + */ + default IggyComponentBuilder useGlobalSslContextParameters(boolean useGlobalSslContextParameters) { + doSetProperty("useGlobalSslContextParameters", useGlobalSslContextParameters); + return this; + } + /** * Iggy username. * @@ -567,6 +636,10 @@ protected boolean setPropertyOnComponent( case "lazyStartProducer": ((IggyComponent) component).setLazyStartProducer((boolean) value); return true; case "partitioning": getOrCreateConfiguration((IggyComponent) component).setPartitioning((org.apache.iggy.message.Partitioning) value); return true; case "autowiredEnabled": ((IggyComponent) component).setAutowiredEnabled((boolean) value); return true; + case "sslContextParameters": getOrCreateConfiguration((IggyComponent) component).setSslContextParameters((org.apache.camel.support.jsse.SSLContextParameters) value); return true; + case "tlsCertificatePath": getOrCreateConfiguration((IggyComponent) component).setTlsCertificatePath((java.lang.String) value); return true; + case "tlsEnabled": getOrCreateConfiguration((IggyComponent) component).setTlsEnabled((boolean) value); return true; + case "useGlobalSslContextParameters": ((IggyComponent) component).setUseGlobalSslContextParameters((boolean) value); return true; case "username": getOrCreateConfiguration((IggyComponent) component).setUsername((java.lang.String) value); return true; default: return false; } diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/IggyEndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/IggyEndpointBuilderFactory.java index 6410c9f3d558e..b6404b1be3f66 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/IggyEndpointBuilderFactory.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/IggyEndpointBuilderFactory.java @@ -586,6 +586,87 @@ default IggyEndpointConsumerBuilder startingOffset(String startingOffset) { doSetProperty("startingOffset", startingOffset); return this; } + /** + * SSL configuration using an + * org.apache.camel.support.jsse.SSLContextParameters instance. This + * takes precedence over tlsEnabled and tlsCertificatePath when + * configured. + * + * The option is a: + * org.apache.camel.support.jsse.SSLContextParameters type. + * + * Group: security + * + * @param sslContextParameters the value to set + * @return the dsl builder + */ + default IggyEndpointConsumerBuilder sslContextParameters(org.apache.camel.support.jsse.SSLContextParameters sslContextParameters) { + doSetProperty("sslContextParameters", sslContextParameters); + return this; + } + /** + * SSL configuration using an + * org.apache.camel.support.jsse.SSLContextParameters instance. This + * takes precedence over tlsEnabled and tlsCertificatePath when + * configured. + * + * The option will be converted to a + * org.apache.camel.support.jsse.SSLContextParameters type. + * + * Group: security + * + * @param sslContextParameters the value to set + * @return the dsl builder + */ + default IggyEndpointConsumerBuilder sslContextParameters(String sslContextParameters) { + doSetProperty("sslContextParameters", sslContextParameters); + return this; + } + /** + * Path to the TLS certificate file for the connection to the Iggy + * server. + * + * The option is a: java.lang.String type. + * + * Group: security + * + * @param tlsCertificatePath the value to set + * @return the dsl builder + */ + default IggyEndpointConsumerBuilder tlsCertificatePath(String tlsCertificatePath) { + doSetProperty("tlsCertificatePath", tlsCertificatePath); + return this; + } + /** + * Whether to enable TLS for the connection to the Iggy server. + * + * The option is a: boolean type. + * + * Default: false + * Group: security + * + * @param tlsEnabled the value to set + * @return the dsl builder + */ + default IggyEndpointConsumerBuilder tlsEnabled(boolean tlsEnabled) { + doSetProperty("tlsEnabled", tlsEnabled); + return this; + } + /** + * Whether to enable TLS for the connection to the Iggy server. + * + * The option will be converted to a boolean type. + * + * Default: false + * Group: security + * + * @param tlsEnabled the value to set + * @return the dsl builder + */ + default IggyEndpointConsumerBuilder tlsEnabled(String tlsEnabled) { + doSetProperty("tlsEnabled", tlsEnabled); + return this; + } /** * Iggy username. * @@ -1098,6 +1179,87 @@ default IggyEndpointProducerBuilder partitioning(String partitioning) { doSetProperty("partitioning", partitioning); return this; } + /** + * SSL configuration using an + * org.apache.camel.support.jsse.SSLContextParameters instance. This + * takes precedence over tlsEnabled and tlsCertificatePath when + * configured. + * + * The option is a: + * org.apache.camel.support.jsse.SSLContextParameters type. + * + * Group: security + * + * @param sslContextParameters the value to set + * @return the dsl builder + */ + default IggyEndpointProducerBuilder sslContextParameters(org.apache.camel.support.jsse.SSLContextParameters sslContextParameters) { + doSetProperty("sslContextParameters", sslContextParameters); + return this; + } + /** + * SSL configuration using an + * org.apache.camel.support.jsse.SSLContextParameters instance. This + * takes precedence over tlsEnabled and tlsCertificatePath when + * configured. + * + * The option will be converted to a + * org.apache.camel.support.jsse.SSLContextParameters type. + * + * Group: security + * + * @param sslContextParameters the value to set + * @return the dsl builder + */ + default IggyEndpointProducerBuilder sslContextParameters(String sslContextParameters) { + doSetProperty("sslContextParameters", sslContextParameters); + return this; + } + /** + * Path to the TLS certificate file for the connection to the Iggy + * server. + * + * The option is a: java.lang.String type. + * + * Group: security + * + * @param tlsCertificatePath the value to set + * @return the dsl builder + */ + default IggyEndpointProducerBuilder tlsCertificatePath(String tlsCertificatePath) { + doSetProperty("tlsCertificatePath", tlsCertificatePath); + return this; + } + /** + * Whether to enable TLS for the connection to the Iggy server. + * + * The option is a: boolean type. + * + * Default: false + * Group: security + * + * @param tlsEnabled the value to set + * @return the dsl builder + */ + default IggyEndpointProducerBuilder tlsEnabled(boolean tlsEnabled) { + doSetProperty("tlsEnabled", tlsEnabled); + return this; + } + /** + * Whether to enable TLS for the connection to the Iggy server. + * + * The option will be converted to a boolean type. + * + * Default: false + * Group: security + * + * @param tlsEnabled the value to set + * @return the dsl builder + */ + default IggyEndpointProducerBuilder tlsEnabled(String tlsEnabled) { + doSetProperty("tlsEnabled", tlsEnabled); + return this; + } /** * Iggy username. * @@ -1507,6 +1669,87 @@ default IggyEndpointBuilder streamName(String streamName) { doSetProperty("streamName", streamName); return this; } + /** + * SSL configuration using an + * org.apache.camel.support.jsse.SSLContextParameters instance. This + * takes precedence over tlsEnabled and tlsCertificatePath when + * configured. + * + * The option is a: + * org.apache.camel.support.jsse.SSLContextParameters type. + * + * Group: security + * + * @param sslContextParameters the value to set + * @return the dsl builder + */ + default IggyEndpointBuilder sslContextParameters(org.apache.camel.support.jsse.SSLContextParameters sslContextParameters) { + doSetProperty("sslContextParameters", sslContextParameters); + return this; + } + /** + * SSL configuration using an + * org.apache.camel.support.jsse.SSLContextParameters instance. This + * takes precedence over tlsEnabled and tlsCertificatePath when + * configured. + * + * The option will be converted to a + * org.apache.camel.support.jsse.SSLContextParameters type. + * + * Group: security + * + * @param sslContextParameters the value to set + * @return the dsl builder + */ + default IggyEndpointBuilder sslContextParameters(String sslContextParameters) { + doSetProperty("sslContextParameters", sslContextParameters); + return this; + } + /** + * Path to the TLS certificate file for the connection to the Iggy + * server. + * + * The option is a: java.lang.String type. + * + * Group: security + * + * @param tlsCertificatePath the value to set + * @return the dsl builder + */ + default IggyEndpointBuilder tlsCertificatePath(String tlsCertificatePath) { + doSetProperty("tlsCertificatePath", tlsCertificatePath); + return this; + } + /** + * Whether to enable TLS for the connection to the Iggy server. + * + * The option is a: boolean type. + * + * Default: false + * Group: security + * + * @param tlsEnabled the value to set + * @return the dsl builder + */ + default IggyEndpointBuilder tlsEnabled(boolean tlsEnabled) { + doSetProperty("tlsEnabled", tlsEnabled); + return this; + } + /** + * Whether to enable TLS for the connection to the Iggy server. + * + * The option will be converted to a boolean type. + * + * Default: false + * Group: security + * + * @param tlsEnabled the value to set + * @return the dsl builder + */ + default IggyEndpointBuilder tlsEnabled(String tlsEnabled) { + doSetProperty("tlsEnabled", tlsEnabled); + return this; + } /** * Iggy username. *