This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git
commit cb9649d236ac3fd2a145e51ef96e0a65e318f190 Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Tue Jun 16 16:40:57 2020 +0200 CAMEL-14622: Component options use @Metadata to markup the options --- .../camel/component/milo/server/milo-server.json | 36 ++-- .../src/main/docs/milo-server-component.adoc | 20 +- .../component/milo/client/MiloClientComponent.java | 2 +- .../component/milo/server/MiloServerComponent.java | 35 +++- .../apache/camel/component/mongodb/mongodb.json | 2 +- .../src/main/docs/mongodb-component.adoc | 2 +- .../camel/component/mongodb/MongoDbComponent.java | 21 +- .../dsl/MiloServerComponentBuilderFactory.java | 229 +++++++++++---------- .../dsl/MongodbComponentBuilderFactory.java | 3 +- 9 files changed, 179 insertions(+), 171 deletions(-) diff --git a/components/camel-milo/src/generated/resources/org/apache/camel/component/milo/server/milo-server.json b/components/camel-milo/src/generated/resources/org/apache/camel/component/milo/server/milo-server.json index 618d572..67638ee 100644 --- a/components/camel-milo/src/generated/resources/org/apache/camel/component/milo/server/milo-server.json +++ b/components/camel-milo/src/generated/resources/org/apache/camel/component/milo/server/milo-server.json @@ -21,26 +21,26 @@ "lenientProperties": false }, "componentProperties": { - "applicationName": { "kind": "property", "displayName": "Application Name", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "The application name" }, - "applicationUri": { "kind": "property", "displayName": "Application Uri", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "The application URI" }, - "bindAddresses": { "kind": "property", "displayName": "Bind Addresses", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "Set the addresses of the local addresses the server should bind to" }, - "buildInfo": { "kind": "property", "displayName": "Build Info", "group": "common", "required": false, "type": "object", "javaType": "org.eclipse.milo.opcua.stack.core.types.structured.BuildInfo", "deprecated": false, "secret": false, "description": "Server build info" }, - "certificate": { "kind": "property", "displayName": "Certificate", "group": "common", "required": false, "type": "object", "javaType": "java.security.cert.X509Certificate", "deprecated": false, "secret": false, "description": "Server certificate" }, - "certificateManager": { "kind": "property", "displayName": "Certificate Manager", "group": "common", "required": false, "type": "object", "javaType": "org.eclipse.milo.opcua.stack.core.security.CertificateManager", "deprecated": false, "secret": false, "description": "Server certificate manager" }, - "certificateValidator": { "kind": "property", "displayName": "Certificate Validator", "group": "common", "required": false, "type": "object", "javaType": "org.eclipse.milo.opcua.stack.core.security.CertificateValidator", "deprecated": false, "secret": false, "description": "Validator for client certificates" }, - "defaultCertificateValidator": { "kind": "property", "displayName": "Default Certificate Validator", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "Validator for client certificates using default file based approach" }, - "enableAnonymousAuthentication": { "kind": "property", "displayName": "Enable Anonymous Authentication", "group": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "Enable anonymous authentication, disabled by default" }, - "namespaceUri": { "kind": "property", "displayName": "Namespace Uri", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "The URI of the namespace, defaults to urn:org:apache:camel" }, - "path": { "kind": "property", "displayName": "Path", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "The path to be appended to the end of the endpoint url. (doesn't need to start with '\/')" }, - "port": { "kind": "property", "displayName": "Port", "group": "common", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "secret": false, "description": "The TCP port the server binds to" }, - "productUri": { "kind": "property", "displayName": "Product Uri", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "The product URI" }, - "securityPolicies": { "kind": "property", "displayName": "Security Policies", "group": "common", "required": false, "type": "object", "javaType": "java.util.Set<org.eclipse.milo.opcua.stack.core.security.SecurityPolicy>", "deprecated": false, "secret": false, "description": "Security policies" }, - "securityPoliciesById": { "kind": "property", "displayName": "Security Policies By Id", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "Security policies by URI or name. Multiple policies can be separated by comma." }, - "userAuthenticationCredentials": { "kind": "property", "displayName": "User Authentication Credentials", "group": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "Set user password combinations in the form of user1:pwd1,user2:pwd2 Usernames and passwords will be URL decoded" }, - "usernameSecurityPolicyUri": { "kind": "property", "displayName": "Username Security Policy Uri", "group": "common", "required": false, "type": "object", "javaType": "org.eclipse.milo.opcua.stack.core.security.SecurityPolicy", "enum": [ "None", "Basic128Rsa15", "Basic256", "Basic256Sha256", "Aes128_Sha256_RsaOaep", "Aes256_Sha256_RsaPss" ], "deprecated": false, "secret": false, "description": "Set the UserTokenPolicy used when" }, + "applicationName": { "kind": "property", "displayName": "Application Name", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "The application name" }, + "applicationUri": { "kind": "property", "displayName": "Application Uri", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "The application URI" }, + "bindAddresses": { "kind": "property", "displayName": "Bind Addresses", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "Set the addresses of the local addresses the server should bind to" }, + "buildInfo": { "kind": "property", "displayName": "Build Info", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.eclipse.milo.opcua.stack.core.types.structured.BuildInfo", "deprecated": false, "secret": false, "description": "Server build info" }, + "namespaceUri": { "kind": "property", "displayName": "Namespace Uri", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "defaultValue": "urn:org:apache:camel", "description": "The URI of the namespace, defaults to urn:org:apache:camel" }, + "path": { "kind": "property", "displayName": "Path", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "The path to be appended to the end of the endpoint url. (doesn't need to start with '\/')" }, + "port": { "kind": "property", "displayName": "Port", "group": "common", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "secret": false, "description": "The TCP port the server binds to" }, + "productUri": { "kind": "property", "displayName": "Product Uri", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "The product URI" }, "bridgeErrorHandler": { "kind": "property", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by [...] "lazyStartProducer": { "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": 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 r [...] - "basicPropertyBinding": { "kind": "property", "displayName": "Basic Property Binding", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "Whether the component should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities" } + "basicPropertyBinding": { "kind": "property", "displayName": "Basic Property Binding", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "Whether the component should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities" }, + "certificate": { "kind": "property", "displayName": "Certificate", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "java.security.cert.X509Certificate", "deprecated": false, "secret": false, "description": "Server certificate" }, + "certificateManager": { "kind": "property", "displayName": "Certificate Manager", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.eclipse.milo.opcua.stack.core.security.CertificateManager", "deprecated": false, "secret": false, "description": "Server certificate manager" }, + "certificateValidator": { "kind": "property", "displayName": "Certificate Validator", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.eclipse.milo.opcua.stack.core.security.CertificateValidator", "deprecated": false, "secret": false, "description": "Validator for client certificates" }, + "defaultCertificateValidator": { "kind": "property", "displayName": "Default Certificate Validator", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "Validator for client certificates using default file based approach" }, + "enableAnonymousAuthentication": { "kind": "property", "displayName": "Enable Anonymous Authentication", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "Enable anonymous authentication, disabled by default" }, + "securityPolicies": { "kind": "property", "displayName": "Security Policies", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "java.util.Set<org.eclipse.milo.opcua.stack.core.security.SecurityPolicy>", "deprecated": false, "secret": false, "description": "Security policies" }, + "securityPoliciesById": { "kind": "property", "displayName": "Security Policies By Id", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "Security policies by URI or name. Multiple policies can be separated by comma." }, + "userAuthenticationCredentials": { "kind": "property", "displayName": "User Authentication Credentials", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "description": "Set user password combinations in the form of user1:pwd1,user2:pwd2 Usernames and passwords will be URL decoded" }, + "usernameSecurityPolicyUri": { "kind": "property", "displayName": "Username Security Policy Uri", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.eclipse.milo.opcua.stack.core.security.SecurityPolicy", "enum": [ "None", "Basic128Rsa15", "Basic256", "Basic256Sha256", "Aes128_Sha256_RsaOaep", "Aes256_Sha256_RsaPss" ], "deprecated": false, "secret": false, "description": "Set the UserTokenPolicy used when" } }, "properties": { "itemId": { "kind": "path", "displayName": "Item Id", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "secret": false, "description": "ID of the item" }, diff --git a/components/camel-milo/src/main/docs/milo-server-component.adoc b/components/camel-milo/src/main/docs/milo-server-component.adoc index b912bcf..691a8fc 100644 --- a/components/camel-milo/src/main/docs/milo-server-component.adoc +++ b/components/camel-milo/src/main/docs/milo-server-component.adoc @@ -45,22 +45,22 @@ The OPC UA Server component supports 20 options, which are listed below. | *applicationUri* (common) | The application URI | | String | *bindAddresses* (common) | Set the addresses of the local addresses the server should bind to | | String | *buildInfo* (common) | Server build info | | BuildInfo -| *certificate* (common) | Server certificate | | X509Certificate -| *certificateManager* (common) | Server certificate manager | | CertificateManager -| *certificateValidator* (common) | Validator for client certificates | | CertificateValidator -| *defaultCertificateValidator* (common) | Validator for client certificates using default file based approach | | String -| *enableAnonymousAuthentication* (common) | Enable anonymous authentication, disabled by default | false | boolean -| *namespaceUri* (common) | The URI of the namespace, defaults to urn:org:apache:camel | | String +| *namespaceUri* (common) | The URI of the namespace, defaults to urn:org:apache:camel | urn:org:apache:camel | String | *path* (common) | The path to be appended to the end of the endpoint url. (doesn't need to start with '/') | | String | *port* (common) | The TCP port the server binds to | | int | *productUri* (common) | The product URI | | String -| *securityPolicies* (common) | Security policies | | Set -| *securityPoliciesById* (common) | Security policies by URI or name. Multiple policies can be separated by comma. | | String -| *userAuthenticationCredentials* (common) | Set user password combinations in the form of user1:pwd1,user2:pwd2 Usernames and passwords will be URL decoded | | String -| *usernameSecurityPolicyUri* (common) | Set the UserTokenPolicy used when. The value can be one of: None, Basic128Rsa15, Basic256, Basic256Sha256, Aes128_Sha256_RsaOaep, Aes256_Sha256_RsaPss | | SecurityPolicy | *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | false | boolean | *lazyStartProducer* (producer) | 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 [...] | *basicPropertyBinding* (advanced) | Whether the component should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | boolean +| *certificate* (security) | Server certificate | | X509Certificate +| *certificateManager* (security) | Server certificate manager | | CertificateManager +| *certificateValidator* (security) | Validator for client certificates | | CertificateValidator +| *defaultCertificateValidator* (security) | Validator for client certificates using default file based approach | | String +| *enableAnonymousAuthentication* (security) | Enable anonymous authentication, disabled by default | false | boolean +| *securityPolicies* (security) | Security policies | | Set +| *securityPoliciesById* (security) | Security policies by URI or name. Multiple policies can be separated by comma. | | String +| *userAuthenticationCredentials* (security) | Set user password combinations in the form of user1:pwd1,user2:pwd2 Usernames and passwords will be URL decoded | | String +| *usernameSecurityPolicyUri* (security) | Set the UserTokenPolicy used when. The value can be one of: None, Basic128Rsa15, Basic256, Basic256Sha256, Aes128_Sha256_RsaOaep, Aes256_Sha256_RsaPss | | SecurityPolicy |=== // component options: END diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientComponent.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientComponent.java index 35a4de0..10ed49a 100644 --- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientComponent.java +++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientComponent.java @@ -56,7 +56,7 @@ public class MiloClientComponent extends DefaultComponent { final String cacheId = configuration.toCacheId(); MiloClientConnection connection = this.cache.get(cacheId); if (connection == null) { - LOG.info("Cache miss - creating new connection instance: {}", cacheId); + LOG.debug("Cache miss - creating new connection instance: {}", cacheId); connection = new MiloClientConnection(configuration); this.cache.put(cacheId, connection); } diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerComponent.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerComponent.java index 96e7110..a02a45d 100644 --- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerComponent.java +++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerComponent.java @@ -38,6 +38,7 @@ import java.util.Set; import org.apache.camel.Endpoint; import org.apache.camel.component.milo.KeyStoreLoader; import org.apache.camel.component.milo.server.internal.CamelNamespace; +import org.apache.camel.spi.Metadata; import org.apache.camel.spi.annotations.Component; import org.apache.camel.support.DefaultComponent; import org.eclipse.milo.opcua.sdk.server.OpcUaServer; @@ -82,26 +83,44 @@ public class MiloServerComponent extends DefaultComponent { private final List<Runnable> runOnStop = new LinkedList<>(); - private int port; - private String namespaceUri = DEFAULT_NAMESPACE_URI; private OpcUaServerConfigBuilder opcServerConfig; private OpcUaServer server; private CamelNamespace namespace; + + @Metadata + private int port; + @Metadata + private List<String> bindAddresses; + @Metadata(defaultValue = "" + DEFAULT_NAMESPACE_URI) + private String namespaceUri = DEFAULT_NAMESPACE_URI; + @Metadata + private String productUri; + @Metadata + private String applicationUri; + @Metadata + private String applicationName; + @Metadata + private String path; + @Metadata + private BuildInfo buildInfo; + @Metadata(label = "security") private Boolean enableAnonymousAuthentication; + @Metadata(label = "security") private CertificateManager certificateManager; + @Metadata(label = "security") private String securityPoliciesById; + @Metadata(label = "security") private Set<SecurityPolicy> securityPolicies; + @Metadata(label = "security", secret = true) private String userAuthenticationCredentials; + @Metadata(label = "security") private String usernameSecurityPolicyUri = OpcUaServerConfig.USER_TOKEN_POLICY_USERNAME.getSecurityPolicyUri(); - private List<String> bindAddresses; + @Metadata(label = "security") private String defaultCertificateValidator; + @Metadata(label = "security") private CertificateValidator certificateValidator; + @Metadata(label = "security") private X509Certificate certificate; - private String productUri; - private String applicationUri; - private String applicationName; - private String path; - private BuildInfo buildInfo; public MiloServerComponent() { this.opcServerConfig = null; diff --git a/components/camel-mongodb/src/generated/resources/org/apache/camel/component/mongodb/mongodb.json b/components/camel-mongodb/src/generated/resources/org/apache/camel/component/mongodb/mongodb.json index 251d2ca..a9ca37f 100644 --- a/components/camel-mongodb/src/generated/resources/org/apache/camel/component/mongodb/mongodb.json +++ b/components/camel-mongodb/src/generated/resources/org/apache/camel/component/mongodb/mongodb.json @@ -21,7 +21,7 @@ "lenientProperties": false }, "componentProperties": { - "mongoConnection": { "kind": "property", "displayName": "Mongo Connection", "group": "common", "required": false, "type": "object", "javaType": "com.mongodb.client.MongoClient", "deprecated": false, "secret": false, "description": "A connection client provided externally" }, + "mongoConnection": { "kind": "property", "displayName": "Mongo Connection", "group": "common", "label": "", "required": false, "type": "object", "javaType": "com.mongodb.client.MongoClient", "deprecated": false, "secret": false, "description": "Shared client used for connection. All endpoints generated from the component will share this connection client." }, "bridgeErrorHandler": { "kind": "property", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by [...] "lazyStartProducer": { "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": 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 r [...] "basicPropertyBinding": { "kind": "property", "displayName": "Basic Property Binding", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "Whether the component should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities" } diff --git a/components/camel-mongodb/src/main/docs/mongodb-component.adoc b/components/camel-mongodb/src/main/docs/mongodb-component.adoc index f4d8dd9..547b2ca 100644 --- a/components/camel-mongodb/src/main/docs/mongodb-component.adoc +++ b/components/camel-mongodb/src/main/docs/mongodb-component.adoc @@ -72,7 +72,7 @@ The MongoDB component supports 4 options, which are listed below. [width="100%",cols="2,5,^1,2",options="header"] |=== | Name | Description | Default | Type -| *mongoConnection* (common) | A connection client provided externally | | MongoClient +| *mongoConnection* (common) | Shared client used for connection. All endpoints generated from the component will share this connection client. | | MongoClient | *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | false | boolean | *lazyStartProducer* (producer) | 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 [...] | *basicPropertyBinding* (advanced) | Whether the component should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | boolean diff --git a/components/camel-mongodb/src/main/java/org/apache/camel/component/mongodb/MongoDbComponent.java b/components/camel-mongodb/src/main/java/org/apache/camel/component/mongodb/MongoDbComponent.java index 9cf699d..78ac11d 100644 --- a/components/camel-mongodb/src/main/java/org/apache/camel/component/mongodb/MongoDbComponent.java +++ b/components/camel-mongodb/src/main/java/org/apache/camel/component/mongodb/MongoDbComponent.java @@ -26,12 +26,10 @@ import org.apache.camel.CamelContext; import org.apache.camel.Endpoint; import org.apache.camel.component.mongodb.meta.MongoDBMetaExtension; import org.apache.camel.component.mongodb.verifier.MongoComponentVerifierExtension; +import org.apache.camel.spi.Metadata; import org.apache.camel.spi.annotations.Component; import org.apache.camel.support.DefaultComponent; -/** - * Represents the component that manages {@link MongoDbEndpoint}. - */ @Component("mongodb") public class MongoDbComponent extends DefaultComponent { @@ -41,9 +39,7 @@ public class MongoDbComponent extends DefaultComponent { MongoDbOperation.update, MongoDbOperation.remove)); - /** - * A connection client provided externally - */ + @Metadata private MongoClient mongoConnection; public MongoDbComponent() { @@ -68,28 +64,19 @@ public class MongoDbComponent extends DefaultComponent { /** * Get the connection bean client used for connection. - * - * @return the client used for connection to db */ public MongoClient getMongoConnection() { return mongoConnection; } /** - * Set a client used for connection: all endpoints generated from the component - * will share this connection bean. - * - * @param mongoConnection the connection bean used as client + * Shared client used for connection. + * All endpoints generated from the component will share this connection client. */ public void setMongoConnection(MongoClient mongoConnection) { this.mongoConnection = mongoConnection; } - @Override - protected void doShutdown() throws Exception { - super.doShutdown(); - } - public static CamelMongoDbException wrapInCamelMongoDbException(Throwable t) { if (t instanceof CamelMongoDbException) { return (CamelMongoDbException) t; diff --git a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/MiloServerComponentBuilderFactory.java b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/MiloServerComponentBuilderFactory.java index 1860bd9..2ae0f69 100644 --- a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/MiloServerComponentBuilderFactory.java +++ b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/MiloServerComponentBuilderFactory.java @@ -98,114 +98,169 @@ public interface MiloServerComponentBuilderFactory { return this; } /** - * Server certificate. + * The URI of the namespace, defaults to urn:org:apache:camel. * - * The option is a: <code>java.security.cert.X509Certificate</code> - * type. + * The option is a: <code>java.lang.String</code> type. * + * Default: urn:org:apache:camel * Group: common */ - default MiloServerComponentBuilder certificate( - java.security.cert.X509Certificate certificate) { - doSetProperty("certificate", certificate); + default MiloServerComponentBuilder namespaceUri( + java.lang.String namespaceUri) { + doSetProperty("namespaceUri", namespaceUri); return this; } /** - * Server certificate manager. + * The path to be appended to the end of the endpoint url. (doesn't need + * to start with '/'). * - * The option is a: - * <code>org.eclipse.milo.opcua.stack.core.security.CertificateManager</code> type. + * The option is a: <code>java.lang.String</code> type. * * Group: common */ - default MiloServerComponentBuilder certificateManager( - org.eclipse.milo.opcua.stack.core.security.CertificateManager certificateManager) { - doSetProperty("certificateManager", certificateManager); + default MiloServerComponentBuilder path(java.lang.String path) { + doSetProperty("path", path); return this; } /** - * Validator for client certificates. + * The TCP port the server binds to. * - * The option is a: - * <code>org.eclipse.milo.opcua.stack.core.security.CertificateValidator</code> type. + * The option is a: <code>int</code> type. * * Group: common */ - default MiloServerComponentBuilder certificateValidator( - org.eclipse.milo.opcua.stack.core.security.CertificateValidator certificateValidator) { - doSetProperty("certificateValidator", certificateValidator); + default MiloServerComponentBuilder port(int port) { + doSetProperty("port", port); return this; } /** - * Validator for client certificates using default file based approach. + * The product URI. * * The option is a: <code>java.lang.String</code> type. * * Group: common */ - default MiloServerComponentBuilder defaultCertificateValidator( - java.lang.String defaultCertificateValidator) { - doSetProperty("defaultCertificateValidator", defaultCertificateValidator); + default MiloServerComponentBuilder productUri( + java.lang.String productUri) { + doSetProperty("productUri", productUri); return this; } /** - * Enable anonymous authentication, disabled by default. + * Allows for bridging the consumer to the Camel routing Error Handler, + * which mean any exceptions occurred while the consumer is trying to + * pickup incoming messages, or the likes, will now be processed as a + * message and handled by the routing Error Handler. By default the + * consumer will use the org.apache.camel.spi.ExceptionHandler to deal + * with exceptions, that will be logged at WARN or ERROR level and + * ignored. * * The option is a: <code>boolean</code> type. * * Default: false - * Group: common + * Group: consumer */ - default MiloServerComponentBuilder enableAnonymousAuthentication( - boolean enableAnonymousAuthentication) { - doSetProperty("enableAnonymousAuthentication", enableAnonymousAuthentication); + default MiloServerComponentBuilder bridgeErrorHandler( + boolean bridgeErrorHandler) { + doSetProperty("bridgeErrorHandler", bridgeErrorHandler); return this; } /** - * The URI of the namespace, defaults to urn:org:apache:camel. + * 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. * - * The option is a: <code>java.lang.String</code> type. + * The option is a: <code>boolean</code> type. * - * Group: common + * Default: false + * Group: producer */ - default MiloServerComponentBuilder namespaceUri( - java.lang.String namespaceUri) { - doSetProperty("namespaceUri", namespaceUri); + default MiloServerComponentBuilder lazyStartProducer( + boolean lazyStartProducer) { + doSetProperty("lazyStartProducer", lazyStartProducer); return this; } /** - * The path to be appended to the end of the endpoint url. (doesn't need - * to start with '/'). + * Whether the component should use basic property binding (Camel 2.x) + * or the newer property binding with additional capabilities. * - * The option is a: <code>java.lang.String</code> type. + * The option is a: <code>boolean</code> type. * - * Group: common + * Default: false + * Group: advanced */ - default MiloServerComponentBuilder path(java.lang.String path) { - doSetProperty("path", path); + default MiloServerComponentBuilder basicPropertyBinding( + boolean basicPropertyBinding) { + doSetProperty("basicPropertyBinding", basicPropertyBinding); return this; } /** - * The TCP port the server binds to. + * Server certificate. * - * The option is a: <code>int</code> type. + * The option is a: <code>java.security.cert.X509Certificate</code> + * type. * - * Group: common + * Group: security */ - default MiloServerComponentBuilder port(int port) { - doSetProperty("port", port); + default MiloServerComponentBuilder certificate( + java.security.cert.X509Certificate certificate) { + doSetProperty("certificate", certificate); return this; } /** - * The product URI. + * Server certificate manager. + * + * The option is a: + * <code>org.eclipse.milo.opcua.stack.core.security.CertificateManager</code> type. + * + * Group: security + */ + default MiloServerComponentBuilder certificateManager( + org.eclipse.milo.opcua.stack.core.security.CertificateManager certificateManager) { + doSetProperty("certificateManager", certificateManager); + return this; + } + /** + * Validator for client certificates. + * + * The option is a: + * <code>org.eclipse.milo.opcua.stack.core.security.CertificateValidator</code> type. + * + * Group: security + */ + default MiloServerComponentBuilder certificateValidator( + org.eclipse.milo.opcua.stack.core.security.CertificateValidator certificateValidator) { + doSetProperty("certificateValidator", certificateValidator); + return this; + } + /** + * Validator for client certificates using default file based approach. * * The option is a: <code>java.lang.String</code> type. * - * Group: common + * Group: security */ - default MiloServerComponentBuilder productUri( - java.lang.String productUri) { - doSetProperty("productUri", productUri); + default MiloServerComponentBuilder defaultCertificateValidator( + java.lang.String defaultCertificateValidator) { + doSetProperty("defaultCertificateValidator", defaultCertificateValidator); + return this; + } + /** + * Enable anonymous authentication, disabled by default. + * + * The option is a: <code>boolean</code> type. + * + * Default: false + * Group: security + */ + default MiloServerComponentBuilder enableAnonymousAuthentication( + boolean enableAnonymousAuthentication) { + doSetProperty("enableAnonymousAuthentication", enableAnonymousAuthentication); return this; } /** @@ -214,7 +269,7 @@ public interface MiloServerComponentBuilderFactory { * The option is a: * <code>java.util.Set<org.eclipse.milo.opcua.stack.core.security.SecurityPolicy></code> type. * - * Group: common + * Group: security */ default MiloServerComponentBuilder securityPolicies( java.util.Set<org.eclipse.milo.opcua.stack.core.security.SecurityPolicy> securityPolicies) { @@ -227,7 +282,7 @@ public interface MiloServerComponentBuilderFactory { * * The option is a: <code>java.lang.String</code> type. * - * Group: common + * Group: security */ default MiloServerComponentBuilder securityPoliciesById( java.lang.String securityPoliciesById) { @@ -240,7 +295,7 @@ public interface MiloServerComponentBuilderFactory { * * The option is a: <code>java.lang.String</code> type. * - * Group: common + * Group: security */ default MiloServerComponentBuilder userAuthenticationCredentials( java.lang.String userAuthenticationCredentials) { @@ -253,67 +308,13 @@ public interface MiloServerComponentBuilderFactory { * The option is a: * <code>org.eclipse.milo.opcua.stack.core.security.SecurityPolicy</code> type. * - * Group: common + * Group: security */ default MiloServerComponentBuilder usernameSecurityPolicyUri( org.eclipse.milo.opcua.stack.core.security.SecurityPolicy usernameSecurityPolicyUri) { doSetProperty("usernameSecurityPolicyUri", usernameSecurityPolicyUri); return this; } - /** - * Allows for bridging the consumer to the Camel routing Error Handler, - * which mean any exceptions occurred while the consumer is trying to - * pickup incoming messages, or the likes, will now be processed as a - * message and handled by the routing Error Handler. By default the - * consumer will use the org.apache.camel.spi.ExceptionHandler to deal - * with exceptions, that will be logged at WARN or ERROR level and - * ignored. - * - * The option is a: <code>boolean</code> type. - * - * Default: false - * Group: consumer - */ - default MiloServerComponentBuilder bridgeErrorHandler( - boolean bridgeErrorHandler) { - doSetProperty("bridgeErrorHandler", bridgeErrorHandler); - return this; - } - /** - * 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. - * - * The option is a: <code>boolean</code> type. - * - * Default: false - * Group: producer - */ - default MiloServerComponentBuilder lazyStartProducer( - boolean lazyStartProducer) { - doSetProperty("lazyStartProducer", lazyStartProducer); - return this; - } - /** - * Whether the component should use basic property binding (Camel 2.x) - * or the newer property binding with additional capabilities. - * - * The option is a: <code>boolean</code> type. - * - * Default: false - * Group: advanced - */ - default MiloServerComponentBuilder basicPropertyBinding( - boolean basicPropertyBinding) { - doSetProperty("basicPropertyBinding", basicPropertyBinding); - return this; - } } class MiloServerComponentBuilderImpl @@ -335,22 +336,22 @@ public interface MiloServerComponentBuilderFactory { case "applicationUri": ((MiloServerComponent) component).setApplicationUri((java.lang.String) value); return true; case "bindAddresses": ((MiloServerComponent) component).setBindAddresses((java.lang.String) value); return true; case "buildInfo": ((MiloServerComponent) component).setBuildInfo((org.eclipse.milo.opcua.stack.core.types.structured.BuildInfo) value); return true; + case "namespaceUri": ((MiloServerComponent) component).setNamespaceUri((java.lang.String) value); return true; + case "path": ((MiloServerComponent) component).setPath((java.lang.String) value); return true; + case "port": ((MiloServerComponent) component).setPort((int) value); return true; + case "productUri": ((MiloServerComponent) component).setProductUri((java.lang.String) value); return true; + case "bridgeErrorHandler": ((MiloServerComponent) component).setBridgeErrorHandler((boolean) value); return true; + case "lazyStartProducer": ((MiloServerComponent) component).setLazyStartProducer((boolean) value); return true; + case "basicPropertyBinding": ((MiloServerComponent) component).setBasicPropertyBinding((boolean) value); return true; case "certificate": ((MiloServerComponent) component).setCertificate((java.security.cert.X509Certificate) value); return true; case "certificateManager": ((MiloServerComponent) component).setCertificateManager((org.eclipse.milo.opcua.stack.core.security.CertificateManager) value); return true; case "certificateValidator": ((MiloServerComponent) component).setCertificateValidator((org.eclipse.milo.opcua.stack.core.security.CertificateValidator) value); return true; case "defaultCertificateValidator": ((MiloServerComponent) component).setDefaultCertificateValidator((java.lang.String) value); return true; case "enableAnonymousAuthentication": ((MiloServerComponent) component).setEnableAnonymousAuthentication((boolean) value); return true; - case "namespaceUri": ((MiloServerComponent) component).setNamespaceUri((java.lang.String) value); return true; - case "path": ((MiloServerComponent) component).setPath((java.lang.String) value); return true; - case "port": ((MiloServerComponent) component).setPort((int) value); return true; - case "productUri": ((MiloServerComponent) component).setProductUri((java.lang.String) value); return true; case "securityPolicies": ((MiloServerComponent) component).setSecurityPolicies((java.util.Set) value); return true; case "securityPoliciesById": ((MiloServerComponent) component).setSecurityPoliciesById((java.lang.String) value); return true; case "userAuthenticationCredentials": ((MiloServerComponent) component).setUserAuthenticationCredentials((java.lang.String) value); return true; case "usernameSecurityPolicyUri": ((MiloServerComponent) component).setUsernameSecurityPolicyUri((org.eclipse.milo.opcua.stack.core.security.SecurityPolicy) value); return true; - case "bridgeErrorHandler": ((MiloServerComponent) component).setBridgeErrorHandler((boolean) value); return true; - case "lazyStartProducer": ((MiloServerComponent) component).setLazyStartProducer((boolean) value); return true; - case "basicPropertyBinding": ((MiloServerComponent) component).setBasicPropertyBinding((boolean) value); return true; default: return false; } } diff --git a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/MongodbComponentBuilderFactory.java b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/MongodbComponentBuilderFactory.java index ff125b8..aaffbfe 100644 --- a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/MongodbComponentBuilderFactory.java +++ b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/MongodbComponentBuilderFactory.java @@ -49,7 +49,8 @@ public interface MongodbComponentBuilderFactory { extends ComponentBuilder<MongoDbComponent> { /** - * A connection client provided externally. + * Shared client used for connection. All endpoints generated from the + * component will share this connection client. * * The option is a: <code>com.mongodb.client.MongoClient</code> type. *