Package org.apache.http.protocol
Class UriHttpRequestHandlerMapper
java.lang.Object
org.apache.http.protocol.UriHttpRequestHandlerMapper
- All Implemented Interfaces:
HttpRequestHandlerMapper
@Contract(threading=SAFE)
public class UriHttpRequestHandlerMapper
extends Object
implements HttpRequestHandlerMapper
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
Patterns may have three formats:
**<uri><uri>*
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
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlookup(HttpRequest request) Looks up a handler matching the given request URI.voidregister(String pattern, HttpRequestHandler handler) Registers the givenHttpRequestHandleras a handler for URIs matching the given pattern.voidunregister(String pattern) Removes registered handler, if exists, for the given pattern.
-
Constructor Details
-
UriHttpRequestHandlerMapper
public UriHttpRequestHandlerMapper()
-
-
Method Details
-
register
Registers the givenHttpRequestHandleras a handler for URIs matching the given pattern.- Parameters:
pattern- the pattern to register the handler for.handler- the handler.
-
unregister
Removes registered handler, if exists, for the given pattern.- Parameters:
pattern- the pattern to unregister the handler for.
-
lookup
Looks up a handler matching the given request URI.- Specified by:
lookupin interfaceHttpRequestHandlerMapper- Parameters:
request- the request- Returns:
- handler or
nullif no match is found.
-