public interface RoutingContext extends ResourceInfo, ExtendedUriInfo
Modifier and Type | Method and Description |
---|---|
Endpoint |
getEndpoint()
Get the matched server-side endpoint if present, or
null otherwise. |
String |
getFinalMatchingGroup()
Get the final matching group of the last successful request URI routing
pattern
match result . |
Object |
peekMatchedResource()
Peek the last resource object that successfully matched the request URI.
|
void |
pushLeftHandPath()
Add currently matched left-hand side part of request path to the list of
matched paths returned by
UriInfo.getMatchedURIs() . |
void |
pushLocatorSubResource(Resource subResourceFromLocator)
Push
sub resource returned from a sub resource locator method. |
void |
pushMatchedLocator(ResourceMethod resourceLocator)
Push the matched
sub resource locator method . |
void |
pushMatchedResource(Object resource)
Push the resource that matched the request URI.
|
void |
pushMatchedRuntimeResource(RuntimeResource runtimeResource)
Push a matched
runtime resource that was visited during matching phase. |
void |
pushMatchResult(MatchResult matchResult)
Push the result of the successful request URI routing pattern match.
|
void |
pushTemplates(UriTemplate resourceTemplate,
UriTemplate methodTemplate)
Push matched request URI routing pattern
templates
for a single matched method. |
void |
setEndpoint(Endpoint endpoint)
Set the matched server-side endpoint.
|
void |
setMappedThrowable(Throwable throwable)
Set the throwable that was mapped to a response.
|
void |
setMatchedResourceMethod(ResourceMethod resourceMethod)
Set the matched
resource method . |
getResourceClass, getResourceMethod
getLocatorSubResources, getMappedThrowable, getMatchedModelResource, getMatchedResourceLocators, getMatchedResourceMethod, getMatchedResults, getMatchedRuntimeResources, getMatchedTemplates, getPathSegments, getPathSegments
getAbsolutePath, getAbsolutePathBuilder, getBaseUri, getBaseUriBuilder, getMatchedResources, getMatchedURIs, getMatchedURIs, getPath, getPath, getPathParameters, getPathParameters, getPathSegments, getPathSegments, getQueryParameters, getQueryParameters, getRequestUri, getRequestUriBuilder, relativize, resolve
void pushMatchResult(MatchResult matchResult)
matchResult
- successful request URI routing pattern
match result
.void pushMatchedResource(Object resource)
resource
- instance of the resource that matched the request URI.Object peekMatchedResource()
pushMatchedResource(java.lang.Object)
void pushTemplates(UriTemplate resourceTemplate, UriTemplate methodTemplate)
templates
for a single matched method.
In case only a single path matching has been performed on the resource (in case of resource methods,
only the resource path is matched), the method template should be passed as null
.
In case a path matching has been performed on both a resource and method paths
(in case of sub-resource methods and locators), both templates (resource and method) must be specified.
resourceTemplate
- resource URI template that should be pushed.methodTemplate
- (sub-resource) method or locator URI template that should be pushed.String getFinalMatchingGroup()
match result
. Also known as right-hand path.
May be empty but is never null
.
void pushLeftHandPath()
UriInfo.getMatchedURIs()
.
Left-hand side request path is the request path excluding the suffix
part of the path matched by the final
matching group
of the last successful request URI routing pattern.void setEndpoint(Endpoint endpoint)
endpoint
- matched server-side endpoint.Endpoint getEndpoint()
null
otherwise.null
if not available.void setMatchedResourceMethod(ResourceMethod resourceMethod)
resource method
. This method needs to be called only if the method was
matched. This method should be called only for setting the final resource method and not for setting sub resource
locators invoked during matching.resourceMethod
- Resource method that was matched.void pushMatchedLocator(ResourceMethod resourceLocator)
sub resource locator method
.resourceLocator
- Sub resource locator method.void pushMatchedRuntimeResource(RuntimeResource runtimeResource)
runtime resource
that was visited during matching phase. This method must
be called for any matched runtime resource.runtimeResource
- Runtime resource that was matched during matching.void pushLocatorSubResource(Resource subResourceFromLocator)
sub resource
returned from a sub resource locator method. The pushed
subResourceFromLocator
is the final model of a sub resource which is already enhanced by
model processors
and
validated.subResourceFromLocator
- Resource constructed from result of sub resource locator method.void setMappedThrowable(Throwable throwable)
throwable
- throwable that was mapped to a response.ExtendedUriInfo.getMappedThrowable()
Copyright © 2007-2024, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.