Package io.stargate.sdk
Class StargateClientBuilder
java.lang.Object
io.stargate.sdk.StargateClientBuilder
- All Implemented Interfaces:
Serializable
The Stargate SDK allows to connect to multiple APIS and provides a wide range of options. With the more advanced settings we
need an abtraction for the configuration. It can then be loaded from multiple sources like .. a builder, an application.yaml, a
service discovery with different configuration loader.
- Author:
- Cedrick LUNVEN (@clunven)
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringif provided the authentication URL is not use to get token.protected ObjectMetrics Registry if provided.protected com.datastax.oss.driver.api.core.config.OptionsMapTrack options in the object to help retrive values.protected com.datastax.oss.driver.api.core.tracker.RequestTrackerRequest tracker.protected com.datastax.oss.driver.api.core.CqlSessionProviding Ad Hoc CqlSession.static final Stringdefault datacenter id.protected com.datastax.oss.driver.api.core.config.ProgrammaticDriverConfigLoaderBuilderDynamic configuration.protected booleanIf the flag is enabled the Cql Session will not be created even if parameters are ok.protected booleanIf the flag is enabled the Grpc Session will not be created even if parameters are ok.Observers.protected org.apache.hc.client5.http.config.RequestConfigOverride Request configuration.protected com.evanlennick.retry4j.config.RetryConfigOverride Retry configuration.protected StringLocal datacenter.protected StringThis the endPoint to invoke to work with different API(s).protected Map<String, StargateDataCenter> if an apiToken is provided it will be used for all nodes.protected Stringuser name. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddDocumentService(io.stargate.sdk.http.ServiceHttp doc) Add a new Document Service.addDocumentService(String dc, io.stargate.sdk.http.ServiceHttp rest) Populate current datacenter.addGraphQLService(io.stargate.sdk.http.ServiceHttp rest) Add a GraphQL Service in the current DCaddGraphQLService(String dc, io.stargate.sdk.http.ServiceHttp rest) Populate current datacenter.addGrpcService(ServiceGrpc grpc) Populate current datacenter.addGrpcService(String dc, ServiceGrpc grpc) Populate current datacenter.addHttpObserver(String name, io.stargate.sdk.audit.ServiceCallObserver observer) Api Invocations trigger some events processed in observer.addServiceJson(String dc, io.stargate.sdk.http.ServiceHttp json) Populate current datacenter.addServiceRest(io.stargate.sdk.http.ServiceHttp rest) Add a node to the cluster.addServiceRest(String dc, io.stargate.sdk.http.ServiceHttp rest) Populate current datacenter.build()Building a StargateClient from the values in the BUILDERBy default Cqlsession is not created, you can enable the flag or using any withCql* operations to enableit.By default Cqlsession is not created, you can enable the flag or using any withCql* operations to enableit.io.stargate.sdk.api.TokenProviderRetrieve anTokenProviderbased on token.com.datastax.oss.driver.api.core.config.ProgrammaticDriverConfigLoaderBuilderAccessor to driver config builder.Getter accessor for attribute 'metricsRegistry'.com.datastax.oss.driver.api.core.config.OptionsMapGetter accessor for attribute 'cqloptions'.com.datastax.oss.driver.api.core.tracker.RequestTrackerGetter accessor for attribute 'cqlRequestTracker'.com.datastax.oss.driver.api.core.CqlSessionGetter accessor for attribute 'cqlSession'.Getter accessor for attribute 'localDC'.Getter accessor for attribute 'observers'.org.apache.hc.client5.http.config.RequestConfigGetter accessor for attribute 'requestConfig'.com.evanlennick.retry4j.config.RetryConfigGetter accessor for attribute 'retryConfig'.Gets stargateNodesDCbooleanGetter accessor for attribute 'disableCqlSession'.booleanGetter accessor for attribute 'disableCqlSession'.voidsetLocalDatacenter(String localDc) Update local datacenter without the cqlOptions.withApiToken(String token) Api token available for all the nodes.withApiTokenProvider(String... url) You will get one token provider for a DCwithApiTokenProviderDC(String dc, io.stargate.sdk.api.TokenProvider tokenProvider) Provide token provider for a DC.withApiTokenProviderDC(String dc, String... url) You will get one token provider for a DCwithAuthCredentials(String username, String password) Fill username and password.withCqlCloudSecureConnectBundle(String cloudConfigUrl) Providing SCB.withCqlCloudSecureConnectBundleDC(String dc, String cloudConfigUrl) Providing SCB.withCqlConsistencyLevel(com.datastax.oss.driver.api.core.ConsistencyLevel cl) Set the consistency levelwithCqlConsistencyLevelDC(String dc, com.datastax.oss.driver.api.core.ConsistencyLevel cl) Define consistency level for a DC.withCqlContactPoints(String... contactPoints) Fill contact points.withCqlContactPointsDC(String dc, String... contactPoints) Fill contact points.withCqlDriverConfigLoaderBuilder(com.datastax.oss.driver.api.core.config.ProgrammaticDriverConfigLoaderBuilder pdclb) Provide the proper programmatic config loader builder.withCqlDriverConfigurationFile(File configFile) You want to initialize CqlSession with a configuration filewithCqlKeyspace(String keyspace) Fill Keyspaces.withCqlMetricsRegistry(Object registry) Metrics registry.withCqlOptionBoolean(com.datastax.oss.driver.api.core.config.TypedDriverOption<Boolean> option, Boolean du) Add a property to the Cql Context.withCqlOptionBooleanDC(String dc, com.datastax.oss.driver.api.core.config.TypedDriverOption<Boolean> option, Boolean du) Add a propery to the Cql Context.withCqlOptionBooleanList(com.datastax.oss.driver.api.core.config.TypedDriverOption<List<Boolean>> option, List<Boolean> du) Add a property to the Cql Context.withCqlOptionBooleanListDC(String dc, com.datastax.oss.driver.api.core.config.TypedDriverOption<List<Boolean>> option, List<Boolean> du) Add a propery to the Cql Context.withCqlOptionClass(com.datastax.oss.driver.api.core.config.TypedDriverOption<Class<?>> option, Class<?> du) Add a property to the Cql Context.withCqlOptionClassDC(String dc, com.datastax.oss.driver.api.core.config.TypedDriverOption<Class<?>> option, Class<?> du) Add a propery to the Cql Context.withCqlOptionClassList(com.datastax.oss.driver.api.core.config.TypedDriverOption<List<Class<?>>> option, List<Class<?>> du) Add a property to the Cql Context.withCqlOptionClassListDC(String dc, com.datastax.oss.driver.api.core.config.TypedDriverOption<List<Class<?>>> option, List<Class<?>> du) Add a propery to the Cql Context.withCqlOptionDouble(com.datastax.oss.driver.api.core.config.TypedDriverOption<Double> option, Double du) Add a property to the Cql Context.withCqlOptionDoubleDC(String dc, com.datastax.oss.driver.api.core.config.TypedDriverOption<Double> option, Double du) Add a propery to the Cql Context.withCqlOptionDoubleList(com.datastax.oss.driver.api.core.config.TypedDriverOption<List<Double>> option, List<Double> du) Add a property to the Cql Context.withCqlOptionDoubleListDC(String dc, com.datastax.oss.driver.api.core.config.TypedDriverOption<List<Double>> option, List<Double> du) Add a propery to the Cql Context.withCqlOptionDuration(com.datastax.oss.driver.api.core.config.TypedDriverOption<Duration> option, Duration du) Add a property to the Cql Context.withCqlOptionDurationDC(String dc, com.datastax.oss.driver.api.core.config.TypedDriverOption<Duration> option, Duration du) Add a propery to the Cql Context.withCqlOptionDurationList(com.datastax.oss.driver.api.core.config.TypedDriverOption<List<Duration>> option, List<Duration> du) Add a property to the Cql Context.withCqlOptionDurationListDC(String dc, com.datastax.oss.driver.api.core.config.TypedDriverOption<List<Duration>> option, List<Duration> du) Add a propery to the Cql Context.withCqlOptionInteger(com.datastax.oss.driver.api.core.config.TypedDriverOption<Integer> option, Integer du) Add a property to the Cql Context.withCqlOptionIntegerDC(String dc, com.datastax.oss.driver.api.core.config.TypedDriverOption<Integer> option, Integer du) Add a propery to the Cql Context.withCqlOptionIntegerList(com.datastax.oss.driver.api.core.config.TypedDriverOption<List<Integer>> option, List<Integer> du) Add a property to the Cql Context.withCqlOptionIntegerListDC(String dc, com.datastax.oss.driver.api.core.config.TypedDriverOption<List<Integer>> option, List<Integer> du) Add a propery to the Cql Context.withCqlOptionLong(com.datastax.oss.driver.api.core.config.TypedDriverOption<Long> option, Long du) Add a property to the Cql Context.withCqlOptionLongDC(String dc, com.datastax.oss.driver.api.core.config.TypedDriverOption<Long> option, Long du) Add a propery to the Cql Context.withCqlOptionLongList(com.datastax.oss.driver.api.core.config.TypedDriverOption<List<Long>> option, List<Long> du) Add a property to the Cql Context.withCqlOptionLongListDC(String dc, com.datastax.oss.driver.api.core.config.TypedDriverOption<List<Long>> option, List<Long> du) Add a propery to the Cql Context.withCqlOptionString(com.datastax.oss.driver.api.core.config.TypedDriverOption<String> option, String du) Add a property to the Cql Context.withCqlOptionStringDC(String dc, com.datastax.oss.driver.api.core.config.TypedDriverOption<String> option, String du) Add a propery to the Cql Context.withCqlOptionStringList(com.datastax.oss.driver.api.core.config.TypedDriverOption<List<String>> option, List<String> du) Add a property to the Cql Context.withCqlOptionStringListDC(String dc, com.datastax.oss.driver.api.core.config.TypedDriverOption<List<String>> option, List<String> du) Add a propery to the Cql Context.withCqlRequestTracker(com.datastax.oss.driver.api.core.tracker.RequestTracker cqlReqTracker) CqlRequest Tracker registry.withCqlSession(com.datastax.oss.driver.api.core.CqlSession cql) Provide your own CqlSession skipping settings in the builder.withHttpObservers(Map<String, io.stargate.sdk.audit.ServiceCallObserver> observers) Api Invocations trigger some events processed in observer.withHttpRequestConfig(org.apache.hc.client5.http.config.RequestConfig reqConfig) Enable fine Grained configuration of the HTTP Client.withHttpRetryConfig(com.evanlennick.retry4j.config.RetryConfig retryConfig) Enable fine Grained configuration of the HTTP Retries.withLocalDatacenter(String localDc) Populate current datacenter.
-
Field Details
-
DEFAULT_DATACENTER
default datacenter id.- See Also:
-
username
user name. -
password
This the endPoint to invoke to work with different API(s). -
appToken
if provided the authentication URL is not use to get token. -
stargateNodesDC
if an apiToken is provided it will be used for all nodes. -
localDatacenter
Local datacenter. -
enabledCql
protected boolean enabledCqlIf the flag is enabled the Cql Session will not be created even if parameters are ok. -
cqlSession
protected com.datastax.oss.driver.api.core.CqlSession cqlSessionProviding Ad Hoc CqlSession. -
driverConfig
protected com.datastax.oss.driver.api.core.config.ProgrammaticDriverConfigLoaderBuilder driverConfigDynamic configuration. -
cqlOptions
protected com.datastax.oss.driver.api.core.config.OptionsMap cqlOptionsTrack options in the object to help retrive values. The configuration is loaded with a Programmatic Loader and not the options Map. -
cqlMetricsRegistry
Metrics Registry if provided. -
cqlRequestTracker
protected com.datastax.oss.driver.api.core.tracker.RequestTracker cqlRequestTrackerRequest tracker. -
enabledGrpc
protected boolean enabledGrpcIf the flag is enabled the Grpc Session will not be created even if parameters are ok. -
httpRetryConfig
protected com.evanlennick.retry4j.config.RetryConfig httpRetryConfigOverride Retry configuration. -
httpRequestConfig
protected org.apache.hc.client5.http.config.RequestConfig httpRequestConfigOverride Request configuration. -
httpObservers
Observers.
-
-
Constructor Details
-
StargateClientBuilder
public StargateClientBuilder()Load defaults from Emvironment variables
-
-
Method Details
-
getStargateNodesDC
Gets stargateNodesDC- Returns:
- value of stargateNodesDC
-
withAuthCredentials
Fill username and password.- Parameters:
username- user identifierpassword- password- Returns:
- current reference
-
getApiTokenProvider
Retrieve anTokenProviderbased on token.- Parameters:
dc- current DC- Returns:
- the token provider
-
withApiToken
Api token available for all the nodes.- Parameters:
token- current token- Returns:
- self reference
-
withApiTokenProvider
You will get one token provider for a DC- Parameters:
url- list of URL for authentication- Returns:
- slef reference
-
withApiTokenProviderDC
public StargateClientBuilder withApiTokenProviderDC(String dc, io.stargate.sdk.api.TokenProvider tokenProvider) Provide token provider for a DC.- Parameters:
dc- datacenternametokenProvider- token provider- Returns:
- self reference
-
withApiTokenProviderDC
You will get one token provider for a DC- Parameters:
dc- datacenter nameurl- list of URL for authentication- Returns:
- slef reference
-
addServiceRest
Add a node to the cluster.- Parameters:
rest- rest node- Returns:
- current builder
-
addServiceRest
Populate current datacenter. Will be used as localDc in cqlSession if provided or local DC at Http level.- Parameters:
dc- target datacenterrest- target service- Returns:
- current reference
-
addServiceJson
Populate current datacenter. Will be used as localDc in cqlSession if provided or local DC at Http level.- Parameters:
dc- target datacenterjson- target json service- Returns:
- current reference
-
addDocumentService
Populate current datacenter. Will be used as localDc in cqlSession if provided or local DC at Http level.- Parameters:
dc- target datacenterrest- target service- Returns:
- current reference
-
addDocumentService
Add a new Document Service.- Parameters:
doc- document service- Returns:
- current reference
-
addGraphQLService
Populate current datacenter. Will be used as localDc in cqlSession if provided or local DC at Http level.- Parameters:
dc- target datacenterrest- target service- Returns:
- current reference
-
addGraphQLService
Add a GraphQL Service in the current DC- Parameters:
rest- current graphQL service- Returns:
- current reference.
-
addGrpcService
Populate current datacenter. Will be used as localDc in cqlSession if provided or local DC at Http level.- Parameters:
dc- target datacentergrpc- target service- Returns:
- current reference
-
addGrpcService
Populate current datacenter. Will be used as localDc in cqlSession if provided or local DC at Http level.- Parameters:
grpc- target service- Returns:
- current reference
-
withLocalDatacenter
Populate current datacenter. Will be used as localDc in cqlSession if provided or local DC at Http level.- Parameters:
localDc- localDataCernter Name- Returns:
- current reference
-
getLocalDatacenter
Getter accessor for attribute 'localDC'.- Returns:
- current value of 'localDC'
-
setLocalDatacenter
Update local datacenter without the cqlOptions. To also update the options please use withLocalDatacenter.- Parameters:
localDc- current value of localDC
-
enableCql
By default Cqlsession is not created, you can enable the flag or using any withCql* operations to enableit.- Returns:
- reference of current object
-
withCqlSession
Provide your own CqlSession skipping settings in the builder.- Parameters:
cql- existing session- Returns:
- self reference
-
withCqlDriverConfigurationFile
You want to initialize CqlSession with a configuration file- Parameters:
configFile- a configuration file- Returns:
- the current reference
-
withCqlDriverConfigLoaderBuilder
public StargateClientBuilder withCqlDriverConfigLoaderBuilder(com.datastax.oss.driver.api.core.config.ProgrammaticDriverConfigLoaderBuilder pdclb) Provide the proper programmatic config loader builder. It will be orverriden when used with Spring.- Parameters:
pdclb- builder- Returns:
- current reference
-
withCqlOptionBoolean
public StargateClientBuilder withCqlOptionBoolean(com.datastax.oss.driver.api.core.config.TypedDriverOption<Boolean> option, Boolean du) Add a property to the Cql Context.- Parameters:
option- current optiondu- option value- Returns:
- current reference
-
withCqlOptionBooleanDC
public StargateClientBuilder withCqlOptionBooleanDC(String dc, com.datastax.oss.driver.api.core.config.TypedDriverOption<Boolean> option, Boolean du) Add a propery to the Cql Context.- Parameters:
dc- targate datacenteroption- current optiondu- option value- Returns:
- current reference
-
withCqlOptionBooleanList
public StargateClientBuilder withCqlOptionBooleanList(com.datastax.oss.driver.api.core.config.TypedDriverOption<List<Boolean>> option, List<Boolean> du) Add a property to the Cql Context.- Parameters:
option- current optiondu- option value- Returns:
- current reference
-
withCqlOptionBooleanListDC
public StargateClientBuilder withCqlOptionBooleanListDC(String dc, com.datastax.oss.driver.api.core.config.TypedDriverOption<List<Boolean>> option, List<Boolean> du) Add a propery to the Cql Context.- Parameters:
dc- targate datacenteroption- current optiondu- option value- Returns:
- current reference
-
withCqlOptionClass
public StargateClientBuilder withCqlOptionClass(com.datastax.oss.driver.api.core.config.TypedDriverOption<Class<?>> option, Class<?> du) Add a property to the Cql Context.- Parameters:
option- current optiondu- option value- Returns:
- current reference
-
withCqlOptionClassDC
public StargateClientBuilder withCqlOptionClassDC(String dc, com.datastax.oss.driver.api.core.config.TypedDriverOption<Class<?>> option, Class<?> du) Add a propery to the Cql Context.- Parameters:
dc- targate datacenteroption- current optiondu- option value- Returns:
- current reference
-
withCqlOptionClassList
public StargateClientBuilder withCqlOptionClassList(com.datastax.oss.driver.api.core.config.TypedDriverOption<List<Class<?>>> option, List<Class<?>> du) Add a property to the Cql Context.- Parameters:
option- current optiondu- option value- Returns:
- current reference
-
withCqlOptionClassListDC
public StargateClientBuilder withCqlOptionClassListDC(String dc, com.datastax.oss.driver.api.core.config.TypedDriverOption<List<Class<?>>> option, List<Class<?>> du) Add a propery to the Cql Context.- Parameters:
dc- targate datacenteroption- current optiondu- option value- Returns:
- current reference
-
withCqlOptionDouble
public StargateClientBuilder withCqlOptionDouble(com.datastax.oss.driver.api.core.config.TypedDriverOption<Double> option, Double du) Add a property to the Cql Context.- Parameters:
option- current optiondu- option value- Returns:
- current reference
-
withCqlOptionDoubleDC
public StargateClientBuilder withCqlOptionDoubleDC(String dc, com.datastax.oss.driver.api.core.config.TypedDriverOption<Double> option, Double du) Add a propery to the Cql Context.- Parameters:
dc- targate datacenteroption- current optiondu- option value- Returns:
- current reference
-
withCqlOptionDoubleList
public StargateClientBuilder withCqlOptionDoubleList(com.datastax.oss.driver.api.core.config.TypedDriverOption<List<Double>> option, List<Double> du) Add a property to the Cql Context.- Parameters:
option- current optiondu- option value- Returns:
- current reference
-
withCqlOptionDoubleListDC
public StargateClientBuilder withCqlOptionDoubleListDC(String dc, com.datastax.oss.driver.api.core.config.TypedDriverOption<List<Double>> option, List<Double> du) Add a propery to the Cql Context.- Parameters:
dc- targate datacenteroption- current optiondu- option value- Returns:
- current reference
-
withCqlOptionDuration
public StargateClientBuilder withCqlOptionDuration(com.datastax.oss.driver.api.core.config.TypedDriverOption<Duration> option, Duration du) Add a property to the Cql Context.- Parameters:
option- current optiondu- option value- Returns:
- current reference
-
withCqlOptionDurationDC
public StargateClientBuilder withCqlOptionDurationDC(String dc, com.datastax.oss.driver.api.core.config.TypedDriverOption<Duration> option, Duration du) Add a propery to the Cql Context.- Parameters:
dc- targate datacenteroption- current optiondu- option value- Returns:
- current reference
-
withCqlOptionDurationList
public StargateClientBuilder withCqlOptionDurationList(com.datastax.oss.driver.api.core.config.TypedDriverOption<List<Duration>> option, List<Duration> du) Add a property to the Cql Context.- Parameters:
option- current optiondu- option value- Returns:
- current reference
-
withCqlOptionDurationListDC
public StargateClientBuilder withCqlOptionDurationListDC(String dc, com.datastax.oss.driver.api.core.config.TypedDriverOption<List<Duration>> option, List<Duration> du) Add a propery to the Cql Context.- Parameters:
dc- targate datacenteroption- current optiondu- option value- Returns:
- current reference
-
withCqlOptionInteger
public StargateClientBuilder withCqlOptionInteger(com.datastax.oss.driver.api.core.config.TypedDriverOption<Integer> option, Integer du) Add a property to the Cql Context.- Parameters:
option- current optiondu- option value- Returns:
- current reference
-
withCqlOptionIntegerDC
public StargateClientBuilder withCqlOptionIntegerDC(String dc, com.datastax.oss.driver.api.core.config.TypedDriverOption<Integer> option, Integer du) Add a propery to the Cql Context.- Parameters:
dc- targate datacenteroption- current optiondu- option value- Returns:
- current reference
-
withCqlOptionIntegerList
public StargateClientBuilder withCqlOptionIntegerList(com.datastax.oss.driver.api.core.config.TypedDriverOption<List<Integer>> option, List<Integer> du) Add a property to the Cql Context.- Parameters:
option- current optiondu- option value- Returns:
- current reference
-
withCqlOptionIntegerListDC
public StargateClientBuilder withCqlOptionIntegerListDC(String dc, com.datastax.oss.driver.api.core.config.TypedDriverOption<List<Integer>> option, List<Integer> du) Add a propery to the Cql Context.- Parameters:
dc- targate datacenteroption- current optiondu- option value- Returns:
- current reference
-
withCqlOptionLong
public StargateClientBuilder withCqlOptionLong(com.datastax.oss.driver.api.core.config.TypedDriverOption<Long> option, Long du) Add a property to the Cql Context.- Parameters:
option- current optiondu- option value- Returns:
- current reference
-
withCqlOptionLongDC
public StargateClientBuilder withCqlOptionLongDC(String dc, com.datastax.oss.driver.api.core.config.TypedDriverOption<Long> option, Long du) Add a propery to the Cql Context.- Parameters:
dc- targate datacenteroption- current optiondu- option value- Returns:
- current reference
-
withCqlOptionLongList
public StargateClientBuilder withCqlOptionLongList(com.datastax.oss.driver.api.core.config.TypedDriverOption<List<Long>> option, List<Long> du) Add a property to the Cql Context.- Parameters:
option- current optiondu- option value- Returns:
- current reference
-
withCqlOptionLongListDC
public StargateClientBuilder withCqlOptionLongListDC(String dc, com.datastax.oss.driver.api.core.config.TypedDriverOption<List<Long>> option, List<Long> du) Add a propery to the Cql Context.- Parameters:
dc- targate datacenteroption- current optiondu- option value- Returns:
- current reference
-
withCqlOptionString
public StargateClientBuilder withCqlOptionString(com.datastax.oss.driver.api.core.config.TypedDriverOption<String> option, String du) Add a property to the Cql Context.- Parameters:
option- current optiondu- option value- Returns:
- current reference
-
withCqlOptionStringDC
public StargateClientBuilder withCqlOptionStringDC(String dc, com.datastax.oss.driver.api.core.config.TypedDriverOption<String> option, String du) Add a propery to the Cql Context.- Parameters:
dc- targate datacenteroption- current optiondu- option value- Returns:
- current reference
-
withCqlOptionStringList
public StargateClientBuilder withCqlOptionStringList(com.datastax.oss.driver.api.core.config.TypedDriverOption<List<String>> option, List<String> du) Add a property to the Cql Context.- Parameters:
option- current optiondu- option value- Returns:
- current reference
-
withCqlOptionStringListDC
public StargateClientBuilder withCqlOptionStringListDC(String dc, com.datastax.oss.driver.api.core.config.TypedDriverOption<List<String>> option, List<String> du) Add a propery to the Cql Context.- Parameters:
dc- targate datacenteroption- current optiondu- option value- Returns:
- current reference
-
withCqlMetricsRegistry
Metrics registry.- Parameters:
registry- target metrics registry- Returns:
- client config
-
withCqlRequestTracker
public StargateClientBuilder withCqlRequestTracker(com.datastax.oss.driver.api.core.tracker.RequestTracker cqlReqTracker) CqlRequest Tracker registry.- Parameters:
cqlReqTracker- cql tracker- Returns:
- client config
-
withCqlConsistencyLevel
public StargateClientBuilder withCqlConsistencyLevel(com.datastax.oss.driver.api.core.ConsistencyLevel cl) Set the consistency level- Parameters:
cl- current consitency level- Returns:
- self reference
-
withCqlConsistencyLevelDC
public StargateClientBuilder withCqlConsistencyLevelDC(String dc, com.datastax.oss.driver.api.core.ConsistencyLevel cl) Define consistency level for a DC.- Parameters:
dc- datacenter namecl- consistency level- Returns:
- self reference
-
withCqlContactPoints
Fill contact points.- Parameters:
contactPoints- contact points- Returns:
- current reference
-
withCqlContactPointsDC
Fill contact points.- Parameters:
dc- datacenter namecontactPoints- contact points- Returns:
- current reference
-
withCqlKeyspace
Fill Keyspaces.- Parameters:
keyspace- keyspace name- Returns:
- current reference
-
withCqlCloudSecureConnectBundle
Providing SCB. (note it is one per Region).- Parameters:
cloudConfigUrl- configuration- Returns:
- current reference
-
withCqlCloudSecureConnectBundleDC
Providing SCB. (note it is one per Region).- Parameters:
dc- datacenter namecloudConfigUrl- configuration- Returns:
- current reference
-
isEnabledCql
public boolean isEnabledCql()Getter accessor for attribute 'disableCqlSession'.- Returns:
- current value of 'disableCqlSession'
-
getCqlSession
public com.datastax.oss.driver.api.core.CqlSession getCqlSession()Getter accessor for attribute 'cqlSession'.- Returns:
- current value of 'cqlSession'
-
getCqlOptions
public com.datastax.oss.driver.api.core.config.OptionsMap getCqlOptions()Getter accessor for attribute 'cqloptions'.- Returns:
- value for cql option
-
getCqlRequestTracker
public com.datastax.oss.driver.api.core.tracker.RequestTracker getCqlRequestTracker()Getter accessor for attribute 'cqlRequestTracker'.- Returns:
- current value of 'cqlRequestTracker'
-
getCqlDriverConfigLoaderBuilder
public com.datastax.oss.driver.api.core.config.ProgrammaticDriverConfigLoaderBuilder getCqlDriverConfigLoaderBuilder()Accessor to driver config builder.- Returns:
- driver config builder
-
getCqlMetricsRegistry
Getter accessor for attribute 'metricsRegistry'.- Returns:
- current value of 'metricsRegistry'
-
enableGrpc
By default Cqlsession is not created, you can enable the flag or using any withCql* operations to enableit.- Returns:
- reference of current object
-
isEnabledGrpc
public boolean isEnabledGrpc()Getter accessor for attribute 'disableCqlSession'.- Returns:
- current value of 'disableCqlSession'
-
withHttpRequestConfig
public StargateClientBuilder withHttpRequestConfig(org.apache.hc.client5.http.config.RequestConfig reqConfig) Enable fine Grained configuration of the HTTP Client.- Parameters:
reqConfig- request configuration- Returns:
- self reference
-
withHttpRetryConfig
public StargateClientBuilder withHttpRetryConfig(com.evanlennick.retry4j.config.RetryConfig retryConfig) Enable fine Grained configuration of the HTTP Retries.- Parameters:
retryConfig- request configuration- Returns:
- self reference
-
addHttpObserver
public StargateClientBuilder addHttpObserver(String name, io.stargate.sdk.audit.ServiceCallObserver observer) Api Invocations trigger some events processed in observer.- Parameters:
name- unique identiierobserver- instance of your Observer- Returns:
- self reference
-
withHttpObservers
public StargateClientBuilder withHttpObservers(Map<String, io.stargate.sdk.audit.ServiceCallObserver> observers) Api Invocations trigger some events processed in observer.- Parameters:
observers- instance of your Observer- Returns:
- self reference
-
getRetryConfig
public com.evanlennick.retry4j.config.RetryConfig getRetryConfig()Getter accessor for attribute 'retryConfig'.- Returns:
- current value of 'retryConfig'
-
getRequestConfig
public org.apache.hc.client5.http.config.RequestConfig getRequestConfig()Getter accessor for attribute 'requestConfig'.- Returns:
- current value of 'requestConfig'
-
getObservers
Getter accessor for attribute 'observers'.- Returns:
- current value of 'observers'
-
build
Building a StargateClient from the values in the BUILDER- Returns:
- instance of the client
-