Interface AppConfigDataAsyncClient
-
- All Superinterfaces:
AutoCloseable,AwsClient,SdkAutoCloseable,SdkClient
@Generated("software.amazon.awssdk:codegen") @ThreadSafe public interface AppConfigDataAsyncClient extends AwsClient
Service client for accessing AWS AppConfig Data 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.AppConfig Data provides the data plane APIs your application uses to retrieve configuration data. Here's how it works:
Your application retrieves configuration data by first establishing a configuration session using the AppConfig Data StartConfigurationSession API action. Your session's client then makes periodic calls to GetLatestConfiguration to check for and retrieve the latest data available.
When calling
StartConfigurationSession, your code sends the following information:-
Identifiers (ID or name) of an AppConfig application, environment, and configuration profile that the session tracks.
-
(Optional) The minimum amount of time the session's client must wait between calls to
GetLatestConfiguration.
In response, AppConfig provides an
InitialConfigurationTokento be given to the session's client and used the first time it callsGetLatestConfigurationfor that session.This token should only be used once in your first call to
GetLatestConfiguration. You must use the new token in theGetLatestConfigurationresponse (NextPollConfigurationToken) in each subsequent call toGetLatestConfiguration.When calling
GetLatestConfiguration, your client code sends the most recentConfigurationTokenvalue it has and receives in response:-
NextPollConfigurationToken: theConfigurationTokenvalue to use on the next call toGetLatestConfiguration. -
NextPollIntervalInSeconds: the duration the client should wait before making its next call toGetLatestConfiguration. This duration may vary over the course of the session, so it should be used instead of the value sent on theStartConfigurationSessioncall. -
The configuration: the latest data intended for the session. This may be empty if the client already has the latest version of the configuration.
The
InitialConfigurationTokenandNextPollConfigurationTokenshould only be used once. To support long poll use cases, the tokens are valid for up to 24 hours. If aGetLatestConfigurationcall uses an expired token, the system returnsBadRequestException.For more information and to view example CLI commands that show how to retrieve a configuration using the AppConfig Data
StartConfigurationSessionandGetLatestConfigurationAPI actions, see Retrieving the configuration in the AppConfig User Guide.
-
-
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
-
getLatestConfiguration
default CompletableFuture<GetLatestConfigurationResponse> getLatestConfiguration(GetLatestConfigurationRequest getLatestConfigurationRequest)
Retrieves the latest deployed configuration. This API may return empty configuration data if the client already has the latest version. For more information about this API action and to view example CLI commands that show how to use it with the StartConfigurationSession API action, see Retrieving the configuration in the AppConfig User Guide.
Note the following important information.
-
Each configuration token is only valid for one call to
GetLatestConfiguration. TheGetLatestConfigurationresponse includes aNextPollConfigurationTokenthat should always replace the token used for the just-completed call in preparation for the next one. -
GetLatestConfigurationis a priced call. For more information, see Pricing.
- Parameters:
getLatestConfigurationRequest-- Returns:
- A Java Future containing the result of the GetLatestConfiguration 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.- ThrottlingException The request was denied due to request throttling.
- ResourceNotFoundException The requested resource could not be found.
- BadRequestException The input fails to satisfy the constraints specified by the service.
- InternalServerException There was an internal failure in the service.
- 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.
- AppConfigDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
- AWS API Documentation
-
-
getLatestConfiguration
default CompletableFuture<GetLatestConfigurationResponse> getLatestConfiguration(Consumer<GetLatestConfigurationRequest.Builder> getLatestConfigurationRequest)
Retrieves the latest deployed configuration. This API may return empty configuration data if the client already has the latest version. For more information about this API action and to view example CLI commands that show how to use it with the StartConfigurationSession API action, see Retrieving the configuration in the AppConfig User Guide.
Note the following important information.
-
Each configuration token is only valid for one call to
GetLatestConfiguration. TheGetLatestConfigurationresponse includes aNextPollConfigurationTokenthat should always replace the token used for the just-completed call in preparation for the next one. -
GetLatestConfigurationis a priced call. For more information, see Pricing.
This is a convenience which creates an instance of the
GetLatestConfigurationRequest.Builderavoiding the need to create one manually viaGetLatestConfigurationRequest.builder()- Parameters:
getLatestConfigurationRequest- AConsumerthat will call methods onGetLatestConfigurationRequest.Builderto create a request.- Returns:
- A Java Future containing the result of the GetLatestConfiguration 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.- ThrottlingException The request was denied due to request throttling.
- ResourceNotFoundException The requested resource could not be found.
- BadRequestException The input fails to satisfy the constraints specified by the service.
- InternalServerException There was an internal failure in the service.
- 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.
- AppConfigDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
- AWS API Documentation
-
-
startConfigurationSession
default CompletableFuture<StartConfigurationSessionResponse> startConfigurationSession(StartConfigurationSessionRequest startConfigurationSessionRequest)
Starts a configuration session used to retrieve a deployed configuration. For more information about this API action and to view example CLI commands that show how to use it with the GetLatestConfiguration API action, see Retrieving the configuration in the AppConfig User Guide.
- Parameters:
startConfigurationSessionRequest-- Returns:
- A Java Future containing the result of the StartConfigurationSession 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.- ThrottlingException The request was denied due to request throttling.
- ResourceNotFoundException The requested resource could not be found.
- BadRequestException The input fails to satisfy the constraints specified by the service.
- InternalServerException There was an internal failure in the service.
- 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.
- AppConfigDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
- AWS API Documentation
-
startConfigurationSession
default CompletableFuture<StartConfigurationSessionResponse> startConfigurationSession(Consumer<StartConfigurationSessionRequest.Builder> startConfigurationSessionRequest)
Starts a configuration session used to retrieve a deployed configuration. For more information about this API action and to view example CLI commands that show how to use it with the GetLatestConfiguration API action, see Retrieving the configuration in the AppConfig User Guide.
This is a convenience which creates an instance of the
StartConfigurationSessionRequest.Builderavoiding the need to create one manually viaStartConfigurationSessionRequest.builder()- Parameters:
startConfigurationSessionRequest- AConsumerthat will call methods onStartConfigurationSessionRequest.Builderto create a request.- Returns:
- A Java Future containing the result of the StartConfigurationSession 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.- ThrottlingException The request was denied due to request throttling.
- ResourceNotFoundException The requested resource could not be found.
- BadRequestException The input fails to satisfy the constraints specified by the service.
- InternalServerException There was an internal failure in the service.
- 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.
- AppConfigDataException Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
- See Also:
- AWS API Documentation
-
serviceClientConfiguration
default AppConfigDataServiceClientConfiguration serviceClientConfiguration()
- Specified by:
serviceClientConfigurationin interfaceAwsClient- Specified by:
serviceClientConfigurationin interfaceSdkClient
-
create
static AppConfigDataAsyncClient create()
Create aAppConfigDataAsyncClientwith the region loaded from theDefaultAwsRegionProviderChainand credentials loaded from theDefaultCredentialsProvider.
-
builder
static AppConfigDataAsyncClientBuilder builder()
Create a builder that can be used to configure and create aAppConfigDataAsyncClient.
-
-