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

public Class HttpRequestHandlerRegistry

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

Deprecated

(4.3) use UriHttpRequestHandlerMapper

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

Field Summary

Modifier and TypeField and Description
private final UriPatternMatcher<HttpRequestHandler>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Map<String, HttpRequestHandler>

Returns:

The map of handlers and their associated URI patterns.
getHandlers
()

Get the handler map.

public HttpRequestHandler
lookup(final String
the request URI
requestURI
)

Implements org.apache.http.protocol.HttpRequestHandlerResolver.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
setHandlers(final Map<String, HttpRequestHandler>
the map containing handlers keyed by their URI patterns.
map
)

Sets handlers from the given map.

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

HttpRequestHandlerRegistryback to summary
public HttpRequestHandlerRegistry()

Method Detail

getHandlersback to summary
public Map<String, HttpRequestHandler> getHandlers()

Get the handler map.

Returns:Map<String, HttpRequestHandler>

The map of handlers and their associated URI patterns.

Since
4.2
lookupback to summary
public HttpRequestHandler lookup(final String requestURI)

Implements org.apache.http.protocol.HttpRequestHandlerResolver.lookup.

Doc from org.apache.http.protocol.HttpRequestHandlerResolver.lookup.

Looks up a handler matching the given request URI.

Parameters
requestURI:String

the request URI

Returns:HttpRequestHandler

HTTP request 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.

setHandlersback to summary
public void setHandlers(final Map<String, HttpRequestHandler> map)

Sets handlers from the given map.

Parameters
map:Map<String, HttpRequestHandler>

the map containing handlers keyed by their URI patterns.

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.