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

@Sharable public class BootHttpRequestHandler extends NioServerHttpRequestHandler
Version:
2.0
Author:
Changski Tie Zheng Zhang 张铁铮, 魏泽北, 杜旺财, 杜富贵
  • Field Details

  • Constructor Details

    • BootHttpRequestHandler

      public BootHttpRequestHandler()
  • Method Details

    • service

      protected ProcessorSettings 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:
      service in class NioServerHttpRequestHandler
    • afterService

      protected 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)
      Specified by:
      afterService in class NioServerHttpRequestHandler
    • 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 customizedAuthorizationCheck (caller is verified), otherwise false
      Throws:
      Exception
    • beforeLogging

      protected 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)
      Specified by:
      beforeLogging in class NioServerHttpRequestHandler
    • afterLogging

      protected 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
      Specified by:
      afterLogging in class NioServerHttpRequestHandler
      Throws:
      Exception
    • beforeSendingError

      public String beforeSendingError(String errorContent)