Class RequestRoute

java.lang.Object
io.mangoo.routing.routes.RequestRoute
All Implemented Interfaces:
MangooRoute

public class RequestRoute extends Object implements MangooRoute
Author:
svenkubiak
  • Constructor Details

    • RequestRoute

      public RequestRoute(Http method)
    • RequestRoute

      public RequestRoute(Http... methods)
  • Method Details

    • to

      public RequestRoute to(String url)
      Sets the URL for this route
      Parameters:
      url - The URL for this route
      Returns:
      RequestRoute instance
    • respondeWith

      public RequestRoute respondeWith(String method)
      Sets the controller method to response on request
      Parameters:
      method - The controller method
      Returns:
      RequestRoute instance
    • withControllerClass

      public void withControllerClass(Class<?> clazz)
      Sets the controller class of this request
      Parameters:
      clazz - The controller class
    • withHttpMethod

      public void withHttpMethod(Http method)
      Sets the HTTP method of this request
      Parameters:
      method - The controller method
    • withBasicAuthentication

      public RequestRoute withBasicAuthentication(String username, String password)
      Sets HTTP Basic authentication to this request on the defined controller class
      Parameters:
      username - The username for basic authentication in cleartext
      password - The password for basic authentication in cleartext
      Returns:
      RequestRoute instance
    • withAuthentication

      public RequestRoute withAuthentication()
      Sets authentication to true for this route, default is false
      Returns:
      RequestRoute instance
    • withNonBlocking

      public RequestRoute withNonBlocking()
      Configures this request as long-running request that is executed in a different thread pool to not block the non-blocking I/O request
      Returns:
      RequestRoute instance
    • withMaxPostSize

      public RequestRoute withMaxPostSize(long size)
      Sets the max size of a body entity
      Parameters:
      size - the size in bytes
      Returns:
      RequestRoute instance
    • getMaxEntitySize

      public long getMaxEntitySize()
    • getUrl

      public String getUrl()
      Specified by:
      getUrl in interface MangooRoute
      Returns:
      The configured URL for this route
    • hasAuthentication

      public boolean hasAuthentication()
    • hasBasicAuthentication

      public boolean hasBasicAuthentication()
    • getUsername

      public String getUsername()
    • getPassword

      public String getPassword()
    • hasMultipleMethods

      public boolean hasMultipleMethods()
    • getMethods

      public Http[] getMethods()
    • getControllerClass

      public Class<?> getControllerClass()
    • getControllerMethod

      public String getControllerMethod()
    • getMethod

      public Http getMethod()
    • isBlocking

      public boolean isBlocking()