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 2017/01/13 14:43:24 UTC

camel git commit: Camel-Couchbase: Added labels to endpoint parameters

Repository: camel
Updated Branches:
  refs/heads/master 39742f911 -> 9d63c03b9


Camel-Couchbase: Added labels to endpoint parameters


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/9d63c03b
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/9d63c03b
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/9d63c03b

Branch: refs/heads/master
Commit: 9d63c03b940062ac11daee63fa9f687dfe339f29
Parents: 39742f9
Author: Andrea Cosentino <an...@gmail.com>
Authored: Fri Jan 13 15:42:47 2017 +0100
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Fri Jan 13 15:42:47 2017 +0100

----------------------------------------------------------------------
 .../src/main/docs/couchbase-component.adoc      | 61 +++++++++--------
 .../component/couchbase/CouchbaseEndpoint.java  | 69 +++++++++++---------
 2 files changed, 69 insertions(+), 61 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/9d63c03b/components/camel-couchbase/src/main/docs/couchbase-component.adoc
----------------------------------------------------------------------
diff --git a/components/camel-couchbase/src/main/docs/couchbase-component.adoc b/components/camel-couchbase/src/main/docs/couchbase-component.adoc
index 439845a..e0a50a8 100644
--- a/components/camel-couchbase/src/main/docs/couchbase-component.adoc
+++ b/components/camel-couchbase/src/main/docs/couchbase-component.adoc
@@ -34,46 +34,47 @@ The Couchbase component has no options.
 // component options: END
 
 // endpoint options: START
-The Couchbase component supports 47 endpoint options which are listed below:
+The Couchbase component supports 50 endpoint options which are listed below:
 
 {% raw %}
 [width="100%",cols="2,1,1m,1m,5",options="header"]
 |=======================================================================
 | Name | Group | Default | Java Type | Description
-| protocol | common |  | String | The protocol to use
-| additionalHosts | common |  | String | The additional hosts
-| autoStartIdForInserts | common | false | boolean | Define if we want an autostart Id when we are doing an insert operation
-| consumerProcessedStrategy | common |  | String | Define the consumer Processed strategy to use
-| descending | common | false | boolean | Define if this operation is descending or not
-| designDocumentName | common |  | String | The design document name to use
+| protocol | common |  | String | *Required* The protocol to use
+| hostname | common |  | String | *Required* The hostname to use
+| bucket | common |  | String | The bucket to use
 | key | common |  | String | The key to use
-| limit | common |  | int | The output limit to use
-| maxReconnectDelay | common |  | long | Define the max delay during a reconnection
-| obsPollInterval | common |  | long | Define the observation polling interval
-| obsTimeout | common |  | long | Define the observation timeout
-| operation | common |  | String | The operation to do
-| opQueueMaxBlockTime | common |  | long | Define the max time an operation can be in queue blocked
-| opTimeOut | common |  | long | Define the operation timeout
-| password | common |  | String | The password to use
-| persistTo | common |  | int | Where to persist the data
-| producerRetryAttempts | common |  | int | Define the number of retry attempts
-| producerRetryPause | common |  | int | Define the retry pause between different attempts
-| rangeEndKey | common |  | String | Define a range for the end key
-| rangeStartKey | common |  | String | Define a range for the start key
-| readBufferSize | common |  | int | Define the buffer size
-| replicateTo | common |  | int | Where to replicate the data
-| shouldOptimize | common | false | boolean | Define if we want to use optimization or not where possible
-| skip | common |  | int | Define the skip to use
-| startingIdForInsertsFrom | common |  | long | Define the starting Id where we are doing an insert operation
-| timeoutExceptionThreshold | common |  | int | Define the threshold for throwing a timeout Exception
-| username | common |  | String | The username to use
-| viewName | common |  | String | The view name to use
+| port | common | 8091 | int | The port number to use
 | bridgeErrorHandler | consumer | false | boolean | 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.
+| consumerProcessedStrategy | consumer | none | String | Define the consumer Processed strategy to use
+| descending | consumer | false | boolean | Define if this operation is descending or not
+| designDocumentName | consumer | beer | String | The design document name to use
+| limit | consumer | -1 | int | The output limit to use
+| rangeEndKey | consumer |  | String | Define a range for the end key
+| rangeStartKey | consumer |  | String | Define a range for the start key
 | sendEmptyMessageWhenIdle | consumer | false | boolean | If the polling consumer did not poll any files you can enable this option to send an empty message (no body) instead.
+| skip | consumer | -1 | int | Define the skip to use
+| viewName | consumer | brewery_beers | String | The view name to use
 | exceptionHandler | consumer (advanced) |  | ExceptionHandler | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this options is not in use. By default the consumer will deal with exceptions that will be logged at WARN or ERROR level and ignored.
 | exchangePattern | consumer (advanced) |  | ExchangePattern | Sets the exchange pattern when the consumer creates an exchange.
 | pollStrategy | consumer (advanced) |  | PollingConsumerPollStrategy | 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.
+| autoStartIdForInserts | producer | false | boolean | Define if we want an autostart Id when we are doing an insert operation
+| operation | producer | CCB_PUT | String | The operation to do
+| persistTo | producer | 0 | int | Where to persist the data
+| producerRetryAttempts | producer | 2 | int | Define the number of retry attempts
+| producerRetryPause | producer | 5000 | int | Define the retry pause between different attempts
+| replicateTo | producer | 0 | int | Where to replicate the data
+| startingIdForInsertsFrom | producer |  | long | Define the starting Id where we are doing an insert operation
+| additionalHosts | advanced |  | String | The additional hosts
+| maxReconnectDelay | advanced | 30000 | long | Define the max delay during a reconnection
+| obsPollInterval | advanced | 400 | long | Define the observation polling interval
+| obsTimeout | advanced | -1 | long | Define the observation timeout
+| opQueueMaxBlockTime | advanced | 10000 | long | Define the max time an operation can be in queue blocked
+| opTimeOut | advanced | 2500 | long | Define the operation timeout
+| readBufferSize | advanced | 16384 | int | Define the buffer size
+| shouldOptimize | advanced | false | boolean | Define if we want to use optimization or not where possible
 | synchronous | advanced | false | boolean | Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported).
+| timeoutExceptionThreshold | advanced | 998 | int | Define the threshold for throwing a timeout Exception
 | backoffErrorThreshold | scheduler |  | int | The number of subsequent error polls (failed due some error) that should happen before the backoffMultipler should kick-in.
 | backoffIdleThreshold | scheduler |  | int | The number of subsequent idle polls that should happen before the backoffMultipler should kick-in.
 | backoffMultiplier | scheduler |  | int | 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.
@@ -87,6 +88,8 @@ The Couchbase component supports 47 endpoint options which are listed below:
 | startScheduler | scheduler | true | boolean | Whether the scheduler should be auto started.
 | timeUnit | scheduler | MILLISECONDS | TimeUnit | Time unit for initialDelay and delay options.
 | useFixedDelay | scheduler | true | boolean | Controls if fixed delay or fixed rate is used. See ScheduledExecutorService in JDK for details.
+| password | security |  | String | The password to use
+| username | security |  | String | The username to use
 |=======================================================================
 {% endraw %}
-// endpoint options: END
\ No newline at end of file
+// endpoint options: END

http://git-wip-us.apache.org/repos/asf/camel/blob/9d63c03b/components/camel-couchbase/src/main/java/org/apache/camel/component/couchbase/CouchbaseEndpoint.java
----------------------------------------------------------------------
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 46c8d29..365559d 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
@@ -32,6 +32,7 @@ import org.apache.camel.Consumer;
 import org.apache.camel.Processor;
 import org.apache.camel.Producer;
 import org.apache.camel.impl.ScheduledPollEndpoint;
+import org.apache.camel.spi.Metadata;
 import org.apache.camel.spi.UriEndpoint;
 import org.apache.camel.spi.UriParam;
 import org.apache.camel.spi.UriPath;
@@ -60,81 +61,85 @@ import static org.apache.camel.component.couchbase.CouchbaseConstants.DEFAULT_VI
 public class CouchbaseEndpoint extends ScheduledPollEndpoint {
 
     @UriPath
+    @Metadata(required = "true")
     private String protocol;
-    private String bucket;
+    @UriPath
+    @Metadata(required = "true")
     private String hostname;
+    @UriParam(defaultValue = "8091")
     private int port;
+    @UriParam
+    private String bucket;
 
     // Couchbase key
     @UriParam
     private String key;
 
     // Authentication
-    @UriParam
-    private String username = "";
-    @UriParam
-    private String password = "";
+    @UriParam(label = "security", secret = true)
+    private String username;
+    @UriParam(label = "security", secret = true)
+    private String password;
 
     // Additional hosts
-    @UriParam
-    private String additionalHosts = "";
+    @UriParam(label = "advanced")
+    private String additionalHosts;
 
     // Persistence and replication parameters
-    @UriParam
+    @UriParam(label = "producer", defaultValue = "0")
     private int persistTo;
 
-    @UriParam
+    @UriParam(label = "producer", defaultValue = "0")
     private int replicateTo;
 
     // Producer parameters
-    @UriParam
+    @UriParam(label = "producer", defaultValue = COUCHBASE_PUT)
     private String operation = COUCHBASE_PUT;
-    @UriParam
+    @UriParam(label = "producer", defaultValue = "false")
     private boolean autoStartIdForInserts;
-    @UriParam
+    @UriParam(label = "producer", defaultValue = "2")
     private int producerRetryAttempts = DEFAULT_PRODUCER_RETRIES;
-    @UriParam
+    @UriParam(label = "producer", defaultValue = "5000")
     private int producerRetryPause = DEFAULT_PAUSE_BETWEEN_RETRIES;
 
-    @UriParam
+    @UriParam(label = "producer")
     private long startingIdForInsertsFrom;
     // View control
-    @UriParam
+    @UriParam(label = "consumer", defaultValue = DEFAULT_DESIGN_DOCUMENT_NAME)
     private String designDocumentName = DEFAULT_DESIGN_DOCUMENT_NAME;
-    @UriParam
+    @UriParam(label = "consumer", defaultValue = DEFAULT_VIEWNAME)
     private String viewName = DEFAULT_VIEWNAME;
-    @UriParam
+    @UriParam(label = "consumer", defaultValue = "-1")
     private int limit = -1;
-    @UriParam
+    @UriParam(label = "consumer", defaultValue = "false")
     private boolean descending;
-    @UriParam
+    @UriParam(label = "consumer", defaultValue = "-1")
     private int skip = -1;
-    @UriParam
-    private String rangeStartKey = "";
-
-    @UriParam
+    @UriParam(label = "consumer")
+    private String rangeStartKey;
+    @UriParam(label = "consumer")
     private String rangeEndKey = "";
 
     // Consumer strategy
-    @UriParam
+    @UriParam(label = "consumer", defaultValue = DEFAULT_CONSUME_PROCESSED_STRATEGY)
     private String consumerProcessedStrategy = DEFAULT_CONSUME_PROCESSED_STRATEGY;
 
     // Connection fine tuning parameters
-    @UriParam
+    @UriParam(label = "advanced", defaultValue = "2500")
     private long opTimeOut = DEFAULT_OP_TIMEOUT;
-    @UriParam
+    @UriParam(label = "advanced", defaultValue = "998")
     private int timeoutExceptionThreshold = DEFAULT_TIMEOUT_EXCEPTION_THRESHOLD;
-    @UriParam
+    @UriParam(label = "advanced", defaultValue = "16384")
     private int readBufferSize = DEFAULT_READ_BUFFER_SIZE;
-    @UriParam
+    @UriParam(label = "advanced", defaultValue = "false")
     private boolean shouldOptimize;
-    @UriParam
+    @UriParam(label = "advanced", defaultValue = "30000")
     private long maxReconnectDelay = DEFAULT_MAX_RECONNECT_DELAY;
-    @UriParam
+    @UriParam(label = "advanced", defaultValue = "10000")
     private long opQueueMaxBlockTime = DEFAULT_OP_QUEUE_MAX_BLOCK_TIME;
-    @UriParam
+    @UriParam(label = "advanced", defaultValue = "400")
     private long obsPollInterval = DEFAULT_OBS_POLL_INTERVAL;
-    @UriParam
+    @UriParam(label = "advanced", defaultValue = "-1")
     private long obsTimeout = DEFAULT_OBS_TIMEOUT;
 
     public CouchbaseEndpoint() {