camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r981742 - in /websites/production/camel/content: cache/main.pageCache gridfs.html
Date Thu, 03 Mar 2016 18:18:35 GMT
Author: buildbot
Date: Thu Mar  3 18:18:34 2016
New Revision: 981742

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 Thu Mar  3 18:18:34 2016
@@ -112,16 +112,40 @@
   <to uri="gridfs:mongoBean?database=${mongodb.database}&operation=findOne"
/>
   <to uri="direct:result" />
 &lt;/route&gt;]]></script>
-</div></div><p>&#160;</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">
+</div></div><p>&#160;</p><h2 id="GridFS-GridFSoperations-producerendpoint">GridFS
operations - producer endpoint</h2><h4 id="GridFS-count">count</h4><p>Returns
the total number of file in the collection, returning an Integer 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(&quot;direct:count&quot;).to(&quot;gridfs?database=tickets&amp;operation=count&quot;);
-Long result = template.requestBodyAndHeader(&quot;direct:count&quot;, &quot;irrelevantBody&quot;);
-assertTrue(&quot;Result is not of type Long&quot;, result instanceof Long);
+Integer result = template.requestBodyAndHeader(&quot;direct:count&quot;, &quot;irrelevantBody&quot;);
+assertTrue(&quot;Result is not of type Long&quot;, result instanceof Integer);
 ]]></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&lt;String,
Object&gt; headers = new HashMap&lt;String, Object&gt;();
 headers.put(Exchange.FILE_NAME, &quot;filename.txt&quot;);
-Long count = template.requestBodyAndHeaders(&quot;direct:count&quot;, query, headers);
+Integer count = template.requestBodyAndHeaders(&quot;direct:count&quot;, query, headers);
 ]]></script>
+</div></div><h4 id="GridFS-listAll">listAll</h4><p>Returns
an Reader that lists all the filenames and their IDs in a tab separated stream.</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(&quot;direct:listAll&quot;).to(&quot;gridfs?database=tickets&amp;operation=listAll&quot;);
+Reader result = template.requestBodyAndHeader(&quot;direct:listAll&quot;, &quot;irrelevantBody&quot;);
+
+filename1.txt	1252314321
+filename2.txt	2897651254]]></script>
+</div></div><p>&#160;</p><h4 id="GridFS-findOne"><strong>findOne</strong></h4><p>Finds
a file in the GridFS system and sets the body to an InputStream of the content. &#160;
Also provides the metadata has headers. &#160;It uses Exchange.FILE_NAME from the incoming
headers to determine the file to find.</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(&quot;direct:findOne&quot;).to(&quot;gridfs?database=tickets&amp;operation=findOne&quot;);
+Map&lt;String, Object&gt; headers = new HashMap&lt;String, Object&gt;();
+headers.put(Exchange.FILE_NAME, &quot;filename.txt&quot;);
+InputStream result = template.requestBodyAndHeaders(&quot;direct:findOne&quot;, &quot;irrelevantBody&quot;,
headers);
+
+]]></script>
+</div></div><p>&#160;</p><h4 id="GridFS-create">create</h4><p>Creates
a new file in the GridFs database. It uses the Exchange.FILE_NAME from the incoming headers
for the name and the body contents (as an InputStream) as the content.</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(&quot;direct:create&quot;).to(&quot;gridfs?database=tickets&amp;operation=create&quot;);
+Map&lt;String, Object&gt; headers = new HashMap&lt;String, Object&gt;();
+headers.put(Exchange.FILE_NAME, &quot;filename.txt&quot;);
+InputStream stream = ... the data for the file ...
+template.requestBodyAndHeaders(&quot;direct:create&quot;, stream, headers);]]></script>
+</div></div><h4 id="GridFS-remove">remove</h4><p>Removes a
file from the GridFS database.</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(&quot;direct:remove&quot;).to(&quot;gridfs?database=tickets&amp;operation=remove&quot;);
+Map&lt;String, Object&gt; headers = new HashMap&lt;String, Object&gt;();
+headers.put(Exchange.FILE_NAME, &quot;filename.txt&quot;);
+template.requestBodyAndHeaders(&quot;direct:remove&quot;, &quot;&quot;, headers);]]></script>
 </div></div><h3 id="GridFS-GridFSConsumer">GridFS Consumer</h3><p>&#160;</p><p>&#160;</p><p>&#160;</p><p>&#160;</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">



Mime
View raw message