Interface CloudFrontKeyValueStoreAsyncClient
- All Superinterfaces:
AutoCloseable,AwsClient,SdkAutoCloseable,SdkClient
builder() method.The asynchronous client performs non-blocking I/O when configured with any
SdkAsyncHttpClient supported in the SDK. However, full non-blocking is not guaranteed as the async client may
perform blocking calls in some cases such as credentials retrieval and endpoint discovery as part of the async API
call.
Amazon CloudFront KeyValueStore Service to View and Update Data in a KVS Resource
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringValue for looking up the service's metadata from theServiceMetadataProvider.static final String -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Create a builder that can be used to configure and create aCloudFrontKeyValueStoreAsyncClient.create()Create aCloudFrontKeyValueStoreAsyncClientwith the region loaded from theDefaultAwsRegionProviderChainand credentials loaded from theDefaultCredentialsProvider.default CompletableFuture<DeleteKeyResponse> deleteKey(Consumer<DeleteKeyRequest.Builder> deleteKeyRequest) Deletes the key value pair specified by the key.default CompletableFuture<DeleteKeyResponse> deleteKey(DeleteKeyRequest deleteKeyRequest) Deletes the key value pair specified by the key.describeKeyValueStore(Consumer<DescribeKeyValueStoreRequest.Builder> describeKeyValueStoreRequest) Returns metadata information about Key Value Store.describeKeyValueStore(DescribeKeyValueStoreRequest describeKeyValueStoreRequest) Returns metadata information about Key Value Store.default CompletableFuture<GetKeyResponse> getKey(Consumer<GetKeyRequest.Builder> getKeyRequest) Returns a key value pair.default CompletableFuture<GetKeyResponse> getKey(GetKeyRequest getKeyRequest) Returns a key value pair.default CompletableFuture<ListKeysResponse> listKeys(Consumer<ListKeysRequest.Builder> listKeysRequest) Returns a list of key value pairs.default CompletableFuture<ListKeysResponse> listKeys(ListKeysRequest listKeysRequest) Returns a list of key value pairs.default ListKeysPublisherlistKeysPaginator(Consumer<ListKeysRequest.Builder> listKeysRequest) This is a variant oflistKeys(software.amazon.awssdk.services.cloudfrontkeyvaluestore.model.ListKeysRequest)operation.default ListKeysPublisherlistKeysPaginator(ListKeysRequest listKeysRequest) This is a variant oflistKeys(software.amazon.awssdk.services.cloudfrontkeyvaluestore.model.ListKeysRequest)operation.default CompletableFuture<PutKeyResponse> putKey(Consumer<PutKeyRequest.Builder> putKeyRequest) Creates a new key value pair or replaces the value of an existing key.default CompletableFuture<PutKeyResponse> putKey(PutKeyRequest putKeyRequest) Creates a new key value pair or replaces the value of an existing key.The SDK service client configuration exposes client settings to the user, e.g., ClientOverrideConfigurationdefault CompletableFuture<UpdateKeysResponse> updateKeys(Consumer<UpdateKeysRequest.Builder> updateKeysRequest) Puts or Deletes multiple key value pairs in a single, all-or-nothing operation.default CompletableFuture<UpdateKeysResponse> updateKeys(UpdateKeysRequest updateKeysRequest) Puts or Deletes multiple key value pairs in a single, all-or-nothing operation.Methods inherited from interface software.amazon.awssdk.utils.SdkAutoCloseable
closeMethods inherited from interface software.amazon.awssdk.core.SdkClient
serviceName
-
Field Details
-
SERVICE_NAME
- See Also:
-
SERVICE_METADATA_ID
Value for looking up the service's metadata from theServiceMetadataProvider.- See Also:
-
-
Method Details
-
deleteKey
Deletes the key value pair specified by the key.
- Parameters:
deleteKeyRequest-- Returns:
- A Java Future containing the result of the DeleteKey operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ConflictException Resource is not in expected state.
- ValidationException Validation failed.
- InternalServerException Internal server error.
- ServiceQuotaExceededException Limit exceeded.
- ResourceNotFoundException Resource was not found.
- AccessDeniedException Access denied.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- CloudFrontKeyValueStoreException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
deleteKey
default CompletableFuture<DeleteKeyResponse> deleteKey(Consumer<DeleteKeyRequest.Builder> deleteKeyRequest) Deletes the key value pair specified by the key.
This is a convenience which creates an instance of the
DeleteKeyRequest.Builderavoiding the need to create one manually viaDeleteKeyRequest.builder()- Parameters:
deleteKeyRequest- AConsumerthat will call methods onDeleteKeyRequest.Builderto create a request.- Returns:
- A Java Future containing the result of the DeleteKey operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ConflictException Resource is not in expected state.
- ValidationException Validation failed.
- InternalServerException Internal server error.
- ServiceQuotaExceededException Limit exceeded.
- ResourceNotFoundException Resource was not found.
- AccessDeniedException Access denied.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- CloudFrontKeyValueStoreException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
describeKeyValueStore
default CompletableFuture<DescribeKeyValueStoreResponse> describeKeyValueStore(DescribeKeyValueStoreRequest describeKeyValueStoreRequest) Returns metadata information about Key Value Store.
- Parameters:
describeKeyValueStoreRequest-- Returns:
- A Java Future containing the result of the DescribeKeyValueStore operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ConflictException Resource is not in expected state.
- InternalServerException Internal server error.
- ResourceNotFoundException Resource was not found.
- AccessDeniedException Access denied.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- CloudFrontKeyValueStoreException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
describeKeyValueStore
default CompletableFuture<DescribeKeyValueStoreResponse> describeKeyValueStore(Consumer<DescribeKeyValueStoreRequest.Builder> describeKeyValueStoreRequest) Returns metadata information about Key Value Store.
This is a convenience which creates an instance of the
DescribeKeyValueStoreRequest.Builderavoiding the need to create one manually viaDescribeKeyValueStoreRequest.builder()- Parameters:
describeKeyValueStoreRequest- AConsumerthat will call methods onDescribeKeyValueStoreRequest.Builderto create a request.- Returns:
- A Java Future containing the result of the DescribeKeyValueStore operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ConflictException Resource is not in expected state.
- InternalServerException Internal server error.
- ResourceNotFoundException Resource was not found.
- AccessDeniedException Access denied.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- CloudFrontKeyValueStoreException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
getKey
Returns a key value pair.
- Parameters:
getKeyRequest-- Returns:
- A Java Future containing the result of the GetKey operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ConflictException Resource is not in expected state.
- InternalServerException Internal server error.
- ResourceNotFoundException Resource was not found.
- AccessDeniedException Access denied.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- CloudFrontKeyValueStoreException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
getKey
Returns a key value pair.
This is a convenience which creates an instance of the
GetKeyRequest.Builderavoiding the need to create one manually viaGetKeyRequest.builder()- Parameters:
getKeyRequest- AConsumerthat will call methods onGetKeyRequest.Builderto create a request.- Returns:
- A Java Future containing the result of the GetKey operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ConflictException Resource is not in expected state.
- InternalServerException Internal server error.
- ResourceNotFoundException Resource was not found.
- AccessDeniedException Access denied.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- CloudFrontKeyValueStoreException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
listKeys
Returns a list of key value pairs.
- Parameters:
listKeysRequest-- Returns:
- A Java Future containing the result of the ListKeys operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ConflictException Resource is not in expected state.
- ValidationException Validation failed.
- InternalServerException Internal server error.
- ResourceNotFoundException Resource was not found.
- AccessDeniedException Access denied.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- CloudFrontKeyValueStoreException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
listKeys
default CompletableFuture<ListKeysResponse> listKeys(Consumer<ListKeysRequest.Builder> listKeysRequest) Returns a list of key value pairs.
This is a convenience which creates an instance of the
ListKeysRequest.Builderavoiding the need to create one manually viaListKeysRequest.builder()- Parameters:
listKeysRequest- AConsumerthat will call methods onListKeysRequest.Builderto create a request.- Returns:
- A Java Future containing the result of the ListKeys operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ConflictException Resource is not in expected state.
- ValidationException Validation failed.
- InternalServerException Internal server error.
- ResourceNotFoundException Resource was not found.
- AccessDeniedException Access denied.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- CloudFrontKeyValueStoreException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
listKeysPaginator
This is a variant of
listKeys(software.amazon.awssdk.services.cloudfrontkeyvaluestore.model.ListKeysRequest)operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will internally handle making service calls for you.When the operation is called, an instance of this class is returned. At this point, no service calls are made yet and so there is no guarantee that the request is valid. If there are errors in your request, you will see the failures only after you start streaming the data. The subscribe method should be called as a request to start streaming data. For more info, see
Publisher.subscribe(org.reactivestreams.Subscriber). Each call to the subscribe method will result in a newSubscriptioni.e., a new contract to stream data from the starting request.The following are few ways to use the response class:
1) Using the subscribe helper method
2) Using a custom subscribersoftware.amazon.awssdk.services.cloudfrontkeyvaluestore.paginators.ListKeysPublisher publisher = client.listKeysPaginator(request); CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response }); future.get();
As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.software.amazon.awssdk.services.cloudfrontkeyvaluestore.paginators.ListKeysPublisher publisher = client.listKeysPaginator(request); publisher.subscribe(new Subscriber<software.amazon.awssdk.services.cloudfrontkeyvaluestore.model.ListKeysResponse>() { public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... }; public void onNext(software.amazon.awssdk.services.cloudfrontkeyvaluestore.model.ListKeysResponse response) { //... }; });Please notice that the configuration of MaxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listKeys(software.amazon.awssdk.services.cloudfrontkeyvaluestore.model.ListKeysRequest)operation.- Parameters:
listKeysRequest-- Returns:
- A custom publisher that can be subscribed to request a stream of response pages.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ConflictException Resource is not in expected state.
- ValidationException Validation failed.
- InternalServerException Internal server error.
- ResourceNotFoundException Resource was not found.
- AccessDeniedException Access denied.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- CloudFrontKeyValueStoreException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
listKeysPaginator
This is a variant of
listKeys(software.amazon.awssdk.services.cloudfrontkeyvaluestore.model.ListKeysRequest)operation. The return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will internally handle making service calls for you.When the operation is called, an instance of this class is returned. At this point, no service calls are made yet and so there is no guarantee that the request is valid. If there are errors in your request, you will see the failures only after you start streaming the data. The subscribe method should be called as a request to start streaming data. For more info, see
Publisher.subscribe(org.reactivestreams.Subscriber). Each call to the subscribe method will result in a newSubscriptioni.e., a new contract to stream data from the starting request.The following are few ways to use the response class:
1) Using the subscribe helper method
2) Using a custom subscribersoftware.amazon.awssdk.services.cloudfrontkeyvaluestore.paginators.ListKeysPublisher publisher = client.listKeysPaginator(request); CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response }); future.get();
As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.software.amazon.awssdk.services.cloudfrontkeyvaluestore.paginators.ListKeysPublisher publisher = client.listKeysPaginator(request); publisher.subscribe(new Subscriber<software.amazon.awssdk.services.cloudfrontkeyvaluestore.model.ListKeysResponse>() { public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... }; public void onNext(software.amazon.awssdk.services.cloudfrontkeyvaluestore.model.ListKeysResponse response) { //... }; });Please notice that the configuration of MaxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listKeys(software.amazon.awssdk.services.cloudfrontkeyvaluestore.model.ListKeysRequest)operation.
This is a convenience which creates an instance of the
ListKeysRequest.Builderavoiding the need to create one manually viaListKeysRequest.builder()- Parameters:
listKeysRequest- AConsumerthat will call methods onListKeysRequest.Builderto create a request.- Returns:
- A custom publisher that can be subscribed to request a stream of response pages.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ConflictException Resource is not in expected state.
- ValidationException Validation failed.
- InternalServerException Internal server error.
- ResourceNotFoundException Resource was not found.
- AccessDeniedException Access denied.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- CloudFrontKeyValueStoreException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
putKey
Creates a new key value pair or replaces the value of an existing key.
- Parameters:
putKeyRequest- A key value pair.- Returns:
- A Java Future containing the result of the PutKey operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ConflictException Resource is not in expected state.
- ValidationException Validation failed.
- InternalServerException Internal server error.
- ServiceQuotaExceededException Limit exceeded.
- ResourceNotFoundException Resource was not found.
- AccessDeniedException Access denied.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- CloudFrontKeyValueStoreException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
putKey
Creates a new key value pair or replaces the value of an existing key.
This is a convenience which creates an instance of the
PutKeyRequest.Builderavoiding the need to create one manually viaPutKeyRequest.builder()- Parameters:
putKeyRequest- AConsumerthat will call methods onPutKeyRequest.Builderto create a request. A key value pair.- Returns:
- A Java Future containing the result of the PutKey operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ConflictException Resource is not in expected state.
- ValidationException Validation failed.
- InternalServerException Internal server error.
- ServiceQuotaExceededException Limit exceeded.
- ResourceNotFoundException Resource was not found.
- AccessDeniedException Access denied.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- CloudFrontKeyValueStoreException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
updateKeys
Puts or Deletes multiple key value pairs in a single, all-or-nothing operation.
- Parameters:
updateKeysRequest-- Returns:
- A Java Future containing the result of the UpdateKeys operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ConflictException Resource is not in expected state.
- ValidationException Validation failed.
- InternalServerException Internal server error.
- ServiceQuotaExceededException Limit exceeded.
- ResourceNotFoundException Resource was not found.
- AccessDeniedException Access denied.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- CloudFrontKeyValueStoreException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
updateKeys
default CompletableFuture<UpdateKeysResponse> updateKeys(Consumer<UpdateKeysRequest.Builder> updateKeysRequest) Puts or Deletes multiple key value pairs in a single, all-or-nothing operation.
This is a convenience which creates an instance of the
UpdateKeysRequest.Builderavoiding the need to create one manually viaUpdateKeysRequest.builder()- Parameters:
updateKeysRequest- AConsumerthat will call methods onUpdateKeysRequest.Builderto create a request.- Returns:
- A Java Future containing the result of the UpdateKeys operation returned by the service.
The CompletableFuture returned by this method can be completed exceptionally with the following exceptions. The exception returned is wrapped with CompletionException, so you need to invokeThrowable.getCause()to retrieve the underlying exception.- ConflictException Resource is not in expected state.
- ValidationException Validation failed.
- InternalServerException Internal server error.
- ServiceQuotaExceededException Limit exceeded.
- ResourceNotFoundException Resource was not found.
- AccessDeniedException Access denied.
- SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.
- SdkClientException If any client side error occurs such as an IO related failure, failure to get credentials, etc.
- CloudFrontKeyValueStoreException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
-
serviceClientConfiguration
Description copied from interface:SdkClientThe SDK service client configuration exposes client settings to the user, e.g., ClientOverrideConfiguration- Specified by:
serviceClientConfigurationin interfaceAwsClient- Specified by:
serviceClientConfigurationin interfaceSdkClient- Returns:
- SdkServiceClientConfiguration
-
create
Create aCloudFrontKeyValueStoreAsyncClientwith the region loaded from theDefaultAwsRegionProviderChainand credentials loaded from theDefaultCredentialsProvider. -
builder
Create a builder that can be used to configure and create aCloudFrontKeyValueStoreAsyncClient.
-