Package io.mangoo.routing.routes
Class ControllerRoute
- java.lang.Object
-
- io.mangoo.routing.routes.ControllerRoute
-
public class ControllerRoute extends Object
- Author:
- svenkubiak
-
-
Constructor Summary
Constructors Constructor Description ControllerRoute(Class<?> clazz)Creates a new set of routes bind to a given controller class
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Class<?>getControllerClass()intgetLimit()StringgetPassword()StringgetUsername()booleanhasAuthentication()booleanhasAuthorization()booleanhasBasicAuthentication()booleanhasBlocking()ControllerRoutewithAuthentication()Sets authentication to true for all provided routes, default is falseControllerRoutewithAuthorization()Sets authentication to true for all provided routes, default is false Also sets authentication to true, default is falseControllerRoutewithBasicAuthentication(String username, String password)Sets Basic HTTP authentication to all method on the given controller classControllerRoutewithNonBlocking()Configures this request as long running request that is executed in a different thread pool to not block the non blocking I/O requestControllerRoutewithRequestLimit(int requestsPerSecond)Sets a request limit to the requestvoidwithRoutes(MangooRoute... routes)Sets the given routes to the defined controller class
-
-
-
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 textpassword- 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()
-
-