Package dev.galasa.framework.api.common
Interface IRoute
- All Known Implementing Classes:
BaseRoute,ProtectedRoute,PublicRoute
public interface IRoute
IRoute provides methods for endpoints to implement when a request is sent through a servlet,
allowing for new routes to be added without needing servlets to know which route handles the request.
Route paths represent the regex patterns that are used to match request paths against.
-
Method Summary
Modifier and TypeMethodDescriptionjavax.servlet.http.HttpServletResponsehandleDeleteRequest(String pathInfo, HttpRequestContext requestContext, javax.servlet.http.HttpServletResponse response) javax.servlet.http.HttpServletResponsehandleGetRequest(String pathInfo, QueryParameters queryParams, HttpRequestContext requestContext, javax.servlet.http.HttpServletResponse response) javax.servlet.http.HttpServletResponsehandlePostRequest(String pathInfo, HttpRequestContext requestContext, javax.servlet.http.HttpServletResponse response) javax.servlet.http.HttpServletResponsehandlePutRequest(String pathInfo, HttpRequestContext requestContext, javax.servlet.http.HttpServletResponse response) booleanisActionPermitted(BuiltInAction action, String loginId) Checks if the given action is permitted for the user that sent the given request
-
Method Details
-
getPathRegex
Pattern getPathRegex() -
handleGetRequest
javax.servlet.http.HttpServletResponse handleGetRequest(String pathInfo, QueryParameters queryParams, HttpRequestContext requestContext, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException, FrameworkException - Throws:
javax.servlet.ServletExceptionIOExceptionFrameworkException
-
handlePutRequest
javax.servlet.http.HttpServletResponse handlePutRequest(String pathInfo, HttpRequestContext requestContext, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException, FrameworkException - Throws:
javax.servlet.ServletExceptionIOExceptionFrameworkException
-
handlePostRequest
javax.servlet.http.HttpServletResponse handlePostRequest(String pathInfo, HttpRequestContext requestContext, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException, FrameworkException - Throws:
javax.servlet.ServletExceptionIOExceptionFrameworkException
-
handleDeleteRequest
javax.servlet.http.HttpServletResponse handleDeleteRequest(String pathInfo, HttpRequestContext requestContext, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException, FrameworkException - Throws:
javax.servlet.ServletExceptionIOExceptionFrameworkException
-
getSupportedQueryParameterNames
SupportedQueryParameterNames getSupportedQueryParameterNames()- Returns:
- A set of query parameter names which are supported by this route. Any extra parameters will be reported as an error.
-
isActionPermitted
Checks if the given action is permitted for the user that sent the given request- Parameters:
action- the action being performedloginId- the login ID of the user sending a request to this route- Returns:
- true if the user is allowed to perform the given action, false otherwise
- Throws:
InternalServletException- if there was an issue accessing the RBAC service
-