2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.controller.sal.connector.remoterpc.api;
12 public interface RoutingTable<I,R> {
17 * Adds a network address for the route. If address for route
18 * exists, appends the address to the list
20 * @param routeId route identifier
21 * @param route network address
22 * @throws RoutingTableException for any logical exception
23 * @throws SystemException
25 public void addRoute(I routeId, R route) throws RoutingTableException,SystemException;
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.
33 * @param routeId route identifier
34 * @param route network address
35 * @throws DuplicateRouteException
36 * @throws RoutingTableException
38 public void addGlobalRoute(I routeId, R route) throws RoutingTableException, SystemException;
44 * Removes the network address for the route from routing table. If only
45 * one network address existed, remove the route as well.
49 public void removeRoute(I routeId, R route);
54 * This method would be used when registering a global service.
56 * @throws RoutingTableException
57 * @throws SystemException
59 public void removeGlobalRoute(I routeId) throws RoutingTableException, SystemException;
62 * Returns a set of network addresses associated with this route
66 public Set<R> getRoutes(I routeId);
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
75 public R getARoute(I routeId);
79 * This will be removed after listeners
80 * have made change on their end to use whiteboard pattern
84 public void registerRouteChangeListener(RouteChangeListener listener);
86 public class DuplicateRouteException extends RoutingTableException {
87 public DuplicateRouteException(String message) {