Class RequestRoute

    • Constructor Detail

      • RequestRoute

        public RequestRoute​(Http method)
      • RequestRoute

        public RequestRoute​(Http... methods)
    • Method Detail

      • 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
      • withRequestLimit

        public RequestRoute withRequestLimit​(int requestsPerSecond)
        Sets a request limit to the request
        Parameters:
        requestsPerSecond - Number of requests per second
        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
      • withAuthorization

        public RequestRoute withAuthorization()
        Sets authorization to true for this route, default is false Also sets authentication to true, 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
      • getUrl

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

        public boolean hasAuthentication()
      • hasAuthorization

        public boolean hasAuthorization()
      • 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()
      • getLimit

        public int getLimit()
      • getMethod

        public Http getMethod()
      • isBlocking

        public boolean isBlocking()