org.glassfish.jersey.server.internal.routing
Interface RoutingContext

All Superinterfaces:
ResourceInfo
All Known Implementing Classes:
UriRoutingContext

public interface RoutingContext
extends ResourceInfo

Jersey request matching and routing context.

Author:
Marek Potociar (marek.potociar at oracle.com), Martin Matula (martin.matula at oracle.com)

Method Summary
 java.lang.Iterable<RankedProvider<ReaderInterceptor>> getBoundReaderInterceptors()
          Get all reader interceptors applicable to this request.
 java.lang.Iterable<RankedProvider<ContainerRequestFilter>> getBoundRequestFilters()
          Get all bound request filters applicable to this request.
 java.lang.Iterable<RankedProvider<ContainerResponseFilter>> getBoundResponseFilters()
          Get all bound response filters applicable to this request.
 java.lang.Iterable<RankedProvider<WriterInterceptor>> getBoundWriterInterceptors()
          Get all writer interceptors applicable to this request.
 java.lang.String getFinalMatchingGroup()
          Get the final matching group of the last successful request URI routing pattern match result.
 Inflector<ContainerRequest,ContainerResponse> getInflector()
          Get the matched request to response data inflector if present, or null otherwise.
 java.util.List<java.util.regex.MatchResult> getMatchedResults()
          Get a read-only list of match results for matched request URI routing patterns.
 java.lang.Object peekMatchedResource()
          Peek the last resource object that successfully matched the request URI.
 java.util.regex.MatchResult peekMatchResult()
          Peek at the last successful request URI routing pattern match result.
 void pushLeftHandPath()
          Add currently matched left-hand side part of request path to the list of matched paths returned by UriInfo.getMatchedURIs().
 void pushMatchedResource(java.lang.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(java.util.regex.MatchResult matchResult)
          Push the result of the successful request URI routing pattern match.
 void pushTemplate(UriTemplate template)
          Push matched request URI routing pattern URI template.
 void setInflector(Inflector<ContainerRequest,ContainerResponse> inflector)
          Set the matched request to response inflector.
 void setMatchedResource(Resource resource)
          Set the matched resource or child resource.
 void setMatchedResourceMethod(ResourceMethod resourceMethod)
          Set the matched resource method.
 
Methods inherited from interface javax.ws.rs.container.ResourceInfo
getResourceClass, getResourceMethod
 

Method Detail

pushMatchResult

void pushMatchResult(java.util.regex.MatchResult matchResult)
Push the result of the successful request URI routing pattern match.

Parameters:
matchResult - successful request URI routing pattern match result.

pushMatchedResource

void pushMatchedResource(java.lang.Object resource)
Push the resource that matched the request URI.

Parameters:
resource - instance of the resource that matched the request URI.

peekMatchedResource

java.lang.Object peekMatchedResource()
Peek the last resource object that successfully matched the request URI.

Returns:
last resource matched as previously set by pushMatchedResource(java.lang.Object)

peekMatchResult

java.util.regex.MatchResult peekMatchResult()
Peek at the last successful request URI routing pattern match result.

Returns:
last successful request URI routing pattern match result.

pushTemplate

void pushTemplate(UriTemplate template)
Push matched request URI routing pattern URI template.

Parameters:
template - URI template of the matched request URI routing pattern.

getFinalMatchingGroup

java.lang.String getFinalMatchingGroup()
Get the final matching group of the last successful request URI routing pattern match result. Also known as right-hand path.

May be empty but is never null.

Returns:
final matching group of the last successful request URI routing pattern match result.

getMatchedResults

java.util.List<java.util.regex.MatchResult> getMatchedResults()
Get a read-only list of match results for matched request URI routing patterns. Entries are ordered in reverse request URI matching order, with the root request URI routing pattern match result last.

Returns:
a read-only reverse list of request URI routing pattern match results.

pushLeftHandPath

void pushLeftHandPath()
Add currently matched left-hand side part of request path to the list of matched paths returned by 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.


setInflector

void setInflector(Inflector<ContainerRequest,ContainerResponse> inflector)
Set the matched request to response inflector. This method can be used in a non-terminal stage to set the inflector that can be retrieved and processed by a subsequent stage.

Parameters:
inflector - matched request to response inflector.

getInflector

Inflector<ContainerRequest,ContainerResponse> getInflector()
Get the matched request to response data inflector if present, or null otherwise.

Returns:
matched request to response inflector, or null if not available.

getBoundRequestFilters

java.lang.Iterable<RankedProvider<ContainerRequestFilter>> getBoundRequestFilters()
Get all bound request filters applicable to this request. This is populated once the right resource method is matched.

Returns:
All bound (dynamically or by name) request filters applicable to the matched inflector (or an empty collection if no inflector matched yet).

getBoundResponseFilters

java.lang.Iterable<RankedProvider<ContainerResponseFilter>> getBoundResponseFilters()
Get all bound response filters applicable to this request. This is populated once the right resource method is matched.

Returns:
All bound (dynamically or by name) response filters applicable to the matched inflector (or an empty collection if no inflector matched yet).

getBoundReaderInterceptors

java.lang.Iterable<RankedProvider<ReaderInterceptor>> getBoundReaderInterceptors()
Get all reader interceptors applicable to this request. This is populated once the right resource method is matched.

Returns:
All reader interceptors applicable to the matched inflector (or an empty collection if no inflector matched yet).

getBoundWriterInterceptors

java.lang.Iterable<RankedProvider<WriterInterceptor>> getBoundWriterInterceptors()
Get all writer interceptors applicable to this request. This is populated once the right resource method is matched.

Returns:
All writer interceptors applicable to the matched inflector (or an empty collection if no inflector matched yet).

setMatchedResourceMethod

void setMatchedResourceMethod(ResourceMethod resourceMethod)
Set the matched 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.

Parameters:
resourceMethod - Resource method that was matched.

setMatchedResource

void setMatchedResource(Resource resource)
Set the matched resource or child resource. This method needs to be called only if the resource was matched. This method should be called only setting for final resource which contains matched resource method and not for setting resources which contains sub resource locators invoked during matching.

Parameters:
resource - Resource that was matched.

pushMatchedRuntimeResource

void pushMatchedRuntimeResource(RuntimeResource runtimeResource)
Push a matched runtime resource that was visited during matching phase. This method must be called for any matched runtime resource.

Parameters:
runtimeResource - Runtime resource that was matched during matching.


Copyright © 2007-2013 Oracle Corporation. All Rights Reserved. Use is subject to license terms.