Class ControllerRoute


  • public class ControllerRoute
    extends Object
    Author:
    svenkubiak
    • Constructor Detail

      • ControllerRoute

        public ControllerRoute​(Class<?> clazz)
        Creates a new set of routes bind to a given controller class
        Parameters:
        clazz - The controller class to bind to
    • Method Detail

      • withRoutes

        public void withRoutes​(MangooRoute... routes)
        Sets the given routes to the defined controller class
        Parameters:
        routes - The routes to be configured for the controller
      • withBasicAuthentication

        public ControllerRoute withBasicAuthentication​(String username,
                                                       String password)
        Sets Basic HTTP authentication to all method on the given controller class
        Parameters:
        username - The username for basic authentication in clear text
        password - The password for basic authentication in clear text
        Returns:
        controller route instance
      • withAuthentication

        public ControllerRoute withAuthentication()
        Sets authentication to true for all provided routes, default is false
        Returns:
        controller route instance
      • withAuthorization

        public ControllerRoute withAuthorization()
        Sets authentication to true for all provided routes, default is false Also sets authentication to true, default is false
        Returns:
        controller route instance
      • withNonBlocking

        public ControllerRoute 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:
        ControllerRoute instance
      • withRequestLimit

        public ControllerRoute withRequestLimit​(int requestsPerSecond)
        Sets a request limit to the request
        Parameters:
        requestsPerSecond - Number of requests per second
        Returns:
        ControllerRoute instance
      • hasAuthentication

        public boolean hasAuthentication()
      • hasAuthorization

        public boolean hasAuthorization()
      • hasBlocking

        public boolean hasBlocking()
      • hasBasicAuthentication

        public boolean hasBasicAuthentication()
      • getControllerClass

        public Class<?> getControllerClass()
      • getUsername

        public String getUsername()
      • getPassword

        public String getPassword()
      • getLimit

        public int getLimit()