You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "davsclaus (via GitHub)" <gi...@apache.org> on 2023/03/11 06:37:06 UTC

[GitHub] [camel] davsclaus commented on a diff in pull request #9401: CAMEL-19050: add DHIS2 component

davsclaus commented on code in PR #9401:
URL: https://github.com/apache/camel/pull/9401#discussion_r1133041318


##########
components/camel-dhis2/camel-dhis2-component/src/main/java/org/apache/camel/component/dhis2/Dhis2Configuration.java:
##########
@@ -0,0 +1,97 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.dhis2;
+
+import org.apache.camel.component.dhis2.internal.Dhis2ApiName;
+import org.apache.camel.spi.Configurer;
+import org.apache.camel.spi.Metadata;
+import org.apache.camel.spi.UriParam;
+import org.apache.camel.spi.UriParams;
+import org.apache.camel.spi.UriPath;
+import org.hisp.dhis.integration.sdk.api.Dhis2Client;
+
+@UriParams
+@Configurer
+public class Dhis2Configuration {
+    @UriParam(description = "Base API URL")
+    private String baseApiUrl;
+
+    @UriParam(description = "Username")
+    private String username;
+
+    @UriParam(description = "Password")

Review Comment:
   secret = true, label = "security"



##########
components/camel-dhis2/camel-dhis2-component/src/main/java/org/apache/camel/component/dhis2/Dhis2Endpoint.java:
##########
@@ -0,0 +1,113 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.dhis2;
+
+import java.util.Map;
+
+import org.apache.camel.Category;
+import org.apache.camel.Consumer;
+import org.apache.camel.Processor;
+import org.apache.camel.Producer;
+import org.apache.camel.component.dhis2.api.Dhis2Get;
+import org.apache.camel.component.dhis2.api.Dhis2Post;
+import org.apache.camel.component.dhis2.api.Dhis2ResourceTables;
+import org.apache.camel.component.dhis2.internal.Dhis2ApiCollection;
+import org.apache.camel.component.dhis2.internal.Dhis2ApiName;
+import org.apache.camel.component.dhis2.internal.Dhis2Constants;
+import org.apache.camel.component.dhis2.internal.Dhis2PropertiesHelper;
+import org.apache.camel.spi.UriEndpoint;
+import org.apache.camel.spi.UriParam;
+import org.apache.camel.support.component.AbstractApiEndpoint;
+import org.apache.camel.support.component.ApiMethod;
+import org.apache.camel.support.component.ApiMethodPropertiesHelper;
+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 = "3.21.0", scheme = "dhis2", title = "DHIS2", syntax = "dhis2:methodName",
+             apiSyntax = "apiName/methodName", category = {
+                     Category.API })
+public class Dhis2Endpoint extends AbstractApiEndpoint<Dhis2ApiName, Dhis2Configuration> {
+
+    @UriParam
+    private final Dhis2Configuration configuration;
+
+    // TODO create and manage API proxy

Review Comment:
   There is a TODO here



##########
components/camel-dhis2/camel-dhis2-component/src/main/java/org/apache/camel/component/dhis2/Dhis2Configuration.java:
##########
@@ -0,0 +1,97 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.dhis2;
+
+import org.apache.camel.component.dhis2.internal.Dhis2ApiName;
+import org.apache.camel.spi.Configurer;
+import org.apache.camel.spi.Metadata;
+import org.apache.camel.spi.UriParam;
+import org.apache.camel.spi.UriParams;
+import org.apache.camel.spi.UriPath;
+import org.hisp.dhis.integration.sdk.api.Dhis2Client;
+
+@UriParams
+@Configurer
+public class Dhis2Configuration {

Review Comment:
   The descriptions are a bit short. Its for humans/docs so it may be nicer to add a little bit more text



##########
components/camel-dhis2/camel-dhis2-component/src/main/java/org/apache/camel/component/dhis2/Dhis2Configuration.java:
##########
@@ -0,0 +1,97 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.dhis2;
+
+import org.apache.camel.component.dhis2.internal.Dhis2ApiName;
+import org.apache.camel.spi.Configurer;
+import org.apache.camel.spi.Metadata;
+import org.apache.camel.spi.UriParam;
+import org.apache.camel.spi.UriParams;
+import org.apache.camel.spi.UriPath;
+import org.hisp.dhis.integration.sdk.api.Dhis2Client;
+
+@UriParams
+@Configurer
+public class Dhis2Configuration {
+    @UriParam(description = "Base API URL")
+    private String baseApiUrl;
+
+    @UriParam(description = "Username")
+    private String username;

Review Comment:
   secret = true, label = "security"



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org