public WaiterExecution<Input, Output> build() { return new WaiterExecution<Input, Output>(this); }
int retriesAttempted = 0; while (true) { switch (getCurrentState()) { case SUCCESS: return true; PollingStrategyContext pollingStrategyContext = new PollingStrategyContext(request, retriesAttempted); if (pollingStrategy.getRetryStrategy().shouldRetry(pollingStrategyContext)) { safeCustomDelay(pollingStrategyContext); retriesAttempted++; } else {
/** * Polls synchronously until it is determined that the resource * transitioned into the desired state or not. * * @param waiterParameters Custom provided parameters. Includes request and * optional custom polling strategy * @throws AmazonServiceException If the service exception thrown doesn't match any of the expected * exceptions, it's re-thrown. * @throws WaiterUnrecoverableException If the resource transitions into a failure/unexpected state. * @throws WaiterTimedOutException If the resource doesn't transition into the desired state * even after a certain number of retries. */ public void run(WaiterParameters<Input> waiterParameters) throws AmazonServiceException, WaiterTimedOutException, WaiterUnrecoverableException { ValidationUtils.assertNotNull(waiterParameters, "waiterParameters"); @SuppressWarnings("unchecked") Input request = (Input) ValidationUtils.assertNotNull(waiterParameters.getRequest(), "request").clone(); request.getRequestClientOptions().appendUserAgent("waiter-request"); WaiterExecution<Input, Output> waiterExecution = new WaiterExecutionBuilder<Input, Output>() .withRequest(request) .withPollingStrategy(waiterParameters.getPollingStrategy() != null ? waiterParameters.getPollingStrategy() : defaultPollingStrategy) .withAcceptors(acceptors) .withSdkFunction(sdkFunction) .build(); waiterExecution.pollResource(); }
/** * Polls synchronously until it is determined that the resource * transitioned into the desired state or not. * * @param waiterParameters Custom provided parameters. Includes request and * optional custom polling strategy * @throws AmazonServiceException If the service exception thrown doesn't match any of the expected * exceptions, it's re-thrown. * @throws WaiterUnrecoverableException If the resource transitions into a failure/unexpected state. * @throws WaiterTimedOutException If the resource doesn't transition into the desired state * even after a certain number of retries. */ public void run(WaiterParameters<Input> waiterParameters) throws AmazonServiceException, WaiterTimedOutException, WaiterUnrecoverableException { ValidationUtils.assertNotNull(waiterParameters, "waiterParameters"); @SuppressWarnings("unchecked") Input request = (Input) ValidationUtils.assertNotNull(waiterParameters.getRequest(), "request").clone(); request.getRequestClientOptions().appendUserAgent("waiter-request"); WaiterExecution<Input, Output> waiterExecution = new WaiterExecutionBuilder<Input, Output>() .withRequest(request) .withPollingStrategy(waiterParameters.getPollingStrategy() != null ? waiterParameters.getPollingStrategy() : defaultPollingStrategy) .withAcceptors(acceptors) .withSdkFunction(sdkFunction) .build(); waiterExecution.pollResource(); }
int retriesAttempted = 0; while (true) { switch (getCurrentState()) { case SUCCESS: return true; PollingStrategyContext pollingStrategyContext = new PollingStrategyContext(request, retriesAttempted); if (pollingStrategy.getRetryStrategy().shouldRetry(pollingStrategyContext)) { safeCustomDelay(pollingStrategyContext); retriesAttempted++; } else {
public WaiterExecution<Input, Output> build() { return new WaiterExecution<Input, Output>(this); }
/** * Polls synchronously until it is determined that the resource * transitioned into the desired state or not. * * @param waiterParameters Custom provided parameters. Includes request and * optional custom polling strategy * @throws AmazonServiceException If the service exception thrown doesn't match any of the expected * exceptions, it's re-thrown. * @throws WaiterUnrecoverableException If the resource transitions into a failure/unexpected state. * @throws WaiterTimedOutException If the resource doesn't transition into the desired state * even after a certain number of retries. */ public void run(WaiterParameters<Input> waiterParameters) throws AmazonServiceException, WaiterTimedOutException, WaiterUnrecoverableException { ValidationUtils.assertNotNull(waiterParameters, "waiterParameters"); @SuppressWarnings("unchecked") Input request = (Input) ValidationUtils.assertNotNull(waiterParameters.getRequest(), "request").clone(); request.getRequestClientOptions().appendUserAgent("waiter-request"); WaiterExecution<Input, Output> waiterExecution = new WaiterExecutionBuilder<Input, Output>() .withRequest(request) .withPollingStrategy(waiterParameters.getPollingStrategy() != null ? waiterParameters.getPollingStrategy() : defaultPollingStrategy) .withAcceptors(acceptors) .withSdkFunction(sdkFunction) .build(); waiterExecution.pollResource(); }
int retriesAttempted = 0; while (true) { switch (getCurrentState()) { case SUCCESS: return true; PollingStrategyContext pollingStrategyContext = new PollingStrategyContext(request, retriesAttempted); if (pollingStrategy.getRetryStrategy().shouldRetry(pollingStrategyContext)) { safeCustomDelay(pollingStrategyContext); retriesAttempted++; } else {
public WaiterExecution<Input, Output> build() { return new WaiterExecution<Input, Output>(this); }