commit | f7e37063d2611fa079f7192ba91ecbd40bd3cc7f | [log] [tgz] |
---|---|---|
author | Charles Chan <rascov@gmail.com> | Fri May 03 13:19:49 2019 -0700 |
committer | Charles Chan <rascov@gmail.com> | Thu Jun 06 17:17:26 2019 -0700 |
tree | 7e212b8826569edbabc5d1025f6df6e5ef66527c | |
parent | 82c31458864cffa6c5cc01bf0a55de5071418b71 [diff] |
Introduce new API in route service to return only resolved routes Change-Id: I17b4c4b84c99bd813a6406624a6e6e43458a15ea
diff --git a/apps/route-service/api/src/main/java/org/onosproject/routeservice/RouteService.java b/apps/route-service/api/src/main/java/org/onosproject/routeservice/RouteService.java index cacee10..81bbb54 100644 --- a/apps/route-service/api/src/main/java/org/onosproject/routeservice/RouteService.java +++ b/apps/route-service/api/src/main/java/org/onosproject/routeservice/RouteService.java
@@ -37,6 +37,14 @@ Collection<RouteInfo> getRoutes(RouteTableId id); /** + * Returns all resolved routes in the given route table. + * + * @param id route table ID + * @return collection of resolved route + */ + Collection<ResolvedRoute> getResolvedRoutes(RouteTableId id); + + /** * Returns the set of route tables in the system. * * @return collection of route table IDs.
diff --git a/apps/route-service/api/src/test/java/org/onosproject/routeservice/RouteServiceAdapter.java b/apps/route-service/api/src/test/java/org/onosproject/routeservice/RouteServiceAdapter.java index 5d41450..f4c189b 100644 --- a/apps/route-service/api/src/test/java/org/onosproject/routeservice/RouteServiceAdapter.java +++ b/apps/route-service/api/src/test/java/org/onosproject/routeservice/RouteServiceAdapter.java
@@ -43,6 +43,11 @@ } @Override + public Collection<ResolvedRoute> getResolvedRoutes(RouteTableId id) { + return null; + } + + @Override public Collection<RouteTableId> getRouteTables() { return null; }
diff --git a/apps/route-service/app/src/main/java/org/onosproject/routeservice/impl/RouteManager.java b/apps/route-service/app/src/main/java/org/onosproject/routeservice/impl/RouteManager.java index afa9cd6..72d5453 100644 --- a/apps/route-service/app/src/main/java/org/onosproject/routeservice/impl/RouteManager.java +++ b/apps/route-service/app/src/main/java/org/onosproject/routeservice/impl/RouteManager.java
@@ -209,6 +209,11 @@ } @Override + public Collection<ResolvedRoute> getResolvedRoutes(RouteTableId id) { + return resolvedRouteStore.getRoutes(id); + } + + @Override public Optional<ResolvedRoute> longestPrefixLookup(IpAddress ip) { return resolvedRouteStore.longestPrefixMatch(ip); }