Package io.quarkus.vertx.http.deployment
Class NonApplicationRootPathBuildItem
java.lang.Object
io.quarkus.builder.item.BuildItem
io.quarkus.builder.item.SimpleBuildItem
io.quarkus.vertx.http.deployment.NonApplicationRootPathBuildItem
public final class NonApplicationRootPathBuildItem
extends io.quarkus.builder.item.SimpleBuildItem
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classPer non-application endpoint instance. -
Field Summary
FieldsModifier and TypeFieldDescription(package private) final boolean(package private) final booleanNon-Application root path is distinct from HTTP root path.(package private) final URINormalized of quarkus.http.root-path.(package private) final URINormalized from quarkus.management.root-path(package private) final URINormalized from quarkus.http.non-application-root-path -
Constructor Summary
ConstructorsConstructorDescriptionNonApplicationRootPathBuildItem(String httpRootPath, String nonApplicationRootPath, String managementRootPath) -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetManagementUrlPrefix(io.quarkus.deployment.builditem.LaunchModeBuildItem mode) Best effort to deduce the URL prefix (scheme, host, port) of the management interface.Return normalized root path configured from quarkus.http.root-path and {quarkus.http.non-application-root-path}.(package private) StringPath to the Non-application root for use with Vert.x Routers, has a leading slash.booleanbooleanIs a dedicated router required for non-application endpoints.resolveManagementNestedPath(String path, String subRoute) resolveManagementPath(String path, ManagementInterfaceBuildTimeConfig managementInterfaceBuildTimeConfig, io.quarkus.deployment.builditem.LaunchModeBuildItem mode) resolveManagementPath(String path, ManagementInterfaceBuildTimeConfig managementInterfaceBuildTimeConfig, io.quarkus.deployment.builditem.LaunchModeBuildItem mode, boolean extensionOverride) resolveNestedPath(String path, String subRoute) Resolve a base path and a sub-resource against the non-application root.resolvePath(String path) Resolve path into an absolute path.
-
Field Details
-
httpRootPath
Normalized of quarkus.http.root-path. Must end in a slash -
nonApplicationRootPath
Normalized from quarkus.http.non-application-root-path -
managementRootPath
Normalized from quarkus.management.root-path -
dedicatedRouterRequired
final boolean dedicatedRouterRequiredNon-Application root path is distinct from HTTP root path. -
attachedToMainRouter
final boolean attachedToMainRouter
-
-
Constructor Details
-
NonApplicationRootPathBuildItem
-
-
Method Details
-
isDedicatedRouterRequired
public boolean isDedicatedRouterRequired()Is a dedicated router required for non-application endpoints.- Returns:
- boolean
-
isAttachedToMainRouter
public boolean isAttachedToMainRouter() -
getVertxRouterPath
String getVertxRouterPath()Path to the Non-application root for use with Vert.x Routers, has a leading slash.If it's under the HTTP Root, return a path relative to HTTP Root. Otherwise, return an absolute path.
- Returns:
- String Path suitable for use with Vert.x Router. It has a leading slash
-
getNormalizedHttpRootPath
-
getNonApplicationRootPath
Return normalized root path configured from quarkus.http.root-path and {quarkus.http.non-application-root-path}. This path will always end in a slash.Use
resolvePath(String)if you need to construct a URI for a non-application endpoint.- Returns:
- Normalized non-application root path ending with a slash
- See Also:
-
getManagementRootPath
- Returns:
- the normalized root path for the mangement endpoints.
getNonApplicationRootPath()if the management interface is disabled.
-
resolvePath
Resolve path into an absolute path. If path is relative, it will be resolved against `quarkus.http.non-application-root-path`. An absolute path will be normalized and returned.Given quarkus.http.root-path=/ and quarkus.http.non-application-root-path="q"
resolvePath("foo")will return /q/fooresolvePath("/foo")will return /foo
Given quarkus.http.root-path=/ and quarkus.http.non-application-root-path="/q"
resolvePath("foo")will return /q/fooresolvePath("/foo")will return /foo
resolvePath("foo")will return /app/q/fooresolvePath("/foo")will return /foo
resolvePath("foo")will return /q/fooresolvePath("/foo")will return /foo
The returned path will not end with a slash.
- Parameters:
path- Path to be resolved to an absolute path.- Returns:
- An absolute path not ending with a slash
- Throws:
IllegalArgumentException- if path is null or empty- See Also:
-
UriNormalizationUtil.normalizeWithBase(URI, String, boolean)
-
resolveManagementPath
public String resolveManagementPath(String path, ManagementInterfaceBuildTimeConfig managementInterfaceBuildTimeConfig, io.quarkus.deployment.builditem.LaunchModeBuildItem mode) -
resolveManagementPath
public String resolveManagementPath(String path, ManagementInterfaceBuildTimeConfig managementInterfaceBuildTimeConfig, io.quarkus.deployment.builditem.LaunchModeBuildItem mode, boolean extensionOverride) -
getManagementUrlPrefix
public static String getManagementUrlPrefix(io.quarkus.deployment.builditem.LaunchModeBuildItem mode) Best effort to deduce the URL prefix (scheme, host, port) of the management interface.- Parameters:
mode- the mode, influencing the default port- Returns:
- the prefix
-
resolveNestedPath
Resolve a base path and a sub-resource against the non-application root. This will call resolvePath on the base path (to establish a fully-resolved, absolute path), and then will resolve the subRoute against that resolved path. This allows a configured subpath to be configured (consistently) as an absolute URI.Given quarkus.http.root-path=/ and quarkus.http.non-application-root-path="q"
resolveNestedPath("foo", "a")will return /q/foo/aresolveNestedPath("foo", "/a)will return /a
The returned path will not end with a slash.
- Parameters:
path- Path to be resolved to an absolute path.- Returns:
- An absolute path not ending with a slash
- Throws:
IllegalArgumentException- if path is null or empty- See Also:
-
UriNormalizationUtil.normalizeWithBase(URI, String, boolean)resolvePath(String)
-
resolveManagementNestedPath
-
routeBuilder
-