commit | 11d4dc55f143422da4a492c8ee0ed695010a31c5 | [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:19:02 2019 -0700 |
tree | fd10d1463f77ed58a4140748286e91babc51ab3c | |
parent | 1bf2a63f4b2baff2f9916b7bbe6864c166a6c3e2 [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); }