@Override public String getReasonPhrase() { return status.getStatusText(); } }, requestContext);
@Override public final String getStatusText() { return status.getStatusText(); }
private void fireStatus(HttpResponseStatus status) { if (listener != null) { listener.onStatus(uri, status.getStatusCode(), status.getStatusText()); } }
@Override public String getReasonPhrase() { return status.getStatusText(); } }, requestContext);
@Override public final String getStatusText() { return status.getStatusText(); }
@Override public final String getStatusText() { return status.getStatusText(); }
@Override public final String getStatusText() { return status.getStatusText(); }
@Override public STATE onStatusReceived( HttpResponseStatus httpResponseStatus ) throws Exception { int statusCode = httpResponseStatus.getStatusCode(); // we don't care about the end of the content if ( statusCode != 200 ) { LOGGER.warning( "Pushed data but response code is: " + statusCode + // ", reason:" + httpResponseStatus.getStatusText() ); } return STATE.ABORT; }
private void fireStatus(HttpResponseStatus status) { if (listener != null) { listener.onStatus(uri, status.getStatusCode(), status.getStatusText()); } }
private void fireStatus(HttpResponseStatus status) { if (listener != null) { listener.onStatus(uri, status.getStatusCode(), status.getStatusText()); } }
private void fireStatus(HttpResponseStatus status) { if (listener != null) { listener.onStatus(uri, status.getStatusCode(), status.getStatusText()); } }
@Override public STATE onStatusReceived(HttpResponseStatus status) throws Exception { super.onStatusReceived(status); if (status.getStatusCode() != 200 && status.getStatusCode() != 204) { LOG.warn("Request failed, status code: {}", status.getStatusCode() + status.getStatusText()); LOG.warn("request: {}", request.toString()); } return STATE.CONTINUE; }
/** * If the response status is 403, retry the connection with the next configured alias. Otherwise just let it * pass. */ @SuppressWarnings( { "rawtypes" } ) public FilterContext filter( FilterContext ctx ) throws FilterException { int code = ctx.getResponseStatus().getStatusCode(); String msg = ctx.getResponseStatus().getStatusText(); logger.debug( String.format( "Response received (%s, %s) ", code, msg ) ); if ( code == 403 ) { logger.debug( "Forbidden: " + msg ); if ( alias != null ) { logger.debug( "Trying next alias: " + alias ); keyManagerAggregate.setAlias( alias ); alias = aliases.poll(); return new FilterContext.FilterContextBuilder( ctx ).replayRequest( true ).build(); } logger.debug( "No alias left, won't replay connection." ); } return ctx; }
/** * {@inheritDoc} */ @Override public STATE onStatusReceived(HttpResponseStatus responseStatus) throws Exception { logger.trace("Status received {}", responseStatus); TransportsUtil.invokeFunction(STATUS, decoders, functions, Integer.class, new Integer(responseStatus.getStatusCode()), STATUS.name(), resolver); if (responseStatus.getStatusCode() == 101) { return STATE.UPGRADE; } else { logger.debug("Invalid status code {} for WebSocket Handshake", responseStatus.getStatusCode()); status = Socket.STATUS.ERROR; throw new TransportNotSupported(responseStatus.getStatusCode(), responseStatus.getStatusText()); } }
<% final ServletOutputStream finalOut = out; // create final reference AsyncHttpClient asyncHttpClient = new AsyncHttpClient(); Future<Integer> f = asyncHttpClient.prepareGet("http://www.ning.com/") .execute(new AsyncCompletionHandler<Integer>(){ public STATE onStatusReceived(HttpResponseStatus respstat)throws Exception{ ***//error occurs in next line*** finalOut.println(respstat.getStatusText()); //use final reference return STATE.CONTINUE; } @Override public Integer onCompleted(Response response) throws Exception{ // Do something with the Response out.println(response.getStatusCode()); return response.getStatusCode(); } @Override public void onThrowable(Throwable t){ // Something wrong happened. } }); %>
/** * {@inheritDoc} */ @Override public STATE onStatusReceived(HttpResponseStatus responseStatus) throws Exception { logger.trace("Status received {}", responseStatus); TransportsUtil.invokeFunction(STATUS, decoders, functions, Integer.class, new Integer(responseStatus.getStatusCode()), STATUS.name(), resolver); if (responseStatus.getStatusCode() == 101) { return STATE.UPGRADE; } else { logger.debug("Invalid status code {} for WebSocket Handshake", responseStatus.getStatusCode()); status = Socket.STATUS.ERROR; throw new TransportNotSupported(responseStatus.getStatusCode(), responseStatus.getStatusText()); } }
@Override public STATE onStatusReceived(final HttpResponseStatus status) throws Exception { // Return null for 404'd GET & DELETE requests if (status.getStatusCode() == 404 && method == HttpMethod.GET || method == HttpMethod.DELETE) { future.succeed(null); return STATE.ABORT; } // Fail on non-2xx responses final int statusCode = status.getStatusCode(); if (!(statusCode >= 200 && statusCode < 300)) { future.fail(new RequestFailedException(status.getStatusCode(), status.getStatusText())); return STATE.ABORT; } if (responseReader == VOID) { future.succeed(null); return STATE.ABORT; } return STATE.CONTINUE; }