Class RouteUtil

java.lang.Object
com.vaadin.hilla.route.RouteUtil
All Implemented Interfaces:
FileRouterRequestUtil

@NullMarked public class RouteUtil extends Object implements FileRouterRequestUtil
A container for utility methods related with Routes.

For internal use only. May be renamed or removed in a future release.

  • Constructor Details

    • RouteUtil

      public RouteUtil()
  • Method Details

    • isAnonymousRoute

      public boolean isAnonymousRoute(jakarta.servlet.http.HttpServletRequest request)
      Description copied from interface: FileRouterRequestUtil
      Checks if the given request goes to a route that allows anonymous access.
      Specified by:
      isAnonymousRoute in interface FileRouterRequestUtil
      Parameters:
      request - the HTTP request to check
      Returns:
      true if the request is targeting a route that allows anonymous access, false otherwise
    • isSecuredRoute

      public boolean isSecuredRoute(jakarta.servlet.http.HttpServletRequest request)
      Description copied from interface: FileRouterRequestUtil
      Checks if the given request goes to a route that requires authentication.
      Specified by:
      isSecuredRoute in interface FileRouterRequestUtil
      Parameters:
      request - the HTTP request to check
      Returns:
      true if the request is targeting a route that requires authentication, false otherwise
    • getAllowedAuthorities

      public Set<String> getAllowedAuthorities(jakarta.servlet.http.HttpServletRequest request)
      Description copied from interface: FileRouterRequestUtil
      Gets the set of authorities that are allowed to access the given request.
      Specified by:
      getAllowedAuthorities in interface FileRouterRequestUtil
      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:
      isRouteAllowed in interface FileRouterRequestUtil
      Parameters:
      request - the HTTP request to check
      Returns:
      true if the request goes allowed route, false otherwise
    • removeChildren

      public static void removeChildren(Map<String,AvailableViewInfo> configurations, AvailableViewInfo viewInfo, String parentPath)
    • 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