Class DefaultHttpRequestHandler
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
org.summerboot.jexpress.nio.server.DefaultHttpRequestHandler
- 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
FieldsFields inherited from class org.summerboot.jexpress.nio.server.BootHttpRequestHandler
BINDING_NAME, cmtpCfg, healthInspector, poFields inherited from class org.summerboot.jexpress.nio.server.NioServerHttpRequestHandler
log, nioCfg -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected 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 booleanpreProcess(RequestProcessor processor, io.netty.handler.codec.http.HttpHeaders httpRequestHeaders, String httpRequestPath, ServiceContext context) do any validation checks before processingMethods inherited from class org.summerboot.jexpress.nio.server.BootHttpRequestHandler
afterLogging, afterService, beforeLogging, beforeSendingError, getHealthInspector, nak, nakError, nakFatal, onActionNotFound, onHttpConnectTimeoutException, onHttpTimeoutException, onInterruptedException, onIOException, onNamingException, onPersistenceException, onRejectedExecutionException, onUnexpectedException, protectAuthToken, serviceMethods 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
-
tokenCache
-
auth
-
-
Constructor Details
-
DefaultHttpRequestHandler
public DefaultHttpRequestHandler()
-
-
Method Details
-
authenticationCheck
protected boolean authenticationCheck(RequestProcessor processor, io.netty.handler.codec.http.HttpHeaders httpRequestHeaders, String httpRequestPath, ServiceContext context) throws Exception Description copied from class:BootHttpRequestHandlercreate User object based on token in the header, then set User object to context- Specified by:
authenticationCheckin classBootHttpRequestHandler- Returns:
- true if good to preProcess (caller is verified), otherwise false
- Throws:
Exception
-
preProcess
protected boolean preProcess(RequestProcessor processor, io.netty.handler.codec.http.HttpHeaders httpRequestHeaders, String httpRequestPath, ServiceContext context) throws Exception Description copied from class:BootHttpRequestHandlerdo any validation checks before processing- Specified by:
preProcessin classBootHttpRequestHandler- Returns:
- true if good to process request, otherwise false
- Throws:
Exception
-