/** * Compares the response against each response acceptor and returns * the state of the acceptor it matches on. If none is matched, returns * retry state by default * * @param response Response object got by executing the specified * waiter operation * @return (Enum) Corresponding waiter state defined by the acceptor or * retry state if none matched */ public WaiterState accepts(Output response) { for (WaiterAcceptor<Output> acceptor : acceptors) { if (acceptor.matches(response)) { return acceptor.getState(); } } return WaiterState.RETRY; }
/** * Compares the exception thrown against each exception acceptor and * returns the state of the acceptor it matches on. If none is * matched, it rethrows the exception to the caller * * @param exception Exception thrown by executing the specified * waiter operation * @return (Enum) Corresponding waiter state defined by the acceptor or * rethrows the exception back to the caller if none matched * @throws Exception */ public WaiterState accepts(AmazonServiceException exception) throws AmazonServiceException { for (WaiterAcceptor<Output> acceptor : acceptors) { if (acceptor.matches(exception)) { return acceptor.getState(); } } throw exception; } }
/** * Compares the response against each response acceptor and returns * the state of the acceptor it matches on. If none is matched, returns * retry state by default * * @param response Response object got by executing the specified * waiter operation * @return (Enum) Corresponding waiter state defined by the acceptor or * retry state if none matched */ public WaiterState accepts(Output response) { for (WaiterAcceptor<Output> acceptor : acceptors) { if (acceptor.matches(response)) { return acceptor.getState(); } } return WaiterState.RETRY; }
/** * Compares the exception thrown against each exception acceptor and * returns the state of the acceptor it matches on. If none is * matched, it rethrows the exception to the caller * * @param exception Exception thrown by executing the specified * waiter operation * @return (Enum) Corresponding waiter state defined by the acceptor or * rethrows the exception back to the caller if none matched * @throws Exception */ public WaiterState accepts(AmazonServiceException exception) throws AmazonServiceException { for (WaiterAcceptor<Output> acceptor : acceptors) { if (acceptor.matches(exception)) { return acceptor.getState(); } } throw exception; } }
/** * Compares the response against each response acceptor and returns * the state of the acceptor it matches on. If none is matched, returns * retry state by default * * @param response Response object got by executing the specified * waiter operation * @return (Enum) Corresponding waiter state defined by the acceptor or * retry state if none matched */ public WaiterState accepts(Output response) { for (WaiterAcceptor<Output> acceptor : acceptors) { if (acceptor.matches(response)) { return acceptor.getState(); } } return WaiterState.RETRY; }
/** * Compares the exception thrown against each exception acceptor and * returns the state of the acceptor it matches on. If none is * matched, it rethrows the exception to the caller * * @param exception Exception thrown by executing the specified * waiter operation * @return (Enum) Corresponding waiter state defined by the acceptor or * rethrows the exception back to the caller if none matched * @throws Exception */ public WaiterState accepts(AmazonServiceException exception) throws AmazonServiceException { for (WaiterAcceptor<Output> acceptor : acceptors) { if (acceptor.matches(exception)) { return acceptor.getState(); } } throw exception; } }