Class GridFsEndpoint
java.lang.Object
org.apache.camel.support.service.BaseService
org.apache.camel.support.service.ServiceSupport
org.apache.camel.support.DefaultEndpoint
org.apache.camel.component.mongodb.gridfs.GridFsEndpoint
- All Implemented Interfaces:
 AutoCloseable,org.apache.camel.CamelContextAware,org.apache.camel.ComponentAware,org.apache.camel.Endpoint,org.apache.camel.IsSingleton,org.apache.camel.Service,org.apache.camel.ShutdownableService,org.apache.camel.spi.HasCamelContext,org.apache.camel.spi.HasId,org.apache.camel.StatefulService,org.apache.camel.SuspendableService
@UriEndpoint(firstVersion="2.18.0",
             scheme="mongodb-gridfs",
             title="MongoDB GridFS",
             syntax="mongodb-gridfs:connectionBean",
             category={DATABASE,FILE},
             headersClass=GridFsConstants.class)
public class GridFsEndpoint
extends org.apache.camel.support.DefaultEndpoint
Interact with MongoDB GridFS.
- 
Field Summary
Fields inherited from class org.apache.camel.support.service.BaseService
BUILT, FAILED, INITIALIZED, INITIALIZING, lock, NEW, SHUTDOWN, SHUTTING_DOWN, STARTED, STARTING, status, STOPPED, STOPPING, SUSPENDED, SUSPENDING - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionorg.apache.camel.ConsumercreateConsumer(org.apache.camel.Processor processor) org.apache.camel.Producerprotected voiddoInit()protected voidSets the name of the GridFS bucket within the database.com.mongodb.client.MongoDatabasegetDB()longgetDelay()com.mongodb.client.MongoCollection<com.mongodb.client.gridfs.model.GridFSFile> com.mongodb.client.gridfs.GridFSBucketlongcom.mongodb.client.MongoClientgetQuery()com.mongodb.ReadPreferencecom.mongodb.WriteConcernvoidvoidvoidsetConnectionBean(String connectionBean) Name ofMongoClientto use.voidsetDatabase(String database) Sets the name of the MongoDB database to targetvoidsetDelay(long delay) Sets the delay between polls within the Consumer.voidIf the QueryType uses a FileAttribute, this sets the name of the attribute that is used.voidsetGridFsBucket(com.mongodb.client.gridfs.GridFSBucket gridFs) voidsetInitialDelay(long initialDelay) Sets the initialDelay before the consumer will start polling.voidsetMongoConnection(com.mongodb.client.MongoClient mongoConnection) Sets the Mongo instance that represents the backing connectionvoidsetOperation(String operation) Sets the operation this endpoint will execute against GridFs.voidIf the QueryType uses a persistent timestamp, this sets the name of the collection within the DB to store the timestamp.voidIf the QueryType uses a persistent timestamp, this is the ID of the object in the collection to store the timestamp.voidAdditional query parameters (in JSON) that are used to configure the query used for finding files in the GridFsConsumervoidSets the QueryStrategy that is used for polling for new files.voidsetQueryStrategy(QueryStrategy queryStrategy) Sets the QueryStrategy that is used for polling for new files.voidsetReadPreference(com.mongodb.ReadPreference readPreference) Sets a MongoDBReadPreferenceon the Mongo connection.voidsetReadPreference(String readPreference) Sets a MongoDBReadPreferenceon the Mongo connection.voidsetWriteConcern(com.mongodb.WriteConcern writeConcern) Set theWriteConcernfor write operations on MongoDB using the standard ones.voidsetWriteConcern(String writeConcern) Set theWriteConcernfor write operations on MongoDB using the standard ones.Methods inherited from class org.apache.camel.support.DefaultEndpoint
configureConsumer, configureExchange, configurePollingConsumer, configureProperties, createAsyncProducer, createEndpointUri, createExchange, createExchange, createPollingConsumer, equals, getCamelContext, getComponent, getEndpointKey, getEndpointUri, getExceptionHandler, getExchangePattern, getId, getPollingConsumerBlockTimeout, getPollingConsumerQueueSize, hashCode, isAutowiredEnabled, isBridgeErrorHandler, isLazyStartProducer, isLenientProperties, isPollingConsumerBlockWhenFull, isPollingConsumerCopy, isSingleton, setAutowiredEnabled, setBridgeErrorHandler, setCamelContext, setComponent, setEndpointUri, setEndpointUriIfNotSpecified, setExceptionHandler, setExchangePattern, setLazyStartProducer, setPollingConsumerBlockTimeout, setPollingConsumerBlockWhenFull, setPollingConsumerCopy, setPollingConsumerQueueSize, setProperties, toStringMethods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doLifecycleChange, doResume, doStart, doStop, doSuspend, fail, getInternalLock, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.camel.ComponentAware
getComponentMethods inherited from interface org.apache.camel.Endpoint
getEndpointBaseUri, isRemote, isSingletonProducerMethods inherited from interface org.apache.camel.Service
build, close, init, start, stopMethods inherited from interface org.apache.camel.ShutdownableService
shutdownMethods inherited from interface org.apache.camel.StatefulService
getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspendingMethods inherited from interface org.apache.camel.SuspendableService
isSuspended, resume, suspend 
- 
Constructor Details
- 
GridFsEndpoint
 
 - 
 - 
Method Details
- 
createProducer
- Throws:
 Exception
 - 
createConsumer
public org.apache.camel.Consumer createConsumer(org.apache.camel.Processor processor) throws Exception - Throws:
 Exception
 - 
initializeConnection
- Throws:
 Exception
 - 
doInit
- Overrides:
 doInitin classorg.apache.camel.support.DefaultEndpoint- Throws:
 Exception
 - 
doShutdown
- Overrides:
 doShutdownin classorg.apache.camel.support.service.BaseService- Throws:
 Exception
 - 
getConnectionBean
 - 
setConnectionBean
Name ofMongoClientto use. - 
getMongoConnection
public com.mongodb.client.MongoClient getMongoConnection() - 
setMongoConnection
public void setMongoConnection(com.mongodb.client.MongoClient mongoConnection) Sets the Mongo instance that represents the backing connection- Parameters:
 mongoConnection- the connection to the database
 - 
getDB
public com.mongodb.client.MongoDatabase getDB() - 
getDatabase
 - 
setDatabase
Sets the name of the MongoDB database to target- Parameters:
 database- name of the MongoDB database
 - 
getBucket
Sets the name of the GridFS bucket within the database. Default is fs. - 
setBucket
 - 
getQuery
 - 
setQuery
Additional query parameters (in JSON) that are used to configure the query used for finding files in the GridFsConsumer - 
getDelay
public long getDelay() - 
setDelay
public void setDelay(long delay) Sets the delay between polls within the Consumer. Default is 500ms - 
getInitialDelay
public long getInitialDelay() - 
setInitialDelay
public void setInitialDelay(long initialDelay) Sets the initialDelay before the consumer will start polling. Default is 1000ms - 
setQueryStrategy
Sets the QueryStrategy that is used for polling for new files. Default is Timestamp - 
setQueryStrategy
Sets the QueryStrategy that is used for polling for new files. Default is Timestamp - 
getQueryStrategy
 - 
setPersistentTSCollection
If the QueryType uses a persistent timestamp, this sets the name of the collection within the DB to store the timestamp. - 
getPersistentTSCollection
 - 
setPersistentTSObject
If the QueryType uses a persistent timestamp, this is the ID of the object in the collection to store the timestamp. - 
getPersistentTSObject
 - 
setFileAttributeName
If the QueryType uses a FileAttribute, this sets the name of the attribute that is used. Default is "camel-processed". - 
getFileAttributeName
 - 
setWriteConcern
Set theWriteConcernfor write operations on MongoDB using the standard ones. Resolved from the fields of the WriteConcern class by calling theWriteConcern.valueOf(String)method.- Parameters:
 writeConcern- the standard name of the WriteConcern- See Also:
 
 - 
setWriteConcern
public void setWriteConcern(com.mongodb.WriteConcern writeConcern) Set theWriteConcernfor write operations on MongoDB using the standard ones. Resolved from the fields of the WriteConcern class by calling theWriteConcern.valueOf(String)method.- Parameters:
 writeConcern- the standard name of the WriteConcern- See Also:
 
 - 
getWriteConcern
public com.mongodb.WriteConcern getWriteConcern() - 
setReadPreference
Sets a MongoDBReadPreferenceon the Mongo connection. Read preferences set directly on the connection will be overridden by this setting. TheReadPreference.valueOf(String)utility method is used to resolve the passedreadPreferencevalue. Some examples for the possible values arenearest,primaryorsecondaryetc.- Parameters:
 readPreference- the name of the read preference to set
 - 
setReadPreference
public void setReadPreference(com.mongodb.ReadPreference readPreference) Sets a MongoDBReadPreferenceon the Mongo connection. Read preferences set directly on the connection will be overridden by this setting. TheReadPreference.valueOf(String)utility method is used to resolve the passedreadPreferencevalue. Some examples for the possible values arenearest,primaryorsecondaryetc.- Parameters:
 readPreference- the name of the read preference to set
 - 
getReadPreference
public com.mongodb.ReadPreference getReadPreference() - 
setOperation
Sets the operation this endpoint will execute against GridFs. - 
getOperation
 - 
getGridFsBucket
public com.mongodb.client.gridfs.GridFSBucket getGridFsBucket() - 
setGridFsBucket
public void setGridFsBucket(com.mongodb.client.gridfs.GridFSBucket gridFs)  - 
getFilesCollection
public com.mongodb.client.MongoCollection<com.mongodb.client.gridfs.model.GridFSFile> getFilesCollection() 
 -