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> {
15 * Adds a network address for the route. If address for route
16 * exists, appends the address to the list
18 * @param routeId route identifier
19 * @param route network address
21 public void addRoute(I routeId, R route);
24 * Adds a network address for the route. If the route already exists,
25 * it throws. This method would be used when registering a global service.
27 * @param routeId route identifier
28 * @param route network address
29 * @throws DuplicateRouteException
31 public void addGlobalRoute(I routeId, R route) throws DuplicateRouteException;
34 * Removes the network address for the route from routing table. If only
35 * one network address existed, remove the route as well.
39 public void removeRoute(I routeId, R route);
42 * Returns a set of network addresses associated with this route
46 public Set<R> getRoutes(I routeId);
49 * Returns only one address from the list of network addresses
50 * associated with the route. The algorithm to determine that
51 * one address is upto the implementer
55 public R getARoute(I routeId);
57 public void registerRouteChangeListener(RouteChangeListener listener);
59 public class DuplicateRouteException extends Exception {}