Interface HttpLifecycleListener
- All Known Implementing Classes:
HttpLifecycleHandler
public interface HttpLifecycleListener
- Version:
- 1.0
- Author:
- Changski Tie Zheng Zhang 张铁铮, 魏泽北, 杜旺财, 杜富贵
-
Method Summary
Modifier and TypeMethodDescriptionvoidafterLogging(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) step5voidafterProcess(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 clientvoidafterSendPingResponse(io.netty.channel.ChannelHandlerContext ctx, String uri, long hit, io.netty.handler.codec.http.HttpResponseStatus status) voidafterService(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 loggingbeforeLogging(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) step4booleanbeforeProcess(RequestProcessor processor, io.netty.handler.codec.http.HttpHeaders httpRequestHeaders, String httpRequestPath, ServiceContext context) step0 - do any validation checks before processingbooleanbeforeProcessPingRequest(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
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
-