Class BaseOptions<T extends BaseOptions<T>>
java.lang.Object
com.datastax.astra.client.core.options.BaseOptions<T>
- Type Parameters:
T
- the sub-class implementing the command options
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
AdminOptions
,AlterTableOptions
,CollectionDeleteManyOptions
,CollectionDeleteOneOptions
,CollectionFindOneAndDeleteOptions
,CollectionFindOneAndReplaceOptions
,CollectionFindOneAndUpdateOptions
,CollectionFindOneOptions
,CollectionFindOptions
,CollectionInsertManyOptions
,CollectionInsertOneOptions
,CollectionOptions
,CollectionReplaceOneOptions
,CollectionUpdateManyOptions
,CountDocumentsOptions
,CountRowsOptions
,CreateCollectionOptions
,CreateIndexOptions
,CreateTableOptions
,CreateVectorIndexOptions
,DatabaseOptions
,DropCollectionOptions
,DropTableIndexOptions
,DropTableOptions
,EstimatedCountDocumentsOptions
,EstimatedCountRowsOptions
,ListCollectionOptions
,ListIndexesOptions
,ListTablesOptions
,TableDeleteManyOptions
,TableDeleteOneOptions
,TableDistinctOptions
,TableFindOneOptions
,TableFindOptions
,TableInsertManyOptions
,TableInsertOneOptions
,TableOptions
,TableUpdateOneOptions
,UpdateOneOptions
Options that will be provided to all commands for this collection.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CommandType
The command type will drive the timeout in used.protected DataAPIClientOptions
Token usedprotected DataAPISerializer
Serializer for the command.protected String
Token to use for authentication. -
Constructor Summary
ConstructorsConstructorDescriptionBaseOptions
(String token, CommandType type, DataAPIClientOptions options) Return the HTTP Request Timeout based on the command type.BaseOptions
(String token, CommandType type, DataAPISerializer serializer, DataAPIClientOptions options) Return the HTTP Request Timeout based on the command type. -
Method Summary
Modifier and TypeMethodDescriptionadminAdditionalHeaders
(Map<String, String> params) Provide the token.clone()
commandType
(CommandType commandType) Provide the command type.dataAPIClientOptions
(DataAPIClientOptions options) Provide a fluent setter for the data API Client.databaseAdditionalHeaders
(Map<String, String> params) Provide the token.embeddingApiKey
(String apiKey) Provide the embedding service API key.embeddingAuthProvider
(EmbeddingHeadersProvider embeddingAuthProvider) Provide the embedding service API key.Gets commandTypeGets dataAPIClientOptionslong
Return the HTTP Request Timeout based on the command typelong
getRequestTimeout
(TimeoutOptions timeoutOptions, CommandType type) Request timeout based on the command type.Gets serializerlong
Return the HTTP Request Timeout based on the command typelong
getTimeout
(TimeoutOptions timeoutOptions, CommandType type) Request timeout based on the command type.getToken()
Gets tokenhttpClientOptions
(HttpClientOptions options) Provide the token.registerObserver
(String name, CommandObserver observer) Allow to register a listener for the command.serializer
(DataAPISerializer serializer) Provide the token.timeout
(long timeoutMillis) Provide the command type.timeout
(long timeoutMillis, CommandType commandType) Provide the command type.Provide the command type.timeoutOptions
(TimeoutOptions timeoutOptions) Provide the embedding service API key.Provide the token.toString()
unregisterObserver
(String name) Remove a listener from the command.
-
Field Details
-
dataAPIClientOptions
Token used -
serializer
Serializer for the command. -
token
Token to use for authentication. -
commandType
The command type will drive the timeout in used.
-
-
Constructor Details
-
BaseOptions
Return the HTTP Request Timeout based on the command type.- Parameters:
token
- authentication tokentype
- command typeoptions
- data api options
-
BaseOptions
public BaseOptions(String token, CommandType type, DataAPISerializer serializer, DataAPIClientOptions options) Return the HTTP Request Timeout based on the command type.- Parameters:
token
- authentication tokentype
- command typeserializer
- serializeroptions
- data api options
-
-
Method Details
-
token
Provide the token.- Parameters:
token
- authentication token- Returns:
- service key
-
serializer
Provide the token.- Parameters:
serializer
- serializer- Returns:
- service key
-
commandType
Provide the command type. The nature of the command will determine the timeout.- Parameters:
commandType
- command Type- Returns:
- service key
-
dataAPIClientOptions
Provide a fluent setter for the data API Client.- Parameters:
options
- command Type- Returns:
- service key
-
timeout
Provide the command type. The nature of the command will determine the timeout.- Parameters:
timeoutMillis
- timeout for the request- Returns:
- service key
-
timeout
Provide the command type. The nature of the command will determine the timeout.- Parameters:
duration
- timeout for the request- Returns:
- service key
-
embeddingAuthProvider
Provide the embedding service API key.- Parameters:
embeddingAuthProvider
- authentication provider- Returns:
- service key
-
embeddingApiKey
Provide the embedding service API key.- Parameters:
apiKey
- target api key- Returns:
- service key
-
databaseAdditionalHeaders
Provide the token.- Parameters:
params
- additional headers- Returns:
- service key
-
adminAdditionalHeaders
Provide the token.- Parameters:
params
- additional headers- Returns:
- service key
-
httpClientOptions
Provide the token.- Parameters:
options
- options to initialize the http client- Returns:
- service key
-
timeoutOptions
Provide the embedding service API key.- Parameters:
timeoutOptions
- options of timeouts- Returns:
- service key
-
registerObserver
Allow to register a listener for the command.- Parameters:
name
- name of the observerobserver
- observer to register- Returns:
- instance of the command options
-
unregisterObserver
Remove a listener from the command.- Parameters:
name
- name of the observer- Returns:
- instance of the command options
-
getTimeout
Request timeout based on the command type.- Parameters:
timeoutOptions
- options of timeoutstype
- command type- Returns:
- timeout
-
getRequestTimeout
Request timeout based on the command type.- Parameters:
timeoutOptions
- options of timeoutstype
- command type- Returns:
- timeout
-
timeout
Provide the command type. The nature of the command will determine the timeout.- Parameters:
timeoutMillis
- timeout for the requestcommandType
- command type- Returns:
- service key
-
getDataAPIClientOptions
Gets dataAPIClientOptions- Returns:
- value of dataAPIClientOptions
-
getTimeout
public long getTimeout()Return the HTTP Request Timeout based on the command type- Returns:
- value of token
-
getRequestTimeout
public long getRequestTimeout()Return the HTTP Request Timeout based on the command type- Returns:
- value of token
-
getToken
Gets token- Returns:
- value of token
-
getCommandType
Gets commandType- Returns:
- value of commandType
-
getSerializer
Gets serializer- Returns:
- value of serializer
-
toString
-
clone
-