Class CassandraEndpoint

java.lang.Object
org.apache.camel.support.service.BaseService
org.apache.camel.support.service.ServiceSupport
org.apache.camel.support.DefaultEndpoint
org.apache.camel.support.ScheduledPollEndpoint
org.apache.camel.component.cassandra.CassandraEndpoint
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.15.0", scheme="cql", title="Cassandra CQL", syntax="cql:beanRef:hosts:port/keyspace", category={DATABASE,BIGDATA}, headersClass=CassandraConstants.class) public class CassandraEndpoint extends org.apache.camel.support.ScheduledPollEndpoint
Integrate with Cassandra 2.0+ using the CQL3 API (not the Thrift API). Based on Cassandra Java Driver provided by DataStax.
  • 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
    Constructor
    Description
    CassandraEndpoint(String endpointUri, org.apache.camel.Component component)
     
    CassandraEndpoint(String uri, CassandraComponent component, com.datastax.oss.driver.api.core.CqlSession session, String keyspace)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.apache.camel.Consumer
    createConsumer(org.apache.camel.Processor processor)
     
    org.apache.camel.Producer
     
    protected com.datastax.oss.driver.api.core.CqlSessionBuilder
     
    protected void
     
    protected void
     
    protected void
    fillMessage(com.datastax.oss.driver.api.core.cql.ResultSet resultSet, org.apache.camel.Message message)
    Copy ResultSet into Message.
     
    Deprecated.
     
    com.datastax.oss.driver.api.core.ConsistencyLevel
     
     
     
    To use a specific comma separated list of Extra Type codecs.
     
     
    To use a specific LoadBalancingPolicyClass
     
     
     
    com.datastax.oss.driver.api.core.CqlSession
     
     
     
    boolean
     
    protected com.datastax.oss.driver.api.core.cql.PreparedStatement
    Create and configure a Prepared CQL statement
    protected com.datastax.oss.driver.api.core.cql.PreparedStatement
    Create and configure a Prepared CQL statement
    void
    setBean(String beanRef)
    Instead of using a hostname:port, refer to an existing configured Session or Cluster from the Camel registry to be used.
    void
    setBeanRef(String beanRef)
    Deprecated.
    void
    setClusterName(String clusterName)
    Cluster name
    void
    setConsistencyLevel(com.datastax.oss.driver.api.core.DefaultConsistencyLevel consistencyLevel)
    Consistency level to use
    void
    CQL query to perform.
    void
    setDatacenter(String datacenter)
    Datacenter to use
    void
    setExtraTypeCodecs(String extraTypeCodecs)
     
    void
    Hostname(s) Cassandra server(s).
    void
    setKeyspace(String keyspace)
    Keyspace to use
    void
    setLoadBalancingPolicyClass(String loadBalancingPolicyClass)
     
    void
    setPassword(String password)
    Password for session authentication
    void
    Port number of Cassandra server(s)
    void
    setPrepareStatements(boolean prepareStatements)
    Whether to use PreparedStatements or regular Statements
    void
    To use a custom class that implements logic for converting ResultSet into message body ALL, ONE, LIMIT_10, LIMIT_100...
    void
    setSession(com.datastax.oss.driver.api.core.CqlSession session)
    To use the Session instance (you would normally not use this option)
    void
    setUsername(String username)
    Username for session authentication

    Methods inherited from class org.apache.camel.support.ScheduledPollEndpoint

    configureConsumer, configureProperties, configureScheduledPollConsumerProperties, doConfigureConsumer, getBackoffErrorThreshold, getBackoffIdleThreshold, getBackoffMultiplier, getDefaultDelay, getDelay, getInitialDelay, getPollStrategy, getRepeatCount, getRunLoggingLevel, getScheduledExecutorService, getScheduler, getSchedulerProperties, getTimeUnit, isGreedy, isSendEmptyMessageWhenIdle, isStartScheduler, isUseFixedDelay, setBackoffErrorThreshold, setBackoffIdleThreshold, setBackoffMultiplier, setDelay, setGreedy, setInitialDelay, setPollStrategy, setRepeatCount, setRunLoggingLevel, setScheduledExecutorService, setScheduler, setSchedulerProperties, setSendEmptyMessageWhenIdle, setStartScheduler, setTimeUnit, setUseFixedDelay

    Methods inherited from class org.apache.camel.support.DefaultEndpoint

    configureExchange, configurePollingConsumer, 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, 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
  • Constructor Details

    • CassandraEndpoint

      public CassandraEndpoint(String endpointUri, org.apache.camel.Component component)
    • CassandraEndpoint

      public CassandraEndpoint(String uri, CassandraComponent component, com.datastax.oss.driver.api.core.CqlSession session, String keyspace)
  • Method Details

    • createProducer

      public org.apache.camel.Producer createProducer() throws Exception
      Throws:
      Exception
    • createConsumer

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

      protected void doStart() throws Exception
      Overrides:
      doStart in class org.apache.camel.support.service.BaseService
      Throws:
      Exception
    • doStop

      protected void doStop() throws Exception
      Overrides:
      doStop in class org.apache.camel.support.service.BaseService
      Throws:
      Exception
    • getSessionHolder

      protected CassandraSessionHolder getSessionHolder()
    • createSessionBuilder

      protected com.datastax.oss.driver.api.core.CqlSessionBuilder createSessionBuilder()
    • prepareStatement

      protected com.datastax.oss.driver.api.core.cql.PreparedStatement prepareStatement(String cql)
      Create and configure a Prepared CQL statement
    • prepareStatement

      protected com.datastax.oss.driver.api.core.cql.PreparedStatement prepareStatement()
      Create and configure a Prepared CQL statement
    • fillMessage

      protected void fillMessage(com.datastax.oss.driver.api.core.cql.ResultSet resultSet, org.apache.camel.Message message)
      Copy ResultSet into Message.
    • getBean

      public String getBean()
    • setBean

      public void setBean(String beanRef)
      Instead of using a hostname:port, refer to an existing configured Session or Cluster from the Camel registry to be used.
    • getBeanRef

      @Deprecated public String getBeanRef()
      Deprecated.
    • setBeanRef

      @Deprecated public void setBeanRef(String beanRef)
      Deprecated.
    • getHosts

      public String getHosts()
    • setHosts

      public void setHosts(String hosts)
      Hostname(s) Cassandra server(s). Multiple hosts can be separated by comma.
    • getPort

      public Integer getPort()
    • setPort

      public void setPort(Integer port)
      Port number of Cassandra server(s)
    • getKeyspace

      public String getKeyspace()
    • setKeyspace

      public void setKeyspace(String keyspace)
      Keyspace to use
    • getDatacenter

      public String getDatacenter()
    • setDatacenter

      public void setDatacenter(String datacenter)
      Datacenter to use
    • getCql

      public String getCql()
    • setCql

      public void setCql(String cql)
      CQL query to perform. Can be overridden with the message header with key CamelCqlQuery.
    • getSession

      public com.datastax.oss.driver.api.core.CqlSession getSession()
    • setSession

      public void setSession(com.datastax.oss.driver.api.core.CqlSession session)
      To use the Session instance (you would normally not use this option)
    • getClusterName

      public String getClusterName()
    • setClusterName

      public void setClusterName(String clusterName)
      Cluster name
    • getUsername

      public String getUsername()
    • setUsername

      public void setUsername(String username)
      Username for session authentication
    • getPassword

      public String getPassword()
    • setPassword

      public void setPassword(String password)
      Password for session authentication
    • getConsistencyLevel

      public com.datastax.oss.driver.api.core.ConsistencyLevel getConsistencyLevel()
    • setConsistencyLevel

      public void setConsistencyLevel(com.datastax.oss.driver.api.core.DefaultConsistencyLevel consistencyLevel)
      Consistency level to use
    • getResultSetConversionStrategy

      public ResultSetConversionStrategy getResultSetConversionStrategy()
    • setResultSetConversionStrategy

      public void setResultSetConversionStrategy(ResultSetConversionStrategy resultSetConversionStrategy)
      To use a custom class that implements logic for converting ResultSet into message body ALL, ONE, LIMIT_10, LIMIT_100...
    • isPrepareStatements

      public boolean isPrepareStatements()
    • setPrepareStatements

      public void setPrepareStatements(boolean prepareStatements)
      Whether to use PreparedStatements or regular Statements
    • getLoadBalancingPolicyClass

      public String getLoadBalancingPolicyClass()
      To use a specific LoadBalancingPolicyClass
    • setLoadBalancingPolicyClass

      public void setLoadBalancingPolicyClass(String loadBalancingPolicyClass)
    • getExtraTypeCodecs

      public String getExtraTypeCodecs()
      To use a specific comma separated list of Extra Type codecs. Possible values are: BLOB_TO_ARRAY, BOOLEAN_LIST_TO_ARRAY, BYTE_LIST_TO_ARRAY, SHORT_LIST_TO_ARRAY, INT_LIST_TO_ARRAY, LONG_LIST_TO_ARRAY, FLOAT_LIST_TO_ARRAY, DOUBLE_LIST_TO_ARRAY, TIMESTAMP_UTC, TIMESTAMP_MILLIS_SYSTEM, TIMESTAMP_MILLIS_UTC, ZONED_TIMESTAMP_SYSTEM, ZONED_TIMESTAMP_UTC, ZONED_TIMESTAMP_PERSISTED, LOCAL_TIMESTAMP_SYSTEM and LOCAL_TIMESTAMP_UTC
    • setExtraTypeCodecs

      public void setExtraTypeCodecs(String extraTypeCodecs)