
software.amazon.awssdk.services.networkfirewall.DefaultNetworkFirewallAsyncClient Maven / Gradle / Ivy
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package software.amazon.awssdk.services.networkfirewall;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.awscore.client.handler.AwsAsyncClientHandler;
import software.amazon.awssdk.awscore.exception.AwsServiceException;
import software.amazon.awssdk.awscore.internal.AwsProtocolMetadata;
import software.amazon.awssdk.awscore.internal.AwsServiceProtocol;
import software.amazon.awssdk.core.RequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkPlugin;
import software.amazon.awssdk.core.SdkRequest;
import software.amazon.awssdk.core.client.config.SdkClientConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientOption;
import software.amazon.awssdk.core.client.handler.AsyncClientHandler;
import software.amazon.awssdk.core.client.handler.ClientExecutionParams;
import software.amazon.awssdk.core.http.HttpResponseHandler;
import software.amazon.awssdk.core.metrics.CoreMetric;
import software.amazon.awssdk.metrics.MetricCollector;
import software.amazon.awssdk.metrics.MetricPublisher;
import software.amazon.awssdk.metrics.NoOpMetricCollector;
import software.amazon.awssdk.protocols.core.ExceptionMetadata;
import software.amazon.awssdk.protocols.json.AwsJsonProtocol;
import software.amazon.awssdk.protocols.json.AwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.BaseAwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.JsonOperationMetadata;
import software.amazon.awssdk.services.networkfirewall.internal.NetworkFirewallServiceClientConfigurationBuilder;
import software.amazon.awssdk.services.networkfirewall.model.AssociateFirewallPolicyRequest;
import software.amazon.awssdk.services.networkfirewall.model.AssociateFirewallPolicyResponse;
import software.amazon.awssdk.services.networkfirewall.model.AssociateSubnetsRequest;
import software.amazon.awssdk.services.networkfirewall.model.AssociateSubnetsResponse;
import software.amazon.awssdk.services.networkfirewall.model.CreateFirewallPolicyRequest;
import software.amazon.awssdk.services.networkfirewall.model.CreateFirewallPolicyResponse;
import software.amazon.awssdk.services.networkfirewall.model.CreateFirewallRequest;
import software.amazon.awssdk.services.networkfirewall.model.CreateFirewallResponse;
import software.amazon.awssdk.services.networkfirewall.model.CreateRuleGroupRequest;
import software.amazon.awssdk.services.networkfirewall.model.CreateRuleGroupResponse;
import software.amazon.awssdk.services.networkfirewall.model.CreateTlsInspectionConfigurationRequest;
import software.amazon.awssdk.services.networkfirewall.model.CreateTlsInspectionConfigurationResponse;
import software.amazon.awssdk.services.networkfirewall.model.DeleteFirewallPolicyRequest;
import software.amazon.awssdk.services.networkfirewall.model.DeleteFirewallPolicyResponse;
import software.amazon.awssdk.services.networkfirewall.model.DeleteFirewallRequest;
import software.amazon.awssdk.services.networkfirewall.model.DeleteFirewallResponse;
import software.amazon.awssdk.services.networkfirewall.model.DeleteResourcePolicyRequest;
import software.amazon.awssdk.services.networkfirewall.model.DeleteResourcePolicyResponse;
import software.amazon.awssdk.services.networkfirewall.model.DeleteRuleGroupRequest;
import software.amazon.awssdk.services.networkfirewall.model.DeleteRuleGroupResponse;
import software.amazon.awssdk.services.networkfirewall.model.DeleteTlsInspectionConfigurationRequest;
import software.amazon.awssdk.services.networkfirewall.model.DeleteTlsInspectionConfigurationResponse;
import software.amazon.awssdk.services.networkfirewall.model.DescribeFirewallPolicyRequest;
import software.amazon.awssdk.services.networkfirewall.model.DescribeFirewallPolicyResponse;
import software.amazon.awssdk.services.networkfirewall.model.DescribeFirewallRequest;
import software.amazon.awssdk.services.networkfirewall.model.DescribeFirewallResponse;
import software.amazon.awssdk.services.networkfirewall.model.DescribeLoggingConfigurationRequest;
import software.amazon.awssdk.services.networkfirewall.model.DescribeLoggingConfigurationResponse;
import software.amazon.awssdk.services.networkfirewall.model.DescribeResourcePolicyRequest;
import software.amazon.awssdk.services.networkfirewall.model.DescribeResourcePolicyResponse;
import software.amazon.awssdk.services.networkfirewall.model.DescribeRuleGroupMetadataRequest;
import software.amazon.awssdk.services.networkfirewall.model.DescribeRuleGroupMetadataResponse;
import software.amazon.awssdk.services.networkfirewall.model.DescribeRuleGroupRequest;
import software.amazon.awssdk.services.networkfirewall.model.DescribeRuleGroupResponse;
import software.amazon.awssdk.services.networkfirewall.model.DescribeTlsInspectionConfigurationRequest;
import software.amazon.awssdk.services.networkfirewall.model.DescribeTlsInspectionConfigurationResponse;
import software.amazon.awssdk.services.networkfirewall.model.DisassociateSubnetsRequest;
import software.amazon.awssdk.services.networkfirewall.model.DisassociateSubnetsResponse;
import software.amazon.awssdk.services.networkfirewall.model.InsufficientCapacityException;
import software.amazon.awssdk.services.networkfirewall.model.InternalServerErrorException;
import software.amazon.awssdk.services.networkfirewall.model.InvalidOperationException;
import software.amazon.awssdk.services.networkfirewall.model.InvalidRequestException;
import software.amazon.awssdk.services.networkfirewall.model.InvalidResourcePolicyException;
import software.amazon.awssdk.services.networkfirewall.model.InvalidTokenException;
import software.amazon.awssdk.services.networkfirewall.model.LimitExceededException;
import software.amazon.awssdk.services.networkfirewall.model.ListFirewallPoliciesRequest;
import software.amazon.awssdk.services.networkfirewall.model.ListFirewallPoliciesResponse;
import software.amazon.awssdk.services.networkfirewall.model.ListFirewallsRequest;
import software.amazon.awssdk.services.networkfirewall.model.ListFirewallsResponse;
import software.amazon.awssdk.services.networkfirewall.model.ListRuleGroupsRequest;
import software.amazon.awssdk.services.networkfirewall.model.ListRuleGroupsResponse;
import software.amazon.awssdk.services.networkfirewall.model.ListTagsForResourceRequest;
import software.amazon.awssdk.services.networkfirewall.model.ListTagsForResourceResponse;
import software.amazon.awssdk.services.networkfirewall.model.ListTlsInspectionConfigurationsRequest;
import software.amazon.awssdk.services.networkfirewall.model.ListTlsInspectionConfigurationsResponse;
import software.amazon.awssdk.services.networkfirewall.model.LogDestinationPermissionException;
import software.amazon.awssdk.services.networkfirewall.model.NetworkFirewallException;
import software.amazon.awssdk.services.networkfirewall.model.PutResourcePolicyRequest;
import software.amazon.awssdk.services.networkfirewall.model.PutResourcePolicyResponse;
import software.amazon.awssdk.services.networkfirewall.model.ResourceNotFoundException;
import software.amazon.awssdk.services.networkfirewall.model.ResourceOwnerCheckException;
import software.amazon.awssdk.services.networkfirewall.model.TagResourceRequest;
import software.amazon.awssdk.services.networkfirewall.model.TagResourceResponse;
import software.amazon.awssdk.services.networkfirewall.model.ThrottlingException;
import software.amazon.awssdk.services.networkfirewall.model.UnsupportedOperationException;
import software.amazon.awssdk.services.networkfirewall.model.UntagResourceRequest;
import software.amazon.awssdk.services.networkfirewall.model.UntagResourceResponse;
import software.amazon.awssdk.services.networkfirewall.model.UpdateFirewallDeleteProtectionRequest;
import software.amazon.awssdk.services.networkfirewall.model.UpdateFirewallDeleteProtectionResponse;
import software.amazon.awssdk.services.networkfirewall.model.UpdateFirewallDescriptionRequest;
import software.amazon.awssdk.services.networkfirewall.model.UpdateFirewallDescriptionResponse;
import software.amazon.awssdk.services.networkfirewall.model.UpdateFirewallEncryptionConfigurationRequest;
import software.amazon.awssdk.services.networkfirewall.model.UpdateFirewallEncryptionConfigurationResponse;
import software.amazon.awssdk.services.networkfirewall.model.UpdateFirewallPolicyChangeProtectionRequest;
import software.amazon.awssdk.services.networkfirewall.model.UpdateFirewallPolicyChangeProtectionResponse;
import software.amazon.awssdk.services.networkfirewall.model.UpdateFirewallPolicyRequest;
import software.amazon.awssdk.services.networkfirewall.model.UpdateFirewallPolicyResponse;
import software.amazon.awssdk.services.networkfirewall.model.UpdateLoggingConfigurationRequest;
import software.amazon.awssdk.services.networkfirewall.model.UpdateLoggingConfigurationResponse;
import software.amazon.awssdk.services.networkfirewall.model.UpdateRuleGroupRequest;
import software.amazon.awssdk.services.networkfirewall.model.UpdateRuleGroupResponse;
import software.amazon.awssdk.services.networkfirewall.model.UpdateSubnetChangeProtectionRequest;
import software.amazon.awssdk.services.networkfirewall.model.UpdateSubnetChangeProtectionResponse;
import software.amazon.awssdk.services.networkfirewall.model.UpdateTlsInspectionConfigurationRequest;
import software.amazon.awssdk.services.networkfirewall.model.UpdateTlsInspectionConfigurationResponse;
import software.amazon.awssdk.services.networkfirewall.transform.AssociateFirewallPolicyRequestMarshaller;
import software.amazon.awssdk.services.networkfirewall.transform.AssociateSubnetsRequestMarshaller;
import software.amazon.awssdk.services.networkfirewall.transform.CreateFirewallPolicyRequestMarshaller;
import software.amazon.awssdk.services.networkfirewall.transform.CreateFirewallRequestMarshaller;
import software.amazon.awssdk.services.networkfirewall.transform.CreateRuleGroupRequestMarshaller;
import software.amazon.awssdk.services.networkfirewall.transform.CreateTlsInspectionConfigurationRequestMarshaller;
import software.amazon.awssdk.services.networkfirewall.transform.DeleteFirewallPolicyRequestMarshaller;
import software.amazon.awssdk.services.networkfirewall.transform.DeleteFirewallRequestMarshaller;
import software.amazon.awssdk.services.networkfirewall.transform.DeleteResourcePolicyRequestMarshaller;
import software.amazon.awssdk.services.networkfirewall.transform.DeleteRuleGroupRequestMarshaller;
import software.amazon.awssdk.services.networkfirewall.transform.DeleteTlsInspectionConfigurationRequestMarshaller;
import software.amazon.awssdk.services.networkfirewall.transform.DescribeFirewallPolicyRequestMarshaller;
import software.amazon.awssdk.services.networkfirewall.transform.DescribeFirewallRequestMarshaller;
import software.amazon.awssdk.services.networkfirewall.transform.DescribeLoggingConfigurationRequestMarshaller;
import software.amazon.awssdk.services.networkfirewall.transform.DescribeResourcePolicyRequestMarshaller;
import software.amazon.awssdk.services.networkfirewall.transform.DescribeRuleGroupMetadataRequestMarshaller;
import software.amazon.awssdk.services.networkfirewall.transform.DescribeRuleGroupRequestMarshaller;
import software.amazon.awssdk.services.networkfirewall.transform.DescribeTlsInspectionConfigurationRequestMarshaller;
import software.amazon.awssdk.services.networkfirewall.transform.DisassociateSubnetsRequestMarshaller;
import software.amazon.awssdk.services.networkfirewall.transform.ListFirewallPoliciesRequestMarshaller;
import software.amazon.awssdk.services.networkfirewall.transform.ListFirewallsRequestMarshaller;
import software.amazon.awssdk.services.networkfirewall.transform.ListRuleGroupsRequestMarshaller;
import software.amazon.awssdk.services.networkfirewall.transform.ListTagsForResourceRequestMarshaller;
import software.amazon.awssdk.services.networkfirewall.transform.ListTlsInspectionConfigurationsRequestMarshaller;
import software.amazon.awssdk.services.networkfirewall.transform.PutResourcePolicyRequestMarshaller;
import software.amazon.awssdk.services.networkfirewall.transform.TagResourceRequestMarshaller;
import software.amazon.awssdk.services.networkfirewall.transform.UntagResourceRequestMarshaller;
import software.amazon.awssdk.services.networkfirewall.transform.UpdateFirewallDeleteProtectionRequestMarshaller;
import software.amazon.awssdk.services.networkfirewall.transform.UpdateFirewallDescriptionRequestMarshaller;
import software.amazon.awssdk.services.networkfirewall.transform.UpdateFirewallEncryptionConfigurationRequestMarshaller;
import software.amazon.awssdk.services.networkfirewall.transform.UpdateFirewallPolicyChangeProtectionRequestMarshaller;
import software.amazon.awssdk.services.networkfirewall.transform.UpdateFirewallPolicyRequestMarshaller;
import software.amazon.awssdk.services.networkfirewall.transform.UpdateLoggingConfigurationRequestMarshaller;
import software.amazon.awssdk.services.networkfirewall.transform.UpdateRuleGroupRequestMarshaller;
import software.amazon.awssdk.services.networkfirewall.transform.UpdateSubnetChangeProtectionRequestMarshaller;
import software.amazon.awssdk.services.networkfirewall.transform.UpdateTlsInspectionConfigurationRequestMarshaller;
import software.amazon.awssdk.utils.CompletableFutureUtils;
/**
* Internal implementation of {@link NetworkFirewallAsyncClient}.
*
* @see NetworkFirewallAsyncClient#builder()
*/
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
final class DefaultNetworkFirewallAsyncClient implements NetworkFirewallAsyncClient {
private static final Logger log = LoggerFactory.getLogger(DefaultNetworkFirewallAsyncClient.class);
private static final AwsProtocolMetadata protocolMetadata = AwsProtocolMetadata.builder()
.serviceProtocol(AwsServiceProtocol.AWS_JSON).build();
private final AsyncClientHandler clientHandler;
private final AwsJsonProtocolFactory protocolFactory;
private final SdkClientConfiguration clientConfiguration;
protected DefaultNetworkFirewallAsyncClient(SdkClientConfiguration clientConfiguration) {
this.clientHandler = new AwsAsyncClientHandler(clientConfiguration);
this.clientConfiguration = clientConfiguration;
this.protocolFactory = init(AwsJsonProtocolFactory.builder()).build();
}
/**
*
* Associates a FirewallPolicy to a Firewall.
*
*
* A firewall policy defines how to monitor and manage your VPC network traffic, using a collection of inspection
* rule groups and other settings. Each firewall requires one firewall policy association, and you can use the same
* firewall policy for multiple firewalls.
*
*
* @param associateFirewallPolicyRequest
* @return A Java Future containing the result of the AssociateFirewallPolicy operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InvalidRequestException The operation failed because of a problem with your request. Examples
* include:
*
* -
*
* You specified an unsupported parameter name or value.
*
*
* -
*
* You tried to update a property with a value that isn't among the available types.
*
*
* -
*
* Your request references an ARN that is malformed, or corresponds to a resource that isn't valid in the
* context of the request.
*
*
* - InternalServerErrorException Your request is valid, but Network Firewall couldn't perform the
* operation because of a system problem. Retry your request.
* - ResourceNotFoundException Unable to locate a resource using the parameters that you provided.
* - ThrottlingException Unable to process the request due to throttling limitations.
* - InvalidTokenException The token you provided is stale or isn't valid for the operation.
* - InvalidOperationException The operation failed because it's not valid. For example, you might have
* tried to delete a rule group or firewall policy that's 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.
* - NetworkFirewallException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkFirewallAsyncClient.AssociateFirewallPolicy
* @see AWS API Documentation
*/
@Override
public CompletableFuture associateFirewallPolicy(
AssociateFirewallPolicyRequest associateFirewallPolicyRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(associateFirewallPolicyRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, associateFirewallPolicyRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Network Firewall");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AssociateFirewallPolicy");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, AssociateFirewallPolicyResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("AssociateFirewallPolicy").withProtocolMetadata(protocolMetadata)
.withMarshaller(new AssociateFirewallPolicyRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(associateFirewallPolicyRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Associates the specified subnets in the Amazon VPC to the firewall. You can specify one subnet for each of the
* Availability Zones that the VPC spans.
*
*
* This request creates an Network Firewall firewall endpoint in each of the subnets. To enable the firewall's
* protections, you must also modify the VPC's route tables for each subnet's Availability Zone, to redirect the
* traffic that's coming into and going out of the zone through the firewall endpoint.
*
*
* @param associateSubnetsRequest
* @return A Java Future containing the result of the AssociateSubnets operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InvalidRequestException The operation failed because of a problem with your request. Examples
* include:
*
* -
*
* You specified an unsupported parameter name or value.
*
*
* -
*
* You tried to update a property with a value that isn't among the available types.
*
*
* -
*
* Your request references an ARN that is malformed, or corresponds to a resource that isn't valid in the
* context of the request.
*
*
* - InternalServerErrorException Your request is valid, but Network Firewall couldn't perform the
* operation because of a system problem. Retry your request.
* - ResourceNotFoundException Unable to locate a resource using the parameters that you provided.
* - ThrottlingException Unable to process the request due to throttling limitations.
* - InvalidTokenException The token you provided is stale or isn't valid for the operation.
* - InvalidOperationException The operation failed because it's not valid. For example, you might have
* tried to delete a rule group or firewall policy that's in use.
* - InsufficientCapacityException Amazon Web Services doesn't currently have enough available capacity to
* fulfill your request. Try your request later.
* - 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.
* - NetworkFirewallException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkFirewallAsyncClient.AssociateSubnets
* @see AWS API Documentation
*/
@Override
public CompletableFuture associateSubnets(AssociateSubnetsRequest associateSubnetsRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(associateSubnetsRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, associateSubnetsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Network Firewall");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AssociateSubnets");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, AssociateSubnetsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("AssociateSubnets").withProtocolMetadata(protocolMetadata)
.withMarshaller(new AssociateSubnetsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(associateSubnetsRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Creates an Network Firewall Firewall and accompanying FirewallStatus for a VPC.
*
*
* The firewall defines the configuration settings for an Network Firewall firewall. The settings that you can
* define at creation include the firewall policy, the subnets in your VPC to use for the firewall endpoints, and
* any tags that are attached to the firewall Amazon Web Services resource.
*
*
* After you create a firewall, you can provide additional settings, like the logging configuration.
*
*
* To update the settings for a firewall, you use the operations that apply to the settings themselves, for example
* UpdateLoggingConfiguration, AssociateSubnets, and UpdateFirewallDeleteProtection.
*
*
* To manage a firewall's tags, use the standard Amazon Web Services resource tagging operations,
* ListTagsForResource, TagResource, and UntagResource.
*
*
* To retrieve information about firewalls, use ListFirewalls and DescribeFirewall.
*
*
* @param createFirewallRequest
* @return A Java Future containing the result of the CreateFirewall operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InvalidRequestException The operation failed because of a problem with your request. Examples
* include:
*
* -
*
* You specified an unsupported parameter name or value.
*
*
* -
*
* You tried to update a property with a value that isn't among the available types.
*
*
* -
*
* Your request references an ARN that is malformed, or corresponds to a resource that isn't valid in the
* context of the request.
*
*
* - LimitExceededException Unable to perform the operation because doing so would violate a limit
* setting.
* - InternalServerErrorException Your request is valid, but Network Firewall couldn't perform the
* operation because of a system problem. Retry your request.
* - ThrottlingException Unable to process the request due to throttling limitations.
* - InsufficientCapacityException Amazon Web Services doesn't currently have enough available capacity to
* fulfill your request. Try your request later.
* - InvalidOperationException The operation failed because it's not valid. For example, you might have
* tried to delete a rule group or firewall policy that's 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.
* - NetworkFirewallException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkFirewallAsyncClient.CreateFirewall
* @see AWS API Documentation
*/
@Override
public CompletableFuture createFirewall(CreateFirewallRequest createFirewallRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createFirewallRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createFirewallRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Network Firewall");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateFirewall");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateFirewallResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateFirewall").withProtocolMetadata(protocolMetadata)
.withMarshaller(new CreateFirewallRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(createFirewallRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Creates the firewall policy for the firewall according to the specifications.
*
*
* An Network Firewall firewall policy defines the behavior of a firewall, in a collection of stateless and stateful
* rule groups and other settings. You can use one firewall policy for multiple firewalls.
*
*
* @param createFirewallPolicyRequest
* @return A Java Future containing the result of the CreateFirewallPolicy operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - LimitExceededException Unable to perform the operation because doing so would violate a limit
* setting.
* - InvalidRequestException The operation failed because of a problem with your request. Examples
* include:
*
* -
*
* You specified an unsupported parameter name or value.
*
*
* -
*
* You tried to update a property with a value that isn't among the available types.
*
*
* -
*
* Your request references an ARN that is malformed, or corresponds to a resource that isn't valid in the
* context of the request.
*
*
* - ThrottlingException Unable to process the request due to throttling limitations.
* - InternalServerErrorException Your request is valid, but Network Firewall couldn't perform the
* operation because of a system problem. Retry your request.
* - InsufficientCapacityException Amazon Web Services doesn't currently have enough available capacity to
* fulfill your request. Try your request later.
* - 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.
* - NetworkFirewallException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkFirewallAsyncClient.CreateFirewallPolicy
* @see AWS API Documentation
*/
@Override
public CompletableFuture createFirewallPolicy(
CreateFirewallPolicyRequest createFirewallPolicyRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createFirewallPolicyRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createFirewallPolicyRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Network Firewall");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateFirewallPolicy");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateFirewallPolicyResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateFirewallPolicy").withProtocolMetadata(protocolMetadata)
.withMarshaller(new CreateFirewallPolicyRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(createFirewallPolicyRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Creates the specified stateless or stateful rule group, which includes the rules for network traffic inspection,
* a capacity setting, and tags.
*
*
* You provide your rule group specification in your request using either RuleGroup
or
* Rules
.
*
*
* @param createRuleGroupRequest
* @return A Java Future containing the result of the CreateRuleGroup operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - LimitExceededException Unable to perform the operation because doing so would violate a limit
* setting.
* - InvalidRequestException The operation failed because of a problem with your request. Examples
* include:
*
* -
*
* You specified an unsupported parameter name or value.
*
*
* -
*
* You tried to update a property with a value that isn't among the available types.
*
*
* -
*
* Your request references an ARN that is malformed, or corresponds to a resource that isn't valid in the
* context of the request.
*
*
* - ThrottlingException Unable to process the request due to throttling limitations.
* - InternalServerErrorException Your request is valid, but Network Firewall couldn't perform the
* operation because of a system problem. Retry your request.
* - InsufficientCapacityException Amazon Web Services doesn't currently have enough available capacity to
* fulfill your request. Try your request later.
* - 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.
* - NetworkFirewallException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkFirewallAsyncClient.CreateRuleGroup
* @see AWS API Documentation
*/
@Override
public CompletableFuture createRuleGroup(CreateRuleGroupRequest createRuleGroupRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createRuleGroupRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createRuleGroupRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Network Firewall");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateRuleGroup");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateRuleGroupResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateRuleGroup").withProtocolMetadata(protocolMetadata)
.withMarshaller(new CreateRuleGroupRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(createRuleGroupRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Creates an Network Firewall TLS inspection configuration. A TLS inspection configuration contains Certificate
* Manager certificate associations between and the scope configurations that Network Firewall uses to decrypt and
* re-encrypt traffic traveling through your firewall.
*
*
* After you create a TLS inspection configuration, you can associate it with a new firewall policy.
*
*
* To update the settings for a TLS inspection configuration, use UpdateTLSInspectionConfiguration.
*
*
* To manage a TLS inspection configuration's tags, use the standard Amazon Web Services resource tagging
* operations, ListTagsForResource, TagResource, and UntagResource.
*
*
* To retrieve information about TLS inspection configurations, use ListTLSInspectionConfigurations and
* DescribeTLSInspectionConfiguration.
*
*
* For more information about TLS inspection configurations, see Inspecting SSL/TLS
* traffic with TLS inspection configurations in the Network Firewall Developer Guide.
*
*
* @param createTlsInspectionConfigurationRequest
* @return A Java Future containing the result of the CreateTLSInspectionConfiguration operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InvalidRequestException The operation failed because of a problem with your request. Examples
* include:
*
* -
*
* You specified an unsupported parameter name or value.
*
*
* -
*
* You tried to update a property with a value that isn't among the available types.
*
*
* -
*
* Your request references an ARN that is malformed, or corresponds to a resource that isn't valid in the
* context of the request.
*
*
* - ThrottlingException Unable to process the request due to throttling limitations.
* - InternalServerErrorException Your request is valid, but Network Firewall couldn't perform the
* operation because of a system problem. Retry your request.
* - LimitExceededException Unable to perform the operation because doing so would violate a limit
* setting.
* - InsufficientCapacityException Amazon Web Services doesn't currently have enough available capacity to
* fulfill your request. Try your request later.
* - 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.
* - NetworkFirewallException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkFirewallAsyncClient.CreateTLSInspectionConfiguration
* @see AWS API Documentation
*/
@Override
public CompletableFuture createTLSInspectionConfiguration(
CreateTlsInspectionConfigurationRequest createTlsInspectionConfigurationRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createTlsInspectionConfigurationRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
createTlsInspectionConfigurationRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Network Firewall");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateTLSInspectionConfiguration");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(operationMetadata, CreateTlsInspectionConfigurationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateTLSInspectionConfiguration").withProtocolMetadata(protocolMetadata)
.withMarshaller(new CreateTlsInspectionConfigurationRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(createTlsInspectionConfigurationRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deletes the specified Firewall and its FirewallStatus. This operation requires the firewall's
* DeleteProtection
flag to be FALSE
. You can't revert this operation.
*
*
* You can check whether a firewall is in use by reviewing the route tables for the Availability Zones where you
* have firewall subnet mappings. Retrieve the subnet mappings by calling DescribeFirewall. You define and
* update the route tables through Amazon VPC. As needed, update the route tables for the zones to remove the
* firewall endpoints. When the route tables no longer use the firewall endpoints, you can remove the firewall
* safely.
*
*
* To delete a firewall, remove the delete protection if you need to using UpdateFirewallDeleteProtection,
* then delete the firewall by calling DeleteFirewall.
*
*
* @param deleteFirewallRequest
* @return A Java Future containing the result of the DeleteFirewall operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InvalidRequestException The operation failed because of a problem with your request. Examples
* include:
*
* -
*
* You specified an unsupported parameter name or value.
*
*
* -
*
* You tried to update a property with a value that isn't among the available types.
*
*
* -
*
* Your request references an ARN that is malformed, or corresponds to a resource that isn't valid in the
* context of the request.
*
*
* - InternalServerErrorException Your request is valid, but Network Firewall couldn't perform the
* operation because of a system problem. Retry your request.
* - ResourceNotFoundException Unable to locate a resource using the parameters that you provided.
* - ThrottlingException Unable to process the request due to throttling limitations.
* - UnsupportedOperationException The operation you requested isn't supported by Network Firewall.
* - InvalidOperationException The operation failed because it's not valid. For example, you might have
* tried to delete a rule group or firewall policy that's 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.
* - NetworkFirewallException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkFirewallAsyncClient.DeleteFirewall
* @see AWS API Documentation
*/
@Override
public CompletableFuture deleteFirewall(DeleteFirewallRequest deleteFirewallRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteFirewallRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteFirewallRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Network Firewall");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteFirewall");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteFirewallResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteFirewall").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DeleteFirewallRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(deleteFirewallRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deletes the specified FirewallPolicy.
*
*
* @param deleteFirewallPolicyRequest
* @return A Java Future containing the result of the DeleteFirewallPolicy operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InvalidRequestException The operation failed because of a problem with your request. Examples
* include:
*
* -
*
* You specified an unsupported parameter name or value.
*
*
* -
*
* You tried to update a property with a value that isn't among the available types.
*
*
* -
*
* Your request references an ARN that is malformed, or corresponds to a resource that isn't valid in the
* context of the request.
*
*
* - ResourceNotFoundException Unable to locate a resource using the parameters that you provided.
* - ThrottlingException Unable to process the request due to throttling limitations.
* - InternalServerErrorException Your request is valid, but Network Firewall couldn't perform the
* operation because of a system problem. Retry your request.
* - UnsupportedOperationException The operation you requested isn't supported by Network Firewall.
* - InvalidOperationException The operation failed because it's not valid. For example, you might have
* tried to delete a rule group or firewall policy that's 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.
* - NetworkFirewallException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkFirewallAsyncClient.DeleteFirewallPolicy
* @see AWS API Documentation
*/
@Override
public CompletableFuture deleteFirewallPolicy(
DeleteFirewallPolicyRequest deleteFirewallPolicyRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteFirewallPolicyRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteFirewallPolicyRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Network Firewall");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteFirewallPolicy");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteFirewallPolicyResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteFirewallPolicy").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DeleteFirewallPolicyRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(deleteFirewallPolicyRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deletes a resource policy that you created in a PutResourcePolicy request.
*
*
* @param deleteResourcePolicyRequest
* @return A Java Future containing the result of the DeleteResourcePolicy operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InvalidRequestException The operation failed because of a problem with your request. Examples
* include:
*
* -
*
* You specified an unsupported parameter name or value.
*
*
* -
*
* You tried to update a property with a value that isn't among the available types.
*
*
* -
*
* Your request references an ARN that is malformed, or corresponds to a resource that isn't valid in the
* context of the request.
*
*
* - InternalServerErrorException Your request is valid, but Network Firewall couldn't perform the
* operation because of a system problem. Retry your request.
* - ResourceNotFoundException Unable to locate a resource using the parameters that you provided.
* - ThrottlingException Unable to process the request due to throttling limitations.
* - InvalidResourcePolicyException The policy statement failed validation.
* - 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.
* - NetworkFirewallException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkFirewallAsyncClient.DeleteResourcePolicy
* @see AWS API Documentation
*/
@Override
public CompletableFuture deleteResourcePolicy(
DeleteResourcePolicyRequest deleteResourcePolicyRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteResourcePolicyRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteResourcePolicyRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Network Firewall");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteResourcePolicy");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteResourcePolicyResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteResourcePolicy").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DeleteResourcePolicyRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(deleteResourcePolicyRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deletes the specified RuleGroup.
*
*
* @param deleteRuleGroupRequest
* @return A Java Future containing the result of the DeleteRuleGroup operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InvalidRequestException The operation failed because of a problem with your request. Examples
* include:
*
* -
*
* You specified an unsupported parameter name or value.
*
*
* -
*
* You tried to update a property with a value that isn't among the available types.
*
*
* -
*
* Your request references an ARN that is malformed, or corresponds to a resource that isn't valid in the
* context of the request.
*
*
* - ResourceNotFoundException Unable to locate a resource using the parameters that you provided.
* - ThrottlingException Unable to process the request due to throttling limitations.
* - InternalServerErrorException Your request is valid, but Network Firewall couldn't perform the
* operation because of a system problem. Retry your request.
* - UnsupportedOperationException The operation you requested isn't supported by Network Firewall.
* - InvalidOperationException The operation failed because it's not valid. For example, you might have
* tried to delete a rule group or firewall policy that's 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.
* - NetworkFirewallException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkFirewallAsyncClient.DeleteRuleGroup
* @see AWS API Documentation
*/
@Override
public CompletableFuture deleteRuleGroup(DeleteRuleGroupRequest deleteRuleGroupRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteRuleGroupRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteRuleGroupRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Network Firewall");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteRuleGroup");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteRuleGroupResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteRuleGroup").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DeleteRuleGroupRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(deleteRuleGroupRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deletes the specified TLSInspectionConfiguration.
*
*
* @param deleteTlsInspectionConfigurationRequest
* @return A Java Future containing the result of the DeleteTLSInspectionConfiguration operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InvalidRequestException The operation failed because of a problem with your request. Examples
* include:
*
* -
*
* You specified an unsupported parameter name or value.
*
*
* -
*
* You tried to update a property with a value that isn't among the available types.
*
*
* -
*
* Your request references an ARN that is malformed, or corresponds to a resource that isn't valid in the
* context of the request.
*
*
* - InternalServerErrorException Your request is valid, but Network Firewall couldn't perform the
* operation because of a system problem. Retry your request.
* - ResourceNotFoundException Unable to locate a resource using the parameters that you provided.
* - ThrottlingException Unable to process the request due to throttling limitations.
* - InvalidOperationException The operation failed because it's not valid. For example, you might have
* tried to delete a rule group or firewall policy that's 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.
* - NetworkFirewallException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkFirewallAsyncClient.DeleteTLSInspectionConfiguration
* @see AWS API Documentation
*/
@Override
public CompletableFuture deleteTLSInspectionConfiguration(
DeleteTlsInspectionConfigurationRequest deleteTlsInspectionConfigurationRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteTlsInspectionConfigurationRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
deleteTlsInspectionConfigurationRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Network Firewall");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteTLSInspectionConfiguration");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(operationMetadata, DeleteTlsInspectionConfigurationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteTLSInspectionConfiguration").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DeleteTlsInspectionConfigurationRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(deleteTlsInspectionConfigurationRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns the data objects for the specified firewall.
*
*
* @param describeFirewallRequest
* @return A Java Future containing the result of the DescribeFirewall operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InvalidRequestException The operation failed because of a problem with your request. Examples
* include:
*
* -
*
* You specified an unsupported parameter name or value.
*
*
* -
*
* You tried to update a property with a value that isn't among the available types.
*
*
* -
*
* Your request references an ARN that is malformed, or corresponds to a resource that isn't valid in the
* context of the request.
*
*
* - InternalServerErrorException Your request is valid, but Network Firewall couldn't perform the
* operation because of a system problem. Retry your request.
* - ResourceNotFoundException Unable to locate a resource using the parameters that you provided.
* - ThrottlingException Unable to process the request due to throttling limitations.
* - 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.
* - NetworkFirewallException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkFirewallAsyncClient.DescribeFirewall
* @see AWS API Documentation
*/
@Override
public CompletableFuture describeFirewall(DescribeFirewallRequest describeFirewallRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeFirewallRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeFirewallRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Network Firewall");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeFirewall");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeFirewallResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeFirewall").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DescribeFirewallRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(describeFirewallRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns the data objects for the specified firewall policy.
*
*
* @param describeFirewallPolicyRequest
* @return A Java Future containing the result of the DescribeFirewallPolicy operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InvalidRequestException The operation failed because of a problem with your request. Examples
* include:
*
* -
*
* You specified an unsupported parameter name or value.
*
*
* -
*
* You tried to update a property with a value that isn't among the available types.
*
*
* -
*
* Your request references an ARN that is malformed, or corresponds to a resource that isn't valid in the
* context of the request.
*
*
* - ResourceNotFoundException Unable to locate a resource using the parameters that you provided.
* - ThrottlingException Unable to process the request due to throttling limitations.
* - InternalServerErrorException Your request is valid, but Network Firewall couldn't perform the
* operation because of a system problem. Retry your request.
* - 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.
* - NetworkFirewallException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkFirewallAsyncClient.DescribeFirewallPolicy
* @see AWS API Documentation
*/
@Override
public CompletableFuture describeFirewallPolicy(
DescribeFirewallPolicyRequest describeFirewallPolicyRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeFirewallPolicyRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeFirewallPolicyRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Network Firewall");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeFirewallPolicy");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeFirewallPolicyResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeFirewallPolicy").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DescribeFirewallPolicyRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(describeFirewallPolicyRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns the logging configuration for the specified firewall.
*
*
* @param describeLoggingConfigurationRequest
* @return A Java Future containing the result of the DescribeLoggingConfiguration operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InvalidRequestException The operation failed because of a problem with your request. Examples
* include:
*
* -
*
* You specified an unsupported parameter name or value.
*
*
* -
*
* You tried to update a property with a value that isn't among the available types.
*
*
* -
*
* Your request references an ARN that is malformed, or corresponds to a resource that isn't valid in the
* context of the request.
*
*
* - InternalServerErrorException Your request is valid, but Network Firewall couldn't perform the
* operation because of a system problem. Retry your request.
* - ResourceNotFoundException Unable to locate a resource using the parameters that you provided.
* - ThrottlingException Unable to process the request due to throttling limitations.
* - 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.
* - NetworkFirewallException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkFirewallAsyncClient.DescribeLoggingConfiguration
* @see AWS API Documentation
*/
@Override
public CompletableFuture describeLoggingConfiguration(
DescribeLoggingConfigurationRequest describeLoggingConfigurationRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeLoggingConfigurationRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeLoggingConfigurationRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Network Firewall");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeLoggingConfiguration");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeLoggingConfigurationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeLoggingConfiguration").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DescribeLoggingConfigurationRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(describeLoggingConfigurationRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Retrieves a resource policy that you created in a PutResourcePolicy request.
*
*
* @param describeResourcePolicyRequest
* @return A Java Future containing the result of the DescribeResourcePolicy operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InvalidRequestException The operation failed because of a problem with your request. Examples
* include:
*
* -
*
* You specified an unsupported parameter name or value.
*
*
* -
*
* You tried to update a property with a value that isn't among the available types.
*
*
* -
*
* Your request references an ARN that is malformed, or corresponds to a resource that isn't valid in the
* context of the request.
*
*
* - InternalServerErrorException Your request is valid, but Network Firewall couldn't perform the
* operation because of a system problem. Retry your request.
* - ResourceNotFoundException Unable to locate a resource using the parameters that you provided.
* - ThrottlingException Unable to process the request due to throttling limitations.
* - 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.
* - NetworkFirewallException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkFirewallAsyncClient.DescribeResourcePolicy
* @see AWS API Documentation
*/
@Override
public CompletableFuture describeResourcePolicy(
DescribeResourcePolicyRequest describeResourcePolicyRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeResourcePolicyRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeResourcePolicyRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Network Firewall");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeResourcePolicy");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeResourcePolicyResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeResourcePolicy").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DescribeResourcePolicyRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(describeResourcePolicyRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns the data objects for the specified rule group.
*
*
* @param describeRuleGroupRequest
* @return A Java Future containing the result of the DescribeRuleGroup operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InvalidRequestException The operation failed because of a problem with your request. Examples
* include:
*
* -
*
* You specified an unsupported parameter name or value.
*
*
* -
*
* You tried to update a property with a value that isn't among the available types.
*
*
* -
*
* Your request references an ARN that is malformed, or corresponds to a resource that isn't valid in the
* context of the request.
*
*
* - ResourceNotFoundException Unable to locate a resource using the parameters that you provided.
* - ThrottlingException Unable to process the request due to throttling limitations.
* - InternalServerErrorException Your request is valid, but Network Firewall couldn't perform the
* operation because of a system problem. Retry your request.
* - 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.
* - NetworkFirewallException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkFirewallAsyncClient.DescribeRuleGroup
* @see AWS API Documentation
*/
@Override
public CompletableFuture describeRuleGroup(DescribeRuleGroupRequest describeRuleGroupRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeRuleGroupRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeRuleGroupRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Network Firewall");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeRuleGroup");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeRuleGroupResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeRuleGroup").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DescribeRuleGroupRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(describeRuleGroupRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* High-level information about a rule group, returned by operations like create and describe. You can use the
* information provided in the metadata to retrieve and manage a rule group. You can retrieve all objects for a rule
* group by calling DescribeRuleGroup.
*
*
* @param describeRuleGroupMetadataRequest
* @return A Java Future containing the result of the DescribeRuleGroupMetadata operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InvalidRequestException The operation failed because of a problem with your request. Examples
* include:
*
* -
*
* You specified an unsupported parameter name or value.
*
*
* -
*
* You tried to update a property with a value that isn't among the available types.
*
*
* -
*
* Your request references an ARN that is malformed, or corresponds to a resource that isn't valid in the
* context of the request.
*
*
* - ResourceNotFoundException Unable to locate a resource using the parameters that you provided.
* - ThrottlingException Unable to process the request due to throttling limitations.
* - InternalServerErrorException Your request is valid, but Network Firewall couldn't perform the
* operation because of a system problem. Retry your request.
* - 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.
* - NetworkFirewallException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkFirewallAsyncClient.DescribeRuleGroupMetadata
* @see AWS API Documentation
*/
@Override
public CompletableFuture describeRuleGroupMetadata(
DescribeRuleGroupMetadataRequest describeRuleGroupMetadataRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeRuleGroupMetadataRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeRuleGroupMetadataRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Network Firewall");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeRuleGroupMetadata");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeRuleGroupMetadataResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeRuleGroupMetadata").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DescribeRuleGroupMetadataRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(describeRuleGroupMetadataRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns the data objects for the specified TLS inspection configuration.
*
*
* @param describeTlsInspectionConfigurationRequest
* @return A Java Future containing the result of the DescribeTLSInspectionConfiguration operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InvalidRequestException The operation failed because of a problem with your request. Examples
* include:
*
* -
*
* You specified an unsupported parameter name or value.
*
*
* -
*
* You tried to update a property with a value that isn't among the available types.
*
*
* -
*
* Your request references an ARN that is malformed, or corresponds to a resource that isn't valid in the
* context of the request.
*
*
* - InternalServerErrorException Your request is valid, but Network Firewall couldn't perform the
* operation because of a system problem. Retry your request.
* - ResourceNotFoundException Unable to locate a resource using the parameters that you provided.
* - ThrottlingException Unable to process the request due to throttling limitations.
* - 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.
* - NetworkFirewallException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkFirewallAsyncClient.DescribeTLSInspectionConfiguration
* @see AWS API Documentation
*/
@Override
public CompletableFuture describeTLSInspectionConfiguration(
DescribeTlsInspectionConfigurationRequest describeTlsInspectionConfigurationRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeTlsInspectionConfigurationRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
describeTlsInspectionConfigurationRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Network Firewall");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeTLSInspectionConfiguration");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(operationMetadata, DescribeTlsInspectionConfigurationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeTLSInspectionConfiguration").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DescribeTlsInspectionConfigurationRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(describeTlsInspectionConfigurationRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Removes the specified subnet associations from the firewall. This removes the firewall endpoints from the subnets
* and removes any network filtering protections that the endpoints were providing.
*
*
* @param disassociateSubnetsRequest
* @return A Java Future containing the result of the DisassociateSubnets operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InvalidRequestException The operation failed because of a problem with your request. Examples
* include:
*
* -
*
* You specified an unsupported parameter name or value.
*
*
* -
*
* You tried to update a property with a value that isn't among the available types.
*
*
* -
*
* Your request references an ARN that is malformed, or corresponds to a resource that isn't valid in the
* context of the request.
*
*
* - InternalServerErrorException Your request is valid, but Network Firewall couldn't perform the
* operation because of a system problem. Retry your request.
* - ResourceNotFoundException Unable to locate a resource using the parameters that you provided.
* - ThrottlingException Unable to process the request due to throttling limitations.
* - InvalidTokenException The token you provided is stale or isn't valid for the operation.
* - InvalidOperationException The operation failed because it's not valid. For example, you might have
* tried to delete a rule group or firewall policy that's 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.
* - NetworkFirewallException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkFirewallAsyncClient.DisassociateSubnets
* @see AWS API Documentation
*/
@Override
public CompletableFuture disassociateSubnets(
DisassociateSubnetsRequest disassociateSubnetsRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(disassociateSubnetsRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, disassociateSubnetsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Network Firewall");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DisassociateSubnets");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DisassociateSubnetsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DisassociateSubnets").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DisassociateSubnetsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(disassociateSubnetsRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Retrieves the metadata for the firewall policies that you have defined. Depending on your setting for max results
* and the number of firewall policies, a single call might not return the full list.
*
*
* @param listFirewallPoliciesRequest
* @return A Java Future containing the result of the ListFirewallPolicies operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InvalidRequestException The operation failed because of a problem with your request. Examples
* include:
*
* -
*
* You specified an unsupported parameter name or value.
*
*
* -
*
* You tried to update a property with a value that isn't among the available types.
*
*
* -
*
* Your request references an ARN that is malformed, or corresponds to a resource that isn't valid in the
* context of the request.
*
*
* - ThrottlingException Unable to process the request due to throttling limitations.
* - InternalServerErrorException Your request is valid, but Network Firewall couldn't perform the
* operation because of a system problem. Retry your request.
* - 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.
* - NetworkFirewallException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkFirewallAsyncClient.ListFirewallPolicies
* @see AWS API Documentation
*/
@Override
public CompletableFuture listFirewallPolicies(
ListFirewallPoliciesRequest listFirewallPoliciesRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listFirewallPoliciesRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listFirewallPoliciesRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Network Firewall");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListFirewallPolicies");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListFirewallPoliciesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListFirewallPolicies").withProtocolMetadata(protocolMetadata)
.withMarshaller(new ListFirewallPoliciesRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(listFirewallPoliciesRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Retrieves the metadata for the firewalls that you have defined. If you provide VPC identifiers in your request,
* this returns only the firewalls for those VPCs.
*
*
* Depending on your setting for max results and the number of firewalls, a single call might not return the full
* list.
*
*
* @param listFirewallsRequest
* @return A Java Future containing the result of the ListFirewalls operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InvalidRequestException The operation failed because of a problem with your request. Examples
* include:
*
* -
*
* You specified an unsupported parameter name or value.
*
*
* -
*
* You tried to update a property with a value that isn't among the available types.
*
*
* -
*
* Your request references an ARN that is malformed, or corresponds to a resource that isn't valid in the
* context of the request.
*
*
* - InternalServerErrorException Your request is valid, but Network Firewall couldn't perform the
* operation because of a system problem. Retry your request.
* - ThrottlingException Unable to process the request due to throttling limitations.
* - 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.
* - NetworkFirewallException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkFirewallAsyncClient.ListFirewalls
* @see AWS API Documentation
*/
@Override
public CompletableFuture listFirewalls(ListFirewallsRequest listFirewallsRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listFirewallsRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listFirewallsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Network Firewall");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListFirewalls");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListFirewallsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListFirewalls").withProtocolMetadata(protocolMetadata)
.withMarshaller(new ListFirewallsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(listFirewallsRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Retrieves the metadata for the rule groups that you have defined. Depending on your setting for max results and
* the number of rule groups, a single call might not return the full list.
*
*
* @param listRuleGroupsRequest
* @return A Java Future containing the result of the ListRuleGroups operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InvalidRequestException The operation failed because of a problem with your request. Examples
* include:
*
* -
*
* You specified an unsupported parameter name or value.
*
*
* -
*
* You tried to update a property with a value that isn't among the available types.
*
*
* -
*
* Your request references an ARN that is malformed, or corresponds to a resource that isn't valid in the
* context of the request.
*
*
* - ThrottlingException Unable to process the request due to throttling limitations.
* - InternalServerErrorException Your request is valid, but Network Firewall couldn't perform the
* operation because of a system problem. Retry your request.
* - 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.
* - NetworkFirewallException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkFirewallAsyncClient.ListRuleGroups
* @see AWS API Documentation
*/
@Override
public CompletableFuture listRuleGroups(ListRuleGroupsRequest listRuleGroupsRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listRuleGroupsRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listRuleGroupsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Network Firewall");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListRuleGroups");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListRuleGroupsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListRuleGroups").withProtocolMetadata(protocolMetadata)
.withMarshaller(new ListRuleGroupsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(listRuleGroupsRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Retrieves the metadata for the TLS inspection configurations that you have defined. Depending on your setting for
* max results and the number of TLS inspection configurations, a single call might not return the full list.
*
*
* @param listTlsInspectionConfigurationsRequest
* @return A Java Future containing the result of the ListTLSInspectionConfigurations operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InvalidRequestException The operation failed because of a problem with your request. Examples
* include:
*
* -
*
* You specified an unsupported parameter name or value.
*
*
* -
*
* You tried to update a property with a value that isn't among the available types.
*
*
* -
*
* Your request references an ARN that is malformed, or corresponds to a resource that isn't valid in the
* context of the request.
*
*
* - InternalServerErrorException Your request is valid, but Network Firewall couldn't perform the
* operation because of a system problem. Retry your request.
* - ThrottlingException Unable to process the request due to throttling limitations.
* - 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.
* - NetworkFirewallException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkFirewallAsyncClient.ListTLSInspectionConfigurations
* @see AWS API Documentation
*/
@Override
public CompletableFuture listTLSInspectionConfigurations(
ListTlsInspectionConfigurationsRequest listTlsInspectionConfigurationsRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listTlsInspectionConfigurationsRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
listTlsInspectionConfigurationsRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Network Firewall");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListTLSInspectionConfigurations");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListTlsInspectionConfigurationsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListTLSInspectionConfigurations").withProtocolMetadata(protocolMetadata)
.withMarshaller(new ListTlsInspectionConfigurationsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(listTlsInspectionConfigurationsRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Retrieves the tags associated with the specified resource. Tags are key:value pairs that you can use to
* categorize and manage your resources, for purposes like billing. For example, you might set the tag key to
* "customer" and the value to the customer name or ID. You can specify one or more tags to add to each Amazon Web
* Services resource, up to 50 tags for a resource.
*
*
* You can tag the Amazon Web Services resources that you manage through Network Firewall: firewalls, firewall
* policies, and rule groups.
*
*
* @param listTagsForResourceRequest
* @return A Java Future containing the result of the ListTagsForResource operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ThrottlingException Unable to process the request due to throttling limitations.
* - InternalServerErrorException Your request is valid, but Network Firewall couldn't perform the
* operation because of a system problem. Retry your request.
* - ResourceNotFoundException Unable to locate a resource using the parameters that you provided.
* - InvalidRequestException The operation failed because of a problem with your request. Examples
* include:
*
* -
*
* You specified an unsupported parameter name or value.
*
*
* -
*
* You tried to update a property with a value that isn't among the available types.
*
*
* -
*
* Your request references an ARN that is malformed, or corresponds to a resource that isn't valid in the
* context of the request.
*
*
* - 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.
* - NetworkFirewallException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkFirewallAsyncClient.ListTagsForResource
* @see AWS API Documentation
*/
@Override
public CompletableFuture listTagsForResource(
ListTagsForResourceRequest listTagsForResourceRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listTagsForResourceRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listTagsForResourceRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Network Firewall");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListTagsForResource");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListTagsForResourceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListTagsForResource").withProtocolMetadata(protocolMetadata)
.withMarshaller(new ListTagsForResourceRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(listTagsForResourceRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Creates or updates an IAM policy for your rule group or firewall policy. Use this to share rule groups and
* firewall policies between accounts. This operation works in conjunction with the Amazon Web Services Resource
* Access Manager (RAM) service to manage resource sharing for Network Firewall.
*
*
* Use this operation to create or update a resource policy for your rule group or firewall policy. In the policy,
* you specify the accounts that you want to share the resource with and the operations that you want the accounts
* to be able to perform.
*
*
* When you add an account in the resource policy, you then run the following Resource Access Manager (RAM)
* operations to access and accept the shared rule group or firewall policy.
*
*
* -
*
*
* GetResourceShareInvitations - Returns the Amazon Resource Names (ARNs) of the resource share invitations.
*
*
* -
*
*
* AcceptResourceShareInvitation - Accepts the share invitation for a specified resource share.
*
*
*
*
* For additional information about resource sharing using RAM, see Resource Access Manager User Guide.
*
*
* @param putResourcePolicyRequest
* @return A Java Future containing the result of the PutResourcePolicy operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InvalidRequestException The operation failed because of a problem with your request. Examples
* include:
*
* -
*
* You specified an unsupported parameter name or value.
*
*
* -
*
* You tried to update a property with a value that isn't among the available types.
*
*
* -
*
* Your request references an ARN that is malformed, or corresponds to a resource that isn't valid in the
* context of the request.
*
*
* - InternalServerErrorException Your request is valid, but Network Firewall couldn't perform the
* operation because of a system problem. Retry your request.
* - ResourceNotFoundException Unable to locate a resource using the parameters that you provided.
* - ThrottlingException Unable to process the request due to throttling limitations.
* - InvalidResourcePolicyException The policy statement failed validation.
* - 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.
* - NetworkFirewallException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkFirewallAsyncClient.PutResourcePolicy
* @see AWS API Documentation
*/
@Override
public CompletableFuture putResourcePolicy(PutResourcePolicyRequest putResourcePolicyRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(putResourcePolicyRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, putResourcePolicyRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Network Firewall");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "PutResourcePolicy");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, PutResourcePolicyResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("PutResourcePolicy").withProtocolMetadata(protocolMetadata)
.withMarshaller(new PutResourcePolicyRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(putResourcePolicyRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Adds the specified tags to the specified resource. Tags are key:value pairs that you can use to categorize and
* manage your resources, for purposes like billing. For example, you might set the tag key to "customer" and the
* value to the customer name or ID. You can specify one or more tags to add to each Amazon Web Services resource,
* up to 50 tags for a resource.
*
*
* You can tag the Amazon Web Services resources that you manage through Network Firewall: firewalls, firewall
* policies, and rule groups.
*
*
* @param tagResourceRequest
* @return A Java Future containing the result of the TagResource operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ThrottlingException Unable to process the request due to throttling limitations.
* - InternalServerErrorException Your request is valid, but Network Firewall couldn't perform the
* operation because of a system problem. Retry your request.
* - ResourceNotFoundException Unable to locate a resource using the parameters that you provided.
* - InvalidRequestException The operation failed because of a problem with your request. Examples
* include:
*
* -
*
* You specified an unsupported parameter name or value.
*
*
* -
*
* You tried to update a property with a value that isn't among the available types.
*
*
* -
*
* Your request references an ARN that is malformed, or corresponds to a resource that isn't valid in the
* context of the request.
*
*
* - 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.
* - NetworkFirewallException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkFirewallAsyncClient.TagResource
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture tagResource(TagResourceRequest tagResourceRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(tagResourceRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, tagResourceRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Network Firewall");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "TagResource");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
TagResourceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("TagResource").withProtocolMetadata(protocolMetadata)
.withMarshaller(new TagResourceRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(tagResourceRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Removes the tags with the specified keys from the specified resource. Tags are key:value pairs that you can use
* to categorize and manage your resources, for purposes like billing. For example, you might set the tag key to
* "customer" and the value to the customer name or ID. You can specify one or more tags to add to each Amazon Web
* Services resource, up to 50 tags for a resource.
*
*
* You can manage tags for the Amazon Web Services resources that you manage through Network Firewall: firewalls,
* firewall policies, and rule groups.
*
*
* @param untagResourceRequest
* @return A Java Future containing the result of the UntagResource operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ThrottlingException Unable to process the request due to throttling limitations.
* - InternalServerErrorException Your request is valid, but Network Firewall couldn't perform the
* operation because of a system problem. Retry your request.
* - ResourceNotFoundException Unable to locate a resource using the parameters that you provided.
* - InvalidRequestException The operation failed because of a problem with your request. Examples
* include:
*
* -
*
* You specified an unsupported parameter name or value.
*
*
* -
*
* You tried to update a property with a value that isn't among the available types.
*
*
* -
*
* Your request references an ARN that is malformed, or corresponds to a resource that isn't valid in the
* context of the request.
*
*
* - 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.
* - NetworkFirewallException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkFirewallAsyncClient.UntagResource
* @see AWS API Documentation
*/
@Override
public CompletableFuture untagResource(UntagResourceRequest untagResourceRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(untagResourceRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, untagResourceRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Network Firewall");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UntagResource");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
UntagResourceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("UntagResource").withProtocolMetadata(protocolMetadata)
.withMarshaller(new UntagResourceRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(untagResourceRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Modifies the flag, DeleteProtection
, which indicates whether it is possible to delete the firewall.
* If the flag is set to TRUE
, the firewall is protected against deletion. This setting helps protect
* against accidentally deleting a firewall that's in use.
*
*
* @param updateFirewallDeleteProtectionRequest
* @return A Java Future containing the result of the UpdateFirewallDeleteProtection operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InvalidRequestException The operation failed because of a problem with your request. Examples
* include:
*
* -
*
* You specified an unsupported parameter name or value.
*
*
* -
*
* You tried to update a property with a value that isn't among the available types.
*
*
* -
*
* Your request references an ARN that is malformed, or corresponds to a resource that isn't valid in the
* context of the request.
*
*
* - InternalServerErrorException Your request is valid, but Network Firewall couldn't perform the
* operation because of a system problem. Retry your request.
* - ResourceNotFoundException Unable to locate a resource using the parameters that you provided.
* - ThrottlingException Unable to process the request due to throttling limitations.
* - InvalidTokenException The token you provided is stale or isn't valid for the operation.
* - ResourceOwnerCheckException Unable to change the resource because your account doesn't own it.
* - 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.
* - NetworkFirewallException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkFirewallAsyncClient.UpdateFirewallDeleteProtection
* @see AWS API Documentation
*/
@Override
public CompletableFuture updateFirewallDeleteProtection(
UpdateFirewallDeleteProtectionRequest updateFirewallDeleteProtectionRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateFirewallDeleteProtectionRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
updateFirewallDeleteProtectionRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Network Firewall");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateFirewallDeleteProtection");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, UpdateFirewallDeleteProtectionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("UpdateFirewallDeleteProtection").withProtocolMetadata(protocolMetadata)
.withMarshaller(new UpdateFirewallDeleteProtectionRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(updateFirewallDeleteProtectionRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Modifies the description for the specified firewall. Use the description to help you identify the firewall when
* you're working with it.
*
*
* @param updateFirewallDescriptionRequest
* @return A Java Future containing the result of the UpdateFirewallDescription operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InvalidRequestException The operation failed because of a problem with your request. Examples
* include:
*
* -
*
* You specified an unsupported parameter name or value.
*
*
* -
*
* You tried to update a property with a value that isn't among the available types.
*
*
* -
*
* Your request references an ARN that is malformed, or corresponds to a resource that isn't valid in the
* context of the request.
*
*
* - InternalServerErrorException Your request is valid, but Network Firewall couldn't perform the
* operation because of a system problem. Retry your request.
* - ResourceNotFoundException Unable to locate a resource using the parameters that you provided.
* - ThrottlingException Unable to process the request due to throttling limitations.
* - InvalidTokenException The token you provided is stale or isn't valid for the operation.
* - 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.
* - NetworkFirewallException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkFirewallAsyncClient.UpdateFirewallDescription
* @see AWS API Documentation
*/
@Override
public CompletableFuture updateFirewallDescription(
UpdateFirewallDescriptionRequest updateFirewallDescriptionRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateFirewallDescriptionRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, updateFirewallDescriptionRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Network Firewall");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateFirewallDescription");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, UpdateFirewallDescriptionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("UpdateFirewallDescription").withProtocolMetadata(protocolMetadata)
.withMarshaller(new UpdateFirewallDescriptionRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(updateFirewallDescriptionRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* A complex type that contains settings for encryption of your firewall resources.
*
*
* @param updateFirewallEncryptionConfigurationRequest
* @return A Java Future containing the result of the UpdateFirewallEncryptionConfiguration operation returned by
* the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InvalidRequestException The operation failed because of a problem with your request. Examples
* include:
*
* -
*
* You specified an unsupported parameter name or value.
*
*
* -
*
* You tried to update a property with a value that isn't among the available types.
*
*
* -
*
* Your request references an ARN that is malformed, or corresponds to a resource that isn't valid in the
* context of the request.
*
*
* - InternalServerErrorException Your request is valid, but Network Firewall couldn't perform the
* operation because of a system problem. Retry your request.
* - ResourceNotFoundException Unable to locate a resource using the parameters that you provided.
* - ThrottlingException Unable to process the request due to throttling limitations.
* - InvalidTokenException The token you provided is stale or isn't valid for the operation.
* - ResourceOwnerCheckException Unable to change the resource because your account doesn't own it.
* - 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.
* - NetworkFirewallException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkFirewallAsyncClient.UpdateFirewallEncryptionConfiguration
* @see AWS API Documentation
*/
@Override
public CompletableFuture updateFirewallEncryptionConfiguration(
UpdateFirewallEncryptionConfigurationRequest updateFirewallEncryptionConfigurationRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateFirewallEncryptionConfigurationRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
updateFirewallEncryptionConfigurationRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Network Firewall");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateFirewallEncryptionConfiguration");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(operationMetadata, UpdateFirewallEncryptionConfigurationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("UpdateFirewallEncryptionConfiguration").withProtocolMetadata(protocolMetadata)
.withMarshaller(new UpdateFirewallEncryptionConfigurationRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(updateFirewallEncryptionConfigurationRequest));
CompletableFuture whenCompleted = executeFuture
.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Updates the properties of the specified firewall policy.
*
*
* @param updateFirewallPolicyRequest
* @return A Java Future containing the result of the UpdateFirewallPolicy operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InvalidRequestException The operation failed because of a problem with your request. Examples
* include:
*
* -
*
* You specified an unsupported parameter name or value.
*
*
* -
*
* You tried to update a property with a value that isn't among the available types.
*
*
* -
*
* Your request references an ARN that is malformed, or corresponds to a resource that isn't valid in the
* context of the request.
*
*
* - ResourceNotFoundException Unable to locate a resource using the parameters that you provided.
* - ThrottlingException Unable to process the request due to throttling limitations.
* - InternalServerErrorException Your request is valid, but Network Firewall couldn't perform the
* operation because of a system problem. Retry your request.
* - InvalidTokenException The token you provided is stale or isn't valid for the operation.
* - 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.
* - NetworkFirewallException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkFirewallAsyncClient.UpdateFirewallPolicy
* @see AWS API Documentation
*/
@Override
public CompletableFuture updateFirewallPolicy(
UpdateFirewallPolicyRequest updateFirewallPolicyRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateFirewallPolicyRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, updateFirewallPolicyRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Network Firewall");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateFirewallPolicy");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, UpdateFirewallPolicyResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("UpdateFirewallPolicy").withProtocolMetadata(protocolMetadata)
.withMarshaller(new UpdateFirewallPolicyRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(updateFirewallPolicyRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Modifies the flag, ChangeProtection
, which indicates whether it is possible to change the firewall.
* If the flag is set to TRUE
, the firewall is protected from changes. This setting helps protect
* against accidentally changing a firewall that's in use.
*
*
* @param updateFirewallPolicyChangeProtectionRequest
* @return A Java Future containing the result of the UpdateFirewallPolicyChangeProtection operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InvalidRequestException The operation failed because of a problem with your request. Examples
* include:
*
* -
*
* You specified an unsupported parameter name or value.
*
*
* -
*
* You tried to update a property with a value that isn't among the available types.
*
*
* -
*
* Your request references an ARN that is malformed, or corresponds to a resource that isn't valid in the
* context of the request.
*
*
* - InternalServerErrorException Your request is valid, but Network Firewall couldn't perform the
* operation because of a system problem. Retry your request.
* - ResourceNotFoundException Unable to locate a resource using the parameters that you provided.
* - ThrottlingException Unable to process the request due to throttling limitations.
* - InvalidTokenException The token you provided is stale or isn't valid for the operation.
* - ResourceOwnerCheckException Unable to change the resource because your account doesn't own it.
* - 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.
* - NetworkFirewallException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkFirewallAsyncClient.UpdateFirewallPolicyChangeProtection
* @see AWS API Documentation
*/
@Override
public CompletableFuture updateFirewallPolicyChangeProtection(
UpdateFirewallPolicyChangeProtectionRequest updateFirewallPolicyChangeProtectionRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateFirewallPolicyChangeProtectionRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
updateFirewallPolicyChangeProtectionRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Network Firewall");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateFirewallPolicyChangeProtection");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(operationMetadata, UpdateFirewallPolicyChangeProtectionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("UpdateFirewallPolicyChangeProtection").withProtocolMetadata(protocolMetadata)
.withMarshaller(new UpdateFirewallPolicyChangeProtectionRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(updateFirewallPolicyChangeProtectionRequest));
CompletableFuture whenCompleted = executeFuture
.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Sets the logging configuration for the specified firewall.
*
*
* To change the logging configuration, retrieve the LoggingConfiguration by calling
* DescribeLoggingConfiguration, then change it and provide the modified object to this update call. You must
* change the logging configuration one LogDestinationConfig at a time inside the retrieved
* LoggingConfiguration object.
*
*
* You can perform only one of the following actions in any call to UpdateLoggingConfiguration
:
*
*
* -
*
* Create a new log destination object by adding a single LogDestinationConfig
array element to
* LogDestinationConfigs
.
*
*
* -
*
* Delete a log destination object by removing a single LogDestinationConfig
array element from
* LogDestinationConfigs
.
*
*
* -
*
* Change the LogDestination
setting in a single LogDestinationConfig
array element.
*
*
*
*
* You can't change the LogDestinationType
or LogType
in a
* LogDestinationConfig
. To change these settings, delete the existing
* LogDestinationConfig
object and create a new one, using two separate calls to this update operation.
*
*
* @param updateLoggingConfigurationRequest
* @return A Java Future containing the result of the UpdateLoggingConfiguration operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InvalidRequestException The operation failed because of a problem with your request. Examples
* include:
*
* -
*
* You specified an unsupported parameter name or value.
*
*
* -
*
* You tried to update a property with a value that isn't among the available types.
*
*
* -
*
* Your request references an ARN that is malformed, or corresponds to a resource that isn't valid in the
* context of the request.
*
*
* - InternalServerErrorException Your request is valid, but Network Firewall couldn't perform the
* operation because of a system problem. Retry your request.
* - ResourceNotFoundException Unable to locate a resource using the parameters that you provided.
* - ThrottlingException Unable to process the request due to throttling limitations.
* - InvalidTokenException The token you provided is stale or isn't valid for the operation.
* - LogDestinationPermissionException Unable to send logs to a configured logging destination.
* - 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.
* - NetworkFirewallException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkFirewallAsyncClient.UpdateLoggingConfiguration
* @see AWS API Documentation
*/
@Override
public CompletableFuture updateLoggingConfiguration(
UpdateLoggingConfigurationRequest updateLoggingConfigurationRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateLoggingConfigurationRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, updateLoggingConfigurationRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Network Firewall");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateLoggingConfiguration");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, UpdateLoggingConfigurationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("UpdateLoggingConfiguration").withProtocolMetadata(protocolMetadata)
.withMarshaller(new UpdateLoggingConfigurationRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(updateLoggingConfigurationRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Updates the rule settings for the specified rule group. You use a rule group by reference in one or more firewall
* policies. When you modify a rule group, you modify all firewall policies that use the rule group.
*
*
* To update a rule group, first call DescribeRuleGroup to retrieve the current RuleGroup object,
* update the object as needed, and then provide the updated object to this call.
*
*
* @param updateRuleGroupRequest
* @return A Java Future containing the result of the UpdateRuleGroup operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException Unable to locate a resource using the parameters that you provided.
* - InvalidRequestException The operation failed because of a problem with your request. Examples
* include:
*
* -
*
* You specified an unsupported parameter name or value.
*
*
* -
*
* You tried to update a property with a value that isn't among the available types.
*
*
* -
*
* Your request references an ARN that is malformed, or corresponds to a resource that isn't valid in the
* context of the request.
*
*
* - ThrottlingException Unable to process the request due to throttling limitations.
* - InternalServerErrorException Your request is valid, but Network Firewall couldn't perform the
* operation because of a system problem. Retry your request.
* - InvalidTokenException The token you provided is stale or isn't valid for the operation.
* - 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.
* - NetworkFirewallException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkFirewallAsyncClient.UpdateRuleGroup
* @see AWS API Documentation
*/
@Override
public CompletableFuture updateRuleGroup(UpdateRuleGroupRequest updateRuleGroupRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateRuleGroupRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, updateRuleGroupRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Network Firewall");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateRuleGroup");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, UpdateRuleGroupResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("UpdateRuleGroup").withProtocolMetadata(protocolMetadata)
.withMarshaller(new UpdateRuleGroupRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(updateRuleGroupRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
*
* @param updateSubnetChangeProtectionRequest
* @return A Java Future containing the result of the UpdateSubnetChangeProtection operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InvalidRequestException The operation failed because of a problem with your request. Examples
* include:
*
*
* -
*
* You specified an unsupported parameter name or value.
*
*
* -
*
* You tried to update a property with a value that isn't among the available types.
*
*
* -
*
* Your request references an ARN that is malformed, or corresponds to a resource that isn't valid in the
* context of the request.
*
*
* - InternalServerErrorException Your request is valid, but Network Firewall couldn't perform the
* operation because of a system problem. Retry your request.
* - ResourceNotFoundException Unable to locate a resource using the parameters that you provided.
* - ThrottlingException Unable to process the request due to throttling limitations.
* - InvalidTokenException The token you provided is stale or isn't valid for the operation.
* - ResourceOwnerCheckException Unable to change the resource because your account doesn't own it.
* - 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.
* - NetworkFirewallException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkFirewallAsyncClient.UpdateSubnetChangeProtection
* @see AWS API Documentation
*/
@Override
public CompletableFuture updateSubnetChangeProtection(
UpdateSubnetChangeProtectionRequest updateSubnetChangeProtectionRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateSubnetChangeProtectionRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, updateSubnetChangeProtectionRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Network Firewall");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateSubnetChangeProtection");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, UpdateSubnetChangeProtectionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("UpdateSubnetChangeProtection").withProtocolMetadata(protocolMetadata)
.withMarshaller(new UpdateSubnetChangeProtectionRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(updateSubnetChangeProtectionRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Updates the TLS inspection configuration settings for the specified TLS inspection configuration. You use a TLS
* inspection configuration by referencing it in one or more firewall policies. When you modify a TLS inspection
* configuration, you modify all firewall policies that use the TLS inspection configuration.
*
*
* To update a TLS inspection configuration, first call DescribeTLSInspectionConfiguration to retrieve the
* current TLSInspectionConfiguration object, update the object as needed, and then provide the updated
* object to this call.
*
*
* @param updateTlsInspectionConfigurationRequest
* @return A Java Future containing the result of the UpdateTLSInspectionConfiguration operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InvalidRequestException The operation failed because of a problem with your request. Examples
* include:
*
* -
*
* You specified an unsupported parameter name or value.
*
*
* -
*
* You tried to update a property with a value that isn't among the available types.
*
*
* -
*
* Your request references an ARN that is malformed, or corresponds to a resource that isn't valid in the
* context of the request.
*
*
* - ResourceNotFoundException Unable to locate a resource using the parameters that you provided.
* - ThrottlingException Unable to process the request due to throttling limitations.
* - InternalServerErrorException Your request is valid, but Network Firewall couldn't perform the
* operation because of a system problem. Retry your request.
* - InvalidTokenException The token you provided is stale or isn't valid for the operation.
* - 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.
* - NetworkFirewallException Base class for all service exceptions. Unknown exceptions will be thrown as
* an instance of this type.
*
* @sample NetworkFirewallAsyncClient.UpdateTLSInspectionConfiguration
* @see AWS API Documentation
*/
@Override
public CompletableFuture updateTLSInspectionConfiguration(
UpdateTlsInspectionConfigurationRequest updateTlsInspectionConfigurationRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateTlsInspectionConfigurationRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
updateTlsInspectionConfigurationRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Network Firewall");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateTLSInspectionConfiguration");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(operationMetadata, UpdateTlsInspectionConfigurationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams