Package com.datastax.astra.sdk
Class AstraClient
java.lang.Object
com.datastax.astra.sdk.AstraClient
- All Implemented Interfaces:
Closeable
,AutoCloseable
Public interface to interact with ASTRA APIs.
- Author:
- Cedrick LUNVEN (@clunven)
-
Field Summary
Modifier and TypeFieldDescriptionprotected AstraClientConfig
Keep some information related to Astra Settings.protected String
Hold a reference on current region used for the Fail-over.static final String
Cloud Secure bundle file prefix, scb_dbId_dbRegion.zipprotected io.stargate.sdk.StargateClient
Access to all Stargate sub Api (rest, graphQL, doc, gRPC). -
Constructor Summary
ConstructorDescriptionAstraClient
(AstraClientConfig config) Initialization through builder.AstraClient
(String token) Create a client with the token onAstraClient
(String dbId, String dbRegion, String token) Simple initialization. -
Method Summary
Modifier and TypeMethodDescriptionDevops APIDevops APIDevops API Streamingio.stargate.sdk.rest.StargateRestApiClient
Rest Api.io.stargate.sdk.doc.StargateDocumentApiClient
Document Api.io.stargate.sdk.gql.StargateGraphQLApiClient
GraphQL Api.io.stargate.sdk.grpc.StargateGrpcApiClient
Integration with grpc Api in Stargate.static AstraClientConfig
builder()
Builder Patternvoid
close()
com.datastax.oss.driver.api.core.CqlSession
CQL APIGetter to the configuration, it should not be changed.io.stargate.sdk.StargateClient
Getter accessor for attribute 'stargateClient'.getToken()
Give access to token.void
Change region the application is working on.
-
Field Details
-
SECURE_CONNECT
Cloud Secure bundle file prefix, scb_dbId_dbRegion.zip- See Also:
-
stargateClient
protected io.stargate.sdk.StargateClient stargateClientAccess to all Stargate sub Api (rest, graphQL, doc, gRPC). -
astraClientConfig
Keep some information related to Astra Settings. -
currentDatabaseRegion
Hold a reference on current region used for the Fail-over.
-
-
Constructor Details
-
AstraClient
Create a client with the token on- Parameters:
token
- current token
-
AstraClient
Simple initialization.- Parameters:
dbId
- database iddbRegion
- database regiontoken
- current token
-
AstraClient
Initialization through builder.- Parameters:
config
- configuration extracted from builder
-
-
Method Details
-
apiStargateDocument
public io.stargate.sdk.doc.StargateDocumentApiClient apiStargateDocument()Document Api.- Returns:
- ApiDocumentClient
-
apiStargateData
public io.stargate.sdk.rest.StargateRestApiClient apiStargateData()Rest Api.- Returns:
- ApiRestClient
-
apiStargateGraphQL
public io.stargate.sdk.gql.StargateGraphQLApiClient apiStargateGraphQL()GraphQL Api.- Returns:
- ApiGraphQLClient
-
apiStargateGrpc
public io.stargate.sdk.grpc.StargateGrpcApiClient apiStargateGrpc()Integration with grpc Api in Stargate.- Returns:
- grpc Stargate API.
-
apiDevops
Devops API- Returns:
- ApiDevopsClient
-
apiDevopsDatabases
Devops API- Returns:
- ApiDevopsClient
-
apiDevopsStreaming
Devops API Streaming- Returns:
- ApiDevopsClient
-
cqlSession
public com.datastax.oss.driver.api.core.CqlSession cqlSession()CQL API- Returns:
- CqlSession
-
getToken
Give access to token.- Returns:
- token value
-
getConfig
Getter to the configuration, it should not be changed.- Returns:
- initial configuration
-
useRegion
Change region the application is working on.- Parameters:
region
- new region
-
builder
Builder Pattern- Returns:
- AstraClientBuilder
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
getStargateClient
public io.stargate.sdk.StargateClient getStargateClient()Getter accessor for attribute 'stargateClient'.- Returns:
- current value of 'stargateClient'
-