commit | d31a0eb42721bc7329547f738f46c43244208ff2 | [log] [tgz] |
---|---|---|
author | Charles Chan <rascov@gmail.com> | Fri May 03 13:19:49 2019 -0700 |
committer | Charles Chan <rascov@gmail.com> | Fri May 24 16:43:54 2019 -0700 |
tree | 5793fa9d7f8a11084797ca0360a0d16908a4163e | |
parent | f3963f1a8addd2d04524f68268c8cb40c669d7db [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 d620a4c..5e90a0c 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
@@ -208,6 +208,11 @@ } @Override + public Collection<ResolvedRoute> getResolvedRoutes(RouteTableId id) { + return resolvedRouteStore.getRoutes(id); + } + + @Override public Optional<ResolvedRoute> longestPrefixLookup(IpAddress ip) { return resolvedRouteStore.longestPrefixMatch(ip); }