Package io.micronaut.http
Class BasicHttpAttributes
java.lang.Object
io.micronaut.http.BasicHttpAttributes
Accessors for basic attributes outside micronaut-http-router.
- Since:
- 4.8.0
- Author:
- Jonas Konrad
-
Method Summary
Modifier and TypeMethodDescriptionstatic Optional<UriMatchInfo>
getRouteMatchInfo
(HttpRequest<?> request) Get the route match as aUriMatchInfo
.getServiceId
(@NonNull HttpRequest<?> request) Get the client service ID.getUriTemplate
(HttpRequest<?> request) Get the URI template as a String, for tracing.static void
setUriTemplate
(@NonNull HttpRequest<?> request, @NonNull String uriTemplate) Set the URI template as a String, for tracing.
-
Method Details
-
getRouteMatchInfo
Get the route match as aUriMatchInfo
.- Parameters:
request
- The request- Returns:
- The route match, if present
-
getUriTemplate
Get the URI template as a String, for tracing.- Parameters:
request
- The request- Returns:
- The template, if present
-
setUriTemplate
public static void setUriTemplate(@NonNull @NonNull HttpRequest<?> request, @NonNull @NonNull String uriTemplate) Set the URI template as a String, for tracing.- Parameters:
request
- The requesturiTemplate
- The template, if present
-
getServiceId
@NonNull public static @NonNull Optional<String> getServiceId(@NonNull @NonNull HttpRequest<?> request) Get the client service ID.- Parameters:
request
- The request- Returns:
- The client service ID
-