software.amazon.awssdk.services.elasticloadbalancingv2.DefaultElasticLoadBalancingV2AsyncClient Maven / Gradle / Ivy
/*
* Copyright 2014-2019 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.elasticloadbalancingv2;
import java.util.concurrent.CompletableFuture;
import java.util.function.Consumer;
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.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.awscore.client.handler.AwsAsyncClientHandler;
import software.amazon.awssdk.awscore.exception.AwsServiceException;
import software.amazon.awssdk.core.ApiName;
import software.amazon.awssdk.core.client.config.SdkClientConfiguration;
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.util.VersionInfo;
import software.amazon.awssdk.protocols.core.ExceptionMetadata;
import software.amazon.awssdk.protocols.query.AwsQueryProtocolFactory;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.AddListenerCertificatesRequest;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.AddListenerCertificatesResponse;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.AddTagsRequest;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.AddTagsResponse;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.AllocationIdNotFoundException;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.AvailabilityZoneNotSupportedException;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.CertificateNotFoundException;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.CreateListenerRequest;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.CreateListenerResponse;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.CreateLoadBalancerRequest;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.CreateLoadBalancerResponse;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.CreateRuleRequest;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.CreateRuleResponse;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.CreateTargetGroupRequest;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.CreateTargetGroupResponse;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.DeleteListenerRequest;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.DeleteListenerResponse;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.DeleteLoadBalancerRequest;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.DeleteLoadBalancerResponse;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.DeleteRuleRequest;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.DeleteRuleResponse;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.DeleteTargetGroupRequest;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.DeleteTargetGroupResponse;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.DeregisterTargetsRequest;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.DeregisterTargetsResponse;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.DescribeAccountLimitsRequest;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.DescribeAccountLimitsResponse;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.DescribeListenerCertificatesRequest;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.DescribeListenerCertificatesResponse;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.DescribeListenersRequest;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.DescribeListenersResponse;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.DescribeLoadBalancerAttributesRequest;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.DescribeLoadBalancerAttributesResponse;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.DescribeLoadBalancersRequest;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.DescribeLoadBalancersResponse;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.DescribeRulesRequest;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.DescribeRulesResponse;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.DescribeSslPoliciesRequest;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.DescribeSslPoliciesResponse;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.DescribeTagsRequest;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.DescribeTagsResponse;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.DescribeTargetGroupAttributesRequest;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.DescribeTargetGroupAttributesResponse;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.DescribeTargetGroupsRequest;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.DescribeTargetGroupsResponse;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.DescribeTargetHealthRequest;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.DescribeTargetHealthResponse;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.DuplicateListenerException;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.DuplicateLoadBalancerNameException;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.DuplicateTagKeysException;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.DuplicateTargetGroupNameException;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.ElasticLoadBalancingV2Exception;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.ElasticLoadBalancingV2Request;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.HealthUnavailableException;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.IncompatibleProtocolsException;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.InvalidConfigurationRequestException;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.InvalidLoadBalancerActionException;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.InvalidSchemeException;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.InvalidSecurityGroupException;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.InvalidSubnetException;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.InvalidTargetException;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.ListenerNotFoundException;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.LoadBalancerNotFoundException;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.ModifyListenerRequest;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.ModifyListenerResponse;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.ModifyLoadBalancerAttributesRequest;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.ModifyLoadBalancerAttributesResponse;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.ModifyRuleRequest;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.ModifyRuleResponse;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.ModifyTargetGroupAttributesRequest;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.ModifyTargetGroupAttributesResponse;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.ModifyTargetGroupRequest;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.ModifyTargetGroupResponse;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.OperationNotPermittedException;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.PriorityInUseException;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.RegisterTargetsRequest;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.RegisterTargetsResponse;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.RemoveListenerCertificatesRequest;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.RemoveListenerCertificatesResponse;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.RemoveTagsRequest;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.RemoveTagsResponse;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.ResourceInUseException;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.RuleNotFoundException;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.SetIpAddressTypeRequest;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.SetIpAddressTypeResponse;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.SetRulePrioritiesRequest;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.SetRulePrioritiesResponse;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.SetSecurityGroupsRequest;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.SetSecurityGroupsResponse;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.SetSubnetsRequest;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.SetSubnetsResponse;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.SslPolicyNotFoundException;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.SubnetNotFoundException;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.TargetGroupAssociationLimitException;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.TargetGroupNotFoundException;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.TooManyActionsException;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.TooManyCertificatesException;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.TooManyListenersException;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.TooManyLoadBalancersException;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.TooManyRegistrationsForTargetIdException;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.TooManyRulesException;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.TooManyTagsException;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.TooManyTargetGroupsException;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.TooManyTargetsException;
import software.amazon.awssdk.services.elasticloadbalancingv2.model.UnsupportedProtocolException;
import software.amazon.awssdk.services.elasticloadbalancingv2.paginators.DescribeListenersPublisher;
import software.amazon.awssdk.services.elasticloadbalancingv2.paginators.DescribeLoadBalancersPublisher;
import software.amazon.awssdk.services.elasticloadbalancingv2.paginators.DescribeTargetGroupsPublisher;
import software.amazon.awssdk.services.elasticloadbalancingv2.transform.AddListenerCertificatesRequestMarshaller;
import software.amazon.awssdk.services.elasticloadbalancingv2.transform.AddTagsRequestMarshaller;
import software.amazon.awssdk.services.elasticloadbalancingv2.transform.CreateListenerRequestMarshaller;
import software.amazon.awssdk.services.elasticloadbalancingv2.transform.CreateLoadBalancerRequestMarshaller;
import software.amazon.awssdk.services.elasticloadbalancingv2.transform.CreateRuleRequestMarshaller;
import software.amazon.awssdk.services.elasticloadbalancingv2.transform.CreateTargetGroupRequestMarshaller;
import software.amazon.awssdk.services.elasticloadbalancingv2.transform.DeleteListenerRequestMarshaller;
import software.amazon.awssdk.services.elasticloadbalancingv2.transform.DeleteLoadBalancerRequestMarshaller;
import software.amazon.awssdk.services.elasticloadbalancingv2.transform.DeleteRuleRequestMarshaller;
import software.amazon.awssdk.services.elasticloadbalancingv2.transform.DeleteTargetGroupRequestMarshaller;
import software.amazon.awssdk.services.elasticloadbalancingv2.transform.DeregisterTargetsRequestMarshaller;
import software.amazon.awssdk.services.elasticloadbalancingv2.transform.DescribeAccountLimitsRequestMarshaller;
import software.amazon.awssdk.services.elasticloadbalancingv2.transform.DescribeListenerCertificatesRequestMarshaller;
import software.amazon.awssdk.services.elasticloadbalancingv2.transform.DescribeListenersRequestMarshaller;
import software.amazon.awssdk.services.elasticloadbalancingv2.transform.DescribeLoadBalancerAttributesRequestMarshaller;
import software.amazon.awssdk.services.elasticloadbalancingv2.transform.DescribeLoadBalancersRequestMarshaller;
import software.amazon.awssdk.services.elasticloadbalancingv2.transform.DescribeRulesRequestMarshaller;
import software.amazon.awssdk.services.elasticloadbalancingv2.transform.DescribeSslPoliciesRequestMarshaller;
import software.amazon.awssdk.services.elasticloadbalancingv2.transform.DescribeTagsRequestMarshaller;
import software.amazon.awssdk.services.elasticloadbalancingv2.transform.DescribeTargetGroupAttributesRequestMarshaller;
import software.amazon.awssdk.services.elasticloadbalancingv2.transform.DescribeTargetGroupsRequestMarshaller;
import software.amazon.awssdk.services.elasticloadbalancingv2.transform.DescribeTargetHealthRequestMarshaller;
import software.amazon.awssdk.services.elasticloadbalancingv2.transform.ModifyListenerRequestMarshaller;
import software.amazon.awssdk.services.elasticloadbalancingv2.transform.ModifyLoadBalancerAttributesRequestMarshaller;
import software.amazon.awssdk.services.elasticloadbalancingv2.transform.ModifyRuleRequestMarshaller;
import software.amazon.awssdk.services.elasticloadbalancingv2.transform.ModifyTargetGroupAttributesRequestMarshaller;
import software.amazon.awssdk.services.elasticloadbalancingv2.transform.ModifyTargetGroupRequestMarshaller;
import software.amazon.awssdk.services.elasticloadbalancingv2.transform.RegisterTargetsRequestMarshaller;
import software.amazon.awssdk.services.elasticloadbalancingv2.transform.RemoveListenerCertificatesRequestMarshaller;
import software.amazon.awssdk.services.elasticloadbalancingv2.transform.RemoveTagsRequestMarshaller;
import software.amazon.awssdk.services.elasticloadbalancingv2.transform.SetIpAddressTypeRequestMarshaller;
import software.amazon.awssdk.services.elasticloadbalancingv2.transform.SetRulePrioritiesRequestMarshaller;
import software.amazon.awssdk.services.elasticloadbalancingv2.transform.SetSecurityGroupsRequestMarshaller;
import software.amazon.awssdk.services.elasticloadbalancingv2.transform.SetSubnetsRequestMarshaller;
import software.amazon.awssdk.utils.CompletableFutureUtils;
/**
* Internal implementation of {@link ElasticLoadBalancingV2AsyncClient}.
*
* @see ElasticLoadBalancingV2AsyncClient#builder()
*/
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
final class DefaultElasticLoadBalancingV2AsyncClient implements ElasticLoadBalancingV2AsyncClient {
private static final Logger log = LoggerFactory.getLogger(DefaultElasticLoadBalancingV2AsyncClient.class);
private final AsyncClientHandler clientHandler;
private final AwsQueryProtocolFactory protocolFactory;
private final SdkClientConfiguration clientConfiguration;
protected DefaultElasticLoadBalancingV2AsyncClient(SdkClientConfiguration clientConfiguration) {
this.clientHandler = new AwsAsyncClientHandler(clientConfiguration);
this.clientConfiguration = clientConfiguration;
this.protocolFactory = init();
}
@Override
public final String serviceName() {
return SERVICE_NAME;
}
/**
*
* Adds the specified SSL server certificate to the certificate list for the specified HTTPS listener.
*
*
* If the certificate in already in the certificate list, the call is successful but the certificate is not added
* again.
*
*
* To get the certificate list for a listener, use DescribeListenerCertificates. To remove certificates from
* the certificate list for a listener, use RemoveListenerCertificates. To replace the default certificate
* for a listener, use ModifyListener.
*
*
* For more information, see SSL Certificates in the Application Load Balancers Guide.
*
*
* @param addListenerCertificatesRequest
* @return A Java Future containing the result of the AddListenerCertificates operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ListenerNotFoundException The specified listener does not exist.
* - TooManyCertificatesException You've reached the limit on the number of certificates per load
* balancer.
* - CertificateNotFoundException The specified certificate does not exist.
* - 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.
* - ElasticLoadBalancingV2Exception Base class for all service exceptions. Unknown exceptions will be
* thrown as an instance of this type.
*
* @sample ElasticLoadBalancingV2AsyncClient.AddListenerCertificates
* @see AWS API Documentation
*/
@Override
public CompletableFuture addListenerCertificates(
AddListenerCertificatesRequest addListenerCertificatesRequest) {
try {
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(AddListenerCertificatesResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("AddListenerCertificates")
.withMarshaller(new AddListenerCertificatesRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(addListenerCertificatesRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Adds the specified tags to the specified Elastic Load Balancing resource. You can tag your Application Load
* Balancers, Network Load Balancers, and your target groups.
*
*
* Each tag consists of a key and an optional value. If a resource already has a tag with the same key,
* AddTags
updates its value.
*
*
* To list the current tags for your resources, use DescribeTags. To remove tags from your resources, use
* RemoveTags.
*
*
* @param addTagsRequest
* @return A Java Future containing the result of the AddTags operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - DuplicateTagKeysException A tag key was specified more than once.
* - TooManyTagsException You've reached the limit on the number of tags per load balancer.
* - LoadBalancerNotFoundException The specified load balancer does not exist.
* - TargetGroupNotFoundException The specified target group does not exist.
* - 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.
* - ElasticLoadBalancingV2Exception Base class for all service exceptions. Unknown exceptions will be
* thrown as an instance of this type.
*
* @sample ElasticLoadBalancingV2AsyncClient.AddTags
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture addTags(AddTagsRequest addTagsRequest) {
try {
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(AddTagsResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams().withOperationName("AddTags")
.withMarshaller(new AddTagsRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(addTagsRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Creates a listener for the specified Application Load Balancer or Network Load Balancer.
*
*
* To update a listener, use ModifyListener. When you are finished with a listener, you can delete it using
* DeleteListener. If you are finished with both the listener and the load balancer, you can delete them both
* using DeleteLoadBalancer.
*
*
* This operation is idempotent, which means that it completes at most one time. If you attempt to create multiple
* listeners with the same settings, each call succeeds.
*
*
* For more information, see Listeners
* for Your Application Load Balancers in the Application Load Balancers Guide and Listeners for
* Your Network Load Balancers in the Network Load Balancers Guide.
*
*
* @param createListenerRequest
* @return A Java Future containing the result of the CreateListener operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - DuplicateListenerException A listener with the specified port already exists.
* - TooManyListenersException You've reached the limit on the number of listeners per load balancer.
* - TooManyCertificatesException You've reached the limit on the number of certificates per load
* balancer.
* - LoadBalancerNotFoundException The specified load balancer does not exist.
* - TargetGroupNotFoundException The specified target group does not exist.
* - TargetGroupAssociationLimitException You've reached the limit on the number of load balancers per
* target group.
* - InvalidConfigurationRequestException The requested configuration is not valid.
* - IncompatibleProtocolsException The specified configuration is not valid with this protocol.
* - SslPolicyNotFoundException The specified SSL policy does not exist.
* - CertificateNotFoundException The specified certificate does not exist.
* - UnsupportedProtocolException The specified protocol is not supported.
* - TooManyRegistrationsForTargetIdException You've reached the limit on the number of times a target can
* be registered with a load balancer.
* - TooManyTargetsException You've reached the limit on the number of targets.
* - TooManyActionsException You've reached the limit on the number of actions per rule.
* - InvalidLoadBalancerActionException The requested action is not valid.
* - 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.
* - ElasticLoadBalancingV2Exception Base class for all service exceptions. Unknown exceptions will be
* thrown as an instance of this type.
*
* @sample ElasticLoadBalancingV2AsyncClient.CreateListener
* @see AWS API Documentation
*/
@Override
public CompletableFuture createListener(CreateListenerRequest createListenerRequest) {
try {
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(CreateListenerResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateListener")
.withMarshaller(new CreateListenerRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(createListenerRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Creates an Application Load Balancer or a Network Load Balancer.
*
*
* When you create a load balancer, you can specify security groups, public subnets, IP address type, and tags.
* Otherwise, you could do so later using SetSecurityGroups, SetSubnets, SetIpAddressType, and
* AddTags.
*
*
* To create listeners for your load balancer, use CreateListener. To describe your current load balancers,
* see DescribeLoadBalancers. When you are finished with a load balancer, you can delete it using
* DeleteLoadBalancer.
*
*
* For limit information, see Limits for
* Your Application Load Balancer in the Application Load Balancers Guide and Limits for Your
* Network Load Balancer in the Network Load Balancers Guide.
*
*
* This operation is idempotent, which means that it completes at most one time. If you attempt to create multiple
* load balancers with the same settings, each call succeeds.
*
*
* For more information, see Application Load Balancers in the Application Load Balancers Guide and Network Load
* Balancers in the Network Load Balancers Guide.
*
*
* @param createLoadBalancerRequest
* @return A Java Future containing the result of the CreateLoadBalancer operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - DuplicateLoadBalancerNameException A load balancer with the specified name already exists.
* - TooManyLoadBalancersException You've reached the limit on the number of load balancers for your AWS
* account.
* - InvalidConfigurationRequestException The requested configuration is not valid.
* - SubnetNotFoundException The specified subnet does not exist.
* - InvalidSubnetException The specified subnet is out of available addresses.
* - InvalidSecurityGroupException The specified security group does not exist.
* - InvalidSchemeException The requested scheme is not valid.
* - TooManyTagsException You've reached the limit on the number of tags per load balancer.
* - DuplicateTagKeysException A tag key was specified more than once.
* - ResourceInUseException A specified resource is in use.
* - AllocationIdNotFoundException The specified allocation ID does not exist.
* - AvailabilityZoneNotSupportedException The specified Availability Zone is not supported.
* - OperationNotPermittedException This operation is not allowed.
* - 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.
* - ElasticLoadBalancingV2Exception Base class for all service exceptions. Unknown exceptions will be
* thrown as an instance of this type.
*
* @sample ElasticLoadBalancingV2AsyncClient.CreateLoadBalancer
* @see AWS API Documentation
*/
@Override
public CompletableFuture createLoadBalancer(CreateLoadBalancerRequest createLoadBalancerRequest) {
try {
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(CreateLoadBalancerResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateLoadBalancer")
.withMarshaller(new CreateLoadBalancerRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(createLoadBalancerRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Creates a rule for the specified listener. The listener must be associated with an Application Load Balancer.
*
*
* Rules are evaluated in priority order, from the lowest value to the highest value. When the conditions for a rule
* are met, its actions are performed. If the conditions for no rules are met, the actions for the default rule are
* performed. For more information, see Listener Rules in the Application Load Balancers Guide.
*
*
* To view your current rules, use DescribeRules. To update a rule, use ModifyRule. To set the
* priorities of your rules, use SetRulePriorities. To delete a rule, use DeleteRule.
*
*
* @param createRuleRequest
* @return A Java Future containing the result of the CreateRule operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - PriorityInUseException The specified priority is in use.
* - TooManyTargetGroupsException You've reached the limit on the number of target groups for your AWS
* account.
* - TooManyRulesException You've reached the limit on the number of rules per load balancer.
* - TargetGroupAssociationLimitException You've reached the limit on the number of load balancers per
* target group.
* - IncompatibleProtocolsException The specified configuration is not valid with this protocol.
* - ListenerNotFoundException The specified listener does not exist.
* - TargetGroupNotFoundException The specified target group does not exist.
* - InvalidConfigurationRequestException The requested configuration is not valid.
* - TooManyRegistrationsForTargetIdException You've reached the limit on the number of times a target can
* be registered with a load balancer.
* - TooManyTargetsException You've reached the limit on the number of targets.
* - UnsupportedProtocolException The specified protocol is not supported.
* - TooManyActionsException You've reached the limit on the number of actions per rule.
* - InvalidLoadBalancerActionException The requested action is not valid.
* - 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.
* - ElasticLoadBalancingV2Exception Base class for all service exceptions. Unknown exceptions will be
* thrown as an instance of this type.
*
* @sample ElasticLoadBalancingV2AsyncClient.CreateRule
* @see AWS API Documentation
*/
@Override
public CompletableFuture createRule(CreateRuleRequest createRuleRequest) {
try {
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(CreateRuleResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams().withOperationName("CreateRule")
.withMarshaller(new CreateRuleRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(createRuleRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Creates a target group.
*
*
* To register targets with the target group, use RegisterTargets. To update the health check settings for
* the target group, use ModifyTargetGroup. To monitor the health of targets in the target group, use
* DescribeTargetHealth.
*
*
* To route traffic to the targets in a target group, specify the target group in an action using
* CreateListener or CreateRule.
*
*
* To delete a target group, use DeleteTargetGroup.
*
*
* This operation is idempotent, which means that it completes at most one time. If you attempt to create multiple
* target groups with the same settings, each call succeeds.
*
*
* For more information, see Target Groups for Your Application Load Balancers in the Application Load Balancers Guide or Target
* Groups for Your Network Load Balancers in the Network Load Balancers Guide.
*
*
* @param createTargetGroupRequest
* @return A Java Future containing the result of the CreateTargetGroup operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - DuplicateTargetGroupNameException A target group with the specified name already exists.
* - TooManyTargetGroupsException You've reached the limit on the number of target groups for your AWS
* account.
* - InvalidConfigurationRequestException The requested configuration is not valid.
* - 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.
* - ElasticLoadBalancingV2Exception Base class for all service exceptions. Unknown exceptions will be
* thrown as an instance of this type.
*
* @sample ElasticLoadBalancingV2AsyncClient.CreateTargetGroup
* @see AWS API Documentation
*/
@Override
public CompletableFuture createTargetGroup(CreateTargetGroupRequest createTargetGroupRequest) {
try {
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(CreateTargetGroupResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateTargetGroup")
.withMarshaller(new CreateTargetGroupRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(createTargetGroupRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deletes the specified listener.
*
*
* Alternatively, your listener is deleted when you delete the load balancer to which it is attached, using
* DeleteLoadBalancer.
*
*
* @param deleteListenerRequest
* @return A Java Future containing the result of the DeleteListener operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ListenerNotFoundException The specified listener does not exist.
* - 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.
* - ElasticLoadBalancingV2Exception Base class for all service exceptions. Unknown exceptions will be
* thrown as an instance of this type.
*
* @sample ElasticLoadBalancingV2AsyncClient.DeleteListener
* @see AWS API Documentation
*/
@Override
public CompletableFuture deleteListener(DeleteListenerRequest deleteListenerRequest) {
try {
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(DeleteListenerResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteListener")
.withMarshaller(new DeleteListenerRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(deleteListenerRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deletes the specified Application Load Balancer or Network Load Balancer and its attached listeners.
*
*
* You can't delete a load balancer if deletion protection is enabled. If the load balancer does not exist or has
* already been deleted, the call succeeds.
*
*
* Deleting a load balancer does not affect its registered targets. For example, your EC2 instances continue to run
* and are still registered to their target groups. If you no longer need these EC2 instances, you can stop or
* terminate them.
*
*
* @param deleteLoadBalancerRequest
* @return A Java Future containing the result of the DeleteLoadBalancer operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - LoadBalancerNotFoundException The specified load balancer does not exist.
* - OperationNotPermittedException This operation is not allowed.
* - ResourceInUseException A specified resource is in use.
* - 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.
* - ElasticLoadBalancingV2Exception Base class for all service exceptions. Unknown exceptions will be
* thrown as an instance of this type.
*
* @sample ElasticLoadBalancingV2AsyncClient.DeleteLoadBalancer
* @see AWS API Documentation
*/
@Override
public CompletableFuture deleteLoadBalancer(DeleteLoadBalancerRequest deleteLoadBalancerRequest) {
try {
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(DeleteLoadBalancerResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteLoadBalancer")
.withMarshaller(new DeleteLoadBalancerRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(deleteLoadBalancerRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deletes the specified rule.
*
*
* @param deleteRuleRequest
* @return A Java Future containing the result of the DeleteRule operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - RuleNotFoundException The specified rule does not exist.
* - OperationNotPermittedException This operation is not allowed.
* - 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.
* - ElasticLoadBalancingV2Exception Base class for all service exceptions. Unknown exceptions will be
* thrown as an instance of this type.
*
* @sample ElasticLoadBalancingV2AsyncClient.DeleteRule
* @see AWS API Documentation
*/
@Override
public CompletableFuture deleteRule(DeleteRuleRequest deleteRuleRequest) {
try {
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(DeleteRuleResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams().withOperationName("DeleteRule")
.withMarshaller(new DeleteRuleRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(deleteRuleRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deletes the specified target group.
*
*
* You can delete a target group if it is not referenced by any actions. Deleting a target group also deletes any
* associated health checks.
*
*
* @param deleteTargetGroupRequest
* @return A Java Future containing the result of the DeleteTargetGroup operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceInUseException A specified resource is in use.
* - 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.
* - ElasticLoadBalancingV2Exception Base class for all service exceptions. Unknown exceptions will be
* thrown as an instance of this type.
*
* @sample ElasticLoadBalancingV2AsyncClient.DeleteTargetGroup
* @see AWS API Documentation
*/
@Override
public CompletableFuture deleteTargetGroup(DeleteTargetGroupRequest deleteTargetGroupRequest) {
try {
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(DeleteTargetGroupResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteTargetGroup")
.withMarshaller(new DeleteTargetGroupRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(deleteTargetGroupRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deregisters the specified targets from the specified target group. After the targets are deregistered, they no
* longer receive traffic from the load balancer.
*
*
* @param deregisterTargetsRequest
* @return A Java Future containing the result of the DeregisterTargets operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - TargetGroupNotFoundException The specified target group does not exist.
* - InvalidTargetException The specified target does not exist, is not in the same VPC as the target
* group, or has an unsupported instance type.
* - 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.
* - ElasticLoadBalancingV2Exception Base class for all service exceptions. Unknown exceptions will be
* thrown as an instance of this type.
*
* @sample ElasticLoadBalancingV2AsyncClient.DeregisterTargets
* @see AWS API Documentation
*/
@Override
public CompletableFuture deregisterTargets(DeregisterTargetsRequest deregisterTargetsRequest) {
try {
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(DeregisterTargetsResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeregisterTargets")
.withMarshaller(new DeregisterTargetsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(deregisterTargetsRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Describes the current Elastic Load Balancing resource limits for your AWS account.
*
*
* For more information, see Limits for
* Your Application Load Balancers in the Application Load Balancer Guide or Limits for Your
* Network Load Balancers in the Network Load Balancers Guide.
*
*
* @param describeAccountLimitsRequest
* @return A Java Future containing the result of the DescribeAccountLimits operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - 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.
* - ElasticLoadBalancingV2Exception Base class for all service exceptions. Unknown exceptions will be
* thrown as an instance of this type.
*
* @sample ElasticLoadBalancingV2AsyncClient.DescribeAccountLimits
* @see AWS API Documentation
*/
@Override
public CompletableFuture describeAccountLimits(
DescribeAccountLimitsRequest describeAccountLimitsRequest) {
try {
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(DescribeAccountLimitsResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeAccountLimits")
.withMarshaller(new DescribeAccountLimitsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(describeAccountLimitsRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Describes the default certificate and the certificate list for the specified HTTPS listener.
*
*
* If the default certificate is also in the certificate list, it appears twice in the results (once with
* IsDefault
set to true and once with IsDefault
set to false).
*
*
* For more information, see SSL Certificates in the Application Load Balancers Guide.
*
*
* @param describeListenerCertificatesRequest
* @return A Java Future containing the result of the DescribeListenerCertificates operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ListenerNotFoundException The specified listener does not exist.
* - 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.
* - ElasticLoadBalancingV2Exception Base class for all service exceptions. Unknown exceptions will be
* thrown as an instance of this type.
*
* @sample ElasticLoadBalancingV2AsyncClient.DescribeListenerCertificates
* @see AWS API Documentation
*/
@Override
public CompletableFuture describeListenerCertificates(
DescribeListenerCertificatesRequest describeListenerCertificatesRequest) {
try {
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(DescribeListenerCertificatesResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeListenerCertificates")
.withMarshaller(new DescribeListenerCertificatesRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(describeListenerCertificatesRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Describes the specified listeners or the listeners for the specified Application Load Balancer or Network Load
* Balancer. You must specify either a load balancer or one or more listeners.
*
*
* For an HTTPS or TLS listener, the output includes the default certificate for the listener. To describe the
* certificate list for the listener, use DescribeListenerCertificates.
*
*
* @param describeListenersRequest
* @return A Java Future containing the result of the DescribeListeners operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ListenerNotFoundException The specified listener does not exist.
* - LoadBalancerNotFoundException The specified load balancer does not exist.
* - UnsupportedProtocolException The specified protocol is not supported.
* - 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.
* - ElasticLoadBalancingV2Exception Base class for all service exceptions. Unknown exceptions will be
* thrown as an instance of this type.
*
* @sample ElasticLoadBalancingV2AsyncClient.DescribeListeners
* @see AWS API Documentation
*/
@Override
public CompletableFuture describeListeners(DescribeListenersRequest describeListenersRequest) {
try {
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(DescribeListenersResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeListeners")
.withMarshaller(new DescribeListenersRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(describeListenersRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Describes the specified listeners or the listeners for the specified Application Load Balancer or Network Load
* Balancer. You must specify either a load balancer or one or more listeners.
*
*
* For an HTTPS or TLS listener, the output includes the default certificate for the listener. To describe the
* certificate list for the listener, use DescribeListenerCertificates.
*
*
*
* This is a variant of
* {@link #describeListeners(software.amazon.awssdk.services.elasticloadbalancingv2.model.DescribeListenersRequest)}
* operation. The return type is a custom publisher that can be subscribed to request a stream of response pages.
* SDK will internally handle making service calls for you.
*
*
* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet
* and so there is no guarantee that the request is valid. If there are errors in your request, you will see the
* failures only after you start streaming the data. The subscribe method should be called as a request to start
* streaming data. For more info, see
* {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe
* method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the
* starting request.
*
*
*
* The following are few ways to use the response class:
*
* 1) Using the subscribe helper method
*
*
* {@code
* software.amazon.awssdk.services.elasticloadbalancingv2.paginators.DescribeListenersPublisher publisher = client.describeListenersPaginator(request);
* CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
* future.get();
* }
*
*
* 2) Using a custom subscriber
*
*
* {@code
* software.amazon.awssdk.services.elasticloadbalancingv2.paginators.DescribeListenersPublisher publisher = client.describeListenersPaginator(request);
* publisher.subscribe(new Subscriber() {
*
* public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
*
*
* public void onNext(software.amazon.awssdk.services.elasticloadbalancingv2.model.DescribeListenersResponse response) { //... };
* });}
*
*
* As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.
*
* Note: If you prefer to have control on service calls, use the
* {@link #describeListeners(software.amazon.awssdk.services.elasticloadbalancingv2.model.DescribeListenersRequest)}
* operation.
*
*
* @param describeListenersRequest
* @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ListenerNotFoundException The specified listener does not exist.
* - LoadBalancerNotFoundException The specified load balancer does not exist.
* - UnsupportedProtocolException The specified protocol is not supported.
* - 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.
* - ElasticLoadBalancingV2Exception Base class for all service exceptions. Unknown exceptions will be
* thrown as an instance of this type.
*
* @sample ElasticLoadBalancingV2AsyncClient.DescribeListeners
* @see AWS API Documentation
*/
public DescribeListenersPublisher describeListenersPaginator(DescribeListenersRequest describeListenersRequest) {
return new DescribeListenersPublisher(this, applyPaginatorUserAgent(describeListenersRequest));
}
/**
*
* Describes the attributes for the specified Application Load Balancer or Network Load Balancer.
*
*
* For more information, see Load Balancer Attributes in the Application Load Balancers Guide or Load Balancer Attributes in the Network Load Balancers Guide.
*
*
* @param describeLoadBalancerAttributesRequest
* @return A Java Future containing the result of the DescribeLoadBalancerAttributes operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - LoadBalancerNotFoundException The specified load balancer does not exist.
* - 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.
* - ElasticLoadBalancingV2Exception Base class for all service exceptions. Unknown exceptions will be
* thrown as an instance of this type.
*
* @sample ElasticLoadBalancingV2AsyncClient.DescribeLoadBalancerAttributes
* @see AWS API Documentation
*/
@Override
public CompletableFuture describeLoadBalancerAttributes(
DescribeLoadBalancerAttributesRequest describeLoadBalancerAttributesRequest) {
try {
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(DescribeLoadBalancerAttributesResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeLoadBalancerAttributes")
.withMarshaller(new DescribeLoadBalancerAttributesRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(describeLoadBalancerAttributesRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Describes the specified load balancers or all of your load balancers.
*
*
* To describe the listeners for a load balancer, use DescribeListeners. To describe the attributes for a
* load balancer, use DescribeLoadBalancerAttributes.
*
*
* @param describeLoadBalancersRequest
* @return A Java Future containing the result of the DescribeLoadBalancers operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - LoadBalancerNotFoundException The specified load balancer does not exist.
* - 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.
* - ElasticLoadBalancingV2Exception Base class for all service exceptions. Unknown exceptions will be
* thrown as an instance of this type.
*
* @sample ElasticLoadBalancingV2AsyncClient.DescribeLoadBalancers
* @see AWS API Documentation
*/
@Override
public CompletableFuture describeLoadBalancers(
DescribeLoadBalancersRequest describeLoadBalancersRequest) {
try {
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(DescribeLoadBalancersResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeLoadBalancers")
.withMarshaller(new DescribeLoadBalancersRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(describeLoadBalancersRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Describes the specified load balancers or all of your load balancers.
*
*
* To describe the listeners for a load balancer, use DescribeListeners. To describe the attributes for a
* load balancer, use DescribeLoadBalancerAttributes.
*
*
*
* This is a variant of
* {@link #describeLoadBalancers(software.amazon.awssdk.services.elasticloadbalancingv2.model.DescribeLoadBalancersRequest)}
* operation. The return type is a custom publisher that can be subscribed to request a stream of response pages.
* SDK will internally handle making service calls for you.
*
*
* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet
* and so there is no guarantee that the request is valid. If there are errors in your request, you will see the
* failures only after you start streaming the data. The subscribe method should be called as a request to start
* streaming data. For more info, see
* {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe
* method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the
* starting request.
*
*
*
* The following are few ways to use the response class:
*
* 1) Using the subscribe helper method
*
*
* {@code
* software.amazon.awssdk.services.elasticloadbalancingv2.paginators.DescribeLoadBalancersPublisher publisher = client.describeLoadBalancersPaginator(request);
* CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
* future.get();
* }
*
*
* 2) Using a custom subscriber
*
*
* {@code
* software.amazon.awssdk.services.elasticloadbalancingv2.paginators.DescribeLoadBalancersPublisher publisher = client.describeLoadBalancersPaginator(request);
* publisher.subscribe(new Subscriber() {
*
* public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
*
*
* public void onNext(software.amazon.awssdk.services.elasticloadbalancingv2.model.DescribeLoadBalancersResponse response) { //... };
* });}
*
*
* As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.
*
* Note: If you prefer to have control on service calls, use the
* {@link #describeLoadBalancers(software.amazon.awssdk.services.elasticloadbalancingv2.model.DescribeLoadBalancersRequest)}
* operation.
*
*
* @param describeLoadBalancersRequest
* @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - LoadBalancerNotFoundException The specified load balancer does not exist.
* - 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.
* - ElasticLoadBalancingV2Exception Base class for all service exceptions. Unknown exceptions will be
* thrown as an instance of this type.
*
* @sample ElasticLoadBalancingV2AsyncClient.DescribeLoadBalancers
* @see AWS API Documentation
*/
public DescribeLoadBalancersPublisher describeLoadBalancersPaginator(DescribeLoadBalancersRequest describeLoadBalancersRequest) {
return new DescribeLoadBalancersPublisher(this, applyPaginatorUserAgent(describeLoadBalancersRequest));
}
/**
*
* Describes the specified rules or the rules for the specified listener. You must specify either a listener or one
* or more rules.
*
*
* @param describeRulesRequest
* @return A Java Future containing the result of the DescribeRules operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ListenerNotFoundException The specified listener does not exist.
* - RuleNotFoundException The specified rule does not exist.
* - UnsupportedProtocolException The specified protocol is not supported.
* - 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.
* - ElasticLoadBalancingV2Exception Base class for all service exceptions. Unknown exceptions will be
* thrown as an instance of this type.
*
* @sample ElasticLoadBalancingV2AsyncClient.DescribeRules
* @see AWS API Documentation
*/
@Override
public CompletableFuture describeRules(DescribeRulesRequest describeRulesRequest) {
try {
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(DescribeRulesResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeRules")
.withMarshaller(new DescribeRulesRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(describeRulesRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Describes the specified policies or all policies used for SSL negotiation.
*
*
* For more information, see Security Policies in the Application Load Balancers Guide.
*
*
* @param describeSslPoliciesRequest
* @return A Java Future containing the result of the DescribeSSLPolicies operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - SslPolicyNotFoundException The specified SSL policy does not exist.
* - 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.
* - ElasticLoadBalancingV2Exception Base class for all service exceptions. Unknown exceptions will be
* thrown as an instance of this type.
*
* @sample ElasticLoadBalancingV2AsyncClient.DescribeSSLPolicies
* @see AWS API Documentation
*/
@Override
public CompletableFuture describeSSLPolicies(
DescribeSslPoliciesRequest describeSslPoliciesRequest) {
try {
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(DescribeSslPoliciesResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeSSLPolicies")
.withMarshaller(new DescribeSslPoliciesRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(describeSslPoliciesRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Describes the tags for the specified resources. You can describe the tags for one or more Application Load
* Balancers, Network Load Balancers, and target groups.
*
*
* @param describeTagsRequest
* @return A Java Future containing the result of the DescribeTags operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - LoadBalancerNotFoundException The specified load balancer does not exist.
* - TargetGroupNotFoundException The specified target group does not exist.
* - ListenerNotFoundException The specified listener does not exist.
* - RuleNotFoundException The specified rule does not exist.
* - 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.
* - ElasticLoadBalancingV2Exception Base class for all service exceptions. Unknown exceptions will be
* thrown as an instance of this type.
*
* @sample ElasticLoadBalancingV2AsyncClient.DescribeTags
* @see AWS API Documentation
*/
@Override
public CompletableFuture describeTags(DescribeTagsRequest describeTagsRequest) {
try {
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(DescribeTagsResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeTags").withMarshaller(new DescribeTagsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(describeTagsRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Describes the attributes for the specified target group.
*
*
* For more information, see Target Group Attributes in the Application Load Balancers Guide or Target Group Attributes in the Network Load Balancers Guide.
*
*
* @param describeTargetGroupAttributesRequest
* @return A Java Future containing the result of the DescribeTargetGroupAttributes operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - TargetGroupNotFoundException The specified target group does not exist.
* - 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.
* - ElasticLoadBalancingV2Exception Base class for all service exceptions. Unknown exceptions will be
* thrown as an instance of this type.
*
* @sample ElasticLoadBalancingV2AsyncClient.DescribeTargetGroupAttributes
* @see AWS API Documentation
*/
@Override
public CompletableFuture describeTargetGroupAttributes(
DescribeTargetGroupAttributesRequest describeTargetGroupAttributesRequest) {
try {
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(DescribeTargetGroupAttributesResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeTargetGroupAttributes")
.withMarshaller(new DescribeTargetGroupAttributesRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(describeTargetGroupAttributesRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Describes the specified target groups or all of your target groups. By default, all target groups are described.
* Alternatively, you can specify one of the following to filter the results: the ARN of the load balancer, the
* names of one or more target groups, or the ARNs of one or more target groups.
*
*
* To describe the targets for a target group, use DescribeTargetHealth. To describe the attributes of a
* target group, use DescribeTargetGroupAttributes.
*
*
* @param describeTargetGroupsRequest
* @return A Java Future containing the result of the DescribeTargetGroups operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - LoadBalancerNotFoundException The specified load balancer does not exist.
* - TargetGroupNotFoundException The specified target group does not exist.
* - 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.
* - ElasticLoadBalancingV2Exception Base class for all service exceptions. Unknown exceptions will be
* thrown as an instance of this type.
*
* @sample ElasticLoadBalancingV2AsyncClient.DescribeTargetGroups
* @see AWS API Documentation
*/
@Override
public CompletableFuture describeTargetGroups(
DescribeTargetGroupsRequest describeTargetGroupsRequest) {
try {
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(DescribeTargetGroupsResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeTargetGroups")
.withMarshaller(new DescribeTargetGroupsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(describeTargetGroupsRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Describes the specified target groups or all of your target groups. By default, all target groups are described.
* Alternatively, you can specify one of the following to filter the results: the ARN of the load balancer, the
* names of one or more target groups, or the ARNs of one or more target groups.
*
*
* To describe the targets for a target group, use DescribeTargetHealth. To describe the attributes of a
* target group, use DescribeTargetGroupAttributes.
*
*
*
* This is a variant of
* {@link #describeTargetGroups(software.amazon.awssdk.services.elasticloadbalancingv2.model.DescribeTargetGroupsRequest)}
* operation. The return type is a custom publisher that can be subscribed to request a stream of response pages.
* SDK will internally handle making service calls for you.
*
*
* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet
* and so there is no guarantee that the request is valid. If there are errors in your request, you will see the
* failures only after you start streaming the data. The subscribe method should be called as a request to start
* streaming data. For more info, see
* {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe
* method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the
* starting request.
*
*
*
* The following are few ways to use the response class:
*
* 1) Using the subscribe helper method
*
*
* {@code
* software.amazon.awssdk.services.elasticloadbalancingv2.paginators.DescribeTargetGroupsPublisher publisher = client.describeTargetGroupsPaginator(request);
* CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
* future.get();
* }
*
*
* 2) Using a custom subscriber
*
*
* {@code
* software.amazon.awssdk.services.elasticloadbalancingv2.paginators.DescribeTargetGroupsPublisher publisher = client.describeTargetGroupsPaginator(request);
* publisher.subscribe(new Subscriber() {
*
* public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
*
*
* public void onNext(software.amazon.awssdk.services.elasticloadbalancingv2.model.DescribeTargetGroupsResponse response) { //... };
* });}
*
*
* As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.
*
* Note: If you prefer to have control on service calls, use the
* {@link #describeTargetGroups(software.amazon.awssdk.services.elasticloadbalancingv2.model.DescribeTargetGroupsRequest)}
* operation.
*
*
* @param describeTargetGroupsRequest
* @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - LoadBalancerNotFoundException The specified load balancer does not exist.
* - TargetGroupNotFoundException The specified target group does not exist.
* - 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.
* - ElasticLoadBalancingV2Exception Base class for all service exceptions. Unknown exceptions will be
* thrown as an instance of this type.
*
* @sample ElasticLoadBalancingV2AsyncClient.DescribeTargetGroups
* @see AWS API Documentation
*/
public DescribeTargetGroupsPublisher describeTargetGroupsPaginator(DescribeTargetGroupsRequest describeTargetGroupsRequest) {
return new DescribeTargetGroupsPublisher(this, applyPaginatorUserAgent(describeTargetGroupsRequest));
}
/**
*
* Describes the health of the specified targets or all of your targets.
*
*
* @param describeTargetHealthRequest
* @return A Java Future containing the result of the DescribeTargetHealth operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InvalidTargetException The specified target does not exist, is not in the same VPC as the target
* group, or has an unsupported instance type.
* - TargetGroupNotFoundException The specified target group does not exist.
* - HealthUnavailableException The health of the specified targets could not be retrieved due to an
* internal error.
* - 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.
* - ElasticLoadBalancingV2Exception Base class for all service exceptions. Unknown exceptions will be
* thrown as an instance of this type.
*
* @sample ElasticLoadBalancingV2AsyncClient.DescribeTargetHealth
* @see AWS API Documentation
*/
@Override
public CompletableFuture describeTargetHealth(
DescribeTargetHealthRequest describeTargetHealthRequest) {
try {
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(DescribeTargetHealthResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeTargetHealth")
.withMarshaller(new DescribeTargetHealthRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(describeTargetHealthRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Modifies the specified properties of the specified listener.
*
*
* Any properties that you do not specify retain their current values. However, changing the protocol from HTTPS to
* HTTP, or from TLS to TCP, removes the security policy and default certificate properties. If you change the
* protocol from HTTP to HTTPS, or from TCP to TLS, you must add the security policy and default certificate
* properties.
*
*
* @param modifyListenerRequest
* @return A Java Future containing the result of the ModifyListener operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - DuplicateListenerException A listener with the specified port already exists.
* - TooManyListenersException You've reached the limit on the number of listeners per load balancer.
* - TooManyCertificatesException You've reached the limit on the number of certificates per load
* balancer.
* - ListenerNotFoundException The specified listener does not exist.
* - TargetGroupNotFoundException The specified target group does not exist.
* - TargetGroupAssociationLimitException You've reached the limit on the number of load balancers per
* target group.
* - IncompatibleProtocolsException The specified configuration is not valid with this protocol.
* - SslPolicyNotFoundException The specified SSL policy does not exist.
* - CertificateNotFoundException The specified certificate does not exist.
* - InvalidConfigurationRequestException The requested configuration is not valid.
* - UnsupportedProtocolException The specified protocol is not supported.
* - TooManyRegistrationsForTargetIdException You've reached the limit on the number of times a target can
* be registered with a load balancer.
* - TooManyTargetsException You've reached the limit on the number of targets.
* - TooManyActionsException You've reached the limit on the number of actions per rule.
* - InvalidLoadBalancerActionException The requested action is not valid.
* - 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.
* - ElasticLoadBalancingV2Exception Base class for all service exceptions. Unknown exceptions will be
* thrown as an instance of this type.
*
* @sample ElasticLoadBalancingV2AsyncClient.ModifyListener
* @see AWS API Documentation
*/
@Override
public CompletableFuture modifyListener(ModifyListenerRequest modifyListenerRequest) {
try {
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(ModifyListenerResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ModifyListener")
.withMarshaller(new ModifyListenerRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(modifyListenerRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Modifies the specified attributes of the specified Application Load Balancer or Network Load Balancer.
*
*
* If any of the specified attributes can't be modified as requested, the call fails. Any existing attributes that
* you do not modify retain their current values.
*
*
* @param modifyLoadBalancerAttributesRequest
* @return A Java Future containing the result of the ModifyLoadBalancerAttributes operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - LoadBalancerNotFoundException The specified load balancer does not exist.
* - InvalidConfigurationRequestException The requested configuration is not valid.
* - 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.
* - ElasticLoadBalancingV2Exception Base class for all service exceptions. Unknown exceptions will be
* thrown as an instance of this type.
*
* @sample ElasticLoadBalancingV2AsyncClient.ModifyLoadBalancerAttributes
* @see AWS API Documentation
*/
@Override
public CompletableFuture modifyLoadBalancerAttributes(
ModifyLoadBalancerAttributesRequest modifyLoadBalancerAttributesRequest) {
try {
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(ModifyLoadBalancerAttributesResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ModifyLoadBalancerAttributes")
.withMarshaller(new ModifyLoadBalancerAttributesRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(modifyLoadBalancerAttributesRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Modifies the specified rule.
*
*
* Any existing properties that you do not modify retain their current values.
*
*
* To modify the actions for the default rule, use ModifyListener.
*
*
* @param modifyRuleRequest
* @return A Java Future containing the result of the ModifyRule operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - TargetGroupAssociationLimitException You've reached the limit on the number of load balancers per
* target group.
* - IncompatibleProtocolsException The specified configuration is not valid with this protocol.
* - RuleNotFoundException The specified rule does not exist.
* - OperationNotPermittedException This operation is not allowed.
* - TooManyRegistrationsForTargetIdException You've reached the limit on the number of times a target can
* be registered with a load balancer.
* - TooManyTargetsException You've reached the limit on the number of targets.
* - TargetGroupNotFoundException The specified target group does not exist.
* - UnsupportedProtocolException The specified protocol is not supported.
* - TooManyActionsException You've reached the limit on the number of actions per rule.
* - InvalidLoadBalancerActionException The requested action is not valid.
* - 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.
* - ElasticLoadBalancingV2Exception Base class for all service exceptions. Unknown exceptions will be
* thrown as an instance of this type.
*
* @sample ElasticLoadBalancingV2AsyncClient.ModifyRule
* @see AWS API Documentation
*/
@Override
public CompletableFuture modifyRule(ModifyRuleRequest modifyRuleRequest) {
try {
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(ModifyRuleResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams().withOperationName("ModifyRule")
.withMarshaller(new ModifyRuleRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(modifyRuleRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Modifies the health checks used when evaluating the health state of the targets in the specified target group.
*
*
* To monitor the health of the targets, use DescribeTargetHealth.
*
*
* @param modifyTargetGroupRequest
* @return A Java Future containing the result of the ModifyTargetGroup operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - TargetGroupNotFoundException The specified target group does not exist.
* - InvalidConfigurationRequestException The requested configuration is not valid.
* - 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.
* - ElasticLoadBalancingV2Exception Base class for all service exceptions. Unknown exceptions will be
* thrown as an instance of this type.
*
* @sample ElasticLoadBalancingV2AsyncClient.ModifyTargetGroup
* @see AWS API Documentation
*/
@Override
public CompletableFuture modifyTargetGroup(ModifyTargetGroupRequest modifyTargetGroupRequest) {
try {
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(ModifyTargetGroupResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ModifyTargetGroup")
.withMarshaller(new ModifyTargetGroupRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(modifyTargetGroupRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Modifies the specified attributes of the specified target group.
*
*
* @param modifyTargetGroupAttributesRequest
* @return A Java Future containing the result of the ModifyTargetGroupAttributes operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - TargetGroupNotFoundException The specified target group does not exist.
* - InvalidConfigurationRequestException The requested configuration is not valid.
* - 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.
* - ElasticLoadBalancingV2Exception Base class for all service exceptions. Unknown exceptions will be
* thrown as an instance of this type.
*
* @sample ElasticLoadBalancingV2AsyncClient.ModifyTargetGroupAttributes
* @see AWS API Documentation
*/
@Override
public CompletableFuture modifyTargetGroupAttributes(
ModifyTargetGroupAttributesRequest modifyTargetGroupAttributesRequest) {
try {
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(ModifyTargetGroupAttributesResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ModifyTargetGroupAttributes")
.withMarshaller(new ModifyTargetGroupAttributesRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(modifyTargetGroupAttributesRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Registers the specified targets with the specified target group.
*
*
* If the target is an EC2 instance, it must be in the running
state when you register it.
*
*
* By default, the load balancer routes requests to registered targets using the protocol and port for the target
* group. Alternatively, you can override the port for a target when you register it. You can register each EC2
* instance or IP address with the same target group multiple times using different ports.
*
*
* With a Network Load Balancer, you cannot register instances by instance ID if they have the following instance
* types: C1, CC1, CC2, CG1, CG2, CR1, CS1, G1, G2, HI1, HS1, M1, M2, M3, and T1. You can register instances of
* these types by IP address.
*
*
* To remove a target from a target group, use DeregisterTargets.
*
*
* @param registerTargetsRequest
* @return A Java Future containing the result of the RegisterTargets operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - TargetGroupNotFoundException The specified target group does not exist.
* - TooManyTargetsException You've reached the limit on the number of targets.
* - InvalidTargetException The specified target does not exist, is not in the same VPC as the target
* group, or has an unsupported instance type.
* - TooManyRegistrationsForTargetIdException You've reached the limit on the number of times a target can
* be registered with a load balancer.
* - 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.
* - ElasticLoadBalancingV2Exception Base class for all service exceptions. Unknown exceptions will be
* thrown as an instance of this type.
*
* @sample ElasticLoadBalancingV2AsyncClient.RegisterTargets
* @see AWS API Documentation
*/
@Override
public CompletableFuture registerTargets(RegisterTargetsRequest registerTargetsRequest) {
try {
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(RegisterTargetsResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("RegisterTargets")
.withMarshaller(new RegisterTargetsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(registerTargetsRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Removes the specified certificate from the certificate list for the specified HTTPS listener.
*
*
* You can't remove the default certificate for a listener. To replace the default certificate, call
* ModifyListener.
*
*
* To list the certificates for your listener, use DescribeListenerCertificates.
*
*
* @param removeListenerCertificatesRequest
* @return A Java Future containing the result of the RemoveListenerCertificates operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ListenerNotFoundException The specified listener does not exist.
* - OperationNotPermittedException This operation is not allowed.
* - 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.
* - ElasticLoadBalancingV2Exception Base class for all service exceptions. Unknown exceptions will be
* thrown as an instance of this type.
*
* @sample ElasticLoadBalancingV2AsyncClient.RemoveListenerCertificates
* @see AWS API Documentation
*/
@Override
public CompletableFuture removeListenerCertificates(
RemoveListenerCertificatesRequest removeListenerCertificatesRequest) {
try {
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(RemoveListenerCertificatesResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("RemoveListenerCertificates")
.withMarshaller(new RemoveListenerCertificatesRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(removeListenerCertificatesRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Removes the specified tags from the specified Elastic Load Balancing resource.
*
*
* To list the current tags for your resources, use DescribeTags.
*
*
* @param removeTagsRequest
* @return A Java Future containing the result of the RemoveTags operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - LoadBalancerNotFoundException The specified load balancer does not exist.
* - TargetGroupNotFoundException The specified target group does not exist.
* - ListenerNotFoundException The specified listener does not exist.
* - RuleNotFoundException The specified rule does not exist.
* - TooManyTagsException You've reached the limit on the number of tags per load balancer.
* - 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.
* - ElasticLoadBalancingV2Exception Base class for all service exceptions. Unknown exceptions will be
* thrown as an instance of this type.
*
* @sample ElasticLoadBalancingV2AsyncClient.RemoveTags
* @see AWS API Documentation
*/
@Override
public CompletableFuture removeTags(RemoveTagsRequest removeTagsRequest) {
try {
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(RemoveTagsResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams().withOperationName("RemoveTags")
.withMarshaller(new RemoveTagsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(removeTagsRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Sets the type of IP addresses used by the subnets of the specified Application Load Balancer or Network Load
* Balancer.
*
*
* @param setIpAddressTypeRequest
* @return A Java Future containing the result of the SetIpAddressType operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - LoadBalancerNotFoundException The specified load balancer does not exist.
* - InvalidConfigurationRequestException The requested configuration is not valid.
* - InvalidSubnetException The specified subnet is out of available addresses.
* - 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.
* - ElasticLoadBalancingV2Exception Base class for all service exceptions. Unknown exceptions will be
* thrown as an instance of this type.
*
* @sample ElasticLoadBalancingV2AsyncClient.SetIpAddressType
* @see AWS API Documentation
*/
@Override
public CompletableFuture setIpAddressType(SetIpAddressTypeRequest setIpAddressTypeRequest) {
try {
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(SetIpAddressTypeResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("SetIpAddressType")
.withMarshaller(new SetIpAddressTypeRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(setIpAddressTypeRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Sets the priorities of the specified rules.
*
*
* You can reorder the rules as long as there are no priority conflicts in the new order. Any existing rules that
* you do not specify retain their current priority.
*
*
* @param setRulePrioritiesRequest
* @return A Java Future containing the result of the SetRulePriorities operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - RuleNotFoundException The specified rule does not exist.
* - PriorityInUseException The specified priority is in use.
* - OperationNotPermittedException This operation is not allowed.
* - 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.
* - ElasticLoadBalancingV2Exception Base class for all service exceptions. Unknown exceptions will be
* thrown as an instance of this type.
*
* @sample ElasticLoadBalancingV2AsyncClient.SetRulePriorities
* @see AWS API Documentation
*/
@Override
public CompletableFuture setRulePriorities(SetRulePrioritiesRequest setRulePrioritiesRequest) {
try {
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(SetRulePrioritiesResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("SetRulePriorities")
.withMarshaller(new SetRulePrioritiesRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(setRulePrioritiesRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Associates the specified security groups with the specified Application Load Balancer. The specified security
* groups override the previously associated security groups.
*
*
* You can't specify a security group for a Network Load Balancer.
*
*
* @param setSecurityGroupsRequest
* @return A Java Future containing the result of the SetSecurityGroups operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - LoadBalancerNotFoundException The specified load balancer does not exist.
* - InvalidConfigurationRequestException The requested configuration is not valid.
* - InvalidSecurityGroupException The specified security group does not exist.
* - 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.
* - ElasticLoadBalancingV2Exception Base class for all service exceptions. Unknown exceptions will be
* thrown as an instance of this type.
*
* @sample ElasticLoadBalancingV2AsyncClient.SetSecurityGroups
* @see AWS API Documentation
*/
@Override
public CompletableFuture setSecurityGroups(SetSecurityGroupsRequest setSecurityGroupsRequest) {
try {
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(SetSecurityGroupsResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("SetSecurityGroups")
.withMarshaller(new SetSecurityGroupsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(setSecurityGroupsRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Enables the Availability Zone for the specified public subnets for the specified Application Load Balancer. The
* specified subnets replace the previously enabled subnets.
*
*
* You can't change the subnets for a Network Load Balancer.
*
*
* @param setSubnetsRequest
* @return A Java Future containing the result of the SetSubnets operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - LoadBalancerNotFoundException The specified load balancer does not exist.
* - InvalidConfigurationRequestException The requested configuration is not valid.
* - SubnetNotFoundException The specified subnet does not exist.
* - InvalidSubnetException The specified subnet is out of available addresses.
* - AllocationIdNotFoundException The specified allocation ID does not exist.
* - AvailabilityZoneNotSupportedException The specified Availability Zone is not supported.
* - 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.
* - ElasticLoadBalancingV2Exception Base class for all service exceptions. Unknown exceptions will be
* thrown as an instance of this type.
*
* @sample ElasticLoadBalancingV2AsyncClient.SetSubnets
* @see AWS API Documentation
*/
@Override
public CompletableFuture setSubnets(SetSubnetsRequest setSubnetsRequest) {
try {
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(SetSubnetsResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams().withOperationName("SetSubnets")
.withMarshaller(new SetSubnetsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(setSubnetsRequest));
return executeFuture;
} catch (Throwable t) {
return CompletableFutureUtils.failedFuture(t);
}
}
@Override
public void close() {
clientHandler.close();
}
private AwsQueryProtocolFactory init() {
return AwsQueryProtocolFactory
.builder()
.registerModeledException(
ExceptionMetadata.builder().errorCode("UnsupportedProtocol")
.exceptionBuilderSupplier(UnsupportedProtocolException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("AllocationIdNotFound")
.exceptionBuilderSupplier(AllocationIdNotFoundException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("ResourceInUse")
.exceptionBuilderSupplier(ResourceInUseException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("DuplicateTargetGroupName")
.exceptionBuilderSupplier(DuplicateTargetGroupNameException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("TooManyRules")
.exceptionBuilderSupplier(TooManyRulesException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("TooManyCertificates")
.exceptionBuilderSupplier(TooManyCertificatesException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("LoadBalancerNotFound")
.exceptionBuilderSupplier(LoadBalancerNotFoundException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("TooManyTargetGroups")
.exceptionBuilderSupplier(TooManyTargetGroupsException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("TooManyLoadBalancers")
.exceptionBuilderSupplier(TooManyLoadBalancersException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("InvalidConfigurationRequest")
.exceptionBuilderSupplier(InvalidConfigurationRequestException::builder).httpStatusCode(400)
.build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("TargetGroupAssociationLimit")
.exceptionBuilderSupplier(TargetGroupAssociationLimitException::builder).httpStatusCode(400)
.build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("InvalidSecurityGroup")
.exceptionBuilderSupplier(InvalidSecurityGroupException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("IncompatibleProtocols")
.exceptionBuilderSupplier(IncompatibleProtocolsException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("TooManyActions")
.exceptionBuilderSupplier(TooManyActionsException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("TooManyListeners")
.exceptionBuilderSupplier(TooManyListenersException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("DuplicateLoadBalancerName")
.exceptionBuilderSupplier(DuplicateLoadBalancerNameException::builder).httpStatusCode(400)
.build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("OperationNotPermitted")
.exceptionBuilderSupplier(OperationNotPermittedException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("InvalidLoadBalancerAction")
.exceptionBuilderSupplier(InvalidLoadBalancerActionException::builder).httpStatusCode(400)
.build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("CertificateNotFound")
.exceptionBuilderSupplier(CertificateNotFoundException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("DuplicateTagKeys")
.exceptionBuilderSupplier(DuplicateTagKeysException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("TooManyTags")
.exceptionBuilderSupplier(TooManyTagsException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("TargetGroupNotFound")
.exceptionBuilderSupplier(TargetGroupNotFoundException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("TooManyRegistrationsForTargetId")
.exceptionBuilderSupplier(TooManyRegistrationsForTargetIdException::builder).httpStatusCode(400)
.build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("ListenerNotFound")
.exceptionBuilderSupplier(ListenerNotFoundException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("PriorityInUse")
.exceptionBuilderSupplier(PriorityInUseException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("InvalidTarget")
.exceptionBuilderSupplier(InvalidTargetException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("SubnetNotFound")
.exceptionBuilderSupplier(SubnetNotFoundException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("AvailabilityZoneNotSupported")
.exceptionBuilderSupplier(AvailabilityZoneNotSupportedException::builder).httpStatusCode(400)
.build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("RuleNotFound")
.exceptionBuilderSupplier(RuleNotFoundException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("SSLPolicyNotFound")
.exceptionBuilderSupplier(SslPolicyNotFoundException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("DuplicateListener")
.exceptionBuilderSupplier(DuplicateListenerException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("InvalidScheme")
.exceptionBuilderSupplier(InvalidSchemeException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("HealthUnavailable")
.exceptionBuilderSupplier(HealthUnavailableException::builder).httpStatusCode(500).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("InvalidSubnet")
.exceptionBuilderSupplier(InvalidSubnetException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("TooManyTargets")
.exceptionBuilderSupplier(TooManyTargetsException::builder).httpStatusCode(400).build())
.clientConfiguration(clientConfiguration)
.defaultServiceExceptionSupplier(ElasticLoadBalancingV2Exception::builder).build();
}
private T applyPaginatorUserAgent(T request) {
Consumer userAgentApplier = b -> b.addApiName(ApiName.builder()
.version(VersionInfo.SDK_VERSION).name("PAGINATED").build());
AwsRequestOverrideConfiguration overrideConfiguration = request.overrideConfiguration()
.map(c -> c.toBuilder().applyMutation(userAgentApplier).build())
.orElse((AwsRequestOverrideConfiguration.builder().applyMutation(userAgentApplier).build()));
return (T) request.toBuilder().overrideConfiguration(overrideConfiguration).build();
}
}