public abstract class SessionRuleBuilder<SelfT extends SessionRuleBuilder<SelfT,SessionT>,SessionT extends com.datastax.oss.driver.api.core.session.Session> extends Object
| Modifier and Type | Field and Description |
|---|---|
protected CassandraResourceRule |
cassandraResource |
protected boolean |
createGraph |
protected boolean |
createKeyspace |
protected String |
graphProtocol |
protected boolean |
isCoreGraph |
protected com.datastax.oss.driver.api.core.config.DriverConfigLoader |
loader |
protected com.datastax.oss.driver.api.core.metadata.NodeStateListener |
nodeStateListener |
protected com.datastax.oss.driver.api.core.metadata.schema.SchemaChangeListener |
schemaChangeListener |
protected SelfT |
self |
| Constructor and Description |
|---|
SessionRuleBuilder(CassandraResourceRule cassandraResource) |
| Modifier and Type | Method and Description |
|---|---|
abstract SessionRule<SessionT> |
build() |
SelfT |
withConfigLoader(com.datastax.oss.driver.api.core.config.DriverConfigLoader loader)
A set of options to override in the session configuration.
|
SelfT |
withCoreEngine() |
SelfT |
withCreateGraph()
Configures the rule to create a new graph instance.
|
SelfT |
withGraphProtocol(String graphProtocol) |
SelfT |
withKeyspace(boolean createKeyspace)
Whether to create a keyspace.
|
SelfT |
withNodeStateListener(com.datastax.oss.driver.api.core.metadata.NodeStateListener listener) |
SelfT |
withSchemaChangeListener(com.datastax.oss.driver.api.core.metadata.schema.SchemaChangeListener listener) |
protected final CassandraResourceRule cassandraResource
protected boolean createKeyspace
protected com.datastax.oss.driver.api.core.metadata.NodeStateListener nodeStateListener
protected com.datastax.oss.driver.api.core.metadata.schema.SchemaChangeListener schemaChangeListener
protected com.datastax.oss.driver.api.core.config.DriverConfigLoader loader
protected boolean createGraph
protected boolean isCoreGraph
protected String graphProtocol
protected final SelfT extends SessionRuleBuilder<SelfT,SessionT> self
public SessionRuleBuilder(CassandraResourceRule cassandraResource)
public SelfT withKeyspace(boolean createKeyspace)
If this is set, the rule will create a keyspace with a name unique to this test (this allows
multiple tests to run concurrently against the same server resource), and make the name
available through SessionRule.keyspace(). The created session will be connected to this
keyspace.
If this method is not called, the default value is true.
Note that this option is only valid with a CcmRule. If the server resource is a
SimulacronRule, this option is ignored, no keyspace gets created, and SessionRule.keyspace() returns null.
public SelfT withConfigLoader(com.datastax.oss.driver.api.core.config.DriverConfigLoader loader)
public SelfT withNodeStateListener(com.datastax.oss.driver.api.core.metadata.NodeStateListener listener)
public SelfT withSchemaChangeListener(com.datastax.oss.driver.api.core.metadata.schema.SchemaChangeListener listener)
public SelfT withCreateGraph()
This assumes that the associated CassandraResourceRule is a DSE instance with the
graph workload enabled.
The name of the graph will be injected in the session's configuration, so that all graph
statements are automatically routed to it. It's also exposed via SessionRule.getGraphName().
public SelfT withCoreEngine()
public abstract SessionRule<SessionT> build()
Copyright © 2017–2023. All rights reserved.