Package com.datastax.astra.client.model
Class CommandOptions<T extends CommandOptions<T>>
java.lang.Object
com.datastax.astra.client.model.CommandOptions<T>
- Type Parameters:
T
- the sub-class implementing the command options
- Direct Known Subclasses:
BulkWriteOptions
,CountDocumentsOptions
,DeleteManyOptions
,DeleteOneOptions
,EstimatedCountDocumentsOptions
,FindOneAndDeleteOptions
,FindOneAndReplaceOptions
,FindOneAndUpdateOptions
,FindOneOptions
,FindOptions
,InsertManyOptions
,InsertOneOptions
,ReplaceOneOptions
,UpdateManyOptions
,UpdateOneOptions
Options that will be provided to all commands for this collection.
-
Field Summary
Modifier and TypeFieldDescriptionprotected EmbeddingHeadersProvider
Embedding auth providerprotected HttpClientOptions
Will be used to create a clientprotected Map
<String, CommandObserver> List of observers to notify.protected String
Token to use for authentication. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionembeddingAPIKey
(String embeddingServiceApiKey) Deprecated.embeddingAuthProvider
(EmbeddingHeadersProvider embeddingAuthProvider) Provide the embedding service API key.Return the @EmbeddingAuthProvider if present in the configuration.Gets httpClientOptionsgetToken()
Gets tokenhttpClientOptions
(HttpClientOptions options) Provide the token.registerObserver
(CommandObserver observer) Register an observer with its className.registerObserver
(String name, CommandObserver observer) Allow to register a listener for the command.Provide the token.unregisterObserver
(Class<CommandObserver> observer) Remove an observer by its class.unregisterObserver
(String name) Remove a listener from the command.
-
Field Details
-
observers
List of observers to notify. -
token
Token to use for authentication. -
httpClientOptions
Will be used to create a client -
embeddingAuthProvider
Embedding auth provider
-
-
Constructor Details
-
CommandOptions
public CommandOptions()Default Constructor.
-
-
Method Details
-
token
Provide the token.- Parameters:
token
- authentication token- Returns:
- service key
-
httpClientOptions
Provide the token.- Parameters:
options
- options to initialize the http client- Returns:
- service key
-
embeddingAuthProvider
Provide the embedding service API key.- Parameters:
embeddingAuthProvider
- authentication provider- Returns:
- service key
-
embeddingAPIKey
Deprecated.has been replace byembeddingAuthProvider(EmbeddingHeadersProvider)
Provide the embedding service API key.- Parameters:
embeddingServiceApiKey
- embedding service key- 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
-
registerObserver
Register an observer with its className.- Parameters:
observer
- command observer- 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
-
unregisterObserver
Remove an observer by its class.- Parameters:
observer
- observer to remove- Returns:
- instance of the command options
-
getEmbeddingAuthProvider
Return the @EmbeddingAuthProvider if present in the configuration.- Returns:
- value of token
-
getToken
Gets token- Returns:
- value of token
-
getHttpClientOptions
Gets httpClientOptions- Returns:
- value of httpClientOptions
-
embeddingAuthProvider(EmbeddingHeadersProvider)