Class UriRegexMatcher<T>
- java.lang.Object
-
- org.apache.hc.core5.http.protocol.UriRegexMatcher<T>
-
- Type Parameters:
T- The type of registered objects.
- All Implemented Interfaces:
LookupRegistry<T>
@Contract(threading=SAFE) @Deprecated public class UriRegexMatcher<T> extends java.lang.Object implements LookupRegistry<T>
Deprecated.UseRequestRouterfor request routing.Maintains a map of objects keyed by a request URI regular expression.The insertion order is in maintained in that map such that the lookup tests each regex until there is a match. This class can be used to resolve an object matching a particular request URI.
- Since:
- 5.0
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.concurrent.locks.ReentrantLocklockDeprecated.private java.util.Map<java.lang.String,T>objectMapDeprecated.private java.util.Map<java.lang.String,java.util.regex.Pattern>patternMapDeprecated.
-
Constructor Summary
Constructors Constructor Description UriRegexMatcher()Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Tlookup(java.lang.String path)Deprecated.Looks up an object matching the given request path.voidregister(java.lang.String regex, T obj)Deprecated.Registers the given object for URIs matching the given regex.java.lang.StringtoString()Deprecated.voidunregister(java.lang.String regex)Deprecated.Removes registered object, if exists, for the given regex.
-
-
-
Field Detail
-
objectMap
private final java.util.Map<java.lang.String,T> objectMap
Deprecated.
-
patternMap
private final java.util.Map<java.lang.String,java.util.regex.Pattern> patternMap
Deprecated.
-
lock
private final java.util.concurrent.locks.ReentrantLock lock
Deprecated.
-
-
Method Detail
-
register
public void register(java.lang.String regex, T obj)Deprecated.Registers the given object for URIs matching the given regex.- Specified by:
registerin interfaceLookupRegistry<T>- Parameters:
regex- the regex to register the handler for.obj- the object.
-
unregister
public void unregister(java.lang.String regex)
Deprecated.Removes registered object, if exists, for the given regex.- Specified by:
unregisterin interfaceLookupRegistry<T>- Parameters:
regex- the regex to unregister.
-
lookup
public T lookup(java.lang.String path)
Deprecated.Looks up an object matching the given request path.- Specified by:
lookupin interfaceLookupRegistry<T>- Parameters:
path- the request path- Returns:
- object or
nullif no match is found.
-
toString
public java.lang.String toString()
Deprecated.- Overrides:
toStringin classjava.lang.Object
-
-