Class LocalListenerRepository

    • Constructor Summary

      Constructors 
      Constructor Description
      LocalListenerRepository()
      Creates a new instance of the local in-memory LocalHookListenerRepository.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addListener​(Listener listener)
      Adds a listener to the repository.
      java.util.List<Listener> findListeners​(java.lang.String url)
      Searches for listeners corresponding to the given url.
      java.util.List<Listener> findListeners​(java.lang.String url, java.lang.String method)
      Searches for listeners corresponding to the given url and the used http method.
      java.util.Set<Listener> get​(java.util.Map<java.lang.String,​java.util.Set<Listener>> container, java.lang.String key)
      Returns a set with listeners monitoring the given url.
      java.util.List<Listener> getListeners()
      Returns a copy of all registred listeners.
      boolean isEmpty()
      Returns whether the repository is empty or not.
      void removeListener​(java.lang.String listenerId)
      Removes the listener for the given listenerId.
      int size()
      Returns the size of the repository.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LocalListenerRepository

        public LocalListenerRepository()
        Creates a new instance of the local in-memory LocalHookListenerRepository.
    • Method Detail

      • findListeners

        public java.util.List<Listener> findListeners​(java.lang.String url)
        Description copied from interface: ListenerRepository
        Searches for listeners corresponding to the given url. This is a hierarchical search, starting from top (/url/foo/bar) to bottom (/url).
        Specified by:
        findListeners in interface ListenerRepository
        Parameters:
        url - url
        Returns:
        List with listeners for the url, can be empty if no listeners are found.
      • removeListener

        public void removeListener​(java.lang.String listenerId)
        Description copied from interface: ListenerRepository
        Removes the listener for the given listenerId.
        Specified by:
        removeListener in interface ListenerRepository
        Parameters:
        listenerId - listenerId
      • size

        public int size()
        Description copied from interface: ListenerRepository
        Returns the size of the repository. If the repository is empty, it will return 0.
        Specified by:
        size in interface ListenerRepository
        Returns:
        size
      • isEmpty

        public boolean isEmpty()
        Description copied from interface: ListenerRepository
        Returns whether the repository is empty or not.
        Specified by:
        isEmpty in interface ListenerRepository
        Returns:
        true if repository is empty.
      • get

        public java.util.Set<Listener> get​(java.util.Map<java.lang.String,​java.util.Set<Listener>> container,
                                           java.lang.String key)
        Description copied from class: ListenerRepositoryBase
        Returns a set with listeners monitoring the given url. Please implement this method according to your needs.
        Specified by:
        get in class ListenerRepositoryBase<java.util.Map<java.lang.String,​java.util.Set<Listener>>>
        Parameters:
        container - container
        key - - a monitored url
        Returns:
        set with listeners for the given url
      • findListeners

        public java.util.List<Listener> findListeners​(java.lang.String url,
                                                      java.lang.String method)
        Description copied from interface: ListenerRepository
        Searches for listeners corresponding to the given url and the used http method. This is a hierarchical search, starting from top (/url/foo/bar) to bottom (/url).
        Specified by:
        findListeners in interface ListenerRepository
        Parameters:
        url - url
        method - http method
        Returns:
        List with listeners for the url, can be empty if no listeners are found.