Class HttpLifecycleHandler
java.lang.Object
org.summerboot.jexpress.boot.event.HttpLifecycleHandler
- All Implemented Interfaces:
HttpLifecycleListener
- Version:
- 1.0
- Author:
- Changski Tie Zheng Zhang 张铁铮, 魏泽北, 杜旺财, 杜富贵
-
Constructor Summary
Constructors -
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) step4voidafterProcess(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) step1voidafterSendPingResponse(io.netty.channel.ChannelHandlerContext ctx, String uri, long hit, io.netty.handler.codec.http.HttpResponseStatus status) 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) step3booleanbeforeProcessPingRequest(io.netty.channel.ChannelHandlerContext ctx, String uri, long hit, io.netty.handler.codec.http.HttpResponseStatus status) beforeSendingError(String errorContent) step2booleanbeofreProcess(RequestProcessor processor, io.netty.handler.codec.http.HttpHeaders httpRequestHeaders, String httpRequestPath, ServiceContext context) step0 - do any validation checks before processing
-
Constructor Details
-
HttpLifecycleHandler
public HttpLifecycleHandler()
-
-
Method Details
-
beforeProcessPingRequest
public boolean beforeProcessPingRequest(io.netty.channel.ChannelHandlerContext ctx, String uri, long hit, io.netty.handler.codec.http.HttpResponseStatus status) - Specified by:
beforeProcessPingRequestin interfaceHttpLifecycleListener
-
afterSendPingResponse
public void afterSendPingResponse(io.netty.channel.ChannelHandlerContext ctx, String uri, long hit, io.netty.handler.codec.http.HttpResponseStatus status) - Specified by:
afterSendPingResponsein interfaceHttpLifecycleListener
-
beofreProcess
public boolean beofreProcess(RequestProcessor processor, io.netty.handler.codec.http.HttpHeaders httpRequestHeaders, String httpRequestPath, ServiceContext context) throws Exception Description copied from interface:HttpLifecycleListenerstep0 - do any validation checks before processing- Specified by:
beofreProcessin interfaceHttpLifecycleListener- Returns:
- true if good to process request, otherwise false
- Throws:
Exception
-
afterProcess
public void afterProcess(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) Description copied from interface:HttpLifecycleListenerstep1- Specified by:
afterProcessin interfaceHttpLifecycleListener
-
beforeSendingError
Description copied from interface:HttpLifecycleListenerstep2- Specified by:
beforeSendingErrorin interfaceHttpLifecycleListener- Returns:
-
beforeLogging
public 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) Description copied from interface:HttpLifecycleListenerstep3- Specified by:
beforeLoggingin interfaceHttpLifecycleListener- Returns:
-
afterLogging
public 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) Description copied from interface:HttpLifecycleListenerstep4- Specified by:
afterLoggingin interfaceHttpLifecycleListener
-