Class BootNioLifecycleHandler
java.lang.Object
org.summerboot.jexpress.nio.server.BootNioLifecycleHandler
- All Implemented Interfaces:
NioLifecycle
- Version:
- 1.0
- Author:
- Changski Tie Zheng Zhang 张铁铮, 魏泽北, 杜旺财, 杜富贵
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidafterLogging(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, String logContent, Throwable ioEx) step4voidafterService(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) step1beforeLogging(String log) step3beforeSendingError(String errorContent) step2booleanpreProcess(RequestProcessor processor, io.netty.handler.codec.http.HttpHeaders httpRequestHeaders, String httpRequestPath, ServiceContext context) step0 - do any validation checks before processingprotected voidprotectAuthToken(RequestProcessor processor, io.netty.handler.codec.http.HttpHeaders httpRequestHeaders)
-
Constructor Details
-
BootNioLifecycleHandler
public BootNioLifecycleHandler()
-
-
Method Details
-
preProcess
public boolean preProcess(RequestProcessor processor, io.netty.handler.codec.http.HttpHeaders httpRequestHeaders, String httpRequestPath, ServiceContext context) throws Exception Description copied from interface:NioLifecyclestep0 - do any validation checks before processing- Specified by:
preProcessin interfaceNioLifecycle- Returns:
- true if good to process request, otherwise false
- Throws:
Exception
-
afterService
public void afterService(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:NioLifecyclestep1- Specified by:
afterServicein interfaceNioLifecycle
-
protectAuthToken
protected void protectAuthToken(RequestProcessor processor, io.netty.handler.codec.http.HttpHeaders httpRequestHeaders) -
beforeSendingError
Description copied from interface:NioLifecyclestep2- Specified by:
beforeSendingErrorin interfaceNioLifecycle- Returns:
-
beforeLogging
Description copied from interface:NioLifecyclestep3- Specified by:
beforeLoggingin interfaceNioLifecycle- Returns:
-
afterLogging
public void afterLogging(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, String logContent, Throwable ioEx) throws Exception Description copied from interface:NioLifecyclestep4- Specified by:
afterLoggingin interfaceNioLifecycle- Throws:
Exception
-