Interface HttpLifecycleListener

All Known Implementing Classes:
HttpLifecycleHandler

public interface HttpLifecycleListener
Version:
1.0
Author:
Changski Tie Zheng Zhang 张铁铮, 魏泽北, 杜旺财, 杜富贵
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    afterLogging(String logContent, io.netty.handler.codec.http.HttpHeaders httpHeaders, io.netty.handler.codec.http.HttpMethod httpMethod, String httpRequestUri, String httpPostRequestBody, ServiceContext context, long queuingTime, long processTime, long responseTime, long responseContentLength, Throwable ioEx)
    step5
    void
    afterProcess(boolean preProcessResult, Object processResult, Throwable processException, RequestProcessor processor, io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.HttpHeaders httpRequestHeaders, io.netty.handler.codec.http.HttpMethod httptMethod, String httpRequestPath, Map<String,List<String>> queryParams, String httpPostRequestBody, ServiceContext context)
    step1 - after process is done, before sending response to client
    void
    afterSendPingResponse(io.netty.channel.ChannelHandlerContext ctx, String uri, long hit, io.netty.handler.codec.http.HttpResponseStatus status)
     
    void
    afterService(io.netty.handler.codec.http.HttpHeaders httpHeaders, io.netty.handler.codec.http.HttpMethod httpMethod, String httpRequestPath, Map<String,List<String>> queryParams, String httpPostRequestBody, ServiceContext context)
    step2 - after sending response to client, before starting logging
    beforeLogging(String originallLogContent, io.netty.handler.codec.http.HttpHeaders httpHeaders, io.netty.handler.codec.http.HttpMethod httpMethod, String httpRequestUri, String httpPostRequestBody, ServiceContext context, long queuingTime, long processTime, long responseTime, long responseContentLength, Throwable ioEx)
    step4
    boolean
    beforeProcess(RequestProcessor processor, io.netty.handler.codec.http.HttpHeaders httpRequestHeaders, String httpRequestPath, ServiceContext context)
    step0 - do any validation checks before processing
    boolean
    beforeProcessPingRequest(io.netty.channel.ChannelHandlerContext ctx, String uri, long hit, io.netty.handler.codec.http.HttpResponseStatus status)
     
    beforeSendingError(String errorContent)
    step3
  • Method Details

    • beforeProcessPingRequest

      boolean beforeProcessPingRequest(io.netty.channel.ChannelHandlerContext ctx, String uri, long hit, io.netty.handler.codec.http.HttpResponseStatus status)
    • afterSendPingResponse

      void afterSendPingResponse(io.netty.channel.ChannelHandlerContext ctx, String uri, long hit, io.netty.handler.codec.http.HttpResponseStatus status)
    • beforeProcess

      boolean beforeProcess(RequestProcessor processor, io.netty.handler.codec.http.HttpHeaders httpRequestHeaders, String httpRequestPath, ServiceContext context) throws Exception
      step0 - do any validation checks before processing
      Parameters:
      processor -
      httpRequestHeaders -
      httpRequestPath -
      context -
      Returns:
      true if good to process request, otherwise false
      Throws:
      Exception
    • afterProcess

      void afterProcess(boolean preProcessResult, Object processResult, Throwable processException, RequestProcessor processor, io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.HttpHeaders httpRequestHeaders, io.netty.handler.codec.http.HttpMethod httptMethod, String httpRequestPath, Map<String,List<String>> queryParams, String httpPostRequestBody, ServiceContext context)
      step1 - after process is done, before sending response to client
      Parameters:
      preProcessResult -
      processResult -
      processException -
      processor -
      ctx -
      httpRequestHeaders -
      httptMethod -
      httpRequestPath -
      queryParams -
      httpPostRequestBody -
      context -
    • afterService

      void afterService(io.netty.handler.codec.http.HttpHeaders httpHeaders, io.netty.handler.codec.http.HttpMethod httpMethod, String httpRequestPath, Map<String,List<String>> queryParams, String httpPostRequestBody, ServiceContext context)
      step2 - after sending response to client, before starting logging
      Parameters:
      httpHeaders -
      httpMethod -
      httpRequestPath -
      queryParams -
      httpPostRequestBody -
      context -
    • beforeSendingError

      String beforeSendingError(String errorContent)
      step3
      Parameters:
      errorContent -
      Returns:
    • beforeLogging

      String beforeLogging(String originallLogContent, io.netty.handler.codec.http.HttpHeaders httpHeaders, io.netty.handler.codec.http.HttpMethod httpMethod, String httpRequestUri, String httpPostRequestBody, ServiceContext context, long queuingTime, long processTime, long responseTime, long responseContentLength, Throwable ioEx)
      step4
      Parameters:
      originallLogContent -
      httpHeaders -
      httpMethod -
      httpRequestUri -
      httpPostRequestBody -
      context -
      queuingTime -
      processTime -
      responseTime -
      responseContentLength -
      ioEx -
      Returns:
    • afterLogging

      void afterLogging(String logContent, io.netty.handler.codec.http.HttpHeaders httpHeaders, io.netty.handler.codec.http.HttpMethod httpMethod, String httpRequestUri, String httpPostRequestBody, ServiceContext context, long queuingTime, long processTime, long responseTime, long responseContentLength, Throwable ioEx) throws Exception
      step5
      Parameters:
      logContent -
      httpHeaders -
      httpMethod -
      httpRequestUri -
      httpPostRequestBody -
      context -
      queuingTime -
      processTime -
      responseTime -
      responseContentLength -
      ioEx -
      Throws:
      Exception