private <T> void afterResponse( Request<?> request, List<RequestHandler2> requestHandler2s, Response<T> response, TimingInfo timingInfo) { for (RequestHandler2 handler2 : requestHandler2s) { handler2.afterResponse(request, response); } }
private void afterError( Request<?> request, Response<?> response, List<RequestHandler2> requestHandler2s, AmazonClientException e) { for (RequestHandler2 handler2 : requestHandler2s) { handler2.afterError(request, response, e); } }
private List<RequestHandler2> requestHandler2s( Request<?> request, ExecutionContext executionContext) { List<RequestHandler2> requestHandler2s = executionContext.getRequestHandler2s(); if (requestHandler2s == null) { return Collections.emptyList(); } // Apply any additional service specific request handlers that need // to be run for (RequestHandler2 requestHandler2 : requestHandler2s) { // If the request handler is a type of CredentialsRequestHandler, // then set the credentials in the request handler. if (requestHandler2 instanceof CredentialsRequestHandler) ((CredentialsRequestHandler) requestHandler2) .setCredentials(executionContext.getCredentials()); requestHandler2.beforeRequest(request); } return requestHandler2s; }