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 1806dcece5f camel-dhis2 - fix wrong uri syntax 1806dcece5f is described below commit 1806dcece5f687848a526a373bfbd13c13a1a839 Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Fri Jun 2 09:09:51 2023 +0200 camel-dhis2 - fix wrong uri syntax --- .../org/apache/camel/catalog/components.properties | 1 + .../apache/camel/catalog/components}/dhis2.json | 2 +- .../component/dhis2/Dhis2EndpointUriFactory.java | 2 +- .../org/apache/camel/component/dhis2/dhis2.json | 2 +- .../camel/component/dhis2/Dhis2Endpoint.java | 3 +- .../org/apache/camel/main/components.properties | 1 + .../component/ComponentsBuilderFactory.java | 14 + .../dsl/Dhis2ComponentBuilderFactory.java | 231 ++++ .../src/generated/resources/metadata.json | 23 + .../builder/endpoint/EndpointBuilderFactory.java | 1 + .../camel/builder/endpoint/EndpointBuilders.java | 1 + .../builder/endpoint/StaticEndpointBuilders.java | 55 + .../endpoint/dsl/Dhis2EndpointBuilderFactory.java | 1153 ++++++++++++++++++++ .../camel-component-known-dependencies.properties | 1 + .../apache/camel/maven/packaging/MojoHelper.java | 2 + 15 files changed, 1487 insertions(+), 5 deletions(-) diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components.properties b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components.properties index 0bda77cf51f..eff09df31ba 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components.properties +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components.properties @@ -73,6 +73,7 @@ debezium-mysql debezium-oracle debezium-postgres debezium-sqlserver +dhis2 digitalocean direct disruptor diff --git a/components/camel-dhis2/camel-dhis2-component/src/generated/resources/org/apache/camel/component/dhis2/dhis2.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/dhis2.json similarity index 99% copy from components/camel-dhis2/camel-dhis2-component/src/generated/resources/org/apache/camel/component/dhis2/dhis2.json copy to catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/dhis2.json index 9dfcb1589b1..9aa214978e9 100644 --- a/components/camel-dhis2/camel-dhis2-component/src/generated/resources/org/apache/camel/component/dhis2/dhis2.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/dhis2.json @@ -14,7 +14,7 @@ "version": "4.0.0-SNAPSHOT", "scheme": "dhis2", "extendsScheme": "", - "syntax": "dhis2:methodName", + "syntax": "dhis2:apiName\/methodName", "async": false, "api": true, "apiSyntax": "apiName\/methodName", 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 4a7b44074cd..5070d971ce7 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 @@ -15,7 +15,7 @@ import org.apache.camel.spi.EndpointUriFactory; */ public class Dhis2EndpointUriFactory extends org.apache.camel.support.component.EndpointUriFactorySupport implements EndpointUriFactory { - private static final String BASE = ":methodName"; + private static final String BASE = ":apiName/methodName"; private static final Set<String> PROPERTY_NAMES; private static final Set<String> SECRET_PROPERTY_NAMES; 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 9dfcb1589b1..9aa214978e9 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 @@ -14,7 +14,7 @@ "version": "4.0.0-SNAPSHOT", "scheme": "dhis2", "extendsScheme": "", - "syntax": "dhis2:methodName", + "syntax": "dhis2:apiName\/methodName", "async": false, "api": true, "apiSyntax": "apiName\/methodName", 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 7d8a8cbfddd..af8ec5f031f 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 @@ -40,9 +40,8 @@ import org.hisp.dhis.integration.sdk.api.Dhis2Client; /** * Leverages the DHIS2 Java SDK to integrate Apache Camel with the DHIS2 Web API. - * <p> */ -@UriEndpoint(firstVersion = "4.0.0", scheme = "dhis2", title = "DHIS2", syntax = "dhis2:methodName", +@UriEndpoint(firstVersion = "4.0.0", scheme = "dhis2", title = "DHIS2", syntax = "dhis2:apiName/methodName", apiSyntax = "apiName/methodName", category = { Category.API }) public class Dhis2Endpoint extends AbstractApiEndpoint<Dhis2ApiName, Dhis2Configuration> { diff --git a/core/camel-main/src/generated/resources/org/apache/camel/main/components.properties b/core/camel-main/src/generated/resources/org/apache/camel/main/components.properties index 0bda77cf51f..eff09df31ba 100644 --- a/core/camel-main/src/generated/resources/org/apache/camel/main/components.properties +++ b/core/camel-main/src/generated/resources/org/apache/camel/main/components.properties @@ -73,6 +73,7 @@ debezium-mysql debezium-oracle debezium-postgres debezium-sqlserver +dhis2 digitalocean direct disruptor diff --git a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java index d6ec55bf575..4dee78746e5 100644 --- a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java +++ b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java @@ -1040,6 +1040,20 @@ public interface ComponentsBuilderFactory { static org.apache.camel.builder.component.dsl.DebeziumSqlserverComponentBuilderFactory.DebeziumSqlserverComponentBuilder debeziumSqlserver() { return org.apache.camel.builder.component.dsl.DebeziumSqlserverComponentBuilderFactory.debeziumSqlserver(); } + /** + * DHIS2 (camel-dhis2) + * Leverages the DHIS2 Java SDK to integrate Apache Camel with the DHIS2 Web + * API. + * + * Category: api + * Since: 4.0 + * Maven coordinates: org.apache.camel:camel-dhis2 + * + * @return the dsl builder + */ + static org.apache.camel.builder.component.dsl.Dhis2ComponentBuilderFactory.Dhis2ComponentBuilder dhis2() { + return org.apache.camel.builder.component.dsl.Dhis2ComponentBuilderFactory.dhis2(); + } /** * DigitalOcean (camel-digitalocean) * Manage Droplets and resources within the DigitalOcean cloud. diff --git a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Dhis2ComponentBuilderFactory.java b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Dhis2ComponentBuilderFactory.java new file mode 100644 index 00000000000..187ff3ec5a5 --- /dev/null +++ b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Dhis2ComponentBuilderFactory.java @@ -0,0 +1,231 @@ +/* + * 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.builder.component.dsl; + +import javax.annotation.processing.Generated; +import org.apache.camel.Component; +import org.apache.camel.builder.component.AbstractComponentBuilder; +import org.apache.camel.builder.component.ComponentBuilder; +import org.apache.camel.component.dhis2.Dhis2Component; + +/** + * Leverages the DHIS2 Java SDK to integrate Apache Camel with the DHIS2 Web + * API. + * + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Generated("org.apache.camel.maven.packaging.ComponentDslMojo") +public interface Dhis2ComponentBuilderFactory { + + /** + * DHIS2 (camel-dhis2) + * Leverages the DHIS2 Java SDK to integrate Apache Camel with the DHIS2 Web + * API. + * + * Category: api + * Since: 4.0 + * Maven coordinates: org.apache.camel:camel-dhis2 + * + * @return the dsl builder + */ + static Dhis2ComponentBuilder dhis2() { + return new Dhis2ComponentBuilderImpl(); + } + + /** + * Builder for the DHIS2 component. + */ + interface Dhis2ComponentBuilder extends ComponentBuilder<Dhis2Component> { + /** + * DHIS2 server base API URL (e.g., + * https://play.dhis2.org/2.39.1.1/api). + * + * The option is a: <code>java.lang.String</code> type. + * + * Group: common + * + * @param baseApiUrl the value to set + * @return the dsl builder + */ + default Dhis2ComponentBuilder baseApiUrl(java.lang.String baseApiUrl) { + doSetProperty("baseApiUrl", baseApiUrl); + 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 + * + * @param bridgeErrorHandler the value to set + * @return the dsl builder + */ + default Dhis2ComponentBuilder 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 + * + * @param lazyStartProducer the value to set + * @return the dsl builder + */ + default Dhis2ComponentBuilder lazyStartProducer( + boolean lazyStartProducer) { + doSetProperty("lazyStartProducer", lazyStartProducer); + return this; + } + /** + * 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. + * + * The option is a: <code>boolean</code> type. + * + * Default: true + * Group: advanced + * + * @param autowiredEnabled the value to set + * @return the dsl builder + */ + default Dhis2ComponentBuilder autowiredEnabled(boolean autowiredEnabled) { + doSetProperty("autowiredEnabled", autowiredEnabled); + return this; + } + /** + * References a user-defined + * org.hisp.dhis.integration.sdk.api.Dhis2Client. + * + * The option is a: + * <code>org.hisp.dhis.integration.sdk.api.Dhis2Client</code> type. + * + * Group: advanced + * + * @param client the value to set + * @return the dsl builder + */ + default Dhis2ComponentBuilder client( + org.hisp.dhis.integration.sdk.api.Dhis2Client client) { + doSetProperty("client", client); + return this; + } + /** + * To use the shared configuration. + * + * The option is a: + * <code>org.apache.camel.component.dhis2.Dhis2Configuration</code> type. + * + * Group: advanced + * + * @param configuration the value to set + * @return the dsl builder + */ + default Dhis2ComponentBuilder configuration( + org.apache.camel.component.dhis2.Dhis2Configuration configuration) { + doSetProperty("configuration", configuration); + return this; + } + /** + * DHIS2 account password for accessing the DHIS2 API. + * + * The option is a: <code>java.lang.String</code> type. + * + * Group: security + * + * @param password the value to set + * @return the dsl builder + */ + default Dhis2ComponentBuilder password(java.lang.String password) { + doSetProperty("password", password); + return this; + } + /** + * DHIS2 account username for accessing the DHIS2 API. + * + * The option is a: <code>java.lang.String</code> type. + * + * Group: security + * + * @param username the value to set + * @return the dsl builder + */ + default Dhis2ComponentBuilder username(java.lang.String username) { + doSetProperty("username", username); + return this; + } + } + + class Dhis2ComponentBuilderImpl + extends + AbstractComponentBuilder<Dhis2Component> + implements + Dhis2ComponentBuilder { + @Override + protected Dhis2Component buildConcreteComponent() { + return new Dhis2Component(); + } + private org.apache.camel.component.dhis2.Dhis2Configuration getOrCreateConfiguration( + org.apache.camel.component.dhis2.Dhis2Component component) { + if (component.getConfiguration() == null) { + component.setConfiguration(new org.apache.camel.component.dhis2.Dhis2Configuration()); + } + return component.getConfiguration(); + } + @Override + protected boolean setPropertyOnComponent( + Component component, + String name, + Object value) { + switch (name) { + case "baseApiUrl": getOrCreateConfiguration((Dhis2Component) component).setBaseApiUrl((java.lang.String) value); return true; + case "bridgeErrorHandler": ((Dhis2Component) component).setBridgeErrorHandler((boolean) value); return true; + case "lazyStartProducer": ((Dhis2Component) component).setLazyStartProducer((boolean) value); return true; + case "autowiredEnabled": ((Dhis2Component) component).setAutowiredEnabled((boolean) value); return true; + case "client": getOrCreateConfiguration((Dhis2Component) component).setClient((org.hisp.dhis.integration.sdk.api.Dhis2Client) value); return true; + case "configuration": ((Dhis2Component) component).setConfiguration((org.apache.camel.component.dhis2.Dhis2Configuration) value); return true; + case "password": getOrCreateConfiguration((Dhis2Component) component).setPassword((java.lang.String) value); return true; + case "username": getOrCreateConfiguration((Dhis2Component) component).setUsername((java.lang.String) value); return true; + default: return false; + } + } + } +} \ No newline at end of file diff --git a/dsl/camel-componentdsl/src/generated/resources/metadata.json b/dsl/camel-componentdsl/src/generated/resources/metadata.json index 83a855bb346..73e25379c8b 100644 --- a/dsl/camel-componentdsl/src/generated/resources/metadata.json +++ b/dsl/camel-componentdsl/src/generated/resources/metadata.json @@ -1661,6 +1661,29 @@ "producerOnly": false, "lenientProperties": false }, + "Dhis2ComponentBuilderFactory": { + "kind": "component", + "name": "dhis2", + "title": "DHIS2", + "description": "Leverages the DHIS2 Java SDK to integrate Apache Camel with the DHIS2 Web API.", + "deprecated": false, + "firstVersion": "4.0.0", + "label": "api", + "javaType": "org.apache.camel.component.dhis2.Dhis2Component", + "supportLevel": "Preview", + "groupId": "org.apache.camel", + "artifactId": "camel-dhis2", + "version": "4.0.0-SNAPSHOT", + "scheme": "dhis2", + "extendsScheme": "", + "syntax": "dhis2:apiName\/methodName", + "async": false, + "api": true, + "apiSyntax": "apiName\/methodName", + "consumerOnly": false, + "producerOnly": false, + "lenientProperties": false + }, "DigitaloceanComponentBuilderFactory": { "kind": "component", "name": "digitalocean", diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilderFactory.java index 96a5eb6c2d7..14cf0170105 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilderFactory.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilderFactory.java @@ -82,6 +82,7 @@ public interface EndpointBuilderFactory org.apache.camel.builder.endpoint.dsl.DebeziumOracleEndpointBuilderFactory.DebeziumOracleBuilders, org.apache.camel.builder.endpoint.dsl.DebeziumPostgresEndpointBuilderFactory.DebeziumPostgresBuilders, org.apache.camel.builder.endpoint.dsl.DebeziumSqlserverEndpointBuilderFactory.DebeziumSqlserverBuilders, + org.apache.camel.builder.endpoint.dsl.Dhis2EndpointBuilderFactory.Dhis2Builders, org.apache.camel.builder.endpoint.dsl.DigitalOceanEndpointBuilderFactory.DigitalOceanBuilders, org.apache.camel.builder.endpoint.dsl.DigitalSignatureEndpointBuilderFactory.DigitalSignatureBuilders, org.apache.camel.builder.endpoint.dsl.DirectEndpointBuilderFactory.DirectBuilders, diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilders.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilders.java index 7f0731519f4..7a028a67a65 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilders.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilders.java @@ -79,6 +79,7 @@ public interface EndpointBuilders org.apache.camel.builder.endpoint.dsl.DebeziumOracleEndpointBuilderFactory, org.apache.camel.builder.endpoint.dsl.DebeziumPostgresEndpointBuilderFactory, org.apache.camel.builder.endpoint.dsl.DebeziumSqlserverEndpointBuilderFactory, + org.apache.camel.builder.endpoint.dsl.Dhis2EndpointBuilderFactory, org.apache.camel.builder.endpoint.dsl.DigitalOceanEndpointBuilderFactory, org.apache.camel.builder.endpoint.dsl.DigitalSignatureEndpointBuilderFactory, org.apache.camel.builder.endpoint.dsl.DirectEndpointBuilderFactory, diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java index ca93a76df4a..d45086899e7 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java @@ -3414,6 +3414,61 @@ public class StaticEndpointBuilders { String path) { return org.apache.camel.builder.endpoint.dsl.DebeziumSqlserverEndpointBuilderFactory.endpointBuilder(componentName, path); } + /** + * DHIS2 (camel-dhis2) + * Leverages the DHIS2 Java SDK to integrate Apache Camel with the DHIS2 Web + * API. + * + * Category: api + * Since: 4.0 + * Maven coordinates: org.apache.camel:camel-dhis2 + * + * Syntax: <code>dhis2:apiName/methodName</code> + * + * Path parameter: apiName (required) + * API operation (e.g., get) + * There are 5 enums and the value can be one of: POST, RESOURCE_TABLES, + * GET, DELETE, PUT + * + * Path parameter: methodName (required) + * Subject of the API operation (e.g., resource) + * + * @param path apiName/methodName + * @return the dsl builder + */ + public static org.apache.camel.builder.endpoint.dsl.Dhis2EndpointBuilderFactory.Dhis2EndpointBuilder dhis2( + String path) { + return org.apache.camel.builder.endpoint.dsl.Dhis2EndpointBuilderFactory.endpointBuilder("dhis2", path); + } + /** + * DHIS2 (camel-dhis2) + * Leverages the DHIS2 Java SDK to integrate Apache Camel with the DHIS2 Web + * API. + * + * Category: api + * Since: 4.0 + * Maven coordinates: org.apache.camel:camel-dhis2 + * + * Syntax: <code>dhis2:apiName/methodName</code> + * + * Path parameter: apiName (required) + * API operation (e.g., get) + * There are 5 enums and the value can be one of: POST, RESOURCE_TABLES, + * GET, DELETE, PUT + * + * Path parameter: methodName (required) + * Subject of the API operation (e.g., resource) + * + * @param componentName to use a custom component name for the endpoint + * instead of the default name + * @param path apiName/methodName + * @return the dsl builder + */ + public static org.apache.camel.builder.endpoint.dsl.Dhis2EndpointBuilderFactory.Dhis2EndpointBuilder dhis2( + String componentName, + String path) { + return org.apache.camel.builder.endpoint.dsl.Dhis2EndpointBuilderFactory.endpointBuilder(componentName, path); + } /** * DigitalOcean (camel-digitalocean) * Manage Droplets and resources within the DigitalOcean cloud. diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Dhis2EndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Dhis2EndpointBuilderFactory.java new file mode 100644 index 00000000000..321b1525bb6 --- /dev/null +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Dhis2EndpointBuilderFactory.java @@ -0,0 +1,1153 @@ +/* + * 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.builder.endpoint.dsl; + +import java.util.*; +import java.util.Map; +import java.util.concurrent.*; +import java.util.function.*; +import java.util.stream.*; +import javax.annotation.processing.Generated; +import org.apache.camel.builder.EndpointConsumerBuilder; +import org.apache.camel.builder.EndpointProducerBuilder; +import org.apache.camel.builder.endpoint.AbstractEndpointBuilder; + +/** + * Leverages the DHIS2 Java SDK to integrate Apache Camel with the DHIS2 Web + * API. + * + * Generated by camel build tools - do NOT edit this file! + */ +@Generated("org.apache.camel.maven.packaging.EndpointDslMojo") +public interface Dhis2EndpointBuilderFactory { + + + /** + * Builder for endpoint consumers for the DHIS2 component. + */ + public interface Dhis2EndpointConsumerBuilder + extends + EndpointConsumerBuilder { + default AdvancedDhis2EndpointConsumerBuilder advanced() { + return (AdvancedDhis2EndpointConsumerBuilder) this; + } + /** + * DHIS2 server base API URL (e.g., + * https://play.dhis2.org/2.39.1.1/api). + * + * The option is a: <code>java.lang.String</code> type. + * + * Group: common + * + * @param baseApiUrl the value to set + * @return the dsl builder + */ + default Dhis2EndpointConsumerBuilder baseApiUrl(String baseApiUrl) { + doSetProperty("baseApiUrl", baseApiUrl); + return this; + } + /** + * Sets the name of a parameter to be passed in the exchange In Body. + * + * The option is a: <code>java.lang.String</code> type. + * + * Group: common + * + * @param inBody the value to set + * @return the dsl builder + */ + default Dhis2EndpointConsumerBuilder inBody(String inBody) { + doSetProperty("inBody", inBody); + return this; + } + /** + * If the polling consumer did not poll any files, you can enable this + * option to send an empty message (no body) instead. + * + * The option is a: <code>boolean</code> type. + * + * Default: false + * Group: consumer + * + * @param sendEmptyMessageWhenIdle the value to set + * @return the dsl builder + */ + default Dhis2EndpointConsumerBuilder sendEmptyMessageWhenIdle( + boolean sendEmptyMessageWhenIdle) { + doSetProperty("sendEmptyMessageWhenIdle", sendEmptyMessageWhenIdle); + return this; + } + /** + * If the polling consumer did not poll any files, you can enable this + * option to send an empty message (no body) instead. + * + * The option will be converted to a <code>boolean</code> + * type. + * + * Default: false + * Group: consumer + * + * @param sendEmptyMessageWhenIdle the value to set + * @return the dsl builder + */ + default Dhis2EndpointConsumerBuilder sendEmptyMessageWhenIdle( + String sendEmptyMessageWhenIdle) { + doSetProperty("sendEmptyMessageWhenIdle", sendEmptyMessageWhenIdle); + return this; + } + /** + * The number of subsequent error polls (failed due some error) that + * should happen before the backoffMultipler should kick-in. + * + * The option is a: <code>int</code> type. + * + * Group: scheduler + * + * @param backoffErrorThreshold the value to set + * @return the dsl builder + */ + default Dhis2EndpointConsumerBuilder backoffErrorThreshold( + int backoffErrorThreshold) { + doSetProperty("backoffErrorThreshold", backoffErrorThreshold); + return this; + } + /** + * The number of subsequent error polls (failed due some error) that + * should happen before the backoffMultipler should kick-in. + * + * The option will be converted to a <code>int</code> type. + * + * Group: scheduler + * + * @param backoffErrorThreshold the value to set + * @return the dsl builder + */ + default Dhis2EndpointConsumerBuilder backoffErrorThreshold( + String backoffErrorThreshold) { + doSetProperty("backoffErrorThreshold", backoffErrorThreshold); + return this; + } + /** + * The number of subsequent idle polls that should happen before the + * backoffMultipler should kick-in. + * + * The option is a: <code>int</code> type. + * + * Group: scheduler + * + * @param backoffIdleThreshold the value to set + * @return the dsl builder + */ + default Dhis2EndpointConsumerBuilder backoffIdleThreshold( + int backoffIdleThreshold) { + doSetProperty("backoffIdleThreshold", backoffIdleThreshold); + return this; + } + /** + * The number of subsequent idle polls that should happen before the + * backoffMultipler should kick-in. + * + * The option will be converted to a <code>int</code> type. + * + * Group: scheduler + * + * @param backoffIdleThreshold the value to set + * @return the dsl builder + */ + default Dhis2EndpointConsumerBuilder backoffIdleThreshold( + String backoffIdleThreshold) { + doSetProperty("backoffIdleThreshold", backoffIdleThreshold); + return this; + } + /** + * 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 again. When this option is in use then + * backoffIdleThreshold and/or backoffErrorThreshold must also be + * configured. + * + * The option is a: <code>int</code> type. + * + * Group: scheduler + * + * @param backoffMultiplier the value to set + * @return the dsl builder + */ + default Dhis2EndpointConsumerBuilder backoffMultiplier( + int backoffMultiplier) { + doSetProperty("backoffMultiplier", backoffMultiplier); + return this; + } + /** + * 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 again. When this option is in use then + * backoffIdleThreshold and/or backoffErrorThreshold must also be + * configured. + * + * The option will be converted to a <code>int</code> type. + * + * Group: scheduler + * + * @param backoffMultiplier the value to set + * @return the dsl builder + */ + default Dhis2EndpointConsumerBuilder backoffMultiplier( + String backoffMultiplier) { + doSetProperty("backoffMultiplier", backoffMultiplier); + return this; + } + /** + * Milliseconds before the next poll. + * + * The option is a: <code>long</code> type. + * + * Default: 500 + * Group: scheduler + * + * @param delay the value to set + * @return the dsl builder + */ + default Dhis2EndpointConsumerBuilder delay(long delay) { + doSetProperty("delay", delay); + return this; + } + /** + * Milliseconds before the next poll. + * + * The option will be converted to a <code>long</code> type. + * + * Default: 500 + * Group: scheduler + * + * @param delay the value to set + * @return the dsl builder + */ + default Dhis2EndpointConsumerBuilder delay(String delay) { + doSetProperty("delay", delay); + return this; + } + /** + * If greedy is enabled, then the ScheduledPollConsumer will run + * immediately again, if the previous run polled 1 or more messages. + * + * The option is a: <code>boolean</code> type. + * + * Default: false + * Group: scheduler + * + * @param greedy the value to set + * @return the dsl builder + */ + default Dhis2EndpointConsumerBuilder greedy(boolean greedy) { + doSetProperty("greedy", greedy); + return this; + } + /** + * If greedy is enabled, then the ScheduledPollConsumer will run + * immediately again, if the previous run polled 1 or more messages. + * + * The option will be converted to a <code>boolean</code> + * type. + * + * Default: false + * Group: scheduler + * + * @param greedy the value to set + * @return the dsl builder + */ + default Dhis2EndpointConsumerBuilder greedy(String greedy) { + doSetProperty("greedy", greedy); + return this; + } + /** + * Milliseconds before the first poll starts. + * + * The option is a: <code>long</code> type. + * + * Default: 1000 + * Group: scheduler + * + * @param initialDelay the value to set + * @return the dsl builder + */ + default Dhis2EndpointConsumerBuilder initialDelay(long initialDelay) { + doSetProperty("initialDelay", initialDelay); + return this; + } + /** + * Milliseconds before the first poll starts. + * + * The option will be converted to a <code>long</code> type. + * + * Default: 1000 + * Group: scheduler + * + * @param initialDelay the value to set + * @return the dsl builder + */ + default Dhis2EndpointConsumerBuilder initialDelay(String initialDelay) { + doSetProperty("initialDelay", initialDelay); + return this; + } + /** + * Specifies a maximum limit of number of fires. So if you set it to 1, + * the scheduler will only fire once. If you set it to 5, it will only + * fire five times. A value of zero or negative means fire forever. + * + * The option is a: <code>long</code> type. + * + * Default: 0 + * Group: scheduler + * + * @param repeatCount the value to set + * @return the dsl builder + */ + default Dhis2EndpointConsumerBuilder repeatCount(long repeatCount) { + doSetProperty("repeatCount", repeatCount); + return this; + } + /** + * Specifies a maximum limit of number of fires. So if you set it to 1, + * the scheduler will only fire once. If you set it to 5, it will only + * fire five times. A value of zero or negative means fire forever. + * + * The option will be converted to a <code>long</code> type. + * + * Default: 0 + * Group: scheduler + * + * @param repeatCount the value to set + * @return the dsl builder + */ + default Dhis2EndpointConsumerBuilder repeatCount(String repeatCount) { + doSetProperty("repeatCount", repeatCount); + return this; + } + /** + * The consumer logs a start/complete log line when it polls. This + * option allows you to configure the logging level for that. + * + * The option is a: + * <code>org.apache.camel.LoggingLevel</code> type. + * + * Default: TRACE + * Group: scheduler + * + * @param runLoggingLevel the value to set + * @return the dsl builder + */ + default Dhis2EndpointConsumerBuilder runLoggingLevel( + org.apache.camel.LoggingLevel runLoggingLevel) { + doSetProperty("runLoggingLevel", runLoggingLevel); + return this; + } + /** + * The consumer logs a start/complete log line when it polls. This + * option allows you to configure the logging level for that. + * + * The option will be converted to a + * <code>org.apache.camel.LoggingLevel</code> type. + * + * Default: TRACE + * Group: scheduler + * + * @param runLoggingLevel the value to set + * @return the dsl builder + */ + default Dhis2EndpointConsumerBuilder runLoggingLevel( + String runLoggingLevel) { + doSetProperty("runLoggingLevel", runLoggingLevel); + return this; + } + /** + * Allows for configuring a custom/shared thread pool to use for the + * consumer. By default each consumer has its own single threaded thread + * pool. + * + * The option is a: + * <code>java.util.concurrent.ScheduledExecutorService</code> type. + * + * Group: scheduler + * + * @param scheduledExecutorService the value to set + * @return the dsl builder + */ + default Dhis2EndpointConsumerBuilder scheduledExecutorService( + ScheduledExecutorService scheduledExecutorService) { + doSetProperty("scheduledExecutorService", scheduledExecutorService); + return this; + } + /** + * Allows for configuring a custom/shared thread pool to use for the + * consumer. By default each consumer has its own single threaded thread + * pool. + * + * The option will be converted to a + * <code>java.util.concurrent.ScheduledExecutorService</code> type. + * + * Group: scheduler + * + * @param scheduledExecutorService the value to set + * @return the dsl builder + */ + default Dhis2EndpointConsumerBuilder scheduledExecutorService( + String scheduledExecutorService) { + doSetProperty("scheduledExecutorService", scheduledExecutorService); + return this; + } + /** + * To use a cron scheduler from either camel-spring or camel-quartz + * component. Use value spring or quartz for built in scheduler. + * + * The option is a: <code>java.lang.Object</code> type. + * + * Default: none + * Group: scheduler + * + * @param scheduler the value to set + * @return the dsl builder + */ + default Dhis2EndpointConsumerBuilder scheduler(Object scheduler) { + doSetProperty("scheduler", scheduler); + return this; + } + /** + * To use a cron scheduler from either camel-spring or camel-quartz + * component. Use value spring or quartz for built in scheduler. + * + * The option will be converted to a + * <code>java.lang.Object</code> type. + * + * Default: none + * Group: scheduler + * + * @param scheduler the value to set + * @return the dsl builder + */ + default Dhis2EndpointConsumerBuilder scheduler(String scheduler) { + doSetProperty("scheduler", scheduler); + return this; + } + /** + * To configure additional properties when using a custom scheduler or + * any of the Quartz, Spring based scheduler. + * + * The option is a: <code>java.util.Map&lt;java.lang.String, + * java.lang.Object&gt;</code> type. + * The option is multivalued, and you can use the + * schedulerProperties(String, Object) method to add a value (call the + * method multiple times to set more values). + * + * Group: scheduler + * + * @param key the option key + * @param value the option value + * @return the dsl builder + */ + default Dhis2EndpointConsumerBuilder schedulerProperties( + String key, + Object value) { + doSetMultiValueProperty("schedulerProperties", "scheduler." + key, value); + return this; + } + /** + * To configure additional properties when using a custom scheduler or + * any of the Quartz, Spring based scheduler. + * + * The option is a: <code>java.util.Map&lt;java.lang.String, + * java.lang.Object&gt;</code> type. + * The option is multivalued, and you can use the + * schedulerProperties(String, Object) method to add a value (call the + * method multiple times to set more values). + * + * Group: scheduler + * + * @param values the values + * @return the dsl builder + */ + default Dhis2EndpointConsumerBuilder schedulerProperties(Map values) { + doSetMultiValueProperties("schedulerProperties", "scheduler.", values); + return this; + } + /** + * Whether the scheduler should be auto started. + * + * The option is a: <code>boolean</code> type. + * + * Default: true + * Group: scheduler + * + * @param startScheduler the value to set + * @return the dsl builder + */ + default Dhis2EndpointConsumerBuilder startScheduler( + boolean startScheduler) { + doSetProperty("startScheduler", startScheduler); + return this; + } + /** + * Whether the scheduler should be auto started. + * + * The option will be converted to a <code>boolean</code> + * type. + * + * Default: true + * Group: scheduler + * + * @param startScheduler the value to set + * @return the dsl builder + */ + default Dhis2EndpointConsumerBuilder startScheduler( + String startScheduler) { + doSetProperty("startScheduler", startScheduler); + return this; + } + /** + * Time unit for initialDelay and delay options. + * + * The option is a: + * <code>java.util.concurrent.TimeUnit</code> type. + * + * Default: MILLISECONDS + * Group: scheduler + * + * @param timeUnit the value to set + * @return the dsl builder + */ + default Dhis2EndpointConsumerBuilder timeUnit(TimeUnit timeUnit) { + doSetProperty("timeUnit", timeUnit); + return this; + } + /** + * Time unit for initialDelay and delay options. + * + * The option will be converted to a + * <code>java.util.concurrent.TimeUnit</code> type. + * + * Default: MILLISECONDS + * Group: scheduler + * + * @param timeUnit the value to set + * @return the dsl builder + */ + default Dhis2EndpointConsumerBuilder timeUnit(String timeUnit) { + doSetProperty("timeUnit", timeUnit); + return this; + } + /** + * Controls if fixed delay or fixed rate is used. See + * ScheduledExecutorService in JDK for details. + * + * The option is a: <code>boolean</code> type. + * + * Default: true + * Group: scheduler + * + * @param useFixedDelay the value to set + * @return the dsl builder + */ + default Dhis2EndpointConsumerBuilder useFixedDelay(boolean useFixedDelay) { + doSetProperty("useFixedDelay", useFixedDelay); + return this; + } + /** + * Controls if fixed delay or fixed rate is used. See + * ScheduledExecutorService in JDK for details. + * + * The option will be converted to a <code>boolean</code> + * type. + * + * Default: true + * Group: scheduler + * + * @param useFixedDelay the value to set + * @return the dsl builder + */ + default Dhis2EndpointConsumerBuilder useFixedDelay(String useFixedDelay) { + doSetProperty("useFixedDelay", useFixedDelay); + return this; + } + /** + * DHIS2 account password for accessing the DHIS2 API. + * + * The option is a: <code>java.lang.String</code> type. + * + * Group: security + * + * @param password the value to set + * @return the dsl builder + */ + default Dhis2EndpointConsumerBuilder password(String password) { + doSetProperty("password", password); + return this; + } + /** + * DHIS2 account username for accessing the DHIS2 API. + * + * The option is a: <code>java.lang.String</code> type. + * + * Group: security + * + * @param username the value to set + * @return the dsl builder + */ + default Dhis2EndpointConsumerBuilder username(String username) { + doSetProperty("username", username); + return this; + } + } + + /** + * Advanced builder for endpoint consumers for the DHIS2 component. + */ + public interface AdvancedDhis2EndpointConsumerBuilder + extends + EndpointConsumerBuilder { + default Dhis2EndpointConsumerBuilder basic() { + return (Dhis2EndpointConsumerBuilder) 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 (advanced) + * + * @param bridgeErrorHandler the value to set + * @return the dsl builder + */ + default AdvancedDhis2EndpointConsumerBuilder bridgeErrorHandler( + boolean bridgeErrorHandler) { + doSetProperty("bridgeErrorHandler", bridgeErrorHandler); + 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 will be converted to a <code>boolean</code> + * type. + * + * Default: false + * Group: consumer (advanced) + * + * @param bridgeErrorHandler the value to set + * @return the dsl builder + */ + default AdvancedDhis2EndpointConsumerBuilder bridgeErrorHandler( + String bridgeErrorHandler) { + doSetProperty("bridgeErrorHandler", bridgeErrorHandler); + return this; + } + /** + * 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 consumer will deal with exceptions, that will be + * logged at WARN or ERROR level and ignored. + * + * The option is a: + * <code>org.apache.camel.spi.ExceptionHandler</code> type. + * + * Group: consumer (advanced) + * + * @param exceptionHandler the value to set + * @return the dsl builder + */ + default AdvancedDhis2EndpointConsumerBuilder exceptionHandler( + org.apache.camel.spi.ExceptionHandler exceptionHandler) { + doSetProperty("exceptionHandler", exceptionHandler); + return this; + } + /** + * 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 consumer will deal with exceptions, that will be + * logged at WARN or ERROR level and ignored. + * + * The option will be converted to a + * <code>org.apache.camel.spi.ExceptionHandler</code> type. + * + * Group: consumer (advanced) + * + * @param exceptionHandler the value to set + * @return the dsl builder + */ + default AdvancedDhis2EndpointConsumerBuilder exceptionHandler( + String exceptionHandler) { + doSetProperty("exceptionHandler", exceptionHandler); + return this; + } + /** + * Sets the exchange pattern when the consumer creates an exchange. + * + * The option is a: + * <code>org.apache.camel.ExchangePattern</code> type. + * + * Group: consumer (advanced) + * + * @param exchangePattern the value to set + * @return the dsl builder + */ + default AdvancedDhis2EndpointConsumerBuilder exchangePattern( + org.apache.camel.ExchangePattern exchangePattern) { + doSetProperty("exchangePattern", exchangePattern); + return this; + } + /** + * Sets the exchange pattern when the consumer creates an exchange. + * + * The option will be converted to a + * <code>org.apache.camel.ExchangePattern</code> type. + * + * Group: consumer (advanced) + * + * @param exchangePattern the value to set + * @return the dsl builder + */ + default AdvancedDhis2EndpointConsumerBuilder exchangePattern( + String exchangePattern) { + doSetProperty("exchangePattern", exchangePattern); + return this; + } + /** + * A pluggable org.apache.camel.PollingConsumerPollingStrategy allowing + * you to provide your custom implementation to control error handling + * usually occurred during the poll operation before an Exchange have + * been created and being routed in Camel. + * + * The option is a: + * <code>org.apache.camel.spi.PollingConsumerPollStrategy</code> type. + * + * Group: consumer (advanced) + * + * @param pollStrategy the value to set + * @return the dsl builder + */ + default AdvancedDhis2EndpointConsumerBuilder pollStrategy( + org.apache.camel.spi.PollingConsumerPollStrategy pollStrategy) { + doSetProperty("pollStrategy", pollStrategy); + return this; + } + /** + * A pluggable org.apache.camel.PollingConsumerPollingStrategy allowing + * you to provide your custom implementation to control error handling + * usually occurred during the poll operation before an Exchange have + * been created and being routed in Camel. + * + * The option will be converted to a + * <code>org.apache.camel.spi.PollingConsumerPollStrategy</code> type. + * + * Group: consumer (advanced) + * + * @param pollStrategy the value to set + * @return the dsl builder + */ + default AdvancedDhis2EndpointConsumerBuilder pollStrategy( + String pollStrategy) { + doSetProperty("pollStrategy", pollStrategy); + return this; + } + /** + * References a user-defined + * org.hisp.dhis.integration.sdk.api.Dhis2Client. + * + * The option is a: + * <code>org.hisp.dhis.integration.sdk.api.Dhis2Client</code> type. + * + * Group: advanced + * + * @param client the value to set + * @return the dsl builder + */ + default AdvancedDhis2EndpointConsumerBuilder client( + org.hisp.dhis.integration.sdk.api.Dhis2Client client) { + doSetProperty("client", client); + return this; + } + /** + * References a user-defined + * org.hisp.dhis.integration.sdk.api.Dhis2Client. + * + * The option will be converted to a + * <code>org.hisp.dhis.integration.sdk.api.Dhis2Client</code> type. + * + * Group: advanced + * + * @param client the value to set + * @return the dsl builder + */ + default AdvancedDhis2EndpointConsumerBuilder client(String client) { + doSetProperty("client", client); + return this; + } + } + + /** + * Builder for endpoint producers for the DHIS2 component. + */ + public interface Dhis2EndpointProducerBuilder + extends + EndpointProducerBuilder { + default AdvancedDhis2EndpointProducerBuilder advanced() { + return (AdvancedDhis2EndpointProducerBuilder) this; + } + /** + * DHIS2 server base API URL (e.g., + * https://play.dhis2.org/2.39.1.1/api). + * + * The option is a: <code>java.lang.String</code> type. + * + * Group: common + * + * @param baseApiUrl the value to set + * @return the dsl builder + */ + default Dhis2EndpointProducerBuilder baseApiUrl(String baseApiUrl) { + doSetProperty("baseApiUrl", baseApiUrl); + return this; + } + /** + * Sets the name of a parameter to be passed in the exchange In Body. + * + * The option is a: <code>java.lang.String</code> type. + * + * Group: common + * + * @param inBody the value to set + * @return the dsl builder + */ + default Dhis2EndpointProducerBuilder inBody(String inBody) { + doSetProperty("inBody", inBody); + return this; + } + /** + * DHIS2 account password for accessing the DHIS2 API. + * + * The option is a: <code>java.lang.String</code> type. + * + * Group: security + * + * @param password the value to set + * @return the dsl builder + */ + default Dhis2EndpointProducerBuilder password(String password) { + doSetProperty("password", password); + return this; + } + /** + * DHIS2 account username for accessing the DHIS2 API. + * + * The option is a: <code>java.lang.String</code> type. + * + * Group: security + * + * @param username the value to set + * @return the dsl builder + */ + default Dhis2EndpointProducerBuilder username(String username) { + doSetProperty("username", username); + return this; + } + } + + /** + * Advanced builder for endpoint producers for the DHIS2 component. + */ + public interface AdvancedDhis2EndpointProducerBuilder + extends + EndpointProducerBuilder { + default Dhis2EndpointProducerBuilder basic() { + return (Dhis2EndpointProducerBuilder) 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 (advanced) + * + * @param lazyStartProducer the value to set + * @return the dsl builder + */ + default AdvancedDhis2EndpointProducerBuilder lazyStartProducer( + boolean lazyStartProducer) { + doSetProperty("lazyStartProducer", lazyStartProducer); + 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 will be converted to a <code>boolean</code> + * type. + * + * Default: false + * Group: producer (advanced) + * + * @param lazyStartProducer the value to set + * @return the dsl builder + */ + default AdvancedDhis2EndpointProducerBuilder lazyStartProducer( + String lazyStartProducer) { + doSetProperty("lazyStartProducer", lazyStartProducer); + return this; + } + /** + * References a user-defined + * org.hisp.dhis.integration.sdk.api.Dhis2Client. + * + * The option is a: + * <code>org.hisp.dhis.integration.sdk.api.Dhis2Client</code> type. + * + * Group: advanced + * + * @param client the value to set + * @return the dsl builder + */ + default AdvancedDhis2EndpointProducerBuilder client( + org.hisp.dhis.integration.sdk.api.Dhis2Client client) { + doSetProperty("client", client); + return this; + } + /** + * References a user-defined + * org.hisp.dhis.integration.sdk.api.Dhis2Client. + * + * The option will be converted to a + * <code>org.hisp.dhis.integration.sdk.api.Dhis2Client</code> type. + * + * Group: advanced + * + * @param client the value to set + * @return the dsl builder + */ + default AdvancedDhis2EndpointProducerBuilder client(String client) { + doSetProperty("client", client); + return this; + } + } + + /** + * Builder for endpoint for the DHIS2 component. + */ + public interface Dhis2EndpointBuilder + extends + Dhis2EndpointConsumerBuilder, + Dhis2EndpointProducerBuilder { + default AdvancedDhis2EndpointBuilder advanced() { + return (AdvancedDhis2EndpointBuilder) this; + } + /** + * DHIS2 server base API URL (e.g., + * https://play.dhis2.org/2.39.1.1/api). + * + * The option is a: <code>java.lang.String</code> type. + * + * Group: common + * + * @param baseApiUrl the value to set + * @return the dsl builder + */ + default Dhis2EndpointBuilder baseApiUrl(String baseApiUrl) { + doSetProperty("baseApiUrl", baseApiUrl); + return this; + } + /** + * Sets the name of a parameter to be passed in the exchange In Body. + * + * The option is a: <code>java.lang.String</code> type. + * + * Group: common + * + * @param inBody the value to set + * @return the dsl builder + */ + default Dhis2EndpointBuilder inBody(String inBody) { + doSetProperty("inBody", inBody); + return this; + } + /** + * DHIS2 account password for accessing the DHIS2 API. + * + * The option is a: <code>java.lang.String</code> type. + * + * Group: security + * + * @param password the value to set + * @return the dsl builder + */ + default Dhis2EndpointBuilder password(String password) { + doSetProperty("password", password); + return this; + } + /** + * DHIS2 account username for accessing the DHIS2 API. + * + * The option is a: <code>java.lang.String</code> type. + * + * Group: security + * + * @param username the value to set + * @return the dsl builder + */ + default Dhis2EndpointBuilder username(String username) { + doSetProperty("username", username); + return this; + } + } + + /** + * Advanced builder for endpoint for the DHIS2 component. + */ + public interface AdvancedDhis2EndpointBuilder + extends + AdvancedDhis2EndpointConsumerBuilder, + AdvancedDhis2EndpointProducerBuilder { + default Dhis2EndpointBuilder basic() { + return (Dhis2EndpointBuilder) this; + } + /** + * References a user-defined + * org.hisp.dhis.integration.sdk.api.Dhis2Client. + * + * The option is a: + * <code>org.hisp.dhis.integration.sdk.api.Dhis2Client</code> type. + * + * Group: advanced + * + * @param client the value to set + * @return the dsl builder + */ + default AdvancedDhis2EndpointBuilder client( + org.hisp.dhis.integration.sdk.api.Dhis2Client client) { + doSetProperty("client", client); + return this; + } + /** + * References a user-defined + * org.hisp.dhis.integration.sdk.api.Dhis2Client. + * + * The option will be converted to a + * <code>org.hisp.dhis.integration.sdk.api.Dhis2Client</code> type. + * + * Group: advanced + * + * @param client the value to set + * @return the dsl builder + */ + default AdvancedDhis2EndpointBuilder client(String client) { + doSetProperty("client", client); + return this; + } + } + + public interface Dhis2Builders { + /** + * DHIS2 (camel-dhis2) + * Leverages the DHIS2 Java SDK to integrate Apache Camel with the DHIS2 + * Web API. + * + * Category: api + * Since: 4.0 + * Maven coordinates: org.apache.camel:camel-dhis2 + * + * Syntax: <code>dhis2:apiName/methodName</code> + * + * Path parameter: apiName (required) + * API operation (e.g., get) + * There are 5 enums and the value can be one of: POST, RESOURCE_TABLES, + * GET, DELETE, PUT + * + * Path parameter: methodName (required) + * Subject of the API operation (e.g., resource) + * + * @param path apiName/methodName + * @return the dsl builder + */ + default Dhis2EndpointBuilder dhis2(String path) { + return Dhis2EndpointBuilderFactory.endpointBuilder("dhis2", path); + } + /** + * DHIS2 (camel-dhis2) + * Leverages the DHIS2 Java SDK to integrate Apache Camel with the DHIS2 + * Web API. + * + * Category: api + * Since: 4.0 + * Maven coordinates: org.apache.camel:camel-dhis2 + * + * Syntax: <code>dhis2:apiName/methodName</code> + * + * Path parameter: apiName (required) + * API operation (e.g., get) + * There are 5 enums and the value can be one of: POST, RESOURCE_TABLES, + * GET, DELETE, PUT + * + * Path parameter: methodName (required) + * Subject of the API operation (e.g., resource) + * + * @param componentName to use a custom component name for the endpoint + * instead of the default name + * @param path apiName/methodName + * @return the dsl builder + */ + default Dhis2EndpointBuilder dhis2(String componentName, String path) { + return Dhis2EndpointBuilderFactory.endpointBuilder(componentName, path); + } + } + static Dhis2EndpointBuilder endpointBuilder( + String componentName, + String path) { + class Dhis2EndpointBuilderImpl extends AbstractEndpointBuilder implements Dhis2EndpointBuilder, AdvancedDhis2EndpointBuilder { + public Dhis2EndpointBuilderImpl(String path) { + super(componentName, path); + } + } + return new Dhis2EndpointBuilderImpl(path); + } +} \ No newline at end of file diff --git a/dsl/camel-kamelet-main/src/generated/resources/camel-component-known-dependencies.properties b/dsl/camel-kamelet-main/src/generated/resources/camel-component-known-dependencies.properties index 5559f3c8679..201e756a5df 100644 --- a/dsl/camel-kamelet-main/src/generated/resources/camel-component-known-dependencies.properties +++ b/dsl/camel-kamelet-main/src/generated/resources/camel-component-known-dependencies.properties @@ -88,6 +88,7 @@ org.apache.camel.component.debezium.DebeziumMySqlComponent=camel:debezium-mysql org.apache.camel.component.debezium.DebeziumOracleComponent=camel:debezium-oracle org.apache.camel.component.debezium.DebeziumPostgresComponent=camel:debezium-postgres org.apache.camel.component.debezium.DebeziumSqlserverComponent=camel:debezium-sqlserver +org.apache.camel.component.dhis2.Dhis2Component=camel:dhis2 org.apache.camel.component.digitalocean.DigitalOceanComponent=camel:digitalocean org.apache.camel.component.direct.DirectComponent=camel:direct org.apache.camel.component.disruptor.DisruptorComponent=camel:disruptor diff --git a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/MojoHelper.java b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/MojoHelper.java index 85e1ce4779e..7de5a007f87 100644 --- a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/MojoHelper.java +++ b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/MojoHelper.java @@ -37,6 +37,8 @@ public final class MojoHelper { dir.resolve("camel-cxf-rest")); case "camel-salesforce": return Collections.singletonList(dir.resolve("camel-salesforce-component")); + case "camel-dhis2": + return Collections.singletonList(dir.resolve("camel-dhis2-component")); case "camel-olingo2": return Collections.singletonList(dir.resolve("camel-olingo2-component")); case "camel-olingo4":