/** * Builds a InstanceOnline 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<DescribeInstancesRequest> instanceOnline() { return new WaiterBuilder<DescribeInstancesRequest, DescribeInstancesResult>() .withSdkFunction(new DescribeInstancesFunction(client)) .withAcceptors(new InstanceOnline.IsOnlineMatcher(), new InstanceOnline.IsSetup_failedMatcher(), new InstanceOnline.IsShutting_downMatcher(), new InstanceOnline.IsStart_failedMatcher(), new InstanceOnline.IsStoppedMatcher(), new InstanceOnline.IsStoppingMatcher(), new InstanceOnline.IsTerminatingMatcher(), new InstanceOnline.IsTerminatedMatcher(), new InstanceOnline.IsStop_failedMatcher()) .withDefaultPollingStrategy(new PollingStrategy(new MaxAttemptsRetryStrategy(40), new FixedDelayStrategy(15))) .withExecutorService(executorService).build(); }
/** * Builds a InstanceOnline 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<DescribeInstancesRequest> instanceOnline() { return new WaiterBuilder<DescribeInstancesRequest, DescribeInstancesResult>() .withSdkFunction(new DescribeInstancesFunction(client)) .withAcceptors(new InstanceOnline.IsOnlineMatcher(), new InstanceOnline.IsSetup_failedMatcher(), new InstanceOnline.IsShutting_downMatcher(), new InstanceOnline.IsStart_failedMatcher(), new InstanceOnline.IsStoppedMatcher(), new InstanceOnline.IsStoppingMatcher(), new InstanceOnline.IsTerminatingMatcher(), new InstanceOnline.IsTerminatedMatcher(), new InstanceOnline.IsStop_failedMatcher()) .withDefaultPollingStrategy(new PollingStrategy(new MaxAttemptsRetryStrategy(40), new FixedDelayStrategy(15))) .withExecutorService(executorService).build(); }