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 7DEE719192 for ; Tue, 1 Mar 2016 22:18:59 +0000 (UTC) Received: (qmail 62613 invoked by uid 500); 1 Mar 2016 22:18:59 -0000 Delivered-To: apmail-camel-commits-archive@camel.apache.org Received: (qmail 62563 invoked by uid 500); 1 Mar 2016 22:18:59 -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 62554 invoked by uid 99); 1 Mar 2016 22:18:59 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Mar 2016 22:18:59 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 04D80180550 for ; Tue, 1 Mar 2016 22:18:59 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.721 X-Spam-Level: * X-Spam-Status: No, score=1.721 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, KAM_LOTSOFHASH=0.25, RP_MATCHES_RCVD=-0.329] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id NfeCygLMTN-z for ; Tue, 1 Mar 2016 22:18:56 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id D00C15FBBD for ; Tue, 1 Mar 2016 22:18:55 +0000 (UTC) Received: from svn01-us-west.apache.org (svn.apache.org [10.41.0.6]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id E7D1DE0057 for ; Tue, 1 Mar 2016 22:18:54 +0000 (UTC) Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id C8BC23A024F for ; Tue, 1 Mar 2016 22:18:54 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r981569 - in /websites/production/camel/content: cache/main.pageCache gridfs.html Date: Tue, 01 Mar 2016 22:18:54 -0000 To: commits@camel.apache.org From: buildbot@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20160301221854.C8BC23A024F@svn01-us-west.apache.org> Author: buildbot Date: Tue Mar 1 22:18:54 2016 New Revision: 981569 Log: Production update by buildbot for camel Modified: websites/production/camel/content/cache/main.pageCache websites/production/camel/content/gridfs.html Modified: websites/production/camel/content/cache/main.pageCache ============================================================================== Binary files - no diff available. Modified: websites/production/camel/content/gridfs.html ============================================================================== --- websites/production/camel/content/gridfs.html (original) +++ websites/production/camel/content/gridfs.html Tue Mar 1 22:18:54 2016 @@ -36,6 +36,16 @@ + + + + + + + Apache Camel: GridFS @@ -75,7 +85,44 @@ <tbody> <tr> <td valign="top" width="100%"> -<div class="wiki-content maincontent"></div> +<div class="wiki-content maincontent"><h2 id="GridFS-CamelGridFScomponent">Camel GridFS component</h2><p><strong>Available as of Camel 2.17</strong></p><p>Maven users will need to add the following dependency to their <code>pom.xml</code> for this component:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-gridfs</artifactId> + <version>x.y.z</version> + <!-- use the same version as your Camel core version --> +</dependency> +]]></script> +</div></div><h2 id="GridFS-URIformat">URI format</h2><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[gridfs:connectionBean?database=databaseName&bucket=bucketName[&moreOptions...] +]]></script> +</div></div><h2 id="GridFS-Endpointoptions">Endpoint options</h2><p>GridFS endpoints support the following options, depending on whether they are acting like a Producer or as a Consumer (options vary based on the consumer type too).</p><p> </p><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Name</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Default Value</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Producer</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Consumer</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>database</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>none</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Required.</strong> The name of the database to which this endpoint will be bound. All operations will be executed aga inst this database.</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><img class="emoticon emoticon-tick" src="https://cwiki.apache.org/confluence/s/en_GB/5982/f2b47fb3d636c8bc9fd0b11c0ec6d0ae18646be7.1/_/images/icons/emoticons/check.png" data-emoticon-name="tick" alt="(tick)"></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><img class="emoticon emoticon-tick" src="https://cwiki.apache.org/confluence/s/en_GB/5982/f2b47fb3d636c8bc9fd0b11c0ec6d0ae18646be7.1/_/images/icons/emoticons/check.png" data-emoticon-name="tick" alt="(tick)"></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>bucket</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>fs</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The name of the GridFS bucket within the Database. The default is the GridFS.DEFAULT_BUCKET value ("fs").</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><img class="emoticon emoticon-tick" src="https://cwiki.apache .org/confluence/s/en_GB/5982/f2b47fb3d636c8bc9fd0b11c0ec6d0ae18646be7.1/_/images/icons/emoticons/check.png" data-emoticon-name="tick" alt="(tick)"></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><img class="emoticon emoticon-tick" src="https://cwiki.apache.org/confluence/s/en_GB/5982/f2b47fb3d636c8bc9fd0b11c0ec6d0ae18646be7.1/_/images/icons/emoticons/check.png" data-emoticon-name="tick" alt="(tick)"></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>operation</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>create</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The id of the operation this endpoint will execute. Pick from the following:</p><ul><li>Query operations: <code>findOne</code>, <code>listAll</code>, <code>count</code></li><li>Write operations: <code>create</code></li><li>Delete operations: <code>remove</code></li></ul></td><td colspan="1" rowspan="1" class="confluenceTd"><p><img class="emoticon emoticon-tic k" src="https://cwiki.apache.org/confluence/s/en_GB/5982/f2b47fb3d636c8bc9fd0b11c0ec6d0ae18646be7.1/_/images/icons/emoticons/check.png" data-emoticon-name="tick" alt="(tick)"></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> </p></td></tr></tbody></table></div><h2 id="GridFS-ConfigurationofdatabaseinSpringXML">Configuration of database in Spring XML</h2><p>The following Spring XML creates a bean defining the connection to a MongoDB instance.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<beans xmlns="http://www.springframework.org/schema/beans" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> + <bean id="mongoBean" class="com.mongodb.Mongo"> + <constructor-arg name="host" value="${mongodb.host}" /> + <constructor-arg name="port" value="${mongodb.port}" /> + </bean> +</beans>]]></script> +</div></div><h3 id="GridFS-Sampleroute">Sample route</h3><p>The following route defined in Spring XML executes the operation <a shape="rect" href="#GridFS-findOne"> <strong>findOne</strong> </a> on a collection.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>Get a file from GridFS</b></div><div class="codeContent panelContent pdl"> +<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<route> + <from uri="direct:start" /> + <!-- using bean 'mongoBean' defined above --> + <to uri="gridfs:mongoBean?database=${mongodb.database}&amp;operation=findOne" /> + <to uri="direct:result" /> +</route>]]></script> +</div></div><p> </p><h2 id="GridFS-GridFSoperations-producerendpoints">GridFS operations - producer endpoints</h2><h3 id="GridFS-Queryoperations">Query operations</h3><h4 id="GridFS-count">count</h4><p>Returns the total number of file in the collection, returning a Long as the OUT message body.<br clear="none"><br clear="none"></p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[// from("direct:count").to("gridfs?database=tickets&operation=count"); +Long result = template.requestBodyAndHeader("direct:count", "irrelevantBody"); +assertTrue("Result is not of type Long", result instanceof Long); +]]></script> +</div></div><p>You can provide a filename header to provide a count of files matching that filename.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[Map<String, Object> headers = new HashMap<String, Object>(); +headers.put(Exchange.FILE_NAME, "filename.txt"); +Long count = template.requestBodyAndHeaders("direct:count", query, headers); +]]></script> +</div></div><h3 id="GridFS-GridFSConsumer">GridFS Consumer</h3><p> </p><p> </p><p> </p><p> </p><p>See also</p><ul><li><a shape="rect" class="external-link" href="http://www.mongodb.org/" rel="nofollow">MongoDB website</a></li><li><a shape="rect" class="external-link" href="http://en.wikipedia.org/wiki/NoSQL" rel="nofollow">NoSQL Wikipedia article</a></li><li><a shape="rect" class="external-link" href="http://api.mongodb.org/java/current/" rel="nofollow">MongoDB Java driver API docs - current version</a></li><li><a shape="rect" class="external-link" href="http://svn.apache.org/viewvc/camel/trunk/components/camel-mongodb/src/test/">Unit tests</a> for more examples of usage</li></ul></div> </td> <td valign="top"> <div class="navigation">