Package org.apache.http.nio.protocol
Class UriHttpAsyncRequestHandlerMapper
java.lang.Object
org.apache.http.nio.protocol.UriHttpAsyncRequestHandlerMapper
- All Implemented Interfaces:
HttpAsyncRequestHandlerMapper
@Contract(threading=SAFE)
public class UriHttpAsyncRequestHandlerMapper
extends Object
implements HttpAsyncRequestHandlerMapper
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
HttpAsyncRequestHandler
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
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
getRequestPath
(HttpRequest request) Extracts request path from the givenHttpRequest
Gets the pattern matcher.lookup
(HttpRequest request) Looks up a handler matching the given request URI.void
register
(String pattern, HttpAsyncRequestHandler<?> handler) Registers the givenHttpAsyncRequestHandler
as a handler for URIs matching the given pattern.toString()
void
unregister
(String pattern) Removes registered handler, if exists, for the given pattern.
-
Field Details
-
matcher
-
-
Constructor Details
-
UriHttpAsyncRequestHandlerMapper
-
UriHttpAsyncRequestHandlerMapper
public UriHttpAsyncRequestHandlerMapper()
-
-
Method Details
-
getUriPatternMatcher
Gets the pattern matcher.- Returns:
- the matcher
- Since:
- 4.4.9
-
register
Registers the givenHttpAsyncRequestHandler
as 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.
-
getRequestPath
Extracts request path from the givenHttpRequest
-
toString
-
lookup
Looks up a handler matching the given request URI.- Specified by:
lookup
in interfaceHttpAsyncRequestHandlerMapper
- Parameters:
request
- the request- Returns:
- handler or
null
if no match is found.
-