/** * 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(); }
/** * Constructs a new waiter with all the parameters defined * in the WaiterExecutionBuilder * * @param waiterExecutionBuilder Contains all the parameters required to construct a * new waiter */ public WaiterExecution(WaiterExecutionBuilder<Input, Output> waiterExecutionBuilder) { this.sdkFunction = ValidationUtils.assertNotNull(waiterExecutionBuilder.getSdkFunction(), "sdkFunction"); this.request = ValidationUtils.assertNotNull(waiterExecutionBuilder.getRequest(), "request"); this.acceptor = new CompositeAcceptor<Output>(ValidationUtils.assertNotNull(waiterExecutionBuilder.getAcceptorsList(), "acceptors")); this.pollingStrategy = ValidationUtils.assertNotNull(waiterExecutionBuilder.getPollingStrategy(), "pollingStrategy"); }
/** * 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(); }
/** * Constructs a new waiter with all the parameters defined * in the WaiterExecutionBuilder * * @param waiterExecutionBuilder Contains all the parameters required to construct a * new waiter */ public WaiterExecution(WaiterExecutionBuilder<Input, Output> waiterExecutionBuilder) { this.sdkFunction = ValidationUtils.assertNotNull(waiterExecutionBuilder.getSdkFunction(), "sdkFunction"); this.request = ValidationUtils.assertNotNull(waiterExecutionBuilder.getRequest(), "request"); this.acceptor = new CompositeAcceptor<Output>(ValidationUtils.assertNotNull(waiterExecutionBuilder.getAcceptorsList(), "acceptors")); this.pollingStrategy = ValidationUtils.assertNotNull(waiterExecutionBuilder.getPollingStrategy(), "pollingStrategy"); }
/** * 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(); }
/** * Constructs a new waiter with all the parameters defined * in the WaiterExecutionBuilder * * @param waiterExecutionBuilder Contains all the parameters required to construct a * new waiter */ public WaiterExecution(WaiterExecutionBuilder<Input, Output> waiterExecutionBuilder) { this.sdkFunction = ValidationUtils.assertNotNull(waiterExecutionBuilder.getSdkFunction(), "sdkFunction"); this.request = ValidationUtils.assertNotNull(waiterExecutionBuilder.getRequest(), "request"); this.acceptor = new CompositeAcceptor<Output>(ValidationUtils.assertNotNull(waiterExecutionBuilder.getAcceptorsList(), "acceptors")); this.pollingStrategy = ValidationUtils.assertNotNull(waiterExecutionBuilder.getPollingStrategy(), "pollingStrategy"); }