X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fremoterpc-routingtable%2Fimplementation%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fconnector%2Fremoterpc%2Fapi%2FRoutingTable.java;h=e5e314cd877d74ab7e52d505a80cf4e1ea059d44;hb=22000c97031a397b247a75ede2383f6ae792efc9;hp=2da031e54008cb68c5cf23cddc84b4cd50742da1;hpb=80794420bbe8e585964ad17fb2d82dbab75f94b0;p=controller.git diff --git a/opendaylight/md-sal/remoterpc-routingtable/implementation/src/main/java/org/opendaylight/controller/sal/connector/remoterpc/api/RoutingTable.java b/opendaylight/md-sal/remoterpc-routingtable/implementation/src/main/java/org/opendaylight/controller/sal/connector/remoterpc/api/RoutingTable.java index 2da031e540..e5e314cd87 100644 --- a/opendaylight/md-sal/remoterpc-routingtable/implementation/src/main/java/org/opendaylight/controller/sal/connector/remoterpc/api/RoutingTable.java +++ b/opendaylight/md-sal/remoterpc-routingtable/implementation/src/main/java/org/opendaylight/controller/sal/connector/remoterpc/api/RoutingTable.java @@ -7,25 +7,33 @@ */ package org.opendaylight.controller.sal.connector.remoterpc.api; -import java.util.Map; import java.util.Set; public interface RoutingTable { - - /** - * Adds a network address for the route. If address for route - * exists, appends the address to the list + * Adds a network address for the route. If the route already exists, + * it throws DuplicateRouteException. + * This method would be used when registering a global service. + * * * @param routeId route identifier * @param route network address - * @throws RoutingTableException for any logical exception + * @throws DuplicateRouteException + * @throws RoutingTableException + */ + public void addGlobalRoute(I routeId, R route) throws RoutingTableException, SystemException; + + /** + * Remove the route. + * This method would be used when registering a global service. + * @param routeId + * @throws RoutingTableException * @throws SystemException */ - public void addRoute(I routeId, R route) throws RoutingTableException,SystemException; + public void removeGlobalRoute(I routeId) throws RoutingTableException, SystemException; - /** + /** * Adds a network address for the route. If the route already exists, * it throws DuplicateRouteException. * This method would be used when registering a global service. @@ -36,9 +44,18 @@ public interface RoutingTable { * @throws DuplicateRouteException * @throws RoutingTableException */ - public void addGlobalRoute(I routeId, R route) throws RoutingTableException, SystemException; - + public R getGlobalRoute(I routeId) throws RoutingTableException, SystemException; + /** + * Adds a network address for the route. If address for route + * exists, appends the address to the list + * + * @param routeId route identifier + * @param route network address + * @throws RoutingTableException for any logical exception + * @throws SystemException + */ + public void addRoute(I routeId, R route) throws RoutingTableException,SystemException; /** @@ -47,17 +64,28 @@ public interface RoutingTable { * @param routeId * @param route */ - public void removeRoute(I routeId, R route); + public void removeRoute(I routeId, R route) throws RoutingTableException,SystemException; + /** + * Adds address for a set of route identifiers. If address for route + * exists, appends the address to the set. + * + * @param routeIds a set of routeIds + * @param route network address + * @throws RoutingTableException for any logical exception + * @throws SystemException + */ + public void addRoutes(Set routeIds, R route) throws RoutingTableException,SystemException; - /** - * Remove the route. - * This method would be used when registering a global service. - * @param routeId - * @throws RoutingTableException - * @throws SystemException - */ - public void removeGlobalRoute(I routeId) throws RoutingTableException, SystemException; + /** + * Removes address for a set of route identifiers. + * + * @param routeIds a set of routeIds + * @param route network address + * @throws RoutingTableException for any logical exception + * @throws SystemException + */ + public void removeRoutes(Set routeIds, R route) throws RoutingTableException,SystemException; /** * Returns a set of network addresses associated with this route @@ -66,29 +94,14 @@ public interface RoutingTable { */ public Set getRoutes(I routeId); - /** - * Returns all network addresses stored in the table - * @return - */ - public Set getAllRoutes(); /** - * Returns only one address from the list of network addresses - * associated with the route. The algorithm to determine that - * one address is upto the implementer + * Returns the last inserted address from the list of network addresses + * associated with the route. * @param routeId * @return */ - public R getARoute(I routeId); - - /** - * - * This will be removed after listeners - * have made change on their end to use whiteboard pattern - * @deprecated - */ - - public void registerRouteChangeListener(RouteChangeListener listener); + public R getLastAddedRoute(I routeId); public class DuplicateRouteException extends RoutingTableException { public DuplicateRouteException(String message) {