MD-SAL Statistics Manager: Added support for queue statistics collection
[controller.git] / opendaylight / md-sal / zeromq-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.Set;
11
12 public interface RoutingTable<I,R> {
13
14
15
16   /**
17    * Adds a network address for the route. If address for route
18    * exists, appends the address to the list
19    *
20    * @param routeId route identifier
21    * @param route network address
22    * @throws RoutingTableException for any logical exception
23    * @throws SystemException
24    */
25   public void addRoute(I routeId, R route) throws  RoutingTableException,SystemException;
26
27     /**
28    * Adds a network address for the route. If the route already exists,
29    * it throws <code>DuplicateRouteException</code>.
30    * This method would be used when registering a global service.
31    *
32    *
33    * @param routeId route identifier
34    * @param route network address
35    * @throws DuplicateRouteException
36    * @throws RoutingTableException
37    */
38   public void addGlobalRoute(I routeId, R route) throws  RoutingTableException, SystemException;
39
40
41
42
43   /**
44    * Removes the network address for the route from routing table. If only
45    * one network address existed, remove the route as well.
46    * @param routeId
47    * @param route
48    */
49   public void removeRoute(I routeId, R route);
50
51
52     /**
53      * Remove the route.
54      * This method would be used when registering a global service.
55      * @param routeId
56      * @throws RoutingTableException
57      * @throws SystemException
58      */
59     public void removeGlobalRoute(I routeId) throws RoutingTableException, SystemException;
60
61   /**
62    * Returns a set of network addresses associated with this route
63    * @param routeId
64    * @return
65    */
66   public Set<R> getRoutes(I routeId);
67
68   /**
69    * Returns only one address from the list of network addresses
70    * associated with the route. The algorithm to determine that
71    * one address is upto the implementer
72    * @param routeId
73    * @return
74    */
75   public R getARoute(I routeId);
76
77     /**
78      *
79      * This will be removed after listeners
80      * have made change on their end to use whiteboard pattern
81      * @deprecated
82      */
83
84   public void registerRouteChangeListener(RouteChangeListener listener);
85
86   public class DuplicateRouteException extends RoutingTableException {
87       public DuplicateRouteException(String message) {
88           super(message);
89       }
90
91   }
92
93 }