Package org.swisspush.gateleen.hook
Interface ListenerRepository
-
- All Known Implementing Classes:
ListenerRepositoryBase,LocalListenerRepository
public interface ListenerRepositoryA repository for listener hooks.- Author:
- https://github.com/ljucam [Mario Ljuca]
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddListener(Listener listener)Adds a listener to the repository.List<Listener>findListeners(String url)Searches for listeners corresponding to the given url.List<Listener>findListeners(String url, String method, io.vertx.core.MultiMap headers)Searches for listeners corresponding to the given url, used http method and request headers.List<Listener>getListeners()Returns a copy of all registered listeners.booleanisEmpty()Returns whether the repository is empty or not.voidremoveListener(String listenerId)Removes the listener for the given listenerId.intsize()Returns the size of the repository.
-
-
-
Method Detail
-
addListener
void addListener(Listener listener)
Adds a listener to the repository.- Parameters:
listener- - the listener
-
findListeners
List<Listener> findListeners(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
List<Listener> findListeners(String url, String method, io.vertx.core.MultiMap headers)
Searches for listeners corresponding to the given url, used http method and request headers. This is a hierarchical search, starting from top (/url/foo/bar) to bottom (/url).- Parameters:
url- urlmethod- http methodheaders- http headers- Returns:
- List with listeners for the url, can be empty if no listeners are found.
-
removeListener
void removeListener(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.
-
-