Class HttpExceptionHandler
java.lang.Object
org.summerboot.jexpress.boot.event.HttpExceptionHandler
- All Implemented Interfaces:
HttpExceptionListener
- Version:
- 1.0
- Author:
- Changski Tie Zheng Zhang 张铁铮, 魏泽北, 杜旺财, 杜富贵
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected 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) voidonConnectException(Throwable ex, io.netty.handler.codec.http.HttpMethod httptMethod, String httpRequestPath, 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) protected voidonNamingException(NamingException ex, Throwable cause, 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) protected voidonPersistenceException(jakarta.persistence.PersistenceException ex, Throwable cause, 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
-
po
-
-
Constructor Details
-
HttpExceptionHandler
public HttpExceptionHandler()
-
-
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 interfaceHttpExceptionListener
-
onNamingException
public void onNamingException(NamingException ex, io.netty.handler.codec.http.HttpMethod httptMethod, String httpRequestPath, ServiceContext context) - Specified by:
onNamingExceptionin interfaceHttpExceptionListener
-
onNamingException
protected void onNamingException(NamingException ex, Throwable cause, io.netty.handler.codec.http.HttpMethod httptMethod, String httpRequestPath, ServiceContext context) -
onPersistenceException
public void onPersistenceException(jakarta.persistence.PersistenceException ex, io.netty.handler.codec.http.HttpMethod httptMethod, String httpRequestPath, ServiceContext context) - Specified by:
onPersistenceExceptionin interfaceHttpExceptionListener
-
onPersistenceException
protected void onPersistenceException(jakarta.persistence.PersistenceException ex, Throwable cause, io.netty.handler.codec.http.HttpMethod httptMethod, String httpRequestPath, ServiceContext context) -
onHttpConnectTimeoutException
public void onHttpConnectTimeoutException(HttpConnectTimeoutException ex, io.netty.handler.codec.http.HttpMethod httptMethod, String httpRequestPath, ServiceContext context) Description copied from interface:HttpExceptionListenerHappens when a connection, over which an HttpRequest is intended to be sent, is not successfully established within a specified time period.- Specified by:
onHttpConnectTimeoutExceptionin interfaceHttpExceptionListener- Parameters:
ex-httptMethod-httpRequestPath-context-
-
onHttpTimeoutException
public void onHttpTimeoutException(HttpTimeoutException ex, io.netty.handler.codec.http.HttpMethod httptMethod, String httpRequestPath, ServiceContext context) Description copied from interface:HttpExceptionListenerHappens when a context is not received within a specified time period.- Specified by:
onHttpTimeoutExceptionin interfaceHttpExceptionListener- Parameters:
ex-httptMethod-httpRequestPath-context-
-
onRejectedExecutionException
public void onRejectedExecutionException(Throwable ex, io.netty.handler.codec.http.HttpMethod httptMethod, String httpRequestPath, ServiceContext context) - Specified by:
onRejectedExecutionExceptionin interfaceHttpExceptionListener
-
onConnectException
public void onConnectException(Throwable ex, io.netty.handler.codec.http.HttpMethod httptMethod, String httpRequestPath, ServiceContext context) - Specified by:
onConnectExceptionin interfaceHttpExceptionListener
-
onIOException
public void onIOException(Throwable ex, io.netty.handler.codec.http.HttpMethod httptMethod, String httpRequestPath, ServiceContext context) - Specified by:
onIOExceptionin interfaceHttpExceptionListener
-
onInterruptedException
public void onInterruptedException(InterruptedException ex, io.netty.handler.codec.http.HttpMethod httptMethod, String httpRequestPath, ServiceContext context) - Specified by:
onInterruptedExceptionin interfaceHttpExceptionListener
-
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 interfaceHttpExceptionListener
-
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-
-