
software.amazon.awssdk.services.appconfig.DefaultAppConfigAsyncClient Maven / Gradle / Ivy
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package software.amazon.awssdk.services.appconfig;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.awscore.client.handler.AwsAsyncClientHandler;
import software.amazon.awssdk.awscore.exception.AwsServiceException;
import software.amazon.awssdk.awscore.internal.AwsProtocolMetadata;
import software.amazon.awssdk.awscore.internal.AwsServiceProtocol;
import software.amazon.awssdk.core.RequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkPlugin;
import software.amazon.awssdk.core.SdkRequest;
import software.amazon.awssdk.core.client.config.SdkClientConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientOption;
import software.amazon.awssdk.core.client.handler.AsyncClientHandler;
import software.amazon.awssdk.core.client.handler.ClientExecutionParams;
import software.amazon.awssdk.core.http.HttpResponseHandler;
import software.amazon.awssdk.core.metrics.CoreMetric;
import software.amazon.awssdk.metrics.MetricCollector;
import software.amazon.awssdk.metrics.MetricPublisher;
import software.amazon.awssdk.metrics.NoOpMetricCollector;
import software.amazon.awssdk.protocols.core.ExceptionMetadata;
import software.amazon.awssdk.protocols.json.AwsJsonProtocol;
import software.amazon.awssdk.protocols.json.AwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.BaseAwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.JsonOperationMetadata;
import software.amazon.awssdk.services.appconfig.internal.AppConfigServiceClientConfigurationBuilder;
import software.amazon.awssdk.services.appconfig.model.AppConfigException;
import software.amazon.awssdk.services.appconfig.model.BadRequestException;
import software.amazon.awssdk.services.appconfig.model.ConflictException;
import software.amazon.awssdk.services.appconfig.model.CreateApplicationRequest;
import software.amazon.awssdk.services.appconfig.model.CreateApplicationResponse;
import software.amazon.awssdk.services.appconfig.model.CreateConfigurationProfileRequest;
import software.amazon.awssdk.services.appconfig.model.CreateConfigurationProfileResponse;
import software.amazon.awssdk.services.appconfig.model.CreateDeploymentStrategyRequest;
import software.amazon.awssdk.services.appconfig.model.CreateDeploymentStrategyResponse;
import software.amazon.awssdk.services.appconfig.model.CreateEnvironmentRequest;
import software.amazon.awssdk.services.appconfig.model.CreateEnvironmentResponse;
import software.amazon.awssdk.services.appconfig.model.CreateExtensionAssociationRequest;
import software.amazon.awssdk.services.appconfig.model.CreateExtensionAssociationResponse;
import software.amazon.awssdk.services.appconfig.model.CreateExtensionRequest;
import software.amazon.awssdk.services.appconfig.model.CreateExtensionResponse;
import software.amazon.awssdk.services.appconfig.model.CreateHostedConfigurationVersionRequest;
import software.amazon.awssdk.services.appconfig.model.CreateHostedConfigurationVersionResponse;
import software.amazon.awssdk.services.appconfig.model.DeleteApplicationRequest;
import software.amazon.awssdk.services.appconfig.model.DeleteApplicationResponse;
import software.amazon.awssdk.services.appconfig.model.DeleteConfigurationProfileRequest;
import software.amazon.awssdk.services.appconfig.model.DeleteConfigurationProfileResponse;
import software.amazon.awssdk.services.appconfig.model.DeleteDeploymentStrategyRequest;
import software.amazon.awssdk.services.appconfig.model.DeleteDeploymentStrategyResponse;
import software.amazon.awssdk.services.appconfig.model.DeleteEnvironmentRequest;
import software.amazon.awssdk.services.appconfig.model.DeleteEnvironmentResponse;
import software.amazon.awssdk.services.appconfig.model.DeleteExtensionAssociationRequest;
import software.amazon.awssdk.services.appconfig.model.DeleteExtensionAssociationResponse;
import software.amazon.awssdk.services.appconfig.model.DeleteExtensionRequest;
import software.amazon.awssdk.services.appconfig.model.DeleteExtensionResponse;
import software.amazon.awssdk.services.appconfig.model.DeleteHostedConfigurationVersionRequest;
import software.amazon.awssdk.services.appconfig.model.DeleteHostedConfigurationVersionResponse;
import software.amazon.awssdk.services.appconfig.model.GetApplicationRequest;
import software.amazon.awssdk.services.appconfig.model.GetApplicationResponse;
import software.amazon.awssdk.services.appconfig.model.GetConfigurationProfileRequest;
import software.amazon.awssdk.services.appconfig.model.GetConfigurationProfileResponse;
import software.amazon.awssdk.services.appconfig.model.GetConfigurationRequest;
import software.amazon.awssdk.services.appconfig.model.GetConfigurationResponse;
import software.amazon.awssdk.services.appconfig.model.GetDeploymentRequest;
import software.amazon.awssdk.services.appconfig.model.GetDeploymentResponse;
import software.amazon.awssdk.services.appconfig.model.GetDeploymentStrategyRequest;
import software.amazon.awssdk.services.appconfig.model.GetDeploymentStrategyResponse;
import software.amazon.awssdk.services.appconfig.model.GetEnvironmentRequest;
import software.amazon.awssdk.services.appconfig.model.GetEnvironmentResponse;
import software.amazon.awssdk.services.appconfig.model.GetExtensionAssociationRequest;
import software.amazon.awssdk.services.appconfig.model.GetExtensionAssociationResponse;
import software.amazon.awssdk.services.appconfig.model.GetExtensionRequest;
import software.amazon.awssdk.services.appconfig.model.GetExtensionResponse;
import software.amazon.awssdk.services.appconfig.model.GetHostedConfigurationVersionRequest;
import software.amazon.awssdk.services.appconfig.model.GetHostedConfigurationVersionResponse;
import software.amazon.awssdk.services.appconfig.model.InternalServerException;
import software.amazon.awssdk.services.appconfig.model.ListApplicationsRequest;
import software.amazon.awssdk.services.appconfig.model.ListApplicationsResponse;
import software.amazon.awssdk.services.appconfig.model.ListConfigurationProfilesRequest;
import software.amazon.awssdk.services.appconfig.model.ListConfigurationProfilesResponse;
import software.amazon.awssdk.services.appconfig.model.ListDeploymentStrategiesRequest;
import software.amazon.awssdk.services.appconfig.model.ListDeploymentStrategiesResponse;
import software.amazon.awssdk.services.appconfig.model.ListDeploymentsRequest;
import software.amazon.awssdk.services.appconfig.model.ListDeploymentsResponse;
import software.amazon.awssdk.services.appconfig.model.ListEnvironmentsRequest;
import software.amazon.awssdk.services.appconfig.model.ListEnvironmentsResponse;
import software.amazon.awssdk.services.appconfig.model.ListExtensionAssociationsRequest;
import software.amazon.awssdk.services.appconfig.model.ListExtensionAssociationsResponse;
import software.amazon.awssdk.services.appconfig.model.ListExtensionsRequest;
import software.amazon.awssdk.services.appconfig.model.ListExtensionsResponse;
import software.amazon.awssdk.services.appconfig.model.ListHostedConfigurationVersionsRequest;
import software.amazon.awssdk.services.appconfig.model.ListHostedConfigurationVersionsResponse;
import software.amazon.awssdk.services.appconfig.model.ListTagsForResourceRequest;
import software.amazon.awssdk.services.appconfig.model.ListTagsForResourceResponse;
import software.amazon.awssdk.services.appconfig.model.PayloadTooLargeException;
import software.amazon.awssdk.services.appconfig.model.ResourceNotFoundException;
import software.amazon.awssdk.services.appconfig.model.ServiceQuotaExceededException;
import software.amazon.awssdk.services.appconfig.model.StartDeploymentRequest;
import software.amazon.awssdk.services.appconfig.model.StartDeploymentResponse;
import software.amazon.awssdk.services.appconfig.model.StopDeploymentRequest;
import software.amazon.awssdk.services.appconfig.model.StopDeploymentResponse;
import software.amazon.awssdk.services.appconfig.model.TagResourceRequest;
import software.amazon.awssdk.services.appconfig.model.TagResourceResponse;
import software.amazon.awssdk.services.appconfig.model.UntagResourceRequest;
import software.amazon.awssdk.services.appconfig.model.UntagResourceResponse;
import software.amazon.awssdk.services.appconfig.model.UpdateApplicationRequest;
import software.amazon.awssdk.services.appconfig.model.UpdateApplicationResponse;
import software.amazon.awssdk.services.appconfig.model.UpdateConfigurationProfileRequest;
import software.amazon.awssdk.services.appconfig.model.UpdateConfigurationProfileResponse;
import software.amazon.awssdk.services.appconfig.model.UpdateDeploymentStrategyRequest;
import software.amazon.awssdk.services.appconfig.model.UpdateDeploymentStrategyResponse;
import software.amazon.awssdk.services.appconfig.model.UpdateEnvironmentRequest;
import software.amazon.awssdk.services.appconfig.model.UpdateEnvironmentResponse;
import software.amazon.awssdk.services.appconfig.model.UpdateExtensionAssociationRequest;
import software.amazon.awssdk.services.appconfig.model.UpdateExtensionAssociationResponse;
import software.amazon.awssdk.services.appconfig.model.UpdateExtensionRequest;
import software.amazon.awssdk.services.appconfig.model.UpdateExtensionResponse;
import software.amazon.awssdk.services.appconfig.model.ValidateConfigurationRequest;
import software.amazon.awssdk.services.appconfig.model.ValidateConfigurationResponse;
import software.amazon.awssdk.services.appconfig.transform.CreateApplicationRequestMarshaller;
import software.amazon.awssdk.services.appconfig.transform.CreateConfigurationProfileRequestMarshaller;
import software.amazon.awssdk.services.appconfig.transform.CreateDeploymentStrategyRequestMarshaller;
import software.amazon.awssdk.services.appconfig.transform.CreateEnvironmentRequestMarshaller;
import software.amazon.awssdk.services.appconfig.transform.CreateExtensionAssociationRequestMarshaller;
import software.amazon.awssdk.services.appconfig.transform.CreateExtensionRequestMarshaller;
import software.amazon.awssdk.services.appconfig.transform.CreateHostedConfigurationVersionRequestMarshaller;
import software.amazon.awssdk.services.appconfig.transform.DeleteApplicationRequestMarshaller;
import software.amazon.awssdk.services.appconfig.transform.DeleteConfigurationProfileRequestMarshaller;
import software.amazon.awssdk.services.appconfig.transform.DeleteDeploymentStrategyRequestMarshaller;
import software.amazon.awssdk.services.appconfig.transform.DeleteEnvironmentRequestMarshaller;
import software.amazon.awssdk.services.appconfig.transform.DeleteExtensionAssociationRequestMarshaller;
import software.amazon.awssdk.services.appconfig.transform.DeleteExtensionRequestMarshaller;
import software.amazon.awssdk.services.appconfig.transform.DeleteHostedConfigurationVersionRequestMarshaller;
import software.amazon.awssdk.services.appconfig.transform.GetApplicationRequestMarshaller;
import software.amazon.awssdk.services.appconfig.transform.GetConfigurationProfileRequestMarshaller;
import software.amazon.awssdk.services.appconfig.transform.GetConfigurationRequestMarshaller;
import software.amazon.awssdk.services.appconfig.transform.GetDeploymentRequestMarshaller;
import software.amazon.awssdk.services.appconfig.transform.GetDeploymentStrategyRequestMarshaller;
import software.amazon.awssdk.services.appconfig.transform.GetEnvironmentRequestMarshaller;
import software.amazon.awssdk.services.appconfig.transform.GetExtensionAssociationRequestMarshaller;
import software.amazon.awssdk.services.appconfig.transform.GetExtensionRequestMarshaller;
import software.amazon.awssdk.services.appconfig.transform.GetHostedConfigurationVersionRequestMarshaller;
import software.amazon.awssdk.services.appconfig.transform.ListApplicationsRequestMarshaller;
import software.amazon.awssdk.services.appconfig.transform.ListConfigurationProfilesRequestMarshaller;
import software.amazon.awssdk.services.appconfig.transform.ListDeploymentStrategiesRequestMarshaller;
import software.amazon.awssdk.services.appconfig.transform.ListDeploymentsRequestMarshaller;
import software.amazon.awssdk.services.appconfig.transform.ListEnvironmentsRequestMarshaller;
import software.amazon.awssdk.services.appconfig.transform.ListExtensionAssociationsRequestMarshaller;
import software.amazon.awssdk.services.appconfig.transform.ListExtensionsRequestMarshaller;
import software.amazon.awssdk.services.appconfig.transform.ListHostedConfigurationVersionsRequestMarshaller;
import software.amazon.awssdk.services.appconfig.transform.ListTagsForResourceRequestMarshaller;
import software.amazon.awssdk.services.appconfig.transform.StartDeploymentRequestMarshaller;
import software.amazon.awssdk.services.appconfig.transform.StopDeploymentRequestMarshaller;
import software.amazon.awssdk.services.appconfig.transform.TagResourceRequestMarshaller;
import software.amazon.awssdk.services.appconfig.transform.UntagResourceRequestMarshaller;
import software.amazon.awssdk.services.appconfig.transform.UpdateApplicationRequestMarshaller;
import software.amazon.awssdk.services.appconfig.transform.UpdateConfigurationProfileRequestMarshaller;
import software.amazon.awssdk.services.appconfig.transform.UpdateDeploymentStrategyRequestMarshaller;
import software.amazon.awssdk.services.appconfig.transform.UpdateEnvironmentRequestMarshaller;
import software.amazon.awssdk.services.appconfig.transform.UpdateExtensionAssociationRequestMarshaller;
import software.amazon.awssdk.services.appconfig.transform.UpdateExtensionRequestMarshaller;
import software.amazon.awssdk.services.appconfig.transform.ValidateConfigurationRequestMarshaller;
import software.amazon.awssdk.utils.CompletableFutureUtils;
/**
* Internal implementation of {@link AppConfigAsyncClient}.
*
* @see AppConfigAsyncClient#builder()
*/
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
final class DefaultAppConfigAsyncClient implements AppConfigAsyncClient {
private static final Logger log = LoggerFactory.getLogger(DefaultAppConfigAsyncClient.class);
private static final AwsProtocolMetadata protocolMetadata = AwsProtocolMetadata.builder()
.serviceProtocol(AwsServiceProtocol.REST_JSON).build();
private final AsyncClientHandler clientHandler;
private final AwsJsonProtocolFactory protocolFactory;
private final SdkClientConfiguration clientConfiguration;
protected DefaultAppConfigAsyncClient(SdkClientConfiguration clientConfiguration) {
this.clientHandler = new AwsAsyncClientHandler(clientConfiguration);
this.clientConfiguration = clientConfiguration;
this.protocolFactory = init(AwsJsonProtocolFactory.builder()).build();
}
/**
*
* Creates an application. In AppConfig, an application is simply an organizational construct like a folder. This
* organizational construct has a relationship with some unit of executable code. For example, you could create an
* application called MyMobileApp to organize and manage configuration data for a mobile application installed by
* your users.
*
*
* @param createApplicationRequest
* @return A Java Future containing the result of the CreateApplication operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - BadRequestException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - ServiceQuotaExceededException The number of one more AppConfig resources exceeds the maximum allowed.
* Verify that your environment doesn't exceed the following service quotas:
*
* Applications: 100 max
*
*
* Deployment strategies: 20 max
*
*
* Configuration profiles: 100 max per application
*
*
* Environments: 20 max per application
*
*
* To resolve this issue, you can delete one or more resources and try again. Or, you can request a quota
* increase. For more information about quotas and to request an increase, see Service quotas for
* AppConfig in the Amazon Web Services General Reference.
* - InternalServerException There was an internal failure in the AppConfig 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.
* - AppConfigException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AppConfigAsyncClient.CreateApplication
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture createApplication(CreateApplicationRequest createApplicationRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createApplicationRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createApplicationRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppConfig");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateApplication");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateApplicationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateApplication").withProtocolMetadata(protocolMetadata)
.withMarshaller(new CreateApplicationRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(createApplicationRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Creates a configuration profile, which is information that enables AppConfig to access the configuration source.
* Valid configuration sources include the following:
*
*
* -
*
* Configuration data in YAML, JSON, and other formats stored in the AppConfig hosted configuration store
*
*
* -
*
* Configuration data stored as objects in an Amazon Simple Storage Service (Amazon S3) bucket
*
*
* -
*
* Pipelines stored in CodePipeline
*
*
* -
*
* Secrets stored in Secrets Manager
*
*
* -
*
* Standard and secure string parameters stored in Amazon Web Services Systems Manager Parameter Store
*
*
* -
*
* Configuration data in SSM documents stored in the Systems Manager document store
*
*
*
*
* A configuration profile includes the following information:
*
*
* -
*
* The URI location of the configuration data.
*
*
* -
*
* The Identity and Access Management (IAM) role that provides access to the configuration data.
*
*
* -
*
* A validator for the configuration data. Available validators include either a JSON Schema or an Amazon Web
* Services Lambda function.
*
*
*
*
* For more information, see Create a Configuration and a Configuration Profile in the AppConfig User Guide.
*
*
* @param createConfigurationProfileRequest
* @return A Java Future containing the result of the CreateConfigurationProfile operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - BadRequestException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - ResourceNotFoundException The requested resource could not be found.
* - InternalServerException There was an internal failure in the AppConfig service.
* - ServiceQuotaExceededException The number of one more AppConfig resources exceeds the maximum allowed.
* Verify that your environment doesn't exceed the following service quotas:
*
* Applications: 100 max
*
*
* Deployment strategies: 20 max
*
*
* Configuration profiles: 100 max per application
*
*
* Environments: 20 max per application
*
*
* To resolve this issue, you can delete one or more resources and try again. Or, you can request a quota
* increase. For more information about quotas and to request an increase, see Service quotas for
* AppConfig in the Amazon Web Services General Reference.
* - 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.
* - AppConfigException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AppConfigAsyncClient.CreateConfigurationProfile
* @see AWS API Documentation
*/
@Override
public CompletableFuture createConfigurationProfile(
CreateConfigurationProfileRequest createConfigurationProfileRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createConfigurationProfileRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createConfigurationProfileRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppConfig");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateConfigurationProfile");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateConfigurationProfileResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateConfigurationProfile").withProtocolMetadata(protocolMetadata)
.withMarshaller(new CreateConfigurationProfileRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(createConfigurationProfileRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Creates a deployment strategy that defines important criteria for rolling out your configuration to the
* designated targets. A deployment strategy includes the overall duration required, a percentage of targets to
* receive the deployment during each interval, an algorithm that defines how percentage grows, and bake time.
*
*
* @param createDeploymentStrategyRequest
* @return A Java Future containing the result of the CreateDeploymentStrategy operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InternalServerException There was an internal failure in the AppConfig service.
* - ServiceQuotaExceededException The number of one more AppConfig resources exceeds the maximum allowed.
* Verify that your environment doesn't exceed the following service quotas:
*
* Applications: 100 max
*
*
* Deployment strategies: 20 max
*
*
* Configuration profiles: 100 max per application
*
*
* Environments: 20 max per application
*
*
* To resolve this issue, you can delete one or more resources and try again. Or, you can request a quota
* increase. For more information about quotas and to request an increase, see Service quotas for
* AppConfig in the Amazon Web Services General Reference.
* - BadRequestException The input fails to satisfy the constraints specified by an Amazon Web Services
* 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.
* - AppConfigException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AppConfigAsyncClient.CreateDeploymentStrategy
* @see AWS API Documentation
*/
@Override
public CompletableFuture createDeploymentStrategy(
CreateDeploymentStrategyRequest createDeploymentStrategyRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createDeploymentStrategyRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createDeploymentStrategyRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppConfig");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateDeploymentStrategy");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateDeploymentStrategyResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateDeploymentStrategy").withProtocolMetadata(protocolMetadata)
.withMarshaller(new CreateDeploymentStrategyRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(createDeploymentStrategyRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Creates an environment. For each application, you define one or more environments. An environment is a deployment
* group of AppConfig targets, such as applications in a Beta
or Production
environment.
* You can also define environments for application subcomponents such as the Web
, Mobile
* and Back-end
components for your application. You can configure Amazon CloudWatch alarms for each
* environment. The system monitors alarms during a configuration deployment. If an alarm is triggered, the system
* rolls back the configuration.
*
*
* @param createEnvironmentRequest
* @return A Java Future containing the result of the CreateEnvironment operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InternalServerException There was an internal failure in the AppConfig service.
* - ResourceNotFoundException The requested resource could not be found.
* - BadRequestException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - ServiceQuotaExceededException The number of one more AppConfig resources exceeds the maximum allowed.
* Verify that your environment doesn't exceed the following service quotas:
*
* Applications: 100 max
*
*
* Deployment strategies: 20 max
*
*
* Configuration profiles: 100 max per application
*
*
* Environments: 20 max per application
*
*
* To resolve this issue, you can delete one or more resources and try again. Or, you can request a quota
* increase. For more information about quotas and to request an increase, see Service quotas for
* AppConfig in the Amazon Web Services General Reference.
* - 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.
* - AppConfigException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AppConfigAsyncClient.CreateEnvironment
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture createEnvironment(CreateEnvironmentRequest createEnvironmentRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createEnvironmentRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createEnvironmentRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppConfig");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateEnvironment");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateEnvironmentResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateEnvironment").withProtocolMetadata(protocolMetadata)
.withMarshaller(new CreateEnvironmentRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(createEnvironmentRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Creates an AppConfig extension. An extension augments your ability to inject logic or behavior at different
* points during the AppConfig workflow of creating or deploying a configuration.
*
*
* You can create your own extensions or use the Amazon Web Services authored extensions provided by AppConfig. For
* an AppConfig extension that uses Lambda, you must create a Lambda function to perform any computation and
* processing defined in the extension. If you plan to create custom versions of the Amazon Web Services authored
* notification extensions, you only need to specify an Amazon Resource Name (ARN) in the Uri
field for
* the new extension version.
*
*
* -
*
* For a custom EventBridge notification extension, enter the ARN of the EventBridge default events in the
* Uri
field.
*
*
* -
*
* For a custom Amazon SNS notification extension, enter the ARN of an Amazon SNS topic in the Uri
* field.
*
*
* -
*
* For a custom Amazon SQS notification extension, enter the ARN of an Amazon SQS message queue in the
* Uri
field.
*
*
*
*
* For more information about extensions, see Working with
* AppConfig extensions in the AppConfig User Guide.
*
*
* @param createExtensionRequest
* @return A Java Future containing the result of the CreateExtension operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - BadRequestException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - ConflictException The request could not be processed because of conflict in the current state of the
* resource.
* - ServiceQuotaExceededException The number of one more AppConfig resources exceeds the maximum allowed.
* Verify that your environment doesn't exceed the following service quotas:
*
* Applications: 100 max
*
*
* Deployment strategies: 20 max
*
*
* Configuration profiles: 100 max per application
*
*
* Environments: 20 max per application
*
*
* To resolve this issue, you can delete one or more resources and try again. Or, you can request a quota
* increase. For more information about quotas and to request an increase, see Service quotas for
* AppConfig in the Amazon Web Services General Reference.
* - InternalServerException There was an internal failure in the AppConfig 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.
* - AppConfigException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AppConfigAsyncClient.CreateExtension
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture createExtension(CreateExtensionRequest createExtensionRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createExtensionRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createExtensionRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppConfig");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateExtension");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateExtensionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateExtension").withProtocolMetadata(protocolMetadata)
.withMarshaller(new CreateExtensionRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(createExtensionRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* When you create an extension or configure an Amazon Web Services authored extension, you associate the extension
* with an AppConfig application, environment, or configuration profile. For example, you can choose to run the
* AppConfig deployment events to Amazon SNS
Amazon Web Services authored extension and receive
* notifications on an Amazon SNS topic anytime a configuration deployment is started for a specific application.
* Defining which extension to associate with an AppConfig resource is called an extension association. An
* extension association is a specified relationship between an extension and an AppConfig resource, such as an
* application or a configuration profile. For more information about extensions and associations, see Working with
* AppConfig extensions in the AppConfig User Guide.
*
*
* @param createExtensionAssociationRequest
* @return A Java Future containing the result of the CreateExtensionAssociation operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - BadRequestException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - ResourceNotFoundException The requested resource could not be found.
* - InternalServerException There was an internal failure in the AppConfig service.
* - ServiceQuotaExceededException The number of one more AppConfig resources exceeds the maximum allowed.
* Verify that your environment doesn't exceed the following service quotas:
*
* Applications: 100 max
*
*
* Deployment strategies: 20 max
*
*
* Configuration profiles: 100 max per application
*
*
* Environments: 20 max per application
*
*
* To resolve this issue, you can delete one or more resources and try again. Or, you can request a quota
* increase. For more information about quotas and to request an increase, see Service quotas for
* AppConfig in the Amazon Web Services General Reference.
* - 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.
* - AppConfigException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AppConfigAsyncClient.CreateExtensionAssociation
* @see AWS API Documentation
*/
@Override
public CompletableFuture createExtensionAssociation(
CreateExtensionAssociationRequest createExtensionAssociationRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createExtensionAssociationRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createExtensionAssociationRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppConfig");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateExtensionAssociation");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateExtensionAssociationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateExtensionAssociation").withProtocolMetadata(protocolMetadata)
.withMarshaller(new CreateExtensionAssociationRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(createExtensionAssociationRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Creates a new configuration in the AppConfig hosted configuration store.
*
*
* @param createHostedConfigurationVersionRequest
* @return A Java Future containing the result of the CreateHostedConfigurationVersion operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - BadRequestException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - ServiceQuotaExceededException The number of one more AppConfig resources exceeds the maximum allowed.
* Verify that your environment doesn't exceed the following service quotas:
*
* Applications: 100 max
*
*
* Deployment strategies: 20 max
*
*
* Configuration profiles: 100 max per application
*
*
* Environments: 20 max per application
*
*
* To resolve this issue, you can delete one or more resources and try again. Or, you can request a quota
* increase. For more information about quotas and to request an increase, see Service quotas for
* AppConfig in the Amazon Web Services General Reference.
* - ResourceNotFoundException The requested resource could not be found.
* - ConflictException The request could not be processed because of conflict in the current state of the
* resource.
* - PayloadTooLargeException The configuration size is too large.
* - InternalServerException There was an internal failure in the AppConfig 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.
* - AppConfigException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AppConfigAsyncClient.CreateHostedConfigurationVersion
* @see AWS API Documentation
*/
@Override
public CompletableFuture createHostedConfigurationVersion(
CreateHostedConfigurationVersionRequest createHostedConfigurationVersionRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createHostedConfigurationVersionRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
createHostedConfigurationVersionRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppConfig");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateHostedConfigurationVersion");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(false).build();
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(operationMetadata, CreateHostedConfigurationVersionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateHostedConfigurationVersion").withProtocolMetadata(protocolMetadata)
.withMarshaller(new CreateHostedConfigurationVersionRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(createHostedConfigurationVersionRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deletes an application. Deleting an application does not delete a configuration from a host.
*
*
* @param deleteApplicationRequest
* @return A Java Future containing the result of the DeleteApplication operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException The requested resource could not be found.
* - InternalServerException There was an internal failure in the AppConfig service.
* - BadRequestException The input fails to satisfy the constraints specified by an Amazon Web Services
* 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.
* - AppConfigException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AppConfigAsyncClient.DeleteApplication
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture deleteApplication(DeleteApplicationRequest deleteApplicationRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteApplicationRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteApplicationRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppConfig");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteApplication");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteApplicationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteApplication").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DeleteApplicationRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(deleteApplicationRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deletes a configuration profile. Deleting a configuration profile does not delete a configuration from a host.
*
*
* @param deleteConfigurationProfileRequest
* @return A Java Future containing the result of the DeleteConfigurationProfile operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException The requested resource could not be found.
* - ConflictException The request could not be processed because of conflict in the current state of the
* resource.
* - InternalServerException There was an internal failure in the AppConfig service.
* - BadRequestException The input fails to satisfy the constraints specified by an Amazon Web Services
* 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.
* - AppConfigException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AppConfigAsyncClient.DeleteConfigurationProfile
* @see AWS API Documentation
*/
@Override
public CompletableFuture deleteConfigurationProfile(
DeleteConfigurationProfileRequest deleteConfigurationProfileRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteConfigurationProfileRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteConfigurationProfileRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppConfig");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteConfigurationProfile");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteConfigurationProfileResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteConfigurationProfile").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DeleteConfigurationProfileRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(deleteConfigurationProfileRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deletes a deployment strategy. Deleting a deployment strategy does not delete a configuration from a host.
*
*
* @param deleteDeploymentStrategyRequest
* @return A Java Future containing the result of the DeleteDeploymentStrategy operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException The requested resource could not be found.
* - InternalServerException There was an internal failure in the AppConfig service.
* - BadRequestException The input fails to satisfy the constraints specified by an Amazon Web Services
* 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.
* - AppConfigException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AppConfigAsyncClient.DeleteDeploymentStrategy
* @see AWS API Documentation
*/
@Override
public CompletableFuture deleteDeploymentStrategy(
DeleteDeploymentStrategyRequest deleteDeploymentStrategyRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteDeploymentStrategyRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteDeploymentStrategyRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppConfig");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteDeploymentStrategy");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteDeploymentStrategyResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteDeploymentStrategy").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DeleteDeploymentStrategyRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(deleteDeploymentStrategyRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deletes an environment. Deleting an environment does not delete a configuration from a host.
*
*
* @param deleteEnvironmentRequest
* @return A Java Future containing the result of the DeleteEnvironment operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException The requested resource could not be found.
* - ConflictException The request could not be processed because of conflict in the current state of the
* resource.
* - InternalServerException There was an internal failure in the AppConfig service.
* - BadRequestException The input fails to satisfy the constraints specified by an Amazon Web Services
* 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.
* - AppConfigException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AppConfigAsyncClient.DeleteEnvironment
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture deleteEnvironment(DeleteEnvironmentRequest deleteEnvironmentRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteEnvironmentRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteEnvironmentRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppConfig");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteEnvironment");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteEnvironmentResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteEnvironment").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DeleteEnvironmentRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(deleteEnvironmentRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deletes an AppConfig extension. You must delete all associations to an extension before you delete the extension.
*
*
* @param deleteExtensionRequest
* @return A Java Future containing the result of the DeleteExtension operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException The requested resource could not be found.
* - InternalServerException There was an internal failure in the AppConfig service.
* - BadRequestException The input fails to satisfy the constraints specified by an Amazon Web Services
* 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.
* - AppConfigException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AppConfigAsyncClient.DeleteExtension
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture deleteExtension(DeleteExtensionRequest deleteExtensionRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteExtensionRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteExtensionRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppConfig");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteExtension");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteExtensionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteExtension").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DeleteExtensionRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(deleteExtensionRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deletes an extension association. This action doesn't delete extensions defined in the association.
*
*
* @param deleteExtensionAssociationRequest
* @return A Java Future containing the result of the DeleteExtensionAssociation operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - BadRequestException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - ResourceNotFoundException The requested resource could not be found.
* - InternalServerException There was an internal failure in the AppConfig 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.
* - AppConfigException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AppConfigAsyncClient.DeleteExtensionAssociation
* @see AWS API Documentation
*/
@Override
public CompletableFuture deleteExtensionAssociation(
DeleteExtensionAssociationRequest deleteExtensionAssociationRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteExtensionAssociationRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteExtensionAssociationRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppConfig");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteExtensionAssociation");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteExtensionAssociationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteExtensionAssociation").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DeleteExtensionAssociationRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(deleteExtensionAssociationRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deletes a version of a configuration from the AppConfig hosted configuration store.
*
*
* @param deleteHostedConfigurationVersionRequest
* @return A Java Future containing the result of the DeleteHostedConfigurationVersion operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - BadRequestException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - ResourceNotFoundException The requested resource could not be found.
* - InternalServerException There was an internal failure in the AppConfig 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.
* - AppConfigException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AppConfigAsyncClient.DeleteHostedConfigurationVersion
* @see AWS API Documentation
*/
@Override
public CompletableFuture deleteHostedConfigurationVersion(
DeleteHostedConfigurationVersionRequest deleteHostedConfigurationVersionRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteHostedConfigurationVersionRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
deleteHostedConfigurationVersionRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppConfig");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteHostedConfigurationVersion");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(operationMetadata, DeleteHostedConfigurationVersionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteHostedConfigurationVersion").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DeleteHostedConfigurationVersionRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(deleteHostedConfigurationVersionRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Retrieves information about an application.
*
*
* @param getApplicationRequest
* @return A Java Future containing the result of the GetApplication operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException The requested resource could not be found.
* - InternalServerException There was an internal failure in the AppConfig service.
* - BadRequestException The input fails to satisfy the constraints specified by an Amazon Web Services
* 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.
* - AppConfigException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AppConfigAsyncClient.GetApplication
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture getApplication(GetApplicationRequest getApplicationRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getApplicationRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getApplicationRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppConfig");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetApplication");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetApplicationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetApplication").withProtocolMetadata(protocolMetadata)
.withMarshaller(new GetApplicationRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(getApplicationRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* (Deprecated) Retrieves the latest deployed configuration.
*
*
*
* Note the following important information.
*
*
* -
*
* This API action is deprecated. Calls to receive configuration data should use the StartConfigurationSession and GetLatestConfiguration APIs instead.
*
*
* -
*
* GetConfiguration
is a priced call. For more information, see Pricing.
*
*
*
*
*
* @param getConfigurationRequest
* @return A Java Future containing the result of the GetConfiguration operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException The requested resource could not be found.
* - InternalServerException There was an internal failure in the AppConfig service.
* - BadRequestException The input fails to satisfy the constraints specified by an Amazon Web Services
* 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.
* - AppConfigException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AppConfigAsyncClient.GetConfiguration
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture getConfiguration(GetConfigurationRequest getConfigurationRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getConfigurationRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getConfigurationRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppConfig");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetConfiguration");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(false).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetConfigurationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetConfiguration").withProtocolMetadata(protocolMetadata)
.withMarshaller(new GetConfigurationRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(getConfigurationRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Retrieves information about a configuration profile.
*
*
* @param getConfigurationProfileRequest
* @return A Java Future containing the result of the GetConfigurationProfile operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException The requested resource could not be found.
* - InternalServerException There was an internal failure in the AppConfig service.
* - BadRequestException The input fails to satisfy the constraints specified by an Amazon Web Services
* 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.
* - AppConfigException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AppConfigAsyncClient.GetConfigurationProfile
* @see AWS API Documentation
*/
@Override
public CompletableFuture getConfigurationProfile(
GetConfigurationProfileRequest getConfigurationProfileRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getConfigurationProfileRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getConfigurationProfileRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppConfig");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetConfigurationProfile");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetConfigurationProfileResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetConfigurationProfile").withProtocolMetadata(protocolMetadata)
.withMarshaller(new GetConfigurationProfileRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(getConfigurationProfileRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Retrieves information about a configuration deployment.
*
*
* @param getDeploymentRequest
* @return A Java Future containing the result of the GetDeployment operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException The requested resource could not be found.
* - InternalServerException There was an internal failure in the AppConfig service.
* - BadRequestException The input fails to satisfy the constraints specified by an Amazon Web Services
* 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.
* - AppConfigException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AppConfigAsyncClient.GetDeployment
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture getDeployment(GetDeploymentRequest getDeploymentRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getDeploymentRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getDeploymentRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppConfig");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetDeployment");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetDeploymentResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetDeployment").withProtocolMetadata(protocolMetadata)
.withMarshaller(new GetDeploymentRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(getDeploymentRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Retrieves information about a deployment strategy. A deployment strategy defines important criteria for rolling
* out your configuration to the designated targets. A deployment strategy includes the overall duration required, a
* percentage of targets to receive the deployment during each interval, an algorithm that defines how percentage
* grows, and bake time.
*
*
* @param getDeploymentStrategyRequest
* @return A Java Future containing the result of the GetDeploymentStrategy operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException The requested resource could not be found.
* - InternalServerException There was an internal failure in the AppConfig service.
* - BadRequestException The input fails to satisfy the constraints specified by an Amazon Web Services
* 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.
* - AppConfigException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AppConfigAsyncClient.GetDeploymentStrategy
* @see AWS API Documentation
*/
@Override
public CompletableFuture getDeploymentStrategy(
GetDeploymentStrategyRequest getDeploymentStrategyRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getDeploymentStrategyRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getDeploymentStrategyRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppConfig");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetDeploymentStrategy");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetDeploymentStrategyResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetDeploymentStrategy").withProtocolMetadata(protocolMetadata)
.withMarshaller(new GetDeploymentStrategyRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(getDeploymentStrategyRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Retrieves information about an environment. An environment is a deployment group of AppConfig applications, such
* as applications in a Production
environment or in an EU_Region
environment. Each
* configuration deployment targets an environment. You can enable one or more Amazon CloudWatch alarms for an
* environment. If an alarm is triggered during a deployment, AppConfig roles back the configuration.
*
*
* @param getEnvironmentRequest
* @return A Java Future containing the result of the GetEnvironment operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException The requested resource could not be found.
* - InternalServerException There was an internal failure in the AppConfig service.
* - BadRequestException The input fails to satisfy the constraints specified by an Amazon Web Services
* 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.
* - AppConfigException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AppConfigAsyncClient.GetEnvironment
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture getEnvironment(GetEnvironmentRequest getEnvironmentRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getEnvironmentRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getEnvironmentRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppConfig");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetEnvironment");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetEnvironmentResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetEnvironment").withProtocolMetadata(protocolMetadata)
.withMarshaller(new GetEnvironmentRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(getEnvironmentRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns information about an AppConfig extension.
*
*
* @param getExtensionRequest
* @return A Java Future containing the result of the GetExtension operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException The requested resource could not be found.
* - InternalServerException There was an internal failure in the AppConfig service.
* - BadRequestException The input fails to satisfy the constraints specified by an Amazon Web Services
* 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.
* - AppConfigException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AppConfigAsyncClient.GetExtension
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture getExtension(GetExtensionRequest getExtensionRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getExtensionRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getExtensionRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppConfig");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetExtension");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetExtensionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetExtension").withProtocolMetadata(protocolMetadata)
.withMarshaller(new GetExtensionRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(getExtensionRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns information about an AppConfig extension association. For more information about extensions and
* associations, see Working with
* AppConfig extensions in the AppConfig User Guide.
*
*
* @param getExtensionAssociationRequest
* @return A Java Future containing the result of the GetExtensionAssociation operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - BadRequestException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - ResourceNotFoundException The requested resource could not be found.
* - InternalServerException There was an internal failure in the AppConfig 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.
* - AppConfigException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AppConfigAsyncClient.GetExtensionAssociation
* @see AWS API Documentation
*/
@Override
public CompletableFuture getExtensionAssociation(
GetExtensionAssociationRequest getExtensionAssociationRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getExtensionAssociationRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getExtensionAssociationRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppConfig");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetExtensionAssociation");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetExtensionAssociationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetExtensionAssociation").withProtocolMetadata(protocolMetadata)
.withMarshaller(new GetExtensionAssociationRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(getExtensionAssociationRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Retrieves information about a specific configuration version.
*
*
* @param getHostedConfigurationVersionRequest
* @return A Java Future containing the result of the GetHostedConfigurationVersion operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - BadRequestException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - ResourceNotFoundException The requested resource could not be found.
* - InternalServerException There was an internal failure in the AppConfig 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.
* - AppConfigException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AppConfigAsyncClient.GetHostedConfigurationVersion
* @see AWS API Documentation
*/
@Override
public CompletableFuture getHostedConfigurationVersion(
GetHostedConfigurationVersionRequest getHostedConfigurationVersionRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getHostedConfigurationVersionRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
getHostedConfigurationVersionRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppConfig");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetHostedConfigurationVersion");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(false).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetHostedConfigurationVersionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetHostedConfigurationVersion").withProtocolMetadata(protocolMetadata)
.withMarshaller(new GetHostedConfigurationVersionRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(getHostedConfigurationVersionRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Lists all applications in your Amazon Web Services account.
*
*
* @param listApplicationsRequest
* @return A Java Future containing the result of the ListApplications operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InternalServerException There was an internal failure in the AppConfig service.
* - BadRequestException The input fails to satisfy the constraints specified by an Amazon Web Services
* 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.
* - AppConfigException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AppConfigAsyncClient.ListApplications
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture listApplications(ListApplicationsRequest listApplicationsRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listApplicationsRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listApplicationsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppConfig");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListApplications");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListApplicationsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListApplications").withProtocolMetadata(protocolMetadata)
.withMarshaller(new ListApplicationsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(listApplicationsRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Lists the configuration profiles for an application.
*
*
* @param listConfigurationProfilesRequest
* @return A Java Future containing the result of the ListConfigurationProfiles operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException The requested resource could not be found.
* - InternalServerException There was an internal failure in the AppConfig service.
* - BadRequestException The input fails to satisfy the constraints specified by an Amazon Web Services
* 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.
* - AppConfigException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AppConfigAsyncClient.ListConfigurationProfiles
* @see AWS API Documentation
*/
@Override
public CompletableFuture listConfigurationProfiles(
ListConfigurationProfilesRequest listConfigurationProfilesRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listConfigurationProfilesRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listConfigurationProfilesRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppConfig");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListConfigurationProfiles");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListConfigurationProfilesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListConfigurationProfiles").withProtocolMetadata(protocolMetadata)
.withMarshaller(new ListConfigurationProfilesRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(listConfigurationProfilesRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Lists deployment strategies.
*
*
* @param listDeploymentStrategiesRequest
* @return A Java Future containing the result of the ListDeploymentStrategies operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InternalServerException There was an internal failure in the AppConfig service.
* - BadRequestException The input fails to satisfy the constraints specified by an Amazon Web Services
* 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.
* - AppConfigException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AppConfigAsyncClient.ListDeploymentStrategies
* @see AWS API Documentation
*/
@Override
public CompletableFuture listDeploymentStrategies(
ListDeploymentStrategiesRequest listDeploymentStrategiesRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listDeploymentStrategiesRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listDeploymentStrategiesRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppConfig");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListDeploymentStrategies");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListDeploymentStrategiesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListDeploymentStrategies").withProtocolMetadata(protocolMetadata)
.withMarshaller(new ListDeploymentStrategiesRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(listDeploymentStrategiesRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Lists the deployments for an environment in descending deployment number order.
*
*
* @param listDeploymentsRequest
* @return A Java Future containing the result of the ListDeployments operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException The requested resource could not be found.
* - InternalServerException There was an internal failure in the AppConfig service.
* - BadRequestException The input fails to satisfy the constraints specified by an Amazon Web Services
* 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.
* - AppConfigException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AppConfigAsyncClient.ListDeployments
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture listDeployments(ListDeploymentsRequest listDeploymentsRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listDeploymentsRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listDeploymentsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppConfig");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListDeployments");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListDeploymentsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListDeployments").withProtocolMetadata(protocolMetadata)
.withMarshaller(new ListDeploymentsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(listDeploymentsRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Lists the environments for an application.
*
*
* @param listEnvironmentsRequest
* @return A Java Future containing the result of the ListEnvironments operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException The requested resource could not be found.
* - InternalServerException There was an internal failure in the AppConfig service.
* - BadRequestException The input fails to satisfy the constraints specified by an Amazon Web Services
* 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.
* - AppConfigException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AppConfigAsyncClient.ListEnvironments
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture listEnvironments(ListEnvironmentsRequest listEnvironmentsRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listEnvironmentsRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listEnvironmentsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppConfig");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListEnvironments");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListEnvironmentsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListEnvironments").withProtocolMetadata(protocolMetadata)
.withMarshaller(new ListEnvironmentsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(listEnvironmentsRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Lists all AppConfig extension associations in the account. For more information about extensions and
* associations, see Working with
* AppConfig extensions in the AppConfig User Guide.
*
*
* @param listExtensionAssociationsRequest
* @return A Java Future containing the result of the ListExtensionAssociations operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InternalServerException There was an internal failure in the AppConfig service.
* - BadRequestException The input fails to satisfy the constraints specified by an Amazon Web Services
* 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.
* - AppConfigException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AppConfigAsyncClient.ListExtensionAssociations
* @see AWS API Documentation
*/
@Override
public CompletableFuture listExtensionAssociations(
ListExtensionAssociationsRequest listExtensionAssociationsRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listExtensionAssociationsRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listExtensionAssociationsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppConfig");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListExtensionAssociations");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListExtensionAssociationsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListExtensionAssociations").withProtocolMetadata(protocolMetadata)
.withMarshaller(new ListExtensionAssociationsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(listExtensionAssociationsRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Lists all custom and Amazon Web Services authored AppConfig extensions in the account. For more information about
* extensions, see Working with
* AppConfig extensions in the AppConfig User Guide.
*
*
* @param listExtensionsRequest
* @return A Java Future containing the result of the ListExtensions operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InternalServerException There was an internal failure in the AppConfig service.
* - BadRequestException The input fails to satisfy the constraints specified by an Amazon Web Services
* 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.
* - AppConfigException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AppConfigAsyncClient.ListExtensions
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture listExtensions(ListExtensionsRequest listExtensionsRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listExtensionsRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listExtensionsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppConfig");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListExtensions");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListExtensionsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListExtensions").withProtocolMetadata(protocolMetadata)
.withMarshaller(new ListExtensionsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(listExtensionsRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Lists configurations stored in the AppConfig hosted configuration store by version.
*
*
* @param listHostedConfigurationVersionsRequest
* @return A Java Future containing the result of the ListHostedConfigurationVersions operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - BadRequestException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - ResourceNotFoundException The requested resource could not be found.
* - InternalServerException There was an internal failure in the AppConfig 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.
* - AppConfigException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AppConfigAsyncClient.ListHostedConfigurationVersions
* @see AWS API Documentation
*/
@Override
public CompletableFuture listHostedConfigurationVersions(
ListHostedConfigurationVersionsRequest listHostedConfigurationVersionsRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listHostedConfigurationVersionsRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
listHostedConfigurationVersionsRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppConfig");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListHostedConfigurationVersions");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListHostedConfigurationVersionsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListHostedConfigurationVersions").withProtocolMetadata(protocolMetadata)
.withMarshaller(new ListHostedConfigurationVersionsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(listHostedConfigurationVersionsRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Retrieves the list of key-value tags assigned to the resource.
*
*
* @param listTagsForResourceRequest
* @return A Java Future containing the result of the ListTagsForResource operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException The requested resource could not be found.
* - BadRequestException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - InternalServerException There was an internal failure in the AppConfig 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.
* - AppConfigException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AppConfigAsyncClient.ListTagsForResource
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture listTagsForResource(
ListTagsForResourceRequest listTagsForResourceRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listTagsForResourceRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listTagsForResourceRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppConfig");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListTagsForResource");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListTagsForResourceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListTagsForResource").withProtocolMetadata(protocolMetadata)
.withMarshaller(new ListTagsForResourceRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(listTagsForResourceRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Starts a deployment.
*
*
* @param startDeploymentRequest
* @return A Java Future containing the result of the StartDeployment operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - BadRequestException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - ResourceNotFoundException The requested resource could not be found.
* - ConflictException The request could not be processed because of conflict in the current state of the
* resource.
* - InternalServerException There was an internal failure in the AppConfig 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.
* - AppConfigException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AppConfigAsyncClient.StartDeployment
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture startDeployment(StartDeploymentRequest startDeploymentRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(startDeploymentRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, startDeploymentRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppConfig");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StartDeployment");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, StartDeploymentResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("StartDeployment").withProtocolMetadata(protocolMetadata)
.withMarshaller(new StartDeploymentRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(startDeploymentRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Stops a deployment. This API action works only on deployments that have a status of DEPLOYING
. This
* action moves the deployment to a status of ROLLED_BACK
.
*
*
* @param stopDeploymentRequest
* @return A Java Future containing the result of the StopDeployment operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException The requested resource could not be found.
* - InternalServerException There was an internal failure in the AppConfig service.
* - BadRequestException The input fails to satisfy the constraints specified by an Amazon Web Services
* 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.
* - AppConfigException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AppConfigAsyncClient.StopDeployment
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture stopDeployment(StopDeploymentRequest stopDeploymentRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(stopDeploymentRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, stopDeploymentRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppConfig");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StopDeployment");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, StopDeploymentResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("StopDeployment").withProtocolMetadata(protocolMetadata)
.withMarshaller(new StopDeploymentRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(stopDeploymentRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Assigns metadata to an AppConfig resource. Tags help organize and categorize your AppConfig resources. Each tag
* consists of a key and an optional value, both of which you define. You can specify a maximum of 50 tags for a
* resource.
*
*
* @param tagResourceRequest
* @return A Java Future containing the result of the TagResource operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException The requested resource could not be found.
* - BadRequestException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - InternalServerException There was an internal failure in the AppConfig 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.
* - AppConfigException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AppConfigAsyncClient.TagResource
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture tagResource(TagResourceRequest tagResourceRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(tagResourceRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, tagResourceRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppConfig");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "TagResource");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
TagResourceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("TagResource").withProtocolMetadata(protocolMetadata)
.withMarshaller(new TagResourceRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(tagResourceRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deletes a tag key and value from an AppConfig resource.
*
*
* @param untagResourceRequest
* @return A Java Future containing the result of the UntagResource operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException The requested resource could not be found.
* - BadRequestException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - InternalServerException There was an internal failure in the AppConfig 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.
* - AppConfigException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AppConfigAsyncClient.UntagResource
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture untagResource(UntagResourceRequest untagResourceRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(untagResourceRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, untagResourceRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppConfig");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UntagResource");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
UntagResourceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams