@UriEndpoint(firstVersion="2.18.0",
scheme="mongodb-gridfs",
title="MongoDB GridFS",
syntax="mongodb-gridfs:connectionBean",
label="database,nosql")
public class GridFsEndpoint
extends org.apache.camel.support.DefaultEndpoint
| Modifier and Type | Field and Description |
|---|---|
static String |
GRIDFS_CHUNKSIZE |
static String |
GRIDFS_FILE_ID_PRODUCED |
static String |
GRIDFS_METADATA |
static String |
GRIDFS_OPERATION |
| Constructor and Description |
|---|
GridFsEndpoint(String uri,
GridFsComponent component) |
| Modifier and Type | Method and Description |
|---|---|
org.apache.camel.Consumer |
createConsumer(org.apache.camel.Processor processor) |
org.apache.camel.Producer |
createProducer() |
protected void |
doInit() |
protected void |
doShutdown() |
String |
getBucket()
Sets the name of the GridFS bucket within the database.
|
String |
getConnectionBean() |
String |
getDatabase() |
com.mongodb.DB |
getDB() |
long |
getDelay() |
String |
getFileAttributeName() |
com.mongodb.DBCollection |
getFilesCollection() |
com.mongodb.gridfs.GridFS |
getGridFs() |
long |
getInitialDelay() |
com.mongodb.MongoClient |
getMongoConnection() |
String |
getOperation() |
String |
getPersistentTSCollection() |
String |
getPersistentTSObject() |
String |
getQuery() |
QueryStrategy |
getQueryStrategy() |
com.mongodb.ReadPreference |
getReadPreference() |
com.mongodb.WriteConcern |
getWriteConcern() |
void |
initializeConnection() |
void |
setBucket(String bucket) |
void |
setConnectionBean(String connectionBean)
Name of
MongoClient to use. |
void |
setDatabase(String database)
Sets the name of the MongoDB database to target
|
void |
setDelay(long delay)
Sets the delay between polls within the Consumer.
|
void |
setFileAttributeName(String f)
If the QueryType uses a FileAttribute, this sets the name of the attribute that is used.
|
void |
setGridFs(com.mongodb.gridfs.GridFS gridFs) |
void |
setInitialDelay(long initialDelay)
Sets the initialDelay before the consumer will start polling.
|
void |
setMongoConnection(com.mongodb.MongoClient mongoConnection)
Sets the Mongo instance that represents the backing connection
|
void |
setOperation(String operation)
Sets the operation this endpoint will execute against GridRS.
|
void |
setPersistentTSCollection(String s)
If the QueryType uses a persistent timestamp, this sets the name of the collection within
the DB to store the timestamp.
|
void |
setPersistentTSObject(String id)
If the QueryType uses a persistent timestamp, this is the ID of the object in the collection
to store the timestamp.
|
void |
setQuery(String query)
Additional query parameters (in JSON) that are used to configure the query used for finding
files in the GridFsConsumer
|
void |
setQueryStrategy(QueryStrategy queryStrategy)
Sets the QueryStrategy that is used for polling for new files.
|
void |
setQueryStrategy(String s)
Sets the QueryStrategy that is used for polling for new files.
|
void |
setReadPreference(com.mongodb.ReadPreference readPreference)
Sets a MongoDB
ReadPreference on the Mongo connection. |
void |
setReadPreference(String readPreference)
Sets a MongoDB
ReadPreference on the Mongo connection. |
void |
setWriteConcern(String writeConcern)
Set the
WriteConcern for write operations on MongoDB using the standard ones. |
void |
setWriteConcern(com.mongodb.WriteConcern writeConcern)
Set the
WriteConcern for write operations on MongoDB using the standard ones. |
configureConsumer, configurePollingConsumer, configureProperties, createAsyncProducer, createEndpointUri, createExchange, createExchange, createPollingConsumer, doStart, doStop, equals, getCamelContext, getComponent, getEndpointKey, getEndpointUri, getExceptionHandler, getExchangePattern, getId, getPollingConsumerBlockTimeout, getPollingConsumerQueueSize, hashCode, isBasicPropertyBinding, isBridgeErrorHandler, isLazyStartProducer, isLenientProperties, isPollingConsumerBlockWhenFull, isSingleton, isSynchronous, setBasicPropertyBinding, setBridgeErrorHandler, setCamelContext, setComponent, setEndpointUri, setEndpointUriIfNotSpecified, setExceptionHandler, setExchangePattern, setLazyStartProducer, setPollingConsumerBlockTimeout, setPollingConsumerBlockWhenFull, setPollingConsumerQueueSize, setProperties, setSynchronous, toStringbuild, doBuild, doFail, doLifecycleChange, doResume, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendclone, finalize, getClass, notify, notifyAll, wait, wait, waitpublic static final String GRIDFS_OPERATION
public static final String GRIDFS_METADATA
public static final String GRIDFS_CHUNKSIZE
public static final String GRIDFS_FILE_ID_PRODUCED
public GridFsEndpoint(String uri, GridFsComponent component)
public org.apache.camel.Consumer createConsumer(org.apache.camel.Processor processor)
throws Exception
Exceptionprotected void doInit()
throws Exception
doInit in class org.apache.camel.support.DefaultEndpointExceptionprotected void doShutdown()
throws Exception
doShutdown in class org.apache.camel.support.service.BaseServiceExceptionpublic String getConnectionBean()
public void setConnectionBean(String connectionBean)
MongoClient to use.public com.mongodb.MongoClient getMongoConnection()
public void setMongoConnection(com.mongodb.MongoClient mongoConnection)
mongoConnection - the connection to the databasepublic com.mongodb.DB getDB()
public String getDatabase()
public void setDatabase(String database)
database - name of the MongoDB databasepublic String getBucket()
public void setBucket(String bucket)
public String getQuery()
public void setQuery(String query)
public long getDelay()
public void setDelay(long delay)
public long getInitialDelay()
public void setInitialDelay(long initialDelay)
public void setQueryStrategy(String s)
public void setQueryStrategy(QueryStrategy queryStrategy)
public QueryStrategy getQueryStrategy()
public void setPersistentTSCollection(String s)
public String getPersistentTSCollection()
public void setPersistentTSObject(String id)
public String getPersistentTSObject()
public void setFileAttributeName(String f)
public String getFileAttributeName()
public void setWriteConcern(String writeConcern)
WriteConcern for write operations on MongoDB using the standard ones.
Resolved from the fields of the WriteConcern class by calling the WriteConcern.valueOf(String) method.writeConcern - the standard name of the WriteConcernpublic void setWriteConcern(com.mongodb.WriteConcern writeConcern)
WriteConcern for write operations on MongoDB using the standard ones.
Resolved from the fields of the WriteConcern class by calling the WriteConcern.valueOf(String) method.writeConcern - the standard name of the WriteConcernpublic com.mongodb.WriteConcern getWriteConcern()
public void setReadPreference(String readPreference)
ReadPreference on the Mongo connection. Read preferences set directly on the connection will be
overridden by this setting.
The ReadPreference.valueOf(String) utility method is used to resolve the passed readPreference
value. Some examples for the possible values are nearest, primary or secondary etc.readPreference - the name of the read preference to setpublic void setReadPreference(com.mongodb.ReadPreference readPreference)
ReadPreference on the Mongo connection. Read preferences set directly on the connection will be
overridden by this setting.
The ReadPreference.valueOf(String) utility method is used to resolve the passed readPreference
value. Some examples for the possible values are nearest, primary or secondary etc.readPreference - the name of the read preference to setpublic com.mongodb.ReadPreference getReadPreference()
public void setOperation(String operation)
public String getOperation()
public com.mongodb.gridfs.GridFS getGridFs()
public void setGridFs(com.mongodb.gridfs.GridFS gridFs)
public com.mongodb.DBCollection getFilesCollection()
Apache Camel