public void connectionOpen(final NHttpConnection conn) { logger.info("Connection from " + conn.getContext().getAttribute(ExecutionContext.HTTP_TARGET_HOST) // conn.getInetAddress().getHostName() ); }
public void connectionOpen(final NHttpConnection conn) { logger.info("Connection from " + conn.getContext().getAttribute(ExecutionContext.HTTP_TARGET_HOST) // conn.getInetAddress().getHostName() ); }
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); }
public void connectionOpen(final NHttpConnection conn) { logger.info("Connection from " + conn.getContext().getAttribute(ExecutionContext.HTTP_TARGET_HOST) // conn.getInetAddress().getHostName() ); }
public static void setResponse(NHttpConnection conn, TargetResponse response) { TargetContext info = (TargetContext) conn.getContext().getAttribute(CONNECTION_INFORMATION); if (info != null) { info.setResponse(response); } else { throw new IllegalStateException("Connection information should be present"); } }
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"); } }
public static ProtocolState getState(NHttpConnection conn) { SourceContext info = (SourceContext) conn.getContext().getAttribute(CONNECTION_INFORMATION); return info != null ? info.getState() : null; }
public static SourceRequest getRequest(NHttpConnection conn) { SourceContext info = (SourceContext) conn.getContext().getAttribute(CONNECTION_INFORMATION); return info != null ? info.getRequest() : null; }
public static SourceResponse getResponse(NHttpConnection conn) { SourceContext info = (SourceContext) conn.getContext().getAttribute(CONNECTION_INFORMATION); return info != null ? info.getResponse() : null; }
public static boolean assertState(NHttpConnection conn, ProtocolState state) { TargetContext info = (TargetContext) conn.getContext().getAttribute(CONNECTION_INFORMATION); return info != null && info.getState() == state; }
public static TargetResponse getResponse(NHttpConnection conn) { TargetContext info = (TargetContext) conn.getContext().getAttribute(CONNECTION_INFORMATION); return info != null ? info.getResponse() : null; }
public static void setRequest(NHttpConnection conn, SourceRequest request) { SourceContext info = (SourceContext) conn.getContext().getAttribute(CONNECTION_INFORMATION); if (info != null) { info.setRequest(request); } else { throw new IllegalStateException("Connection information should be present"); } }
public static Lock getLock(NHttpConnection conn) { SourceContext info = (SourceContext) conn.getContext().getAttribute(CONNECTION_INFORMATION); return info != null ? info.getLock() : null; }
public static ProtocolState getState(NHttpConnection conn) { TargetContext info = (TargetContext) conn.getContext().getAttribute(CONNECTION_INFORMATION); return info != null ? info.getState() : null; }
public static TargetRequest getRequest(NHttpConnection conn) { TargetContext info = (TargetContext) conn.getContext().getAttribute(CONNECTION_INFORMATION); return info != null ? info.getRequest() : null; }
public static void create(NHttpConnection conn, ProtocolState state, SourceConfiguration configuration) { SourceContext sourceContext = new SourceContext(configuration); conn.getContext().setAttribute(CONNECTION_INFORMATION, sourceContext); sourceContext.setState(state); if (sourceContext.getSourceConfiguration().isCorrelationLoggingEnabled()) { sourceContext.updateLastStateUpdatedTime(); } }
public static void create(NHttpConnection conn, ProtocolState state, TargetConfiguration configuration) { TargetContext targetContext = new TargetContext(configuration); conn.getContext().setAttribute(CONNECTION_INFORMATION, targetContext); targetContext.setState(state); if (targetContext.getTargetConfiguration().isCorrelationLoggingEnabled()) { targetContext.updateLastStateUpdatedTime(); } }