You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2020/10/15 17:14:30 UTC

[camel] branch master updated (1ed8218 -> 9c296fb)

This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git.


    from 1ed8218  Warn if the MockEndpoint's latch did not finish within the specified time (#4456)
     new 46e23d1  CAMEL-15688 - Camel-couchbase: Make the configuration of the endpoint less complex
     new 6e015ef  Regen Catalog
     new 9c296fb  CAMEL-15688 - Camel-couchbase: Make the configuration of the endpoint less complex, changed the error logged

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../resources/org/apache/camel/catalog/components/couchbase.json    | 2 +-
 .../org/apache/camel/catalog/docs/couchbase-component.adoc          | 2 +-
 .../resources/org/apache/camel/component/couchbase/couchbase.json   | 2 +-
 components/camel-couchbase/src/main/docs/couchbase-component.adoc   | 2 +-
 .../org/apache/camel/component/couchbase/CouchbaseConstants.java    | 2 +-
 .../org/apache/camel/component/couchbase/CouchbaseEndpoint.java     | 6 +-----
 .../apache/camel/component/couchbase/CouchbaseComponentTest.java    | 5 ++---
 .../org/apache/camel/component/couchbase/CouchbaseEndpointTest.java | 6 ------
 .../camel/builder/endpoint/dsl/CouchbaseEndpointBuilderFactory.java | 3 +++
 docs/components/modules/ROOT/pages/couchbase-component.adoc         | 2 +-
 10 files changed, 12 insertions(+), 20 deletions(-)


[camel] 01/03: CAMEL-15688 - Camel-couchbase: Make the configuration of the endpoint less complex

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 46e23d1b7fa324f3a5ad2edf8d53e061262012ff
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Oct 15 17:58:54 2020 +0200

    CAMEL-15688 - Camel-couchbase: Make the configuration of the endpoint less complex
---
 .../org/apache/camel/catalog/docs/couchbase-component.adoc          | 2 +-
 .../resources/org/apache/camel/component/couchbase/couchbase.json   | 2 +-
 components/camel-couchbase/src/main/docs/couchbase-component.adoc   | 2 +-
 .../org/apache/camel/component/couchbase/CouchbaseEndpoint.java     | 6 +-----
 .../apache/camel/component/couchbase/CouchbaseComponentTest.java    | 5 ++---
 .../org/apache/camel/component/couchbase/CouchbaseEndpointTest.java | 6 ------
 .../camel/builder/endpoint/dsl/CouchbaseEndpointBuilderFactory.java | 3 +++
 docs/components/modules/ROOT/pages/couchbase-component.adoc         | 2 +-
 8 files changed, 10 insertions(+), 18 deletions(-)

diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/couchbase-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/couchbase-component.adoc
index e6034d4..a5e0472 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/couchbase-component.adoc
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/couchbase-component.adoc
@@ -79,7 +79,7 @@ with the following path and query parameters:
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
-| *bucket* (common) | The bucket to use |  | String
+| *bucket* (common) | *Required* The bucket to use |  | String
 | *collection* (common) | The collection to use |  | String
 | *key* (common) | The key to use |  | String
 | *scope* (common) | The scope to use |  | String
diff --git a/components/camel-couchbase/src/generated/resources/org/apache/camel/component/couchbase/couchbase.json b/components/camel-couchbase/src/generated/resources/org/apache/camel/component/couchbase/couchbase.json
index 392c32d..7d59f57 100644
--- a/components/camel-couchbase/src/generated/resources/org/apache/camel/component/couchbase/couchbase.json
+++ b/components/camel-couchbase/src/generated/resources/org/apache/camel/component/couchbase/couchbase.json
@@ -30,7 +30,7 @@
     "protocol": { "kind": "path", "displayName": "Protocol", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "secret": false, "description": "The protocol to use" },
     "hostname": { "kind": "path", "displayName": "Hostname", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "secret": false, "description": "The hostname to use" },
     "port": { "kind": "path", "displayName": "Port", "group": "common", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "secret": false, "defaultValue": 8091, "description": "The port number to use" },
-    "bucket": { "kind": "parameter", "displayName": "Bucket", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "The bucket to use" },
+    "bucket": { "kind": "parameter", "displayName": "Bucket", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "secret": false, "description": "The bucket to use" },
     "collection": { "kind": "parameter", "displayName": "Collection", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "The collection to use" },
     "key": { "kind": "parameter", "displayName": "Key", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "The key to use" },
     "scope": { "kind": "parameter", "displayName": "Scope", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "The scope to use" },
diff --git a/components/camel-couchbase/src/main/docs/couchbase-component.adoc b/components/camel-couchbase/src/main/docs/couchbase-component.adoc
index e6034d4..a5e0472 100644
--- a/components/camel-couchbase/src/main/docs/couchbase-component.adoc
+++ b/components/camel-couchbase/src/main/docs/couchbase-component.adoc
@@ -79,7 +79,7 @@ with the following path and query parameters:
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
-| *bucket* (common) | The bucket to use |  | String
+| *bucket* (common) | *Required* The bucket to use |  | String
 | *collection* (common) | The collection to use |  | String
 | *key* (common) | The key to use |  | String
 | *scope* (common) | The scope to use |  | String
diff --git a/components/camel-couchbase/src/main/java/org/apache/camel/component/couchbase/CouchbaseEndpoint.java b/components/camel-couchbase/src/main/java/org/apache/camel/component/couchbase/CouchbaseEndpoint.java
index a3145c3..4477784 100644
--- a/components/camel-couchbase/src/main/java/org/apache/camel/component/couchbase/CouchbaseEndpoint.java
+++ b/components/camel-couchbase/src/main/java/org/apache/camel/component/couchbase/CouchbaseEndpoint.java
@@ -67,6 +67,7 @@ public class CouchbaseEndpoint extends ScheduledPollEndpoint {
     private int port;
 
     @UriParam
+    @Metadata(required = true)
     private String bucket;
 
     @UriParam
@@ -146,11 +147,6 @@ public class CouchbaseEndpoint extends ScheduledPollEndpoint {
 
         port = remainingUri.getPort() == -1 ? DEFAULT_COUCHBASE_PORT : remainingUri.getPort();
 
-        if (remainingUri.getPath() == null || remainingUri.getPath().trim().length() == 0) {
-            throw new IllegalArgumentException(COUCHBASE_URI_ERROR);
-        }
-        bucket = remainingUri.getPath().substring(1);
-
         hostname = remainingUri.getHost();
         if (hostname == null) {
             throw new IllegalArgumentException(COUCHBASE_URI_ERROR);
diff --git a/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/CouchbaseComponentTest.java b/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/CouchbaseComponentTest.java
index d46920f..17a5938 100644
--- a/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/CouchbaseComponentTest.java
+++ b/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/CouchbaseComponentTest.java
@@ -63,14 +63,13 @@ public class CouchbaseComponentTest extends CamelTestSupport {
         params.put("persistTo", 2);
         params.put("replicateTo", 3);
 
-        String uri = "couchdb:http://localhost:91234/bucket";
-        String remaining = "http://localhost:91234/bucket";
+        String uri = "couchdb:http://localhost:91234";
+        String remaining = "http://localhost:91234";
 
         CouchbaseEndpoint endpoint = component.createEndpoint(uri, remaining, params);
 
         assertEquals("http", endpoint.getProtocol());
         assertEquals("localhost", endpoint.getHostname());
-        assertEquals("bucket", endpoint.getBucket());
         assertEquals(91234, endpoint.getPort());
         assertEquals("ugol", endpoint.getUsername());
         assertEquals("pwd", endpoint.getPassword());
diff --git a/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/CouchbaseEndpointTest.java b/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/CouchbaseEndpointTest.java
index 610a1ce..2d68579 100644
--- a/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/CouchbaseEndpointTest.java
+++ b/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/CouchbaseEndpointTest.java
@@ -35,12 +35,6 @@ public class CouchbaseEndpointTest {
     }
 
     @Test
-    public void testBucketRequired() throws Exception {
-        assertThrows(IllegalArgumentException.class,
-                () -> new CouchbaseEndpoint("couchbase:http://localhost:80", "http://localhost:80", new CouchbaseComponent()));
-    }
-
-    @Test
     public void testDefaultPortIsSet() throws Exception {
         CouchbaseEndpoint endpoint = new CouchbaseEndpoint(
                 "couchbase:http://localhost/bucket", "http://localhost/bucket", new CouchbaseComponent());
diff --git a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/CouchbaseEndpointBuilderFactory.java b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/CouchbaseEndpointBuilderFactory.java
index 909f259..4f12741 100644
--- a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/CouchbaseEndpointBuilderFactory.java
+++ b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/CouchbaseEndpointBuilderFactory.java
@@ -52,6 +52,7 @@ public interface CouchbaseEndpointBuilderFactory {
          * 
          * The option is a: <code>java.lang.String</code> type.
          * 
+         * Required: true
          * Group: common
          */
         default CouchbaseEndpointConsumerBuilder bucket(String bucket) {
@@ -909,6 +910,7 @@ public interface CouchbaseEndpointBuilderFactory {
          * 
          * The option is a: <code>java.lang.String</code> type.
          * 
+         * Required: true
          * Group: common
          */
         default CouchbaseEndpointProducerBuilder bucket(String bucket) {
@@ -1298,6 +1300,7 @@ public interface CouchbaseEndpointBuilderFactory {
          * 
          * The option is a: <code>java.lang.String</code> type.
          * 
+         * Required: true
          * Group: common
          */
         default CouchbaseEndpointBuilder bucket(String bucket) {
diff --git a/docs/components/modules/ROOT/pages/couchbase-component.adoc b/docs/components/modules/ROOT/pages/couchbase-component.adoc
index 0899532..9bc9546 100644
--- a/docs/components/modules/ROOT/pages/couchbase-component.adoc
+++ b/docs/components/modules/ROOT/pages/couchbase-component.adoc
@@ -81,7 +81,7 @@ with the following path and query parameters:
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
-| *bucket* (common) | The bucket to use |  | String
+| *bucket* (common) | *Required* The bucket to use |  | String
 | *collection* (common) | The collection to use |  | String
 | *key* (common) | The key to use |  | String
 | *scope* (common) | The scope to use |  | String


[camel] 02/03: Regen Catalog

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 6e015efb3ed1ef8f09ba5b703663e620a0dbc0da
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Oct 15 18:48:01 2020 +0200

    Regen Catalog
---
 .../resources/org/apache/camel/catalog/components/couchbase.json        | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/couchbase.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/couchbase.json
index 392c32d..7d59f57 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/couchbase.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/couchbase.json
@@ -30,7 +30,7 @@
     "protocol": { "kind": "path", "displayName": "Protocol", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "secret": false, "description": "The protocol to use" },
     "hostname": { "kind": "path", "displayName": "Hostname", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "secret": false, "description": "The hostname to use" },
     "port": { "kind": "path", "displayName": "Port", "group": "common", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "secret": false, "defaultValue": 8091, "description": "The port number to use" },
-    "bucket": { "kind": "parameter", "displayName": "Bucket", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "The bucket to use" },
+    "bucket": { "kind": "parameter", "displayName": "Bucket", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "secret": false, "description": "The bucket to use" },
     "collection": { "kind": "parameter", "displayName": "Collection", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "The collection to use" },
     "key": { "kind": "parameter", "displayName": "Key", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "The key to use" },
     "scope": { "kind": "parameter", "displayName": "Scope", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "The scope to use" },


[camel] 03/03: CAMEL-15688 - Camel-couchbase: Make the configuration of the endpoint less complex, changed the error logged

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 9c296fb3e9c682d7ab7a8e620c2cc277eb9d8cf5
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Oct 15 18:48:53 2020 +0200

    CAMEL-15688 - Camel-couchbase: Make the configuration of the endpoint less complex, changed the error logged
---
 .../java/org/apache/camel/component/couchbase/CouchbaseConstants.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/components/camel-couchbase/src/main/java/org/apache/camel/component/couchbase/CouchbaseConstants.java b/components/camel-couchbase/src/main/java/org/apache/camel/component/couchbase/CouchbaseConstants.java
index 8e11389..2bb0831 100644
--- a/components/camel-couchbase/src/main/java/org/apache/camel/component/couchbase/CouchbaseConstants.java
+++ b/components/camel-couchbase/src/main/java/org/apache/camel/component/couchbase/CouchbaseConstants.java
@@ -23,7 +23,7 @@ package org.apache.camel.component.couchbase;
 public interface CouchbaseConstants {
 
     String COUCHBASE_URI_ERROR
-            = "Invalid URI. Format must be of the form couchbase:http[s]://hostname[:port]/bucket?[options...]";
+            = "Invalid URI. Format must be of the form couchbase:http[s]://hostname[:port]?[options...]";
     String COUCHBASE_PUT = "CCB_PUT";
     String COUCHBASE_GET = "CCB_GET";
     String COUCHBASE_DELETE = "CCB_DEL";