Package io.stargate.sdk
Class StargateClient
java.lang.Object
io.stargate.sdk.StargateClient
- All Implemented Interfaces:
Closeable,AutoCloseable
Global Client to interact with a Stargate instance.
- Author:
- Cedrick LUNVEN (@clunven)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DataApiClientWrapping JSON Api Clientprotected StargateDocumentApiClientWrapping Api Document resources.protected StargateGraphQLApiClientWrapping Api GraphQL resources.protected StargateGrpcApiClientWrapping Api GRPC resources.protected StargateRestApiClientWrapping Api REST DATA resources.protected StringLocal DC. -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructorStargateClient(StargateClientBuilder config) Initialize the client from builder parameters. -
Method Summary
Modifier and TypeMethodDescriptionapiData()Retrieve API GraphQL, doing load balancing, failover and retries.Retrieve API Document, doing load balancing, failover and retries.Retrieve API GraphQL, doing load balancing, failover and retries.apiGrpc()Retrieve items using the gRPC interfaceapiRest()Retrieve API Data, doing load balancing, failover and retries.static StargateClientBuilderbuilder()Builder Patternvoidclose()Optional<com.datastax.oss.driver.api.core.CqlSession> Accessing Cql Session.com.datastax.oss.driver.api.core.CqlSessionInitializing CqlSession based on current parameters.voidsetCurrentDatacenter(String currentDatacenter) Set value for currentDatacenter
-
Field Details
-
currentDatacenter
Local DC. (load balancing on the nodes there and failover only if not available. -
apiRestClient
Wrapping Api REST DATA resources. -
apiDocumentClient
Wrapping Api Document resources. -
apiGraphQLClient
Wrapping Api GraphQL resources. -
apiGrpcClient
Wrapping Api GRPC resources. -
apiDataClient
Wrapping JSON Api Client
-
-
Constructor Details
-
StargateClient
public StargateClient()Default constructor -
StargateClient
Initialize the client from builder parameters.- Parameters:
config- current builder.
-
-
Method Details
-
initCqlSession
public com.datastax.oss.driver.api.core.CqlSession initCqlSession()Initializing CqlSession based on current parameters. - Parameters can be provided by the Builder populating Values - Parameters can be provided by the configuration keys in Spring application.yaml- Returns:
- a new cqlSession
-
builder
Builder Pattern- Returns:
- StargateClientBuilder
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
cqlSession
Accessing Cql Session.- Returns:
- CqlSession
-
apiData
Retrieve API GraphQL, doing load balancing, failover and retries.- Returns:
- Api graphQL client
-
apiDocument
Retrieve API Document, doing load balancing, failover and retries.- Returns:
- current API Document
-
apiRest
Retrieve API Data, doing load balancing, failover and retries.- Returns:
- Api REST DATA client
-
apiGraphQL
Retrieve API GraphQL, doing load balancing, failover and retries.- Returns:
- Api graphQL client
-
apiGrpc
Retrieve items using the gRPC interface- Returns:
- grpc interface
-
setCurrentDatacenter
Set value for currentDatacenter- Parameters:
currentDatacenter- new value for currentDatacenter
-