Refactor the code that updates the vpn-to-dpn list
[netvirt.git] / vpnservice / vpnmanager / vpnmanager-api / src / main / java / org / opendaylight / netvirt / vpnmanager / api / IVpnManager.java
1 /*
2  * Copyright (c) 2015 - 2016 Ericsson India Global Services Pvt Ltd. 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
9 package org.opendaylight.netvirt.vpnmanager.api;
10
11 import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
12 import org.opendaylight.netvirt.fibmanager.api.IFibManager;
13 import org.opendaylight.netvirt.fibmanager.api.RouteOrigin;
14 import java.math.BigInteger;
15 import java.util.List;
16
17 public interface IVpnManager {
18     void setFibManager(IFibManager fibManager);
19     void addExtraRoute(String destination, String nextHop, String rd, String routerID, int label, RouteOrigin origin);
20     void delExtraRoute(String destination, String nextHop, String rd, String routerID);
21
22     /**
23      * Returns true if the specified VPN exists
24      *
25      * @param vpnName it must match against the vpn-instance-name attrib in one of the VpnInstances
26      *
27      * @return
28      */
29     boolean existsVpn(String vpnName);
30     boolean isVPNConfigured();
31
32     long getArpCacheTimeoutMillis();
33     /**
34      * Retrieves the list of DPNs where the specified VPN has footprint
35      *
36      * @param vpnInstanceName The name of the Vpn instance
37      * @return The list of DPNs
38      */
39     List<BigInteger> getDpnsOnVpn(String vpnInstanceName);
40
41     /**
42      * Updates the footprint that a VPN has on a given DPN by adding/removing
43      * the specified interface
44      *
45      * @param dpId DPN where the VPN interface belongs to
46      * @param vpnName Name of the VPN whose footprint is being modified
47      * @param interfaceName Name of the VPN interface to be added/removed
48      *          to/from the specified DPN
49      * @param add true for addition, false for removal
50      */
51     void updateVpnFootprint(BigInteger dpId, String vpnName, String interfaceName, boolean add);
52
53     void setupSubnetMacIntoVpnInstance(String vpnName, String srcMacAddress,
54             BigInteger dpnId, WriteTransaction writeTx, int addOrRemove);
55 }