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

    Fields
    Modifier and Type
    Field
    Description
    static final long
     
    static final int
     
    static final String
     

    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
    Constructor
    Description
     
    CouchDbEndpoint(String endpointUri, String remaining, CouchDbComponent component)
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
    org.apache.camel.Consumer
    createConsumer(org.apache.camel.Processor processor)
     
    org.apache.camel.Producer
     
     
    long
     
     
     
    int
     
     
     
     
    boolean
     
    boolean
     
    boolean
     
    void
    setCreateDatabase(boolean createDatabase)
    Creates the database if it does not already exist
    void
    setDatabase(String database)
    Name of the database to use
    void
    setDeletes(boolean deletes)
    Document deletes are published as events
    void
    setHeartbeat(long heartbeat)
    How often to send an empty message to keep socket alive in millis
    void
    setHostname(String hostname)
    Hostname of the running couchdb instance
    void
    setPassword(String password)
    Password for authenticated databases
    void
    setPort(int port)
    Port number for the running couchdb instance
    void
    setProtocol(String protocol)
    The protocol to use for communicating with the database.
    void
    Specifies how many revisions are returned in the changes array.
    void
    setUpdates(boolean updates)
    Document inserts/updates are published as events
    void
    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, 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, doStart, doStop, 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

    Methods inherited from interface org.apache.camel.ComponentAware

    getComponent

    Methods inherited from interface org.apache.camel.Endpoint

    getEndpointBaseUri, isSingletonProducer

    Methods inherited from interface org.apache.camel.Service

    build, close, init, start, stop

    Methods inherited from interface org.apache.camel.ShutdownableService

    shutdown

    Methods inherited from interface org.apache.camel.StatefulService

    getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspending

    Methods inherited from interface org.apache.camel.SuspendableService

    isSuspended, resume, suspend
  • Field Details

  • Constructor Details

  • Method Details

    • createConsumer

      public org.apache.camel.Consumer createConsumer(org.apache.camel.Processor processor) throws Exception
      Throws:
      Exception
    • createProducer

      public org.apache.camel.Producer createProducer() 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