Package com.vaadin.hilla.route
Class RouteUtil
java.lang.Object
com.vaadin.hilla.route.RouteUtil
- All Implemented Interfaces:
FileRouterRequestUtil
A container for utility methods related with Routes.
For internal use only. May be renamed or removed in a future release.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAllowedAuthorities(jakarta.servlet.http.HttpServletRequest request) Gets the set of authorities that are allowed to access the given request.protected @Nullable AvailableViewInfogetRouteByPath(Map<String, AvailableViewInfo> availableRoutes, String path) Gets the client view configuration for the given route.booleanisAnonymousRoute(jakarta.servlet.http.HttpServletRequest request) Checks if the given request goes to a route that allows anonymous access.booleanisRouteAllowed(jakarta.servlet.http.HttpServletRequest request) Checks if the given request is allowed route to the user.booleanisSecuredRoute(jakarta.servlet.http.HttpServletRequest request) Checks if the given request goes to a route that requires authentication.static voidremoveChildren(Map<String, AvailableViewInfo> configurations, AvailableViewInfo viewInfo, String parentPath)
-
Constructor Details
-
RouteUtil
public RouteUtil()
-
-
Method Details
-
isAnonymousRoute
public boolean isAnonymousRoute(jakarta.servlet.http.HttpServletRequest request) Description copied from interface:FileRouterRequestUtilChecks if the given request goes to a route that allows anonymous access.- Specified by:
isAnonymousRoutein interfaceFileRouterRequestUtil- Parameters:
request- the HTTP request to check- Returns:
trueif the request is targeting a route that allows anonymous access,falseotherwise
-
isSecuredRoute
public boolean isSecuredRoute(jakarta.servlet.http.HttpServletRequest request) Description copied from interface:FileRouterRequestUtilChecks if the given request goes to a route that requires authentication.- Specified by:
isSecuredRoutein interfaceFileRouterRequestUtil- Parameters:
request- the HTTP request to check- Returns:
trueif the request is targeting a route that requires authentication,falseotherwise
-
getAllowedAuthorities
Description copied from interface:FileRouterRequestUtilGets the set of authorities that are allowed to access the given request.- Specified by:
getAllowedAuthoritiesin interfaceFileRouterRequestUtil- Parameters:
request- the HTTP request to check- Returns:
- the set of authorities that are allowed to access the given request, or an empty set if no authority is required
-
isRouteAllowed
public boolean isRouteAllowed(jakarta.servlet.http.HttpServletRequest request) Checks if the given request is allowed route to the user.- Specified by:
isRouteAllowedin interfaceFileRouterRequestUtil- Parameters:
request- the HTTP request to check- Returns:
trueif the request goes allowed route,falseotherwise
-
getRouteByPath
protected @Nullable AvailableViewInfo getRouteByPath(Map<String, AvailableViewInfo> availableRoutes, String path) Gets the client view configuration for the given route.- Parameters:
path- the URL path to get the client view configuration for- Returns:
- - the client view configuration for the given route
-