Class BootHttpRequestHandler
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.channel.SimpleChannelInboundHandler<io.netty.handler.codec.http.FullHttpRequest>
org.summerboot.jexpress.nio.server.NioServerHttpRequestHandler
org.summerboot.jexpress.nio.server.BootHttpRequestHandler
- All Implemented Interfaces:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelInboundHandler,ErrorAuditor
- Version:
- 2.0
- Author:
- Changski Tie Zheng Zhang 张铁铮, 魏泽北, 杜旺财, 杜富贵
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Authenticatorstatic final Stringprotected static SMTPClientConfigprotected NioExceptionHandlerprotected NioLifecycleprotected AuthTokenCacheFields inherited from class org.summerboot.jexpress.nio.server.NioServerHttpRequestHandler
log, nioCfg -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidafterLogging(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) protected booleanauthenticationCheck(RequestProcessor processor, io.netty.handler.codec.http.HttpHeaders httpRequestHeaders, String httpRequestPath, ServiceContext context) create User object based on token in the header, then set User object to contextprotected StringbeforeLogging(String log) beforeSendingError(String errorContent) protected voidservice(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) Methods inherited from class org.summerboot.jexpress.nio.server.NioServerHttpRequestHandler
channelActive, channelInactive, channelRead0, channelReadComplete, exceptionCaught, getRequestProcessor, userEventTriggeredMethods inherited from class io.netty.channel.SimpleChannelInboundHandler
acceptInboundMessage, channelReadMethods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelRegistered, channelUnregistered, channelWritabilityChangedMethods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.netty.channel.ChannelHandler
handlerAdded, handlerRemoved
-
Field Details
-
BINDING_NAME
- See Also:
-
authenticator
-
nioExceptionHandler
-
tokenCache
-
nioLifecycleHandler
-
cmtpCfg
-
-
Constructor Details
-
BootHttpRequestHandler
public BootHttpRequestHandler()
-
-
Method Details
-
service
protected void service(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) - Specified by:
servicein classNioServerHttpRequestHandler
-
authenticationCheck
protected boolean authenticationCheck(RequestProcessor processor, io.netty.handler.codec.http.HttpHeaders httpRequestHeaders, String httpRequestPath, ServiceContext context) throws Exception create User object based on token in the header, then set User object to context- Parameters:
processor-httpRequestHeaders-httpRequestPath-context-- Returns:
- true if good to preAccessCheck (caller is verified), otherwise false
- Throws:
Exception
-
beforeLogging
- Specified by:
beforeLoggingin classNioServerHttpRequestHandler
-
afterLogging
protected 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 - Specified by:
afterLoggingin classNioServerHttpRequestHandler- Throws:
Exception
-
beforeSendingError
-