Class ConditionalHandler.ElseNext

All Implemented Interfaces:
Handler, Handler.Container, Handler.Singleton, Request.Handler, Container, Destroyable, Dumpable, Dumpable.DumpableContainer, LifeCycle, Invocable
Direct Known Subclasses:
ConditionalHandler.DontHandle, ConditionalHandler.Reject, ConditionalHandler.SkipNext
Enclosing class:
ConditionalHandler

public abstract static class ConditionalHandler.ElseNext extends ConditionalHandler
An abstract implementation of ConditionalHandler that, if conditions are not met, will call the ConditionalHandler.nextHandler(Request, Response, Callback) from onConditionsNotMet(Request, Response, Callback). Implementations must provide an ConditionalHandler.onConditionsMet(Request, Response, Callback) to provide the handling for when conditions are met.
  • Constructor Details

    • ElseNext

      public ElseNext()
    • ElseNext

      public ElseNext(Handler handler)
  • Method Details

    • onConditionsNotMet

      protected boolean onConditionsNotMet(Request request, Response response, Callback callback) throws Exception
      Description copied from class: ConditionalHandler
      This method is called when the request has not met the conditions and is not to be handled by this handler. Implementations may return false; send an error response; or handle the request differently.
      Specified by:
      onConditionsNotMet in class ConditionalHandler
      Parameters:
      request - The request to handle
      response - The response to generate
      callback - The callback for completion
      Returns:
      True if this handler will complete the callback
      Throws:
      Exception - If there is a problem handling
      See Also: