camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [1/2] camel git commit: Add the _id of the file just persisted to the context
Date Thu, 28 Apr 2016 10:54:50 GMT
Repository: camel
Updated Branches:
  refs/heads/camel-2.17.x 31e45f488 -> f683d96d6
  refs/heads/master d78e0908d -> 3c4e19e48


Add the _id of the file just persisted to the context


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

Branch: refs/heads/master
Commit: 3c4e19e482dd413251bf5dd283ca69d1edd4b0ac
Parents: d78e090
Author: Joseluis Pedrosa <joseluis.pedrosa@elephanttalk.com>
Authored: Thu Apr 28 12:41:45 2016 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Thu Apr 28 12:54:05 2016 +0200

----------------------------------------------------------------------
 .../java/org/apache/camel/component/gridfs/GridFsEndpoint.java     | 1 +
 .../java/org/apache/camel/component/gridfs/GridFsProducer.java     | 2 ++
 2 files changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/3c4e19e4/components/camel-mongodb-gridfs/src/main/java/org/apache/camel/component/gridfs/GridFsEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-mongodb-gridfs/src/main/java/org/apache/camel/component/gridfs/GridFsEndpoint.java
b/components/camel-mongodb-gridfs/src/main/java/org/apache/camel/component/gridfs/GridFsEndpoint.java
index 4856a7f..cfd8831 100644
--- a/components/camel-mongodb-gridfs/src/main/java/org/apache/camel/component/gridfs/GridFsEndpoint.java
+++ b/components/camel-mongodb-gridfs/src/main/java/org/apache/camel/component/gridfs/GridFsEndpoint.java
@@ -47,6 +47,7 @@ public class GridFsEndpoint extends DefaultEndpoint {
     public static final String GRIDFS_OPERATION = "gridfs.operation";
     public static final String GRIDFS_METADATA = "gridfs.metadata";
     public static final String GRIDFS_CHUNKSIZE = "gridfs.chunksize";
+    public static final String GRIDFS_FILE_ID_PRODUCED = "gridfs.fileid";
 
     private static final Logger LOG = LoggerFactory.getLogger(GridFsEndpoint.class);
 

http://git-wip-us.apache.org/repos/asf/camel/blob/3c4e19e4/components/camel-mongodb-gridfs/src/main/java/org/apache/camel/component/gridfs/GridFsProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-mongodb-gridfs/src/main/java/org/apache/camel/component/gridfs/GridFsProducer.java
b/components/camel-mongodb-gridfs/src/main/java/org/apache/camel/component/gridfs/GridFsProducer.java
index dccb499..397cc03 100644
--- a/components/camel-mongodb-gridfs/src/main/java/org/apache/camel/component/gridfs/GridFsProducer.java
+++ b/components/camel-mongodb-gridfs/src/main/java/org/apache/camel/component/gridfs/GridFsProducer.java
@@ -61,7 +61,9 @@ public class GridFsProducer extends DefaultProducer {
             DBObject dbObject = (DBObject) JSON.parse(metaData);
             gfsFile.setMetaData(dbObject);
             gfsFile.save();
+            //add headers with the id and file name produced by the driver.
             exchange.getIn().setHeader(Exchange.FILE_NAME_PRODUCED, gfsFile.getFilename());
+            exchange.getIn().setHeader(GridFsEndpoint.GRIDFS_FILE_ID_PRODUCED, gfsFile.getId());
         } else if ("remove".equals(operation)) {
             final String filename = exchange.getIn().getHeader(Exchange.FILE_NAME, String.class);
             endpoint.getGridFs().remove(filename);


Mime
View raw message