public void connectionOpen(final NHttpConnection conn) { logger.info("Connection from " + conn.getContext().getAttribute(ExecutionContext.HTTP_TARGET_HOST) // conn.getInetAddress().getHostName() ); }
public static void updateState(NHttpConnection conn, ProtocolState state) { SourceContext sourceContext = (SourceContext) conn.getContext().getAttribute(CONNECTION_INFORMATION); if (sourceContext != null) { if (sourceContext.getSourceConfiguration().isCorrelationLoggingEnabled()) { method = sourceContext.getRequest().getMethod(); } else { HttpRequest httpRequest = conn.getHttpRequest(); if (httpRequest != null) { url = httpRequest.getRequestLine().getUri(); conn.getContext().getAttribute(PassThroughConstants.CORRELATION_ID).toString()); correlationLog.info((sourceContext.updateLastStateUpdatedTime() - lastStateUpdateTime) + "|HTTP State Transition|" + conn.getContext().getAttribute("http.connection") + "|" + method + "|" + url + "|" + state.name());
private void shutdownConnection(final NHttpConnection conn) { try { conn.shutdown(); } catch (final IOException ex) { log(ex); } }
public static void updateState(NHttpConnection conn, ProtocolState state) { conn.getContext().getAttribute(CONNECTION_INFORMATION); if (targetContext != null) { targetContext.setState(state); method = targetContext.getRequest().getMethod(); } else { HttpRequest httpRequest = conn.getHttpRequest(); if (httpRequest != null) { url = httpRequest.getRequestLine().getUri(); conn.getContext().getAttribute(PassThroughConstants.CORRELATION_ID).toString()); correlationLog.info((targetContext.updateLastStateUpdatedTime() - lastStateUpdateTime) + "|HTTP State Transition|" + conn.getContext().getAttribute("http.connection") + "|" + method + "|" + url + "|" + state.name());
private void shutdownConnection(final NHttpConnection conn) { try { conn.shutdown(); } catch (final IOException ex) { log(ex); } }
public void connectionOpen(final NHttpConnection conn) { logger.info("Connection from " + conn.getContext().getAttribute(ExecutionContext.HTTP_TARGET_HOST) // conn.getInetAddress().getHostName() ); }
private void shutdownConnection(final NHttpConnection conn) { try { conn.shutdown(); } catch (final IOException ex) { log(ex); } }
private State getState(final NHttpConnection conn) { return (State) conn.getContext().getAttribute(HTTP_EXCHANGE_STATE); }
private void shutdownConnection(final NHttpConnection conn) { try { conn.shutdown(); } catch (final IOException ex) { log(ex); } }
private HttpAsyncClientExchangeHandler getHandler(final NHttpConnection conn) { return (HttpAsyncClientExchangeHandler) conn.getContext().getAttribute(HTTP_HANDLER); }
private State getState(final NHttpConnection conn) { return (State) conn.getContext().getAttribute(HTTP_EXCHANGE_STATE); }
private HttpAsyncClientExchangeHandler getHandler(final NHttpConnection conn) { return (HttpAsyncClientExchangeHandler) conn.getContext().getAttribute(HTTP_HANDLER); }
private State getState(final NHttpConnection conn) { return (State) conn.getContext().getAttribute(HTTP_EXCHANGE_STATE); }
private State getState(final NHttpConnection conn) { return (State) conn.getContext().getAttribute(HTTP_EXCHANGE_STATE); }
public void connectionOpen(final NHttpConnection conn) { logger.info("Connection from " + conn.getContext().getAttribute(ExecutionContext.HTTP_TARGET_HOST) // conn.getInetAddress().getHostName() ); }
public static SourceContext get(NHttpConnection conn) { return (SourceContext) conn.getContext().getAttribute(CONNECTION_INFORMATION); }
public static TargetContext get(NHttpConnection conn) { return (TargetContext) conn.getContext().getAttribute(CONNECTION_INFORMATION); }
public static boolean assertState(NHttpConnection conn, ProtocolState state) { SourceContext info = (SourceContext) conn.getContext().getAttribute(CONNECTION_INFORMATION); return info != null && info.getState() == state; }
public static void setResponse(NHttpConnection conn, SourceResponse response) { SourceContext info = (SourceContext) conn.getContext().getAttribute(CONNECTION_INFORMATION); if (info != null) { info.setResponse(response); } else { throw new IllegalStateException("Connection information should be present"); } }
public static void setRequest(NHttpConnection conn, TargetRequest request) { TargetContext info = (TargetContext) conn.getContext().getAttribute(CONNECTION_INFORMATION); if (info != null) { info.setRequest(request); } else { throw new IllegalStateException("Connection information should be present"); } }