Package org.swisspush.gateleen.hook
Interface RouteRepository
-
- All Known Implementing Classes:
LocalRouteRepository,RouteRepositoryBase
public interface RouteRepositoryA repository for routes of hooks.- Author:
- https://github.com/ljucam [Mario Ljuca]
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddRoute(String urlPattern, Route route)Adds a route for the given url pattern.Set<String>getCollections(String parentUri)Returns a set with collections (routes) contained in the given parent.RoutegetRoute(String url)Returns the route which is foreseen for the given url.Map<String,Route>getRoutes()Returns a copy of all routes.voidremoveRoute(String urlPattern)Removes the route for the url pattern.
-
-
-
Method Detail
-
addRoute
void addRoute(String urlPattern, Route route)
Adds a route for the given url pattern.- Parameters:
urlPattern- - is used as a key.route- route
-
removeRoute
void removeRoute(String urlPattern)
Removes the route for the url pattern.- Parameters:
urlPattern- urlPattern
-
getRoute
Route getRoute(String url)
Returns the route which is foreseen for the given url. The repository checks if a url pattern is present for this url and then returns the corresponding route. If nothing is found, null is returned.- Parameters:
url- url- Returns:
- a route or null if no route is found
-
getRoutes
Map<String,Route> getRoutes()
Returns a copy of all routes.- Returns:
- a copy of all routes
-
getCollections
Set<String> getCollections(String parentUri)
Returns a set with collections (routes) contained in the given parent. Only routes (collections) directly resided in the given parent will be returned. If no route could be found an empty set will be returned.- Parameters:
parentUri- the parent of which the routes should be listed- Returns:
- a set with routes
-
-