2 * Copyright (c) 2015, 2017 Ericsson India Global Services Pvt Ltd. 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.netvirt.neutronvpn;
10 import java.util.Collection;
11 import java.util.List;
12 import java.util.concurrent.ExecutionException;
13 import javax.inject.Inject;
14 import javax.inject.Singleton;
15 import org.opendaylight.netvirt.neutronvpn.interfaces.INeutronVpnManager;
16 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
17 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.networks.rev150712.networks.attributes.networks.Network;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.ports.rev150712.ports.attributes.ports.Port;
20 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.subnets.rev150712.subnets.attributes.subnets.Subnet;
23 public class NeutronvpnManagerImpl implements INeutronVpnManager {
25 private final NeutronvpnManager nvManager;
26 private final NeutronvpnUtils neutronvpnUtils;
29 public NeutronvpnManagerImpl(final NeutronvpnManager neutronvpnManager, final NeutronvpnUtils neutronvpnUtils) {
30 this.nvManager = neutronvpnManager;
31 this.neutronvpnUtils = neutronvpnUtils;
35 public List<String> showNeutronPortsCLI() throws ExecutionException, InterruptedException {
36 return nvManager.showNeutronPortsCLI();
40 public Network getNeutronNetwork(Uuid networkId) {
41 return nvManager.getNeutronNetwork(networkId);
45 public List<String> showVpnConfigCLI(Uuid vuuid) throws InterruptedException, ExecutionException {
46 return nvManager.showVpnConfigCLI(vuuid);
50 public Uuid getNetworkForSubnet(Uuid subnetId) {
51 return nvManager.getNetworkForSubnet(subnetId);
55 public List<Uuid> getNetworksForVpn(Uuid vpnId) {
56 return nvManager.getNetworksForVpn(vpnId);
60 public Port getNeutronPort(String name) {
61 return nvManager.getNeutronPort(name);
65 public Subnet getNeutronSubnet(Uuid subnetId) {
66 return nvManager.getNeutronSubnet(subnetId);
70 public Collection<Uuid> getSubnetIdsForGatewayIp(IpAddress ipAddress) {
71 return neutronvpnUtils.getSubnetIdsForGatewayIp(ipAddress);
75 public void programV6InternetFallbackFlow(Uuid routerId, Uuid internetVpnId, int addOrRemove) {
76 nvManager.programV6InternetFallbackFlow(routerId, internetVpnId, addOrRemove);