Class CouchDbEndpoint
java.lang.Object
org.apache.camel.support.service.BaseService
org.apache.camel.support.service.ServiceSupport
org.apache.camel.support.DefaultEndpoint
org.apache.camel.component.couchdb.CouchDbEndpoint
- 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.11.0",
scheme="couchdb",
title="CouchDB",
syntax="couchdb:protocol:hostname:port/database",
category=DATABASE,
headersClass=CouchDbConstants.class)
public class CouchDbEndpoint
extends org.apache.camel.support.DefaultEndpoint
Consume changesets for inserts, updates and deletes in a CouchDB database, as well as get, save, update and delete
documents from a CouchDB database.
-
Field Summary
FieldsFields 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
ConstructorsConstructorDescriptionCouchDbEndpoint(String endpointUri, String remaining, CouchDbComponent component) -
Method Summary
Modifier and TypeMethodDescriptionprotected CouchDbClientWrapperorg.apache.camel.ConsumercreateConsumer(org.apache.camel.Processor processor) org.apache.camel.ProducerlongintgetPort()getStyle()booleanbooleanbooleanvoidsetCreateDatabase(boolean createDatabase) Creates the database if it does not already existvoidsetDatabase(String database) Name of the database to usevoidsetDeletes(boolean deletes) Document deletes are published as eventsvoidsetHeartbeat(long heartbeat) How often to send an empty message to keep socket alive in millisvoidsetHostname(String hostname) Hostname of the running couchdb instancevoidsetPassword(String password) Password for authenticated databasesvoidsetPort(int port) Port number for the running couchdb instancevoidsetProtocol(String protocol) The protocol to use for communicating with the database.voidSpecifies how many revisions are returned in the changes array.voidsetUpdates(boolean updates) Document inserts/updates are published as eventsvoidsetUsername(String username) Username in case of authenticated databasesMethods inherited from class org.apache.camel.support.DefaultEndpoint
configureConsumer, configureExchange, configurePollingConsumer, configureProperties, createAsyncProducer, createEndpointUri, createExchange, createExchange, createPollingConsumer, doInit, 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, doShutdown, doStart, doStop, doSuspend, fail, 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, 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
-
Field Details
-
DEFAULT_STYLE
- See Also:
-
DEFAULT_HEARTBEAT
public static final long DEFAULT_HEARTBEAT- See Also:
-
DEFAULT_PORT
public static final int DEFAULT_PORT- See Also:
-
-
Constructor Details
-
CouchDbEndpoint
public CouchDbEndpoint() -
CouchDbEndpoint
public CouchDbEndpoint(String endpointUri, String remaining, CouchDbComponent component) throws Exception - Throws:
Exception
-
-
Method Details
-
createConsumer
public org.apache.camel.Consumer createConsumer(org.apache.camel.Processor processor) throws Exception - Throws:
Exception
-
createProducer
- Throws:
Exception
-
createClient
-
getProtocol
-
setProtocol
The protocol to use for communicating with the database. -
getHostname
-
setHostname
Hostname of the running couchdb instance -
getStyle
-
setStyle
Specifies how many revisions are returned in the changes array. The default, main_only, will only return the current "winning" revision; all_docs will return all leaf revisions (including conflicts and deleted former conflicts.) -
getUsername
-
setUsername
Username in case of authenticated databases -
getDatabase
-
setDatabase
Name of the database to use -
getPassword
-
setPassword
Password for authenticated databases -
getPort
public int getPort() -
setPort
public void setPort(int port) Port number for the running couchdb instance -
getHeartbeat
public long getHeartbeat() -
setHeartbeat
public void setHeartbeat(long heartbeat) How often to send an empty message to keep socket alive in millis -
isCreateDatabase
public boolean isCreateDatabase() -
setCreateDatabase
public void setCreateDatabase(boolean createDatabase) Creates the database if it does not already exist -
isDeletes
public boolean isDeletes() -
setDeletes
public void setDeletes(boolean deletes) Document deletes are published as events -
isUpdates
public boolean isUpdates() -
setUpdates
public void setUpdates(boolean updates) Document inserts/updates are published as events
-