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.Endpoint
,org.apache.camel.IsSingleton
,org.apache.camel.Service
,org.apache.camel.ShutdownableService
,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,NOSQL}, 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
Fields Modifier and Type Field Description static long
DEFAULT_HEARTBEAT
static int
DEFAULT_PORT
static String
DEFAULT_STYLE
-
Constructor Summary
Constructors Constructor Description CouchDbEndpoint()
CouchDbEndpoint(String endpointUri, String remaining, CouchDbComponent component)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected CouchDbClientWrapper
createClient()
org.apache.camel.Consumer
createConsumer(org.apache.camel.Processor processor)
org.apache.camel.Producer
createProducer()
String
getDatabase()
long
getHeartbeat()
String
getHostname()
String
getPassword()
int
getPort()
String
getProtocol()
String
getStyle()
String
getUsername()
boolean
isCreateDatabase()
boolean
isDeletes()
boolean
isUpdates()
void
setCreateDatabase(boolean createDatabase)
Creates the database if it does not already existvoid
setDatabase(String database)
Name of the database to usevoid
setDeletes(boolean deletes)
Document deletes are published as eventsvoid
setHeartbeat(long heartbeat)
How often to send an empty message to keep socket alive in millisvoid
setHostname(String hostname)
Hostname of the running couchdb instancevoid
setPassword(String password)
Password for authenticated databasesvoid
setPort(int port)
Port number for the running couchdb instancevoid
setProtocol(String protocol)
The protocol to use for communicating with the database.void
setStyle(String style)
Specifies how many revisions are returned in the changes array.void
setUpdates(boolean updates)
Document inserts/updates are published as eventsvoid
setUsername(String username)
Username in case of authenticated databases-
Methods inherited from class org.apache.camel.support.DefaultEndpoint
configureConsumer, configureExchange, configurePollingConsumer, configureProperties, createAsyncProducer, createEndpointUri, createExchange, createExchange, createPollingConsumer, doInit, doStart, doStop, 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, toString
-
Methods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doLifecycleChange, doResume, doShutdown, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
-
-
-
Field Detail
-
DEFAULT_STYLE
public static final String DEFAULT_STYLE
- See Also:
- Constant Field Values
-
DEFAULT_HEARTBEAT
public static final long DEFAULT_HEARTBEAT
- See Also:
- Constant Field Values
-
DEFAULT_PORT
public static final int DEFAULT_PORT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CouchDbEndpoint
public CouchDbEndpoint()
-
CouchDbEndpoint
public CouchDbEndpoint(String endpointUri, String remaining, CouchDbComponent component) throws Exception
- Throws:
Exception
-
-
Method Detail
-
createConsumer
public org.apache.camel.Consumer createConsumer(org.apache.camel.Processor processor) throws Exception
- Throws:
Exception
-
createClient
protected CouchDbClientWrapper createClient()
-
getProtocol
public String getProtocol()
-
setProtocol
public void setProtocol(String protocol)
The protocol to use for communicating with the database.
-
getHostname
public String getHostname()
-
setHostname
public void setHostname(String hostname)
Hostname of the running couchdb instance
-
getStyle
public String getStyle()
-
setStyle
public void setStyle(String style)
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
public String getUsername()
-
setUsername
public void setUsername(String username)
Username in case of authenticated databases
-
getDatabase
public String getDatabase()
-
setDatabase
public void setDatabase(String database)
Name of the database to use
-
getPassword
public String getPassword()
-
setPassword
public void setPassword(String password)
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
-
-