This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push: new 78cc3f180b4 CAMEL-19050: merge code from camel-3.x branch (#9521) 78cc3f180b4 is described below commit 78cc3f180b466bd484e38142347d69caa31879b2 Author: Claude Mamo <823038+claudem...@users.noreply.github.com> AuthorDate: Mon Mar 13 18:18:19 2023 +0100 CAMEL-19050: merge code from camel-3.x branch (#9521) --- .../component/dhis2/Dhis2ComponentConfigurer.java | 4 ++-- .../component/dhis2/Dhis2EndpointConfigurer.java | 4 ++-- .../component/dhis2/Dhis2EndpointUriFactory.java | 5 ++++- .../org/apache/camel/component/dhis2/dhis2.json | 24 +++++++++++----------- .../camel/component/dhis2/Dhis2Configuration.java | 12 +++++------ .../camel/component/dhis2/Dhis2Endpoint.java | 1 - 6 files changed, 26 insertions(+), 24 deletions(-) diff --git a/components/camel-dhis2/camel-dhis2-component/src/generated/java/org/apache/camel/component/dhis2/Dhis2ComponentConfigurer.java b/components/camel-dhis2/camel-dhis2-component/src/generated/java/org/apache/camel/component/dhis2/Dhis2ComponentConfigurer.java index 52900b5efa5..284353477e8 100644 --- a/components/camel-dhis2/camel-dhis2-component/src/generated/java/org/apache/camel/component/dhis2/Dhis2ComponentConfigurer.java +++ b/components/camel-dhis2/camel-dhis2-component/src/generated/java/org/apache/camel/component/dhis2/Dhis2ComponentConfigurer.java @@ -21,13 +21,13 @@ public class Dhis2ComponentConfigurer extends PropertyConfigurerSupport implemen static { Map<String, Object> map = new CaseInsensitiveMap(); map.put("baseApiUrl", java.lang.String.class); - map.put("password", java.lang.String.class); - map.put("username", java.lang.String.class); map.put("bridgeErrorHandler", boolean.class); map.put("lazyStartProducer", boolean.class); map.put("autowiredEnabled", boolean.class); map.put("client", org.hisp.dhis.integration.sdk.api.Dhis2Client.class); map.put("configuration", org.apache.camel.component.dhis2.Dhis2Configuration.class); + map.put("password", java.lang.String.class); + map.put("username", java.lang.String.class); ALL_OPTIONS = map; } diff --git a/components/camel-dhis2/camel-dhis2-component/src/generated/java/org/apache/camel/component/dhis2/Dhis2EndpointConfigurer.java b/components/camel-dhis2/camel-dhis2-component/src/generated/java/org/apache/camel/component/dhis2/Dhis2EndpointConfigurer.java index 95cac75b87f..7e312c97ed5 100644 --- a/components/camel-dhis2/camel-dhis2-component/src/generated/java/org/apache/camel/component/dhis2/Dhis2EndpointConfigurer.java +++ b/components/camel-dhis2/camel-dhis2-component/src/generated/java/org/apache/camel/component/dhis2/Dhis2EndpointConfigurer.java @@ -24,8 +24,6 @@ public class Dhis2EndpointConfigurer extends PropertyConfigurerSupport implement map.put("methodName", java.lang.String.class); map.put("baseApiUrl", java.lang.String.class); map.put("inBody", java.lang.String.class); - map.put("password", java.lang.String.class); - map.put("username", java.lang.String.class); map.put("sendEmptyMessageWhenIdle", boolean.class); map.put("bridgeErrorHandler", boolean.class); map.put("exceptionHandler", org.apache.camel.spi.ExceptionHandler.class); @@ -47,6 +45,8 @@ public class Dhis2EndpointConfigurer extends PropertyConfigurerSupport implement map.put("startScheduler", boolean.class); map.put("timeUnit", java.util.concurrent.TimeUnit.class); map.put("useFixedDelay", boolean.class); + map.put("password", java.lang.String.class); + map.put("username", java.lang.String.class); ALL_OPTIONS = map; } diff --git a/components/camel-dhis2/camel-dhis2-component/src/generated/java/org/apache/camel/component/dhis2/Dhis2EndpointUriFactory.java b/components/camel-dhis2/camel-dhis2-component/src/generated/java/org/apache/camel/component/dhis2/Dhis2EndpointUriFactory.java index c534f084966..bfd9ec411b1 100644 --- a/components/camel-dhis2/camel-dhis2-component/src/generated/java/org/apache/camel/component/dhis2/Dhis2EndpointUriFactory.java +++ b/components/camel-dhis2/camel-dhis2-component/src/generated/java/org/apache/camel/component/dhis2/Dhis2EndpointUriFactory.java @@ -61,7 +61,10 @@ public class Dhis2EndpointUriFactory extends org.apache.camel.support.component. props.add("useFixedDelay"); props.add("username"); PROPERTY_NAMES = Collections.unmodifiableSet(props); - SECRET_PROPERTY_NAMES = Collections.emptySet(); + Set<String> secretProps = new HashSet<>(2); + secretProps.add("password"); + secretProps.add("username"); + SECRET_PROPERTY_NAMES = Collections.unmodifiableSet(secretProps); Set<String> prefixes = new HashSet<>(1); prefixes.add("scheduler."); MULTI_VALUE_PREFIXES = Collections.unmodifiableSet(prefixes); diff --git a/components/camel-dhis2/camel-dhis2-component/src/generated/resources/org/apache/camel/component/dhis2/dhis2.json b/components/camel-dhis2/camel-dhis2-component/src/generated/resources/org/apache/camel/component/dhis2/dhis2.json index 6f2feb00021..d3fc57d7197 100644 --- a/components/camel-dhis2/camel-dhis2-component/src/generated/resources/org/apache/camel/component/dhis2/dhis2.json +++ b/components/camel-dhis2/camel-dhis2-component/src/generated/resources/org/apache/camel/component/dhis2/dhis2.json @@ -23,29 +23,27 @@ "lenientProperties": false }, "componentProperties": { - "baseApiUrl": { "kind": "property", "displayName": "Base Api Url", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.dhis2.Dhis2Configuration", "configurationField": "configuration", "description": "Base API URL" }, - "password": { "kind": "property", "displayName": "Password", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.dhis2.Dhis2Configuration", "configurationField": "configuration", "description": "Password" }, - "username": { "kind": "property", "displayName": "Username", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.dhis2.Dhis2Configuration", "configurationField": "configuration", "description": "Username" }, + "baseApiUrl": { "kind": "property", "displayName": "Base Api Url", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.dhis2.Dhis2Configuration", "configurationField": "configuration", "description": "DHIS2 server base API URL (e.g., https:\/\/play.dhis2.org\/2.39.1.1\/api)" }, "bridgeErrorHandler": { "kind": "property", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": 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 me [...] "lazyStartProducer": { "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 star [...] "autowiredEnabled": { "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 t [...] - "client": { "kind": "property", "displayName": "Client", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.hisp.dhis.integration.sdk.api.Dhis2Client", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.dhis2.Dhis2Configuration", "configurationField": "configuration", "description": "To use the custom client" }, - "configuration": { "kind": "property", "displayName": "Configuration", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.dhis2.Dhis2Configuration", "deprecated": false, "autowired": false, "secret": false, "description": "To use the shared configuration" } + "client": { "kind": "property", "displayName": "Client", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.hisp.dhis.integration.sdk.api.Dhis2Client", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.dhis2.Dhis2Configuration", "configurationField": "configuration", "description": "References a user-defined org.hisp.dhis.integration.sdk.api.Dhis2Client" }, + "configuration": { "kind": "property", "displayName": "Configuration", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.dhis2.Dhis2Configuration", "deprecated": false, "autowired": false, "secret": false, "description": "To use the shared configuration" }, + "password": { "kind": "property", "displayName": "Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.dhis2.Dhis2Configuration", "configurationField": "configuration", "description": "DHIS2 account password for accessing the DHIS2 API" }, + "username": { "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.dhis2.Dhis2Configuration", "configurationField": "configuration", "description": "DHIS2 account username for accessing the DHIS2 API" } }, "properties": { - "apiName": { "kind": "path", "displayName": "Api Name", "group": "common", "label": "", "required": true, "type": "object", "javaType": "org.apache.camel.component.dhis2.internal.Dhis2ApiName", "enum": [ "POST", "RESOURCE_TABLES", "GET" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.dhis2.Dhis2Configuration", "configurationField": "configuration", "description": "API name" }, - "methodName": { "kind": "path", "displayName": "Method Name", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.dhis2.Dhis2Configuration", "configurationField": "configuration", "description": "Method name" }, - "baseApiUrl": { "kind": "parameter", "displayName": "Base Api Url", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.dhis2.Dhis2Configuration", "configurationField": "configuration", "description": "Base API URL" }, + "apiName": { "kind": "path", "displayName": "Api Name", "group": "common", "label": "", "required": true, "type": "object", "javaType": "org.apache.camel.component.dhis2.internal.Dhis2ApiName", "enum": [ "POST", "RESOURCE_TABLES", "GET" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.dhis2.Dhis2Configuration", "configurationField": "configuration", "description": "API operation (e.g., get)" }, + "methodName": { "kind": "path", "displayName": "Method Name", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.dhis2.Dhis2Configuration", "configurationField": "configuration", "description": "Subject of the API operation (e.g., resource)" }, + "baseApiUrl": { "kind": "parameter", "displayName": "Base Api Url", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.dhis2.Dhis2Configuration", "configurationField": "configuration", "description": "DHIS2 server base API URL (e.g., https:\/\/play.dhis2.org\/2.39.1.1\/api)" }, "inBody": { "kind": "parameter", "displayName": "In Body", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the name of a parameter to be passed in the exchange In Body" }, - "password": { "kind": "parameter", "displayName": "Password", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.dhis2.Dhis2Configuration", "configurationField": "configuration", "description": "Password" }, - "username": { "kind": "parameter", "displayName": "Username", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.dhis2.Dhis2Configuration", "configurationField": "configuration", "description": "Username" }, "sendEmptyMessageWhenIdle": { "kind": "parameter", "displayName": "Send Empty Message When Idle", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "If the polling consumer did not poll any files, you can enable this option to send an empty message (no body) instead." }, "bridgeErrorHandler": { "kind": "parameter", "displayName": "Bridge Error Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": 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 [...] "exceptionHandler": { "kind": "parameter", "displayName": "Exception Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.ExceptionHandler", "optionalPrefix": "consumer.", "deprecated": false, "autowired": false, "secret": false, "description": "To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the con [...] "exchangePattern": { "kind": "parameter", "displayName": "Exchange Pattern", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "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." }, "pollStrategy": { "kind": "parameter", "displayName": "Poll Strategy", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.PollingConsumerPollStrategy", "deprecated": false, "autowired": false, "secret": false, "description": "A pluggable org.apache.camel.PollingConsumerPollingStrategy allowing you to provide your custom implementation to control error handling usually occurred during the poll operation [...] "lazyStartProducer": { "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 other [...] - "client": { "kind": "parameter", "displayName": "Client", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.hisp.dhis.integration.sdk.api.Dhis2Client", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.dhis2.Dhis2Configuration", "configurationField": "configuration", "description": "To use the custom client" }, + "client": { "kind": "parameter", "displayName": "Client", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.hisp.dhis.integration.sdk.api.Dhis2Client", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.dhis2.Dhis2Configuration", "configurationField": "configuration", "description": "References a user-defined org.hisp.dhis.integration.sdk.api.Dhis2Client" }, "backoffErrorThreshold": { "kind": "parameter", "displayName": "Backoff Error Threshold", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "description": "The number of subsequent error polls (failed due some error) that should happen before the backoffMultipler should kick-in." }, "backoffIdleThreshold": { "kind": "parameter", "displayName": "Backoff Idle Threshold", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "description": "The number of subsequent idle polls that should happen before the backoffMultipler should kick-in." }, "backoffMultiplier": { "kind": "parameter", "displayName": "Backoff Multiplier", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "description": "To let the scheduled polling consumer backoff if there has been a number of subsequent idles\/errors in a row. The multiplier is then the number of polls that will be skipped before the next actual attempt is happening agai [...] @@ -59,7 +57,9 @@ "schedulerProperties": { "kind": "parameter", "displayName": "Scheduler Properties", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "object", "javaType": "java.util.Map<java.lang.String, java.lang.Object>", "prefix": "scheduler.", "multiValue": true, "deprecated": false, "autowired": false, "secret": false, "description": "To configure additional properties when using a custom scheduler or any of the Quartz, Spring based scheduler." }, "startScheduler": { "kind": "parameter", "displayName": "Start Scheduler", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether the scheduler should be auto started." }, "timeUnit": { "kind": "parameter", "displayName": "Time Unit", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "object", "javaType": "java.util.concurrent.TimeUnit", "enum": [ "NANOSECONDS", "MICROSECONDS", "MILLISECONDS", "SECONDS", "MINUTES", "HOURS", "DAYS" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "MILLISECONDS", "description": "Time unit for initialDelay and delay options." }, - "useFixedDelay": { "kind": "parameter", "displayName": "Use Fixed Delay", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Controls if fixed delay or fixed rate is used. See ScheduledExecutorService in JDK for details." } + "useFixedDelay": { "kind": "parameter", "displayName": "Use Fixed Delay", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Controls if fixed delay or fixed rate is used. See ScheduledExecutorService in JDK for details." }, + "password": { "kind": "parameter", "displayName": "Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.dhis2.Dhis2Configuration", "configurationField": "configuration", "description": "DHIS2 account password for accessing the DHIS2 API" }, + "username": { "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.dhis2.Dhis2Configuration", "configurationField": "configuration", "description": "DHIS2 account username for accessing the DHIS2 API" } }, "apis": { "get": { "consumerOnly": false, "producerOnly": false, "description": "Sample API used by Dhis2 Component whose method signatures are read from Java source", "methods": { "collection": { "description": "", "signatures": [ "java.util.Iterator collection(String path, String itemType, Boolean paging, String fields, String filter, java.util.Map<String, Object> queryParams)" ] }, "resource": { "description": "", "signatures": [ "java.io.InputStream resource(String path, String fields, Str [...] diff --git a/components/camel-dhis2/camel-dhis2-component/src/main/java/org/apache/camel/component/dhis2/Dhis2Configuration.java b/components/camel-dhis2/camel-dhis2-component/src/main/java/org/apache/camel/component/dhis2/Dhis2Configuration.java index 229acca6c01..72463618f57 100644 --- a/components/camel-dhis2/camel-dhis2-component/src/main/java/org/apache/camel/component/dhis2/Dhis2Configuration.java +++ b/components/camel-dhis2/camel-dhis2-component/src/main/java/org/apache/camel/component/dhis2/Dhis2Configuration.java @@ -27,24 +27,24 @@ import org.hisp.dhis.integration.sdk.api.Dhis2Client; @UriParams @Configurer public class Dhis2Configuration { - @UriParam(description = "Base API URL") + @UriParam(description = "DHIS2 server base API URL (e.g., https://play.dhis2.org/2.39.1.1/api)") private String baseApiUrl; - @UriParam(description = "Username") + @UriParam(description = "DHIS2 account username for accessing the DHIS2 API", secret = true, label = "security") private String username; - @UriParam(description = "Password") + @UriParam(description = "DHIS2 account password for accessing the DHIS2 API", secret = true, label = "security") private String password; - @UriPath(description = "API name") + @UriPath(description = "API operation (e.g., get)") @Metadata(required = true) private Dhis2ApiName apiName; - @UriPath(description = "Method name") + @UriPath(description = "Subject of the API operation (e.g., resource)") @Metadata(required = true) private String methodName; - @UriParam(label = "advanced", description = "To use the custom client") + @UriParam(label = "advanced", description = "References a user-defined org.hisp.dhis.integration.sdk.api.Dhis2Client") private Dhis2Client client; public String getBaseApiUrl() { diff --git a/components/camel-dhis2/camel-dhis2-component/src/main/java/org/apache/camel/component/dhis2/Dhis2Endpoint.java b/components/camel-dhis2/camel-dhis2-component/src/main/java/org/apache/camel/component/dhis2/Dhis2Endpoint.java index e6dbbad1381..bcf8e0e7298 100644 --- a/components/camel-dhis2/camel-dhis2-component/src/main/java/org/apache/camel/component/dhis2/Dhis2Endpoint.java +++ b/components/camel-dhis2/camel-dhis2-component/src/main/java/org/apache/camel/component/dhis2/Dhis2Endpoint.java @@ -48,7 +48,6 @@ public class Dhis2Endpoint extends AbstractApiEndpoint<Dhis2ApiName, Dhis2Config @UriParam private final Dhis2Configuration configuration; - // TODO create and manage API proxy private Object apiProxy; public Dhis2Endpoint(String uri, Dhis2Component component,