Return-Path: X-Original-To: apmail-camel-commits-archive@www.apache.org Delivered-To: apmail-camel-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 83680102C1 for ; Fri, 2 Jan 2015 15:28:35 +0000 (UTC) Received: (qmail 37191 invoked by uid 500); 2 Jan 2015 15:28:36 -0000 Delivered-To: apmail-camel-commits-archive@camel.apache.org Received: (qmail 37041 invoked by uid 500); 2 Jan 2015 15:28:36 -0000 Mailing-List: contact commits-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list commits@camel.apache.org Received: (qmail 36815 invoked by uid 99); 2 Jan 2015 15:28:36 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Jan 2015 15:28:36 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id B8695A3C79E; Fri, 2 Jan 2015 15:28:35 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: davsclaus@apache.org To: commits@camel.apache.org Date: Fri, 02 Jan 2015 15:28:36 -0000 Message-Id: In-Reply-To: <94a5332ab2514a67b848a3a304060836@git.apache.org> References: <94a5332ab2514a67b848a3a304060836@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [2/7] camel git commit: CAMEL-7999: More components include documentation CAMEL-7999: More components include documentation Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/0a173c0c Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/0a173c0c Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/0a173c0c Branch: refs/heads/master Commit: 0a173c0cab20b3a83af96998c41ac1e907b7b95d Parents: e16f0ab Author: Claus Ibsen Authored: Fri Jan 2 15:57:23 2015 +0100 Committer: Claus Ibsen Committed: Fri Jan 2 15:57:23 2015 +0100 ---------------------------------------------------------------------- .../component/couchdb/CouchDbComponent.java | 7 ++++--- .../camel/component/couchdb/CouchDbEndpoint.java | 19 +++++++++++++++++-- 2 files changed, 21 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/0a173c0c/components/camel-couchdb/src/main/java/org/apache/camel/component/couchdb/CouchDbComponent.java ---------------------------------------------------------------------- diff --git a/components/camel-couchdb/src/main/java/org/apache/camel/component/couchdb/CouchDbComponent.java b/components/camel-couchdb/src/main/java/org/apache/camel/component/couchdb/CouchDbComponent.java index 726771f..dd1d147 100644 --- a/components/camel-couchdb/src/main/java/org/apache/camel/component/couchdb/CouchDbComponent.java +++ b/components/camel-couchdb/src/main/java/org/apache/camel/component/couchdb/CouchDbComponent.java @@ -19,15 +19,16 @@ package org.apache.camel.component.couchdb; import java.util.Map; import org.apache.camel.CamelContext; -import org.apache.camel.impl.DefaultComponent; +import org.apache.camel.impl.UriEndpointComponent; -public class CouchDbComponent extends DefaultComponent { +public class CouchDbComponent extends UriEndpointComponent { public CouchDbComponent() { + super(CouchDbEndpoint.class); } public CouchDbComponent(CamelContext context) { - super(context); + super(context, CouchDbEndpoint.class); } @Override http://git-wip-us.apache.org/repos/asf/camel/blob/0a173c0c/components/camel-couchdb/src/main/java/org/apache/camel/component/couchdb/CouchDbEndpoint.java ---------------------------------------------------------------------- diff --git a/components/camel-couchdb/src/main/java/org/apache/camel/component/couchdb/CouchDbEndpoint.java b/components/camel-couchdb/src/main/java/org/apache/camel/component/couchdb/CouchDbEndpoint.java index 91bc013..238484d 100644 --- a/components/camel-couchdb/src/main/java/org/apache/camel/component/couchdb/CouchDbEndpoint.java +++ b/components/camel-couchdb/src/main/java/org/apache/camel/component/couchdb/CouchDbEndpoint.java @@ -24,8 +24,12 @@ import org.apache.camel.Exchange; import org.apache.camel.Processor; import org.apache.camel.Producer; import org.apache.camel.impl.DefaultEndpoint; +import org.apache.camel.spi.UriEndpoint; +import org.apache.camel.spi.UriParam; +import org.apache.camel.spi.UriPath; import org.lightcouch.CouchDbClient; +@UriEndpoint(scheme = "couchdb", consumerClass = CouchDbConsumer.class, label = "database,nosql") public class CouchDbEndpoint extends DefaultEndpoint { public static final String DEFAULT_STYLE = "main_only"; @@ -34,16 +38,27 @@ public class CouchDbEndpoint extends DefaultEndpoint { private static final String URI_ERROR = "Invalid URI. Format must be of the form couchdb:http[s]://hostname[:port]/database?[options...]"; + @UriPath private String protocol; + @UriPath private String hostname; + @UriPath + private int port; + @UriPath + private String database; + @UriParam(defaultValue = DEFAULT_STYLE) private String style = DEFAULT_STYLE; + @UriParam private String username; - private String database; + @UriParam private String password; - private int port; + @UriParam(defaultValue = "" + DEFAULT_HEARTBEAT) private long heartbeat = DEFAULT_HEARTBEAT; + @UriParam(defaultValue = "false") private boolean createDatabase; + @UriParam(defaultValue = "true") private boolean deletes = true; + @UriParam(defaultValue = "true") private boolean updates = true; public CouchDbEndpoint() {