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 static 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 Details

  • Method Details

    • 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 invoke Throwable.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.Builder avoiding the need to create one manually via DeleteKeyRequest.builder()

      Parameters:
      deleteKeyRequest - A Consumer that will call methods on DeleteKeyRequest.Builder to 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 invoke Throwable.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 invoke Throwable.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.Builder avoiding the need to create one manually via DescribeKeyValueStoreRequest.builder()

      Parameters:
      describeKeyValueStoreRequest - A Consumer that will call methods on DescribeKeyValueStoreRequest.Builder to 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 invoke Throwable.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

      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 invoke Throwable.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.Builder avoiding the need to create one manually via GetKeyRequest.builder()

      Parameters:
      getKeyRequest - A Consumer that will call methods on GetKeyRequest.Builder to 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 invoke Throwable.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

      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 invoke Throwable.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

      Returns a list of key value pairs.


      This is a convenience which creates an instance of the ListKeysRequest.Builder avoiding the need to create one manually via ListKeysRequest.builder()

      Parameters:
      listKeysRequest - A Consumer that will call methods on ListKeysRequest.Builder to 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 invoke Throwable.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

      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 new Subscription i.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
       
       software.amazon.awssdk.services.cloudfrontkeyvaluestore.paginators.ListKeysPublisher publisher = client.listKeysPaginator(request);
       CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response });
       future.get();
       
       
      2) Using a custom subscriber
       
       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) { //... };
       });
       
      As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.

      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 invoke Throwable.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

      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 new Subscription i.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
       
       software.amazon.awssdk.services.cloudfrontkeyvaluestore.paginators.ListKeysPublisher publisher = client.listKeysPaginator(request);
       CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response });
       future.get();
       
       
      2) Using a custom subscriber
       
       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) { //... };
       });
       
      As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.

      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.Builder avoiding the need to create one manually via ListKeysRequest.builder()

      Parameters:
      listKeysRequest - A Consumer that will call methods on ListKeysRequest.Builder to 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 invoke Throwable.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

      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 invoke Throwable.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.Builder avoiding the need to create one manually via PutKeyRequest.builder()

      Parameters:
      putKeyRequest - A Consumer that will call methods on PutKeyRequest.Builder to 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 invoke Throwable.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(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 invoke Throwable.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.Builder avoiding the need to create one manually via UpdateKeysRequest.builder()

      Parameters:
      updateKeysRequest - A Consumer that will call methods on UpdateKeysRequest.Builder to 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 invoke Throwable.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

      default CloudFrontKeyValueStoreServiceClientConfiguration serviceClientConfiguration()
      Description copied from interface: SdkClient
      The SDK service client configuration exposes client settings to the user, e.g., ClientOverrideConfiguration
      Specified by:
      serviceClientConfiguration in interface AwsClient
      Specified by:
      serviceClientConfiguration in interface SdkClient
      Returns:
      SdkServiceClientConfiguration
    • create

      Create a CloudFrontKeyValueStoreAsyncClient with the region loaded from the DefaultAwsRegionProviderChain and credentials loaded from the DefaultCredentialsProvider.
    • builder

      Create a builder that can be used to configure and create a CloudFrontKeyValueStoreAsyncClient.