Interface LightHttpHandler

All Superinterfaces:
io.undertow.server.HttpHandler
All Known Subinterfaces:
Interceptor, MiddlewareHandler, RequestInterceptor, ResponseInterceptor
All Known Implementing Classes:
OrchestrationHandler, RequestInterceptorInjectionHandler, ResponseInterceptorInjectionHandler

public interface LightHttpHandler extends io.undertow.server.HttpHandler
This is an extension of HttpHandler that provides a default method to handle error status. All API handler should extend from this interface.
Author:
Steve Hu
  • Field Details

  • Method Details

    • setExchangeStatus

      default void setExchangeStatus(io.undertow.server.HttpServerExchange exchange, String code, Object... args)
      This method is used to construct a standard error status in JSON format from an error code.
      Parameters:
      exchange - HttpServerExchange
      code - error code
      args - arguments for error description
    • setExchangeStatus

      default void setExchangeStatus(io.undertow.server.HttpServerExchange exchange, String code, Map<String,Object> metadata, Object... args)
      This method is used to construct a standard error status with metadata in JSON format from an error code.
      Parameters:
      exchange - HttpServerExchange
      code - error code
      metadata - additional metadata info
      args - arguments for error description
    • setExchangeStatus

      default void setExchangeStatus(io.undertow.server.HttpServerExchange ex, Status status)
      There are situations that the downstream service returns an error status response and we just want to bubble up to the caller and eventually to the original caller.
      Parameters:
      ex - HttpServerExchange
      status - error status