X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fzeromq-routingtable%2Fimplementation%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fconnector%2Fremoterpc%2Fapi%2FRoutingTable.java;fp=opendaylight%2Fmd-sal%2Fsal-zeromq-connector%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fconnector%2Fremoterpc%2Fapi%2FRoutingTable.java;h=97d2a6d02a40a054135b7bf390279fb669208f87;hp=3c6c42e5c7963f6afd2ba148329111d8e04b6cfd;hb=90ba98827f4eb7aef46fa26edf65f73617a62553;hpb=97ec40086c461eae4ab2075a11da61fabf755b42 diff --git a/opendaylight/md-sal/sal-zeromq-connector/src/main/java/org/opendaylight/controller/sal/connector/remoterpc/api/RoutingTable.java b/opendaylight/md-sal/zeromq-routingtable/implementation/src/main/java/org/opendaylight/controller/sal/connector/remoterpc/api/RoutingTable.java similarity index 69% rename from opendaylight/md-sal/sal-zeromq-connector/src/main/java/org/opendaylight/controller/sal/connector/remoterpc/api/RoutingTable.java rename to opendaylight/md-sal/zeromq-routingtable/implementation/src/main/java/org/opendaylight/controller/sal/connector/remoterpc/api/RoutingTable.java index 3c6c42e5c7..97d2a6d02a 100644 --- a/opendaylight/md-sal/sal-zeromq-connector/src/main/java/org/opendaylight/controller/sal/connector/remoterpc/api/RoutingTable.java +++ b/opendaylight/md-sal/zeromq-routingtable/implementation/src/main/java/org/opendaylight/controller/sal/connector/remoterpc/api/RoutingTable.java @@ -11,6 +11,8 @@ 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 @@ -18,17 +20,22 @@ public interface RoutingTable { * @param routeId route identifier * @param route network address */ - public void addRoute(I routeId, R route); + public void addRoute(I routeId, R route) throws SystemException, RoutingTableException; /** * Adds a network address for the route. If the route already exists, - * it throws. This method would be used when registering a global service. + * it throws DuplicateRouteException. + * This method would be used when registering a global service. + * * * @param routeId route identifier * @param route network address * @throws DuplicateRouteException */ - public void addGlobalRoute(I routeId, R route) throws DuplicateRouteException; + public void addGlobalRoute(I routeId, R route) throws RoutingTableException, SystemException; + + + /** * Removes the network address for the route from routing table. If only @@ -38,6 +45,14 @@ public interface RoutingTable { */ public void removeRoute(I routeId, R route); + + /** + * Remove the route. + * This method would be used when registering a global service. + * @param routeId + */ + public void removeGlobalRoute(I routeId); + /** * Returns a set of network addresses associated with this route * @param routeId @@ -49,12 +64,18 @@ public interface RoutingTable { * 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 - * @param route + * @param routeId * @return */ public R getARoute(I routeId); public void registerRouteChangeListener(RouteChangeListener listener); - public class DuplicateRouteException extends Exception {} + public class DuplicateRouteException extends RoutingTableException { + public DuplicateRouteException(String message) { + super(message); + } + + } + }