Interface ListenerRepository

    • Method Summary

      All Methods Instance Methods Abstract 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.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.
    • Method Detail

      • addListener

        void addListener​(Listener listener)
        Adds a listener to the repository.
        Parameters:
        listener - - the listener
      • findListeners

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

        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. This is a hierarchical search, starting from top (/url/foo/bar) to bottom (/url).
        Parameters:
        url - url
        method - http method
        Returns:
        List with listeners for the url, can be empty if no listeners are found.
      • removeListener

        void removeListener​(java.lang.String listenerId)
        Removes the listener for the given listenerId.
        Parameters:
        listenerId - listenerId
      • size

        int size()
        Returns the size of the repository. If the repository is empty, it will return 0.
        Returns:
        size
      • isEmpty

        boolean isEmpty()
        Returns whether the repository is empty or not.
        Returns:
        true if repository is empty.
      • getListeners

        java.util.List<Listener> getListeners()
        Returns a copy of all registred listeners.
        Returns:
        a copy of all registred listeners