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 Classes Modifier and Type Class Description static classNonApplicationRootPathBuildItem.BuilderPer non-application endpoint instance.
-
Field Summary
Fields Modifier and Type Field Description (package private) booleanattachedToMainRouter(package private) booleandedicatedRouterRequiredNon-Application root path is distinct from HTTP root path.(package private) URIhttpRootPathNormalized of quarkus.http.root-path.(package private) URImanagementRootPathNormalized from quarkus.management.root-path(package private) URInonApplicationRootPathNormalized from quarkus.http.non-application-root-path
-
Constructor Summary
Constructors Constructor Description NonApplicationRootPathBuildItem(String httpRootPath, String nonApplicationRootPath, String managementRootPath)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetManagementRootPath()static StringgetManagementUrlPrefix(io.quarkus.deployment.builditem.LaunchModeBuildItem mode)Best effort to deduce the URL prefix (scheme, host, port) of the management interface.StringgetNonApplicationRootPath()Return normalized root path configured from quarkus.http.root-path and {quarkus.http.non-application-root-path}.StringgetNormalizedHttpRootPath()(package private) StringgetVertxRouterPath()Path to the Non-application root for use with Vert.x Routers, has a leading slash.booleanisAttachedToMainRouter()booleanisDedicatedRouterRequired()Is a dedicated router required for non-application endpoints.StringresolveManagementNestedPath(String path, String subRoute)StringresolveManagementPath(String path, ManagementInterfaceBuildTimeConfig managementInterfaceBuildTimeConfig, io.quarkus.deployment.builditem.LaunchModeBuildItem mode)StringresolveNestedPath(String path, String subRoute)Resolve a base path and a sub-resource against the non-application root.StringresolvePath(String path)Resolve path into an absolute path.NonApplicationRootPathBuildItem.BuilderrouteBuilder()
-
-
-
Field Detail
-
httpRootPath
final URI httpRootPath
Normalized of quarkus.http.root-path. Must end in a slash
-
nonApplicationRootPath
final URI nonApplicationRootPath
Normalized from quarkus.http.non-application-root-path
-
managementRootPath
final URI managementRootPath
Normalized from quarkus.management.root-path
-
dedicatedRouterRequired
final boolean dedicatedRouterRequired
Non-Application root path is distinct from HTTP root path.
-
attachedToMainRouter
final boolean attachedToMainRouter
-
-
Method Detail
-
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
public String getNormalizedHttpRootPath()
-
getNonApplicationRootPath
public String 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:
resolvePath(String)
-
getManagementRootPath
public String getManagementRootPath()
- Returns:
- the normalized root path for the mangement endpoints.
getNonApplicationRootPath()if the management interface is disabled.
-
resolvePath
public String resolvePath(String path)
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)
-
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
public String resolveNestedPath(String path, String subRoute)
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
public String resolveManagementNestedPath(String path, String subRoute)
-
routeBuilder
public NonApplicationRootPathBuildItem.Builder routeBuilder()
-
-