@UriEndpoint(scheme="cql",
title="Cassandra CQL",
syntax="cql:beanRef:hosts:port/keyspace",
consumerClass=CassandraConsumer.class,
label="database,nosql")
public class CassandraEndpoint
extends DefaultEndpoint
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending| Constructor and Description |
|---|
CassandraEndpoint(String uri,
CassandraComponent component,
com.datastax.driver.core.Cluster cluster,
com.datastax.driver.core.Session session,
String keyspace) |
CassandraEndpoint(String endpointUri,
Component component) |
| Modifier and Type | Method and Description |
|---|---|
protected com.datastax.driver.core.Cluster.Builder |
createClusterBuilder() |
Consumer |
createConsumer(Processor processor)
Creates a new Event
Driven Consumer which consumes messages from the endpoint using the
given processor
|
Producer |
createProducer()
Creates a new producer which is used send messages into the endpoint
|
protected void |
doStart()
Implementations override this method to support customized start/stop.
|
protected void |
doStop()
Implementations override this method to support customized start/stop.
|
protected void |
fillMessage(com.datastax.driver.core.ResultSet resultSet,
Message message)
Copy ResultSet into Message.
|
String |
getBean() |
String |
getBeanRef()
Deprecated.
|
com.datastax.driver.core.Cluster |
getCluster() |
String |
getClusterName() |
com.datastax.driver.core.ConsistencyLevel |
getConsistencyLevel() |
String |
getCql() |
String |
getHosts() |
String |
getKeyspace() |
String |
getLoadBalancingPolicy()
To use a specific LoadBalancingPolicy
|
String |
getPassword() |
Integer |
getPort() |
ResultSetConversionStrategy |
getResultSetConversionStrategy() |
com.datastax.driver.core.Session |
getSession() |
protected CassandraSessionHolder |
getSessionHolder() |
String |
getUsername() |
boolean |
isPrepareStatements() |
boolean |
isSingleton()
Whether this class supports being singleton or not.
|
protected com.datastax.driver.core.PreparedStatement |
prepareStatement()
Create and configure a Prepared CQL statement
|
protected com.datastax.driver.core.PreparedStatement |
prepareStatement(String cql)
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 |
setCluster(com.datastax.driver.core.Cluster cluster)
To use the Cluster instance (you would normally not use this option)
|
void |
setClusterName(String clusterName)
Cluster name
|
void |
setConsistencyLevel(com.datastax.driver.core.ConsistencyLevel consistencyLevel)
Consistency level to use
|
void |
setCql(String cql)
CQL query to perform.
|
void |
setHosts(String hosts)
Hostname(s) cassansdra server(s).
|
void |
setKeyspace(String keyspace)
Keyspace to use
|
void |
setLoadBalancingPolicy(String loadBalancingPolicy) |
void |
setPassword(String password)
Password for session authentication
|
void |
setPort(Integer port)
Port number of cassansdra server(s)
|
void |
setPrepareStatements(boolean prepareStatements)
Whether to use PreparedStatements or regular Statements
|
void |
setResultSetConversionStrategy(ResultSetConversionStrategy resultSetConversionStrategy)
To use a custom class that implements logic for converting ResultSet into message body ALL, ONE, LIMIT_10, LIMIT_100...
|
void |
setSession(com.datastax.driver.core.Session session)
To use the Session instance (you would normally not use this option)
|
void |
setUsername(String username)
Username for session authentication
|
configureConsumer, configurePollingConsumer, configureProperties, createEndpointConfiguration, createEndpointUri, createExchange, createExchange, createExchange, createPollingConsumer, equals, getCamelContext, getComponent, getConsumerProperties, getEndpointConfiguration, getEndpointKey, getEndpointUri, getExceptionHandler, getExchangePattern, getId, getPollingConsumerBlockTimeout, getPollingConsumerQueueSize, hashCode, isBridgeErrorHandler, isLenientProperties, isPollingConsumerBlockWhenFull, isSynchronous, setBridgeErrorHandler, setCamelContext, setConsumerProperties, setEndpointConfiguration, setEndpointUri, setEndpointUriIfNotSpecified, setExceptionHandler, setExchangePattern, setPollingConsumerBlockTimeout, setPollingConsumerBlockWhenFull, setPollingConsumerQueueSize, setProperties, setSynchronous, toStringdoResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendpublic CassandraEndpoint(String uri, CassandraComponent component, com.datastax.driver.core.Cluster cluster, com.datastax.driver.core.Session session, String keyspace)
public Producer createProducer() throws Exception
EndpointException - can be thrownpublic Consumer createConsumer(Processor processor) throws Exception
Endpointprocessor - the given processorException - can be thrownpublic boolean isSingleton()
IsSingletonprotected void doStart()
throws Exception
ServiceSupportServiceSupport.doStop() for more details.doStart in class DefaultEndpointExceptionServiceSupport.doStop()protected void doStop()
throws Exception
ServiceSupportServiceSupport.doStop() method when
the service is being stopped. This method will also be invoked
if the service is still in uninitialized state (eg has not
been started). The method is always called to allow the service
to do custom logic when the service is being stopped, such as when
CamelContext is shutting down.doStop in class DefaultEndpointExceptionServiceSupport.doStart()protected CassandraSessionHolder getSessionHolder()
protected com.datastax.driver.core.Cluster.Builder createClusterBuilder()
throws Exception
Exceptionprotected com.datastax.driver.core.PreparedStatement prepareStatement(String cql)
protected com.datastax.driver.core.PreparedStatement prepareStatement()
protected void fillMessage(com.datastax.driver.core.ResultSet resultSet,
Message message)
public String getBean()
public void setBean(String beanRef)
@Deprecated public String getBeanRef()
@Deprecated public void setBeanRef(String beanRef)
public String getHosts()
public void setHosts(String hosts)
public Integer getPort()
public void setPort(Integer port)
public String getKeyspace()
public void setKeyspace(String keyspace)
public String getCql()
public void setCql(String cql)
public com.datastax.driver.core.Cluster getCluster()
public void setCluster(com.datastax.driver.core.Cluster cluster)
public com.datastax.driver.core.Session getSession()
public void setSession(com.datastax.driver.core.Session session)
public String getClusterName()
public void setClusterName(String clusterName)
public String getUsername()
public void setUsername(String username)
public String getPassword()
public void setPassword(String password)
public com.datastax.driver.core.ConsistencyLevel getConsistencyLevel()
public void setConsistencyLevel(com.datastax.driver.core.ConsistencyLevel consistencyLevel)
public ResultSetConversionStrategy getResultSetConversionStrategy()
public void setResultSetConversionStrategy(ResultSetConversionStrategy resultSetConversionStrategy)
public boolean isPrepareStatements()
public void setPrepareStatements(boolean prepareStatements)
public String getLoadBalancingPolicy()
public void setLoadBalancingPolicy(String loadBalancingPolicy)
Copyright © 2007–2016 The Apache Software Foundation. All rights reserved.