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

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

  • 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:
      service in class NioServerHttpRequestHandler
    • authenticationCheck

      protected boolean authenticationCheck(RequestProcessor processor, io.netty.handler.codec.http.HttpHeaders httpRequestHeaders, String httpRequestPath, ServiceContext context) throws Exception
      Throws:
      Exception
    • preProcess

      protected boolean preProcess(RequestProcessor processor, io.netty.handler.codec.http.HttpHeaders httpRequestHeaders, String httpRequestPath, ServiceContext context) throws Exception
      Throws:
      Exception
    • onActionNotFound

      protected void onActionNotFound(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)
    • onNamingException

      protected void onNamingException(NamingException ex, io.netty.handler.codec.http.HttpMethod httptMethod, String httpRequestPath, ServiceContext context)
    • onPersistenceException

      protected void onPersistenceException(jakarta.persistence.PersistenceException ex, io.netty.handler.codec.http.HttpMethod httptMethod, String httpRequestPath, ServiceContext context)
    • onHttpConnectTimeoutException

      protected void onHttpConnectTimeoutException(HttpConnectTimeoutException ex, io.netty.handler.codec.http.HttpMethod httptMethod, String httpRequestPath, ServiceContext context)
      Happens when a connection, over which an HttpRequest is intended to be sent, is not successfully established within a specified time period.
      Parameters:
      ex -
      httptMethod -
      httpRequestPath -
      context -
    • onHttpTimeoutException

      protected void onHttpTimeoutException(HttpTimeoutException ex, io.netty.handler.codec.http.HttpMethod httptMethod, String httpRequestPath, ServiceContext context)
      Happens when a context is not received within a specified time period.
      Parameters:
      ex -
      httptMethod -
      httpRequestPath -
      context -
    • onRejectedExecutionException

      protected void onRejectedExecutionException(Throwable ex, io.netty.handler.codec.http.HttpMethod httptMethod, String httpRequestPath, ServiceContext context)
    • onIOException

      protected void onIOException(Throwable ex, io.netty.handler.codec.http.HttpMethod httptMethod, String httpRequestPath, ServiceContext context)
    • getHealthInspector

      protected HealthInspector getHealthInspector()
    • onInterruptedException

      protected void onInterruptedException(InterruptedException ex, io.netty.handler.codec.http.HttpMethod httptMethod, String httpRequestPath, ServiceContext context)
    • onUnexpectedException

      protected void onUnexpectedException(Throwable ex, 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)
    • afterService

      protected 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)
    • protectAuthToken

      protected void protectAuthToken(RequestProcessor processor, io.netty.handler.codec.http.HttpHeaders httpRequestHeaders)
    • beforeLogging

      protected String beforeLogging(String log)
      Specified by:
      beforeLogging in class NioServerHttpRequestHandler
    • 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:
      afterLogging in class NioServerHttpRequestHandler
      Throws:
      Exception
    • nak

      protected void nak(ServiceContext context, io.netty.handler.codec.http.HttpResponseStatus httpResponseStatus, int appErrorCode, String errorMessage)
    • nakError

      protected void nakError(ServiceContext context, io.netty.handler.codec.http.HttpResponseStatus httpResponseStatus, int appErrorCode, String errorMessage, Throwable ex)
      Build negative acknowledgement context with exception at ERROR level when ex is not null
      Parameters:
      context -
      httpResponseStatus -
      appErrorCode -
      errorMessage -
      ex -
    • nakFatal

      protected void nakFatal(ServiceContext context, io.netty.handler.codec.http.HttpResponseStatus httpResponseStatus, int appErrorCode, String errorMessage, Throwable ex, Collection<String> emailTo, String content)
      Build negative acknowledgement context with exception at FATAL level, no matter ex is null or not
      Parameters:
      context -
      httpResponseStatus -
      appErrorCode -
      errorMessage -
      ex -
      emailTo -
      content -
    • beforeSendingError

      public String beforeSendingError(String errorContent)