Class UriPatternMatcher<T>

  • Type Parameters:
    T - The type of registered objects.
    All Implemented Interfaces:
    LookupRegistry<T>

    @Contract(threading=SAFE)
    @Deprecated
    public class UriPatternMatcher<T>
    extends java.lang.Object
    implements LookupRegistry<T>
    Deprecated.
    Use RequestRouter for request routing.
    Maintains a map of objects keyed by a request URI pattern.

    Patterns may have three formats:

    • *
    • *<uri>
    • <uri>*

    This class can be used to resolve an object matching a particular request URI.

    Since:
    4.0
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.concurrent.locks.ReentrantLock lock
      Deprecated.
       
      private java.util.Map<java.lang.String,​T> map
      Deprecated.
       
    • Constructor Summary

      Constructors 
      Constructor Description
      UriPatternMatcher()
      Deprecated.
       
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      java.util.Set<java.util.Map.Entry<java.lang.String,​T>> entrySet()
      Deprecated.
      Returns a Set view of the mappings contained in this matcher.
      T lookup​(java.lang.String path)
      Deprecated.
      Looks up an object matching the given request path.
      protected boolean matchUriRequestPattern​(java.lang.String pattern, java.lang.String path)
      Deprecated.
      Tests if the given request path matches the given pattern.
      void register​(java.lang.String pattern, T obj)
      Deprecated.
      Registers the given object for URIs matching the given pattern.
      java.lang.String toString()
      Deprecated.
       
      void unregister​(java.lang.String pattern)
      Deprecated.
      Removes registered object, if exists, for the given pattern.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • map

        private final java.util.Map<java.lang.String,​T> map
        Deprecated.
      • lock

        private final java.util.concurrent.locks.ReentrantLock lock
        Deprecated.
    • Constructor Detail

      • UriPatternMatcher

        public UriPatternMatcher()
        Deprecated.
    • Method Detail

      • entrySet

        public java.util.Set<java.util.Map.Entry<java.lang.String,​T>> entrySet()
        Deprecated.
        Returns a Set view of the mappings contained in this matcher.
        Returns:
        a set view of the mappings contained in this matcher.
        Since:
        4.4.9
        See Also:
        Map.entrySet()
      • register

        public void register​(java.lang.String pattern,
                             T obj)
        Deprecated.
        Registers the given object for URIs matching the given pattern.
        Specified by:
        register in interface LookupRegistry<T>
        Parameters:
        pattern - the pattern to register the handler for.
        obj - the object.
      • unregister

        public void unregister​(java.lang.String pattern)
        Deprecated.
        Removes registered object, if exists, for the given pattern.
        Specified by:
        unregister in interface LookupRegistry<T>
        Parameters:
        pattern - the pattern to unregister.
      • lookup

        public T lookup​(java.lang.String path)
        Deprecated.
        Looks up an object matching the given request path.
        Specified by:
        lookup in interface LookupRegistry<T>
        Parameters:
        path - the request path
        Returns:
        object or null if no match is found.
      • matchUriRequestPattern

        protected boolean matchUriRequestPattern​(java.lang.String pattern,
                                                 java.lang.String path)
        Deprecated.
        Tests if the given request path matches the given pattern.
        Parameters:
        pattern - the pattern
        path - the request path
        Returns:
        true if the request URI matches the pattern, false otherwise.
      • toString

        public java.lang.String toString()
        Deprecated.
        Overrides:
        toString in class java.lang.Object