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
23 public void addRoute(I routeId, R route) throws SystemException, RoutingTableException;
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.
31 * @param routeId route identifier
32 * @param route network address
33 * @throws DuplicateRouteException
35 public void addGlobalRoute(I routeId, R route) throws RoutingTableException, SystemException;
41 * Removes the network address for the route from routing table. If only
42 * one network address existed, remove the route as well.
46 public void removeRoute(I routeId, R route);
51 * This method would be used when registering a global service.
54 public void removeGlobalRoute(I routeId);
57 * Returns a set of network addresses associated with this route
61 public Set<R> getRoutes(I routeId);
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
70 public R getARoute(I routeId);
72 public void registerRouteChangeListener(RouteChangeListener listener);
74 public class DuplicateRouteException extends RoutingTableException {
75 public DuplicateRouteException(String message) {