Class RouteBuildItem

java.lang.Object
io.quarkus.builder.item.BuildItem
io.quarkus.builder.item.MultiBuildItem
io.quarkus.vertx.http.deployment.spi.RouteBuildItem

public final class RouteBuildItem extends io.quarkus.builder.item.MultiBuildItem
A build item that represents a route that should be added to the router.

Producing this build item does not mean the HTTP server is available. It will be consumed if the Quarkus Vert.x HTTP extension is present.

  • Constructor Details

    • RouteBuildItem

      public RouteBuildItem(RouteBuildItem.RouteType typeOfRoute, String path, Consumer<io.vertx.ext.web.Route> customizer, boolean isManagement, io.vertx.core.Handler<io.vertx.ext.web.RoutingContext> handler, boolean displayOnNotFoundPage, String notFoundPageTitle, String routeConfigKey, OptionalInt order)
  • Method Details

    • getTypeOfRoute

      public RouteBuildItem.RouteType getTypeOfRoute()
    • hasOrder

      public boolean hasOrder()
    • getOrder

      public int getOrder()
    • hasRouteConfigKey

      public boolean hasRouteConfigKey()
    • getRouteConfigKey

      public String getRouteConfigKey()
    • getHandler

      public io.vertx.core.Handler<io.vertx.ext.web.RoutingContext> getHandler()
    • getHandlerType

      public RouteBuildItem.HandlerType getHandlerType()
    • getPath

      public String getPath()
    • getCustomizer

      public Consumer<io.vertx.ext.web.Route> getCustomizer()
    • getNotFoundPageTitle

      public String getNotFoundPageTitle()
    • isDisplayOnNotFoundPage

      public boolean isDisplayOnNotFoundPage()
    • newApplicationRoute

      public static RouteBuildItem.Builder newApplicationRoute(String path)
      Declares a new application route. Application routes are part of the application business logic and are mounted on the application router. The quarkus.http.root-path property is applied in front of the route path (if set).
      Parameters:
      path - the path, must not be null or empty
      Returns:
      the builder to configure the route
    • newAbsoluteRoute

      public static RouteBuildItem.Builder newAbsoluteRoute(String path)
      Declares a new absolute route. Application routes are part of the application business logic and are mounted at the root of the server. The quarkus.http.root-path property is not applied.
      Parameters:
      path - the path, must not be null or empty, and must start with a slash
      Returns:
      the builder to configure the route
    • newFrameworkRoute

      public static RouteBuildItem.Builder newFrameworkRoute(String path)
      Declares a new framework route. A framework route is provided by the Quarkus framework (or extensions).

      The quarkus.http.non-application-root-path property is applied in front of the route path (defaults to /q).

      The declared route is not considered as a management route, meaning it will be mounted on the application router and exposed on the main HTTP server. See newManagementRoute(String) to declare a management route.

      Parameters:
      path - the path, must not be null or empty.
      Returns:
      the builder to configure the route
    • newManagementRoute

      public static RouteBuildItem.Builder newManagementRoute(String path)
      Declares a new management route.

      A management route is provided by the Quarkus framework (or extensions), and unlike routes declared with newFrameworkRoute(String), are mounted on the management router (exposed on the management HTTP server) when the management interface is enabled (see the management interface documentation for further details).

      If the management interface is not enabled, the quarkus.http.non-application-root-path property is applied in front of the route path (defaults to /q). If the management interface is enabled, the quarkus.management.root-path property is applied in front of the route path (also defaults to /q but exposed on another port, 9000 by default).

      Parameters:
      path - the path, must not be null or empty.
      Returns:
      the builder to configure the route
    • newManagementRoute

      public static RouteBuildItem.Builder newManagementRoute(String path, String managementConfigKey)
      Declares a new framework route, conditionally considered as a management route depending on the value of the managementConfigKey property.

      The route is provided by the Quarkus framework (or extensions). Depending on the value associated to the managementConfigKey property, the route is either mounted to the application router (exposed on the main HTTP server) or on the management router (exposed on the management HTTP server). The property must be a boolean (set to true to expose the route on the management server or false to expose it on the main HTTP server).

      If the management interface is not enabled, regardless the value of the property, the route is exposed on the main HTTP server. The quarkus.http.non-application-root-path property is applied in front of the route path (defaults to /q).

      If the management interface is enabled and if the property is set to true, the route is exposed on the management server and the quarkus.management.root-path property is applied in front of the route path (also defaults to /q but exposed on another port, 9000 by default).

      If the management interface is enabled and if the property is set to false, the route is exposed on the main HTTP server. The quarkus.http.non-application-root-path property is applied in front of the route path (defaults to /q).

      Parameters:
      path - the path, must not be null or empty.
      Returns:
      the builder to configure the route
    • isManagement

      public boolean isManagement()