Class UninitializedResponse


public class UninitializedResponse extends ServiceResponse<Object>
UninitializedResponse wraps the exchage and allows setting a customResponseInitializer Interceptors at intercePoint REQUEST_BEFORE_EXCHANGE_INIT receive UninitializedResponse as response argument
  • Method Details

    • of

      public static UninitializedResponse of(io.undertow.server.HttpServerExchange exchange)
    • getContent

      public Object getContent()
      throws IllegalStateException
      Overrides:
      getContent in class ServiceResponse<Object>
    • setContent

      public void setContent(Object content)
      throws IllegalStateException
      Overrides:
      setContent in class ServiceResponse<Object>
    • readContent

      public String readContent()
      throws IllegalStateException
      Specified by:
      readContent in class ServiceResponse<Object>
      Returns:
      the content as string
    • setInError

      public void setInError(int code, String message, Throwable t)
      throws IllegalStateException
      Specified by:
      setInError in class ServiceResponse<Object>
      Parameters:
      code -
      message -
      t -
    • setCustomResponseInitializer

      public void setCustomResponseInitializer(Consumer<io.undertow.server.HttpServerExchange> customResponseInitializer)
      If a customResponseInitializer is set (not null), the ServiceExchangeInitializer will delegate to customResponseInitializer.accept(exchange) the responsability to initialize the response
      Parameters:
      customSender -
    • customResponseInitializer

      public Consumer<io.undertow.server.HttpServerExchange> customResponseInitializer()
      Returns:
      the custom Consumer used to initialize the response in place of the Service default one