Class 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  
      • 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
    • 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 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 setStyle​(String style)
      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, 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 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
    • Method Detail

      • 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
      • 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