changed the pom.xml to include proper integration test
[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    */
23   public void addRoute(I routeId, R route) throws SystemException,  RoutingTableException;
24
25   /**
26    * Adds a network address for the route. If the route already exists,
27    * it throws <code>DuplicateRouteException</code>.
28    * This method would be used when registering a global service.
29    *
30    *
31    * @param routeId route identifier
32    * @param route network address
33    * @throws DuplicateRouteException
34    */
35   public void addGlobalRoute(I routeId, R route) throws  RoutingTableException, SystemException;
36
37
38
39
40   /**
41    * Removes the network address for the route from routing table. If only
42    * one network address existed, remove the route as well.
43    * @param routeId
44    * @param route
45    */
46   public void removeRoute(I routeId, R route);
47
48
49     /**
50      * Remove the route.
51      * This method would be used when registering a global service.
52      * @param routeId
53      */
54     public void removeGlobalRoute(I routeId);
55
56   /**
57    * Returns a set of network addresses associated with this route
58    * @param routeId
59    * @return
60    */
61   public Set<R> getRoutes(I routeId);
62
63   /**
64    * Returns only one address from the list of network addresses
65    * associated with the route. The algorithm to determine that
66    * one address is upto the implementer
67    * @param routeId
68    * @return
69    */
70   public R getARoute(I routeId);
71
72   public void registerRouteChangeListener(RouteChangeListener listener);
73
74   public class DuplicateRouteException extends RoutingTableException {
75       public DuplicateRouteException(String message) {
76           super(message);
77       }
78
79   }
80
81 }