Interface CloudFrontKeyValueStoreAsyncClient
-
- All Superinterfaces:
AutoCloseable,AwsClient,SdkAutoCloseable,SdkClient
@Generated("software.amazon.awssdk:codegen") @ThreadSafe public interface CloudFrontKeyValueStoreAsyncClient extends AwsClient
Service client for accessing Amazon CloudFront KeyValueStore asynchronously. This can be created using the staticbuilder()method.The asynchronous client performs non-blocking I/O when configured with anySdkAsyncHttpClientsupported 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
Fields Modifier and Type Field Description static StringSERVICE_METADATA_IDValue for looking up the service's metadata from theServiceMetadataProvider.static StringSERVICE_NAME
-
Method Summary
-
Methods inherited from interface software.amazon.awssdk.utils.SdkAutoCloseable
close
-
Methods inherited from interface software.amazon.awssdk.core.SdkClient
serviceName
-
-
-
-
Field Detail
-
SERVICE_NAME
static final String SERVICE_NAME
- See Also:
- Constant Field Values
-
SERVICE_METADATA_ID
static final String SERVICE_METADATA_ID
Value for looking up the service's metadata from theServiceMetadataProvider.- See Also:
- Constant Field Values
-
-
Method Detail
-
deleteKey
default CompletableFuture<DeleteKeyResponse> deleteKey(DeleteKeyRequest deleteKeyRequest)
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:
- AWS API Documentation
-
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:
- AWS API Documentation
-
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:
- AWS API Documentation
-
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:
- AWS API Documentation
-
getKey
default CompletableFuture<GetKeyResponse> getKey(GetKeyRequest getKeyRequest)
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:
- AWS API Documentation
-
getKey
default CompletableFuture<GetKeyResponse> getKey(Consumer<GetKeyRequest.Builder> getKeyRequest)
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:
- AWS API Documentation
-
listKeys
default CompletableFuture<ListKeysResponse> listKeys(ListKeysRequest listKeysRequest)
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:
- AWS API Documentation
-
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:
- AWS API Documentation
-
listKeysPaginator
default ListKeysPublisher listKeysPaginator(ListKeysRequest listKeysRequest)
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:
- AWS API Documentation
-
listKeysPaginator
default ListKeysPublisher listKeysPaginator(Consumer<ListKeysRequest.Builder> listKeysRequest)
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:
- AWS API Documentation
-
putKey
default CompletableFuture<PutKeyResponse> putKey(PutKeyRequest putKeyRequest)
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:
- AWS API Documentation
-
putKey
default CompletableFuture<PutKeyResponse> putKey(Consumer<PutKeyRequest.Builder> putKeyRequest)
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:
- AWS API Documentation
-
updateKeys
default CompletableFuture<UpdateKeysResponse> updateKeys(UpdateKeysRequest updateKeysRequest)
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:
- AWS API Documentation
-
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:
- AWS API Documentation
-
serviceClientConfiguration
default CloudFrontKeyValueStoreServiceClientConfiguration serviceClientConfiguration()
- Specified by:
serviceClientConfigurationin interfaceAwsClient- Specified by:
serviceClientConfigurationin interfaceSdkClient
-
create
static CloudFrontKeyValueStoreAsyncClient create()
Create aCloudFrontKeyValueStoreAsyncClientwith the region loaded from theDefaultAwsRegionProviderChainand credentials loaded from theDefaultCredentialsProvider.
-
builder
static CloudFrontKeyValueStoreAsyncClientBuilder builder()
Create a builder that can be used to configure and create aCloudFrontKeyValueStoreAsyncClient.
-
-