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 @@
<![endif]-->
+ <link href='//camel.apache.org/styles/highlighter/styles/shCoreCamel.css'
rel='stylesheet' type='text/css' />
+ <link href='//camel.apache.org/styles/highlighter/styles/shThemeCamel.css'
rel='stylesheet' type='text/css' />
+ <script src='//camel.apache.org/styles/highlighter/scripts/shCore.js'
type='text/javascript'></script>
+ <script src='//camel.apache.org/styles/highlighter/scripts/shBrushJava.js'
type='text/javascript'></script>
+ <script src='//camel.apache.org/styles/highlighter/scripts/shBrushXml.js'
type='text/javascript'></script>
+
+ <script type="text/javascript">
+ SyntaxHighlighter.defaults['toolbar'] = false;
+ SyntaxHighlighter.all();
+ </script>
<title>
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">