/* * Copyright 2018-2023 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 com.amazonaws.services.cloudfront.waiters; import javax.annotation.Generated; import com.amazonaws.annotation.SdkInternalApi; import com.amazonaws.services.cloudfront.AmazonCloudFront; import com.amazonaws.services.cloudfront.model.*; import com.amazonaws.waiters.*; import java.util.concurrent.ExecutorService; @Generated("com.amazonaws:aws-java-sdk-code-generator") public class AmazonCloudFrontWaiters { /** * Represents the service client */ private final AmazonCloudFront client; private final ExecutorService executorService = WaiterExecutorServiceFactory.buildExecutorServiceForWaiter("AmazonCloudFrontWaiters"); /** * Constructs a new AmazonCloudFrontWaiters with the given client * * @param client * Service client */ @SdkInternalApi public AmazonCloudFrontWaiters(AmazonCloudFront client) { this.client = client; } /** * Builds a DistributionDeployed waiter by using custom parameters waiterParameters and other parameters defined in * the waiters specification, and then polls until it determines whether the resource entered the desired state or * not, where polling criteria is bound by either default polling strategy or custom polling strategy. */ public Waiter distributionDeployed() { return new WaiterBuilder().withSdkFunction(new GetDistributionFunction(client)) .withAcceptors(new DistributionDeployed.IsDeployedMatcher()) .withDefaultPollingStrategy(new PollingStrategy(new MaxAttemptsRetryStrategy(35), new FixedDelayStrategy(60))) .withExecutorService(executorService).build(); } /** * Builds a StreamingDistributionDeployed waiter by using custom parameters waiterParameters and other parameters * defined in the waiters specification, and then polls until it determines whether the resource entered the desired * state or not, where polling criteria is bound by either default polling strategy or custom polling strategy. */ public Waiter streamingDistributionDeployed() { return new WaiterBuilder() .withSdkFunction(new GetStreamingDistributionFunction(client)).withAcceptors(new StreamingDistributionDeployed.IsDeployedMatcher()) .withDefaultPollingStrategy(new PollingStrategy(new MaxAttemptsRetryStrategy(25), new FixedDelayStrategy(60))) .withExecutorService(executorService).build(); } /** * Builds a InvalidationCompleted waiter by using custom parameters waiterParameters and other parameters defined in * the waiters specification, and then polls until it determines whether the resource entered the desired state or * not, where polling criteria is bound by either default polling strategy or custom polling strategy. */ public Waiter invalidationCompleted() { return new WaiterBuilder().withSdkFunction(new GetInvalidationFunction(client)) .withAcceptors(new InvalidationCompleted.IsCompletedMatcher()) .withDefaultPollingStrategy(new PollingStrategy(new MaxAttemptsRetryStrategy(30), new FixedDelayStrategy(20))) .withExecutorService(executorService).build(); } public void shutdown() { executorService.shutdown(); } }