|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.http.protocol.UriHttpRequestHandlerMapper
@Contract(threading=SAFE) public class UriHttpRequestHandlerMapper
Maintains a map of HTTP request handlers keyed by a request URI pattern.
Patterns may have three formats:
*
*<uri>
<uri>*
HttpRequestHandler
matching a particular request URI. Usually the
mapped request handler will be used to process the request with the
specified request URI.
Constructor Summary | |
---|---|
|
UriHttpRequestHandlerMapper()
|
protected |
UriHttpRequestHandlerMapper(UriPatternMatcher<HttpRequestHandler> matcher)
|
Method Summary | |
---|---|
protected String |
getRequestPath(HttpRequest request)
Extracts request path from the given HttpRequest |
HttpRequestHandler |
lookup(HttpRequest request)
Looks up a handler matching the given request URI. |
void |
register(String pattern,
HttpRequestHandler handler)
Registers the given HttpRequestHandler as a handler for URIs
matching the given pattern. |
void |
unregister(String pattern)
Removes registered handler, if exists, for the given pattern. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected UriHttpRequestHandlerMapper(UriPatternMatcher<HttpRequestHandler> matcher)
public UriHttpRequestHandlerMapper()
Method Detail |
---|
public void register(String pattern, HttpRequestHandler handler)
HttpRequestHandler
as a handler for URIs
matching the given pattern.
pattern
- the pattern to register the handler for.handler
- the handler.public void unregister(String pattern)
pattern
- the pattern to unregister the handler for.protected String getRequestPath(HttpRequest request)
HttpRequest
public HttpRequestHandler lookup(HttpRequest request)
lookup
in interface HttpRequestHandlerMapper
request
- the request
null
if no match is found.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |