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

All Superinterfaces:
ResourceInfo

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
 Iterable<RankedProvider<ReaderInterceptor>> getBoundReaderInterceptors()
          Get all reader interceptors applicable to this request.
 Iterable<RankedProvider<ContainerRequestFilter>> getBoundRequestFilters()
          Get all bound request filters applicable to this request.
 Iterable<RankedProvider<ContainerResponseFilter>> getBoundResponseFilters()
          Get all bound response filters applicable to this request.
 Iterable<RankedProvider<WriterInterceptor>> getBoundWriterInterceptors()
          Get all writer interceptors applicable to this request.
 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.
 List<MatchResult> getMatchedResults()
          Get a read-only list of match results for matched request URI routing patterns.
 Object peekMatchedResource()
          Peek the last resource object that successfully matched the request URI.
 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(Object resource)
          Push the resource that matched the request URI.
 void pushMatchResult(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.
 
Methods inherited from interface javax.ws.rs.container.ResourceInfo
getResourceClass, getResourceMethod
 

Method Detail

pushMatchResult

void pushMatchResult(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(Object resource)
Push the resource that matched the request URI.

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

peekMatchedResource

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

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

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

List<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

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

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

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

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).


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