Top Description Fields Constructors Methods
org.apache.http.protocol

public Class UriHttpRequestHandlerMapper

extends Object
implements HttpRequestHandlerMapper
Class Inheritance
All Implemented Interfaces
org.apache.http.protocol.HttpRequestHandlerMapper
Annotations
@Contract
threading:SAFE
Imports
org.apache.http.HttpRequest, org.apache.http.annotation.ThreadingBehavior, .Contract, org.apache.http.util.Args

Maintains a map of HTTP request handlers keyed by a request URI pattern.
Patterns may have three formats:
This class can be used to map an instance of HttpRequestHandler matching a particular request URI. Usually the mapped request handler will be used to process the request with the specified request URI.
Since
4.3

Field Summary

Modifier and TypeField and Description
private final UriPatternMatcher<HttpRequestHandler>

Constructor Summary

AccessConstructor and Description
protected
public

Method Summary

Modifier and TypeMethod and Description
protected String
getRequestPath(final HttpRequest request)

Extracts request path from the given HttpRequest

public HttpRequestHandler

Returns:

handler or null if no match is found.
lookup
(final HttpRequest
the request
request
)

Implements org.apache.http.protocol.HttpRequestHandlerMapper.lookup.

Looks up a handler matching the given request URI.
public void
register(final String
the pattern to register the handler for.
pattern
,
final HttpRequestHandler
the handler.
handler
)

Registers the given HttpRequestHandler as a handler for URIs matching the given pattern.

public void
unregister(final String
the pattern to unregister the handler for.
pattern
)

Removes registered handler, if exists, for the given pattern.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

matcherback to summary
private final UriPatternMatcher<HttpRequestHandler> matcher

Constructor Detail

UriHttpRequestHandlerMapperback to summary
protected UriHttpRequestHandlerMapper(final UriPatternMatcher<HttpRequestHandler> matcher)
UriHttpRequestHandlerMapperback to summary
public UriHttpRequestHandlerMapper()

Method Detail

getRequestPathback to summary
protected String getRequestPath(final HttpRequest request)

Extracts request path from the given HttpRequest

lookupback to summary
public HttpRequestHandler lookup(final HttpRequest request)

Implements org.apache.http.protocol.HttpRequestHandlerMapper.lookup.

Looks up a handler matching the given request URI.

Parameters
request:HttpRequest

the request

Returns:HttpRequestHandler

handler or null if no match is found.

Annotations
@Override
registerback to summary
public void register(final String pattern, final HttpRequestHandler handler)

Registers the given HttpRequestHandler as a handler for URIs matching the given pattern.

Parameters
pattern:String

the pattern to register the handler for.

handler:HttpRequestHandler

the handler.

unregisterback to summary
public void unregister(final String pattern)

Removes registered handler, if exists, for the given pattern.

Parameters
pattern:String

the pattern to unregister the handler for.