Enhancements to remote rpc server. Using zmq router-dealer bridge to make the server...
[controller.git] / opendaylight / md-sal / remoterpc-routingtable / implementation / src / main / java / org / opendaylight / controller / sal / connector / remoterpc / api / RoutingTable.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.controller.sal.connector.remoterpc.api;
9
10 import java.util.Map;
11 import java.util.Set;
12
13 public interface RoutingTable<I,R> {
14
15
16
17   /**
18    * Adds a network address for the route. If address for route
19    * exists, appends the address to the list
20    *
21    * @param routeId route identifier
22    * @param route network address
23    * @throws RoutingTableException for any logical exception
24    * @throws SystemException
25    */
26   public void addRoute(I routeId, R route) throws  RoutingTableException,SystemException;
27
28     /**
29    * Adds a network address for the route. If the route already exists,
30    * it throws <code>DuplicateRouteException</code>.
31    * This method would be used when registering a global service.
32    *
33    *
34    * @param routeId route identifier
35    * @param route network address
36    * @throws DuplicateRouteException
37    * @throws RoutingTableException
38    */
39   public void addGlobalRoute(I routeId, R route) throws  RoutingTableException, SystemException;
40
41
42
43
44   /**
45    * Removes the network address for the route from routing table. If only
46    * one network address existed, remove the route as well.
47    * @param routeId
48    * @param route
49    */
50   public void removeRoute(I routeId, R route);
51
52
53     /**
54      * Remove the route.
55      * This method would be used when registering a global service.
56      * @param routeId
57      * @throws RoutingTableException
58      * @throws SystemException
59      */
60     public void removeGlobalRoute(I routeId) throws RoutingTableException, SystemException;
61
62   /**
63    * Returns a set of network addresses associated with this route
64    * @param routeId
65    * @return
66    */
67   public Set<R> getRoutes(I routeId);
68
69   /**
70    * Returns all network addresses stored in the table
71    * @return
72    */
73   public Set<Map.Entry> getAllRoutes();
74
75   /**
76    * Returns only one address from the list of network addresses
77    * associated with the route. The algorithm to determine that
78    * one address is upto the implementer
79    * @param routeId
80    * @return
81    */
82   public R getARoute(I routeId);
83
84     /**
85      *
86      * This will be removed after listeners
87      * have made change on their end to use whiteboard pattern
88      * @deprecated
89      */
90
91   public void registerRouteChangeListener(RouteChangeListener listener);
92
93   public class DuplicateRouteException extends RoutingTableException {
94       public DuplicateRouteException(String message) {
95           super(message);
96       }
97
98   }
99
100 }