Class BootHttpExceptionHandler
java.lang.Object
org.summerboot.jexpress.nio.server.BootHttpExceptionHandler
- All Implemented Interfaces:
HttpExceptionHandler
- Version:
- 1.0
- Author:
- Changski Tie Zheng Zhang 张铁铮, 魏泽北, 杜旺财, 杜富贵
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidnak(ServiceContext context, io.netty.handler.codec.http.HttpResponseStatus httpResponseStatus, int appErrorCode, String errorMessage) protected voidnakError(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 nullprotected voidnakFatal(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 notvoidonActionNotFound(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) voidonHttpConnectTimeoutException(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.voidonHttpTimeoutException(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.voidonInterruptedException(InterruptedException ex, io.netty.handler.codec.http.HttpMethod httptMethod, String httpRequestPath, ServiceContext context) voidonIOException(Throwable ex, io.netty.handler.codec.http.HttpMethod httptMethod, String httpRequestPath, ServiceContext context) voidonNamingException(NamingException ex, io.netty.handler.codec.http.HttpMethod httptMethod, String httpRequestPath, ServiceContext context) voidonPersistenceException(jakarta.persistence.PersistenceException ex, io.netty.handler.codec.http.HttpMethod httptMethod, String httpRequestPath, ServiceContext context) voidonRejectedExecutionException(Throwable ex, io.netty.handler.codec.http.HttpMethod httptMethod, String httpRequestPath, ServiceContext context) voidonUnexpectedException(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)
-
Field Details
-
healthInspector
-
po
-
-
Constructor Details
-
BootHttpExceptionHandler
public BootHttpExceptionHandler()
-
-
Method Details
-
onActionNotFound
public 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) - Specified by:
onActionNotFoundin interfaceHttpExceptionHandler
-
onNamingException
public void onNamingException(NamingException ex, io.netty.handler.codec.http.HttpMethod httptMethod, String httpRequestPath, ServiceContext context) - Specified by:
onNamingExceptionin interfaceHttpExceptionHandler
-
onPersistenceException
public void onPersistenceException(jakarta.persistence.PersistenceException ex, io.netty.handler.codec.http.HttpMethod httptMethod, String httpRequestPath, ServiceContext context) - Specified by:
onPersistenceExceptionin interfaceHttpExceptionHandler
-
onHttpConnectTimeoutException
public void onHttpConnectTimeoutException(HttpConnectTimeoutException ex, io.netty.handler.codec.http.HttpMethod httptMethod, String httpRequestPath, ServiceContext context) Description copied from interface:HttpExceptionHandlerHappens when a connection, over which an HttpRequest is intended to be sent, is not successfully established within a specified time period.- Specified by:
onHttpConnectTimeoutExceptionin interfaceHttpExceptionHandler
-
onHttpTimeoutException
public void onHttpTimeoutException(HttpTimeoutException ex, io.netty.handler.codec.http.HttpMethod httptMethod, String httpRequestPath, ServiceContext context) Description copied from interface:HttpExceptionHandlerHappens when a context is not received within a specified time period.- Specified by:
onHttpTimeoutExceptionin interfaceHttpExceptionHandler
-
onRejectedExecutionException
public void onRejectedExecutionException(Throwable ex, io.netty.handler.codec.http.HttpMethod httptMethod, String httpRequestPath, ServiceContext context) - Specified by:
onRejectedExecutionExceptionin interfaceHttpExceptionHandler
-
onIOException
public void onIOException(Throwable ex, io.netty.handler.codec.http.HttpMethod httptMethod, String httpRequestPath, ServiceContext context) - Specified by:
onIOExceptionin interfaceHttpExceptionHandler
-
onInterruptedException
public void onInterruptedException(InterruptedException ex, io.netty.handler.codec.http.HttpMethod httptMethod, String httpRequestPath, ServiceContext context) - Specified by:
onInterruptedExceptionin interfaceHttpExceptionHandler
-
onUnexpectedException
public 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) - Specified by:
onUnexpectedExceptionin interfaceHttpExceptionHandler
-
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-
-