NeutronVPN: Code reorganization and copyright changes 71/32471/2
authorAbhinav Gupta <abhinav.gupta@ericsson.com>
Wed, 13 Jan 2016 05:39:02 +0000 (11:09 +0530)
committerAbhinav Gupta <abhinav.gupta@ericsson.com>
Thu, 14 Jan 2016 07:21:13 +0000 (12:51 +0530)
1. Localized neutron subnet, port related code to listener classes
2. Removed unnecessary throwing of runtime exceptions in catch block
3. Copyright changes

Change-Id: If2c41f1e940edb7d1657763348975872f0865ca5
Signed-off-by: Abhinav Gupta <abhinav.gupta@ericsson.com>
20 files changed:
neutronvpn/neutronvpn-api/pom.xml
neutronvpn/neutronvpn-api/src/main/java/org/opendaylight/vpnservice/neutronvpn/interfaces/INeutronVpnManager.java
neutronvpn/neutronvpn-impl/pom.xml
neutronvpn/neutronvpn-impl/src/main/config/default-config.xml
neutronvpn/neutronvpn-impl/src/main/java/org/opendaylight/vpnservice/neutronvpn/NeutronBgpvpnChangeListener.java
neutronvpn/neutronvpn-impl/src/main/java/org/opendaylight/vpnservice/neutronvpn/NeutronNetworkChangeListener.java
neutronvpn/neutronvpn-impl/src/main/java/org/opendaylight/vpnservice/neutronvpn/NeutronPortChangeListener.java
neutronvpn/neutronvpn-impl/src/main/java/org/opendaylight/vpnservice/neutronvpn/NeutronRouterChangeListener.java
neutronvpn/neutronvpn-impl/src/main/java/org/opendaylight/vpnservice/neutronvpn/NeutronSubnetChangeListener.java
neutronvpn/neutronvpn-impl/src/main/java/org/opendaylight/vpnservice/neutronvpn/NeutronvpnManager.java
neutronvpn/neutronvpn-impl/src/main/java/org/opendaylight/vpnservice/neutronvpn/NeutronvpnProvider.java
neutronvpn/neutronvpn-impl/src/main/java/org/opendaylight/vpnservice/neutronvpn/NeutronvpnUtils.java
neutronvpn/neutronvpn-impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/neutronvpn/impl/rev150325/NeutronvpnImplModule.java
neutronvpn/neutronvpn-impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/neutronvpn/impl/rev150325/NeutronvpnImplModuleFactory.java
neutronvpn/neutronvpn-shell/pom.xml
neutronvpn/neutronvpn-shell/src/main/java/org/opendaylight/vpnservice/neutronvpn/shell/ConfigureL3VpnCommand.java
neutronvpn/neutronvpn-shell/src/main/java/org/opendaylight/vpnservice/neutronvpn/shell/ShowNeutronPortsCommand.java
neutronvpn/neutronvpn-shell/src/main/java/org/opendaylight/vpnservice/neutronvpn/shell/ShowVpnConfigCommand.java
neutronvpn/neutronvpn-shell/src/main/resources/OSGI-INF/blueprint/blueprint.xml
neutronvpn/pom.xml

index 16d28cb8683a4481f67e0d81a0d7c351ad3b219d..8624c6fc85210baa4e8174305457984ebb0cb900 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
-Copyright (c) 2015 - 2016 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
+Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
 
 This program and the accompanying materials are made available under the
 terms of the Eclipse Public License v1.0 which accompanies this distribution,
index 8da26707adc59ec95c917b4fe6f3d68b30cd613a..5aa42dcb97c487872de8e4f0d539a33edb6e4309 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 - 2016 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
+ * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
index 8f9e42a95a6b044e03c0262b387e69098c400ea8..0ad31796383b415c8012ea320d6c362883de56ea 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- vi: set et smarttab sw=4 tabstop=4: --><!--
-Copyright (c) 2015 - 2016 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
+<!--
+Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
 
 This program and the accompanying materials are made available under the
 terms of the Eclipse Public License v1.0 which accompanies this distribution,
index 898204245c5c50a2b4631f7f5c3f7189d2eba655..13b91f09ef6a7dd4632c4ca4fee75f33464bad41 100644 (file)
@@ -1,7 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- vi: set et smarttab sw=4 tabstop=4: -->
 <!--
-Copyright (c) 2015 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
+Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
 
 This program and the accompanying materials are made available under the
 terms of the Eclipse Public License v1.0 which accompanies this distribution,
index d413a32117290ec24c033456b7e2bf0c1ff4d552..7375c0585601b9cbad04cb80c1104a9a1a9163f1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 - 2016 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
+ * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
index e5bc67ef5e66747232e0d59ac7c0e4ae7dace2c0..1e0252b028b54c536fa006857aa2b77c9c3e602a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 - 2016 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
+ * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
index a615600aeeafd0df12718908319d5dafdeeb418c..3783a61ba6f3ae60c904a4e57b00fa271d63c64f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 - 2016 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
+ * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -8,15 +8,27 @@
 package org.opendaylight.vpnservice.neutronvpn;
 
 
+import com.google.common.base.Optional;
+
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.binding.api.DataChangeListener;
 import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker.DataChangeScope;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.vpnservice.mdsalutil.AbstractDataChangeListener;
+import org.opendaylight.vpnservice.mdsalutil.MDSALUtil;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.iana._if.type.rev140508.L2vlan;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.InterfaceBuilder;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.ports.rev150712.port.attributes.FixedIps;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.ports.rev150712.ports.attributes.Ports;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.ports.rev150712.ports.attributes.ports.Port;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.rev150712.Neutron;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.neutronvpn.rev150602.neutron.port.data
+        .PortFixedipToPortNameBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.neutronvpn.rev150602.neutron.port.data
+        .PortNameToPortUuidBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.neutronvpn.rev150602.subnetmaps.Subnetmap;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.slf4j.Logger;
@@ -72,7 +84,7 @@ public class NeutronPortChangeListener extends AbstractDataChangeListener<Port>
         if (LOG.isTraceEnabled()) {
             LOG.trace("Adding Port : key: " + identifier + ", value=" + input);
         }
-        nvpnManager.handleNeutronPortCreated(input);
+        handleNeutronPortCreated(input);
 
     }
 
@@ -81,7 +93,7 @@ public class NeutronPortChangeListener extends AbstractDataChangeListener<Port>
         if (LOG.isTraceEnabled()) {
             LOG.trace("Removing Port : key: " + identifier + ", value=" + input);
         }
-        nvpnManager.handleNeutronPortDeleted(input);
+        handleNeutronPortDeleted(input);
 
     }
 
@@ -102,7 +114,158 @@ public class NeutronPortChangeListener extends AbstractDataChangeListener<Port>
                     iterator.remove();
                 }
             }
-            nvpnManager.handleNeutronPortUpdated(original, update);
+            handleNeutronPortUpdated(original, update);
+        }
+    }
+
+    private void handleNeutronPortCreated(Port port) {
+        LOG.info("Of-port-interface creation");
+        int portVlanId = NeutronvpnUtils.getVlanFromNeutronPort(port);
+        // Create of-port interface for this neutron port
+        createOfPortInterface(port, portVlanId);
+        LOG.debug("Add port to subnet");
+        // add port to local Subnets DS
+        Uuid vpnId = addPortToSubnets(port);
+
+        if (vpnId != null) {
+            // create vpn-interface on this neutron port
+            LOG.debug("Adding VPN Interface");
+            nvpnManager.createVpnInterface(vpnId, port);
+        }
+    }
+
+    private void handleNeutronPortDeleted(Port port) {
+        LOG.debug("Of-port-interface removal");
+        LOG.debug("Remove port from subnet");
+        // remove port from local Subnets DS
+        Uuid vpnId = removePortFromSubnets(port);
+
+        if (vpnId != null) {
+            // remove vpn-interface for this neutron port
+            LOG.debug("removing VPN Interface");
+            nvpnManager.deleteVpnInterface(port);
+        }
+        int portVlanId = NeutronvpnUtils.getVlanFromNeutronPort(port);
+        // Remove of-port interface for this neutron port
+        deleteOfPortInterface(port, portVlanId);
+
+    }
+
+    private void handleNeutronPortUpdated(Port portoriginal, Port portupdate) {
+        LOG.debug("Add port to subnet");
+        // add port FixedIPs to local Subnets DS
+        Uuid vpnIdup = addPortToSubnets(portupdate);
+
+        if (vpnIdup != null) {
+            nvpnManager.createVpnInterface(vpnIdup, portupdate);
+        }
+
+        // remove port FixedIPs from local Subnets DS
+        Uuid vpnIdor = removePortFromSubnets(portoriginal);
+
+        if (vpnIdor != null) {
+            nvpnManager.deleteVpnInterface(portoriginal);
+        }
+    }
+
+    private void createOfPortInterface(Port port, int portVlanId) {
+        String name = NeutronvpnUtils.uuidToTapPortName(port.getUuid());
+        //String ifname = new StringBuilder(name).append(":").append(Integer.toString(portVlanId)).toString();
+        //Network network = NeutronvpnUtils.getNeutronNetwork(broker, port.getNetworkId());
+        //Boolean isVlanTransparent = network.isVlanTransparent();
+
+        LOG.debug("Creating OFPort Interface {}", name);
+        InstanceIdentifier interfaceIdentifier = NeutronvpnUtils.buildVlanInterfaceIdentifier(name);
+        try {
+            Optional<Interface> optionalInf = NeutronvpnUtils.read(broker, LogicalDatastoreType.CONFIGURATION,
+                    interfaceIdentifier);
+            if (!optionalInf.isPresent()) {
+                // handle these for trunkport extensions : portVlanId, isVlanTransparent
+                Interface inf = new InterfaceBuilder().setEnabled(true).setName(name).setType(L2vlan.class).build();
+                MDSALUtil.syncWrite(broker, LogicalDatastoreType.CONFIGURATION, interfaceIdentifier, inf);
+            } else {
+                LOG.error("Interface {} is already present", name);
+            }
+        } catch (Exception e) {
+            LOG.error("failed to create interface {} due to the exception {} ", name, e.getMessage());
+        }
+
+        InstanceIdentifier portIdentifier = NeutronvpnUtils.buildPortNameToPortUuidIdentifier(name);
+        PortNameToPortUuidBuilder builder = new PortNameToPortUuidBuilder().setPortName(name).setPortId(port.getUuid());
+        MDSALUtil.syncWrite(broker, LogicalDatastoreType.CONFIGURATION, portIdentifier, builder.build());
+        LOG.debug("name-uuid map for port with name: {}, uuid: {} added to NeutronPortData DS", name, port.getUuid
+                ());
+    }
+
+    private void deleteOfPortInterface(Port port, int portVlanId) {
+        String name = NeutronvpnUtils.uuidToTapPortName(port.getUuid());
+        //String ifname = new StringBuilder(name).append(":").append(Integer.toString(portVlanId)).toString();
+        LOG.debug("Removing OFPort Interface {}", name);
+        InstanceIdentifier interfaceIdentifier = NeutronvpnUtils.buildVlanInterfaceIdentifier(name);
+        try {
+            Optional<Interface> optionalInf = NeutronvpnUtils.read(broker, LogicalDatastoreType.CONFIGURATION,
+                    interfaceIdentifier);
+            if (optionalInf.isPresent()) {
+                MDSALUtil.syncDelete(broker, LogicalDatastoreType.CONFIGURATION, interfaceIdentifier);
+            } else {
+                LOG.error("Interface {} is not present", name);
+            }
+        } catch (Exception e) {
+            LOG.error("Failed to delete interface {} due to the exception {}", name, e.getMessage());
+        }
+
+        InstanceIdentifier portIdentifier = NeutronvpnUtils.buildPortNameToPortUuidIdentifier(name);
+        MDSALUtil.syncDelete(broker, LogicalDatastoreType.CONFIGURATION, portIdentifier);
+        LOG.debug("name-uuid map for port with name: {}, uuid: {} deleted from NeutronPortData DS", name, port
+                .getUuid());
+    }
+
+    // adds port to subnet list and creates vpnInterface
+    private Uuid addPortToSubnets(Port port) {
+        Uuid subnetId = null;
+        Uuid vpnId = null;
+        String name = NeutronvpnUtils.uuidToTapPortName(port.getUuid());
+
+        // find all subnets to which this port is associated
+        List<FixedIps> ips = port.getFixedIps();
+        for (FixedIps ip : ips) {
+            String ipValue = ip.getIpAddress().getIpv4Address().getValue();
+
+            InstanceIdentifier id = NeutronvpnUtils.buildFixedIpToPortNameIdentifier(ipValue);
+            PortFixedipToPortNameBuilder builder = new PortFixedipToPortNameBuilder().setPortFixedip(ipValue)
+                    .setPortName(name);
+            MDSALUtil.syncWrite(broker, LogicalDatastoreType.CONFIGURATION, id, builder.build());
+            LOG.debug("fixedIp-name map for neutron port with fixedIp: {}, name: {} added to NeutronPortData DS",
+                    ipValue, name);
+
+            subnetId = ip.getSubnetId();
+            Subnetmap subnetmap = nvpnManager.updateSubnetNode(subnetId, null, null, null, null, port.getUuid());
+            if (vpnId == null && subnetmap != null) {
+                vpnId = subnetmap.getVpnId();
+            }
+        }
+        return vpnId;
+    }
+
+    private Uuid removePortFromSubnets(Port port) {
+        Uuid subnetId = null;
+        Uuid vpnId = null;
+
+        // find all Subnets to which this port is associated
+        List<FixedIps> ips = port.getFixedIps();
+        for (FixedIps ip : ips) {
+            String ipValue = ip.getIpAddress().getIpv4Address().getValue();
+
+            InstanceIdentifier id = NeutronvpnUtils.buildFixedIpToPortNameIdentifier(ipValue);
+            MDSALUtil.syncDelete(broker, LogicalDatastoreType.CONFIGURATION, id);
+            LOG.debug("fixedIp-name map for neutron port with fixedIp: {} deleted from NeutronPortData DS", ipValue);
+
+            subnetId = ip.getSubnetId();
+            Subnetmap subnetmap = nvpnManager.removeFromSubnetNode(subnetId, null, null, null, port.getUuid());
+            if (vpnId == null && subnetmap != null) {
+                vpnId = subnetmap.getVpnId();
+            }
         }
+        return vpnId;
     }
 }
index 6d644851c663bf71af6f4f73b5f9710070ca47eb..826f9f839b52a35c0082c336f631031fe79ff456 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 - 2016 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
+ * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
index 6a1c05a4d45863485b78d950e5300cbfba0cd148..bea68b9a52fd3cfb7464056bc5d46b9bc0e20e2d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 - 2016 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
+ * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -7,20 +7,29 @@
  */
 package org.opendaylight.vpnservice.neutronvpn;
 
+import com.google.common.base.Optional;
 
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.binding.api.DataChangeListener;
 import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker.DataChangeScope;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.vpnservice.mdsalutil.AbstractDataChangeListener;
+import org.opendaylight.vpnservice.mdsalutil.MDSALUtil;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.rev150712.Neutron;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.subnets.rev150712.subnets.attributes.Subnets;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.subnets.rev150712.subnets.attributes.subnets.Subnet;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.neutronvpn.rev150602.networkmaps.NetworkMap;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.neutronvpn.rev150602.networkmaps.NetworkMapBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.neutronvpn.rev150602.networkmaps.NetworkMapKey;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.util.ArrayList;
+import java.util.List;
+
 
 public class NeutronSubnetChangeListener extends AbstractDataChangeListener<Subnet> implements AutoCloseable {
     private static final Logger LOG = LoggerFactory.getLogger(NeutronSubnetChangeListener.class);
@@ -67,7 +76,7 @@ public class NeutronSubnetChangeListener extends AbstractDataChangeListener<Subn
         if (LOG.isTraceEnabled()) {
             LOG.trace("Adding Subnet : key: " + identifier + ", value=" + input);
         }
-        nvpnManager.handleNeutronSubnetCreated(input.getUuid(), input.getNetworkId(), input.getTenantId());
+        handleNeutronSubnetCreated(input.getUuid(), input.getNetworkId(), input.getTenantId());
     }
 
     @Override
@@ -75,7 +84,7 @@ public class NeutronSubnetChangeListener extends AbstractDataChangeListener<Subn
         if (LOG.isTraceEnabled()) {
             LOG.trace("Removing subnet : key: " + identifier + ", value=" + input);
         }
-        nvpnManager.handleNeutronSubnetDeleted(input.getUuid(), input.getNetworkId(), null);
+        handleNeutronSubnetDeleted(input.getUuid(), input.getNetworkId(), null);
     }
 
     @Override
@@ -84,6 +93,93 @@ public class NeutronSubnetChangeListener extends AbstractDataChangeListener<Subn
             LOG.trace("Updating Subnet : key: " + identifier + ", original value=" + original + ", update value=" +
                     update);
         }
-        nvpnManager.handleNeutronSubnetUpdated(update.getUuid(), update.getNetworkId(), update.getTenantId());
+        handleNeutronSubnetUpdated(update.getUuid(), update.getNetworkId(), update.getTenantId());
+    }
+
+    private void handleNeutronSubnetCreated(Uuid subnetId, Uuid networkId, Uuid tenantId) {
+        nvpnManager.updateSubnetNode(subnetId, tenantId, networkId, null, null, null);
+        if (networkId != null && NeutronvpnUtils.getNeutronNetwork(broker, networkId) != null) {
+            createSubnetToNetworkMapping(subnetId, networkId);
+        }
+    }
+
+    private void handleNeutronSubnetDeleted(Uuid subnetId, Uuid networkId, Uuid tenantId) {
+        Uuid vpnId = NeutronvpnUtils.getVpnForNetwork(broker, networkId);
+        if (vpnId != null) {
+            nvpnManager.removeSubnetFromVpn(vpnId, subnetId);
+        }
+        if (networkId != null)  {
+            deleteSubnetToNetworkMapping(subnetId, networkId);
+        }
+    }
+
+    private void handleNeutronSubnetUpdated(Uuid subnetId, Uuid networkId, Uuid tenantId) {
+        Uuid oldNetworkId = NeutronvpnUtils.getSubnetmap(broker, subnetId).getNetworkId();
+        if (oldNetworkId != null && !oldNetworkId.equals(networkId)) {
+            deleteSubnetToNetworkMapping(subnetId, oldNetworkId);
+        }
+        if (networkId != null && !networkId.equals(oldNetworkId)) {
+            createSubnetToNetworkMapping(subnetId, networkId);
+        }
+        nvpnManager.updateSubnetNode(subnetId, tenantId, networkId, null, null, null);
+    }
+
+    private void createSubnetToNetworkMapping(Uuid subnetId, Uuid networkId) {
+        try {
+            InstanceIdentifier networkMapIdentifier = NeutronvpnUtils.buildNetworkMapIdentifier(networkId);
+            Optional<NetworkMap> optionalNetworkMap = NeutronvpnUtils.read(broker, LogicalDatastoreType.CONFIGURATION,
+                    networkMapIdentifier);
+            NetworkMapBuilder nwMapBuilder = null;
+            if (optionalNetworkMap.isPresent()) {
+                nwMapBuilder = new NetworkMapBuilder(optionalNetworkMap.get());
+            } else {
+                nwMapBuilder = new NetworkMapBuilder().setKey(new NetworkMapKey(networkId)).setNetworkId(networkId);
+                LOG.debug("Adding a new network node in NetworkMaps DS for network {}", networkId.getValue());
+            }
+            List<Uuid> subnetIdList = nwMapBuilder.getSubnetIdList();
+            if (subnetIdList == null) {
+                subnetIdList = new ArrayList<>();
+            }
+            subnetIdList.add(subnetId);
+            nwMapBuilder.setSubnetIdList(subnetIdList);
+            MDSALUtil.syncWrite(broker, LogicalDatastoreType.CONFIGURATION, networkMapIdentifier, nwMapBuilder.build());
+            LOG.debug("Created subnet-network mapping for subnet {} network {}", subnetId.getValue(),
+                    networkId.getValue());
+        } catch (Exception e) {
+            LOG.error("Create subnet-network mapping failed for subnet {} network {}", subnetId.getValue(),
+                    networkId.getValue());
+        }
+    }
+
+    private void deleteSubnetToNetworkMapping(Uuid subnetId, Uuid networkId) {
+        try {
+            InstanceIdentifier networkMapIdentifier = NeutronvpnUtils.buildNetworkMapIdentifier(networkId);
+            Optional<NetworkMap> optionalNetworkMap = NeutronvpnUtils.read(broker, LogicalDatastoreType.CONFIGURATION,
+                    networkMapIdentifier);
+            if (optionalNetworkMap.isPresent()) {
+                NetworkMapBuilder nwMapBuilder = new NetworkMapBuilder(optionalNetworkMap.get());
+                List<Uuid> subnetIdList = nwMapBuilder.getSubnetIdList();
+                if (subnetIdList.remove(subnetId)) {
+                    if (subnetIdList.size() == 0) {
+                        MDSALUtil.syncDelete(broker, LogicalDatastoreType.CONFIGURATION, networkMapIdentifier);
+                        LOG.debug("Deleted network node in NetworkMaps DS for network {}", subnetId.getValue(),
+                                networkId.getValue());
+                    } else {
+                        nwMapBuilder.setSubnetIdList(subnetIdList);
+                        MDSALUtil.syncWrite(broker, LogicalDatastoreType.CONFIGURATION, networkMapIdentifier,
+                                nwMapBuilder.build());
+                        LOG.debug("Deleted subnet-network mapping for subnet {} network {}", subnetId.getValue(),
+                                networkId.getValue());
+                    }
+                } else {
+                    LOG.error("Subnet {} is not mapped to network {}", subnetId.getValue(), networkId.getValue());
+                }
+            } else {
+                LOG.error("network {} not present for subnet {} ", networkId, subnetId);
+            }
+        } catch (Exception e) {
+            LOG.error("Delete subnet-network mapping failed for subnet {} network {}", subnetId.getValue(),
+                    networkId.getValue());
+        }
     }
 }
index 48959211d91b995ae237bc13684cf0b0031183e4..a94101d0fb0328d15fb59cb7794d6eb09319c486 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 - 2016 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
+ * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -11,7 +11,6 @@ import com.google.common.base.Optional;
 import com.google.common.util.concurrent.SettableFuture;
 
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.vpnservice.mdsalutil.MDSALUtil;
 import org.opendaylight.vpnservice.mdsalutil.interfaces.IMdsalApiManager;
@@ -31,10 +30,7 @@ import org.opendaylight.yang.gen.v1.urn.huawei.params.xml.ns.yang.l3vpn.rev14081
 import org.opendaylight.yang.gen.v1.urn.huawei.params.xml.ns.yang.l3vpn.rev140815.vpn.interfaces.VpnInterface;
 import org.opendaylight.yang.gen.v1.urn.huawei.params.xml.ns.yang.l3vpn.rev140815.vpn.interfaces.VpnInterfaceBuilder;
 import org.opendaylight.yang.gen.v1.urn.huawei.params.xml.ns.yang.l3vpn.rev140815.vpn.interfaces.VpnInterfaceKey;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.iana._if.type.rev140508.L2vlan;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.InterfaceBuilder;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.l3vpn.rev130911.Adjacencies;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.l3vpn.rev130911.AdjacenciesBuilder;
@@ -77,20 +73,12 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.neutronvpn.rev15
 import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.neutronvpn.rev150602.getl3vpn.output.L3vpnInstances;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.neutronvpn.rev150602.getl3vpn.output
         .L3vpnInstancesBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.neutronvpn.rev150602.networkmaps.NetworkMap;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.neutronvpn.rev150602.networkmaps.NetworkMapBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.neutronvpn.rev150602.networkmaps.NetworkMapKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.neutronvpn.rev150602.neutron.port.data
-        .PortFixedipToPortNameBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.neutronvpn.rev150602.neutron.port.data
-        .PortNameToPortUuidBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.neutronvpn.rev150602.subnetmaps.Subnetmap;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.neutronvpn.rev150602.subnetmaps.SubnetmapBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.neutronvpn.rev150602.subnetmaps.SubnetmapKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.neutronvpn.rev150602.vpnmaps.VpnMap;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.neutronvpn.rev150602.vpnmaps.VpnMapBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.neutronvpn.rev150602.vpnmaps.VpnMapKey;
-import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.RpcError;
 import org.opendaylight.yangtools.yang.common.RpcError.ErrorType;
@@ -138,7 +126,7 @@ public class NeutronvpnManager implements NeutronvpnService, AutoCloseable {
 
             InstanceIdentifier<Subnetmap> id = InstanceIdentifier.builder(Subnetmaps.class).
                     child(Subnetmap.class, new SubnetmapKey(subnetId)).build();
-            Optional<Subnetmap> sn = read(LogicalDatastoreType.CONFIGURATION, id);
+            Optional<Subnetmap> sn = NeutronvpnUtils.read(broker, LogicalDatastoreType.CONFIGURATION, id);
             logger.debug("updating Subnet :read: ");
             if (sn.isPresent()) {
                 builder = new SubnetmapBuilder(sn.get());
@@ -189,7 +177,7 @@ public class NeutronvpnManager implements NeutronvpnService, AutoCloseable {
         try {
             InstanceIdentifier<Subnetmap> id = InstanceIdentifier.builder(Subnetmaps.class).
                     child(Subnetmap.class, new SubnetmapKey(subnetId)).build();
-            Optional<Subnetmap> sn = read(LogicalDatastoreType.CONFIGURATION, id);
+            Optional<Subnetmap> sn = NeutronvpnUtils.read(broker, LogicalDatastoreType.CONFIGURATION, id);
 
             if (sn.isPresent()) {
                 SubnetmapBuilder builder = new SubnetmapBuilder(sn.get());
@@ -224,63 +212,6 @@ public class NeutronvpnManager implements NeutronvpnService, AutoCloseable {
         return subnetmap;
     }
 
-    private void createSubnetToNetworkMapping(Uuid subnetId, Uuid networkId) {
-        try {
-            InstanceIdentifier networkMapIdentifier = NeutronvpnUtils.buildNetworkMapIdentifier(networkId);
-            Optional<NetworkMap> optionalNetworkMap = read(LogicalDatastoreType.CONFIGURATION, networkMapIdentifier);
-            NetworkMapBuilder nwMapBuilder = null;
-            if (optionalNetworkMap.isPresent()) {
-                nwMapBuilder = new NetworkMapBuilder(optionalNetworkMap.get());
-            } else {
-                nwMapBuilder = new NetworkMapBuilder().setKey(new NetworkMapKey(networkId)).setNetworkId(networkId);
-                logger.debug("Adding a new network node in NetworkMaps DS for network {}", networkId.getValue());
-            }
-            List<Uuid> subnetIdList = nwMapBuilder.getSubnetIdList();
-            if (subnetIdList == null) {
-                subnetIdList = new ArrayList<>();
-            }
-            subnetIdList.add(subnetId);
-            nwMapBuilder.setSubnetIdList(subnetIdList);
-            MDSALUtil.syncWrite(broker, LogicalDatastoreType.CONFIGURATION, networkMapIdentifier, nwMapBuilder.build());
-            logger.debug("Created subnet-network mapping for subnet {} network {}", subnetId.getValue(),
-                    networkId.getValue());
-        } catch (Exception e) {
-            logger.error("Create subnet-network mapping failed for subnet {} network {}", subnetId.getValue(),
-                    networkId.getValue());
-        }
-    }
-
-    private void deleteSubnetToNetworkMapping(Uuid subnetId, Uuid networkId) {
-        try {
-            InstanceIdentifier networkMapIdentifier = NeutronvpnUtils.buildNetworkMapIdentifier(networkId);
-            Optional<NetworkMap> optionalNetworkMap = read(LogicalDatastoreType.CONFIGURATION, networkMapIdentifier);
-            if (optionalNetworkMap.isPresent()) {
-                NetworkMapBuilder nwMapBuilder = new NetworkMapBuilder(optionalNetworkMap.get());
-                List<Uuid> subnetIdList = nwMapBuilder.getSubnetIdList();
-                if (subnetIdList.remove(subnetId)) {
-                    if (subnetIdList.size() == 0) {
-                        MDSALUtil.syncDelete(broker, LogicalDatastoreType.CONFIGURATION, networkMapIdentifier);
-                        logger.debug("Deleted network node in NetworkMaps DS for network {}", subnetId.getValue(),
-                                networkId.getValue());
-                    } else {
-                        nwMapBuilder.setSubnetIdList(subnetIdList);
-                        MDSALUtil.syncWrite(broker, LogicalDatastoreType.CONFIGURATION, networkMapIdentifier,
-                                nwMapBuilder.build());
-                        logger.debug("Deleted subnet-network mapping for subnet {} network {}", subnetId.getValue(),
-                                networkId.getValue());
-                    }
-                } else {
-                    logger.error("Subnet {} is not mapped to network {}", subnetId.getValue(), networkId.getValue());
-                }
-            } else {
-                logger.error("network {} not present for subnet {} ", networkId, subnetId);
-            }
-        } catch (Exception e) {
-            logger.error("Delete subnet-network mapping failed for subnet {} network {}", subnetId.getValue(),
-                    networkId.getValue());
-        }
-    }
-
     private void updateVpnInstanceNode(String name, List<String> rd, List<String> irt, List<String> ert) {
 
         try {
@@ -288,7 +219,8 @@ public class NeutronvpnManager implements NeutronvpnService, AutoCloseable {
             List<VpnTarget> vpnTargetList = new ArrayList<VpnTarget>();
             InstanceIdentifier<VpnInstance> vpnIdentifier = InstanceIdentifier.builder(VpnInstances.class).
                     child(VpnInstance.class, new VpnInstanceKey(name)).build();
-            Optional<VpnInstance> optionalVpn = read(LogicalDatastoreType.CONFIGURATION, vpnIdentifier);
+            Optional<VpnInstance> optionalVpn = NeutronvpnUtils.read(broker, LogicalDatastoreType.CONFIGURATION,
+                    vpnIdentifier);
             logger.debug("Creating/Updating a new vpn-instance node: {} ", name);
             if (optionalVpn.isPresent()) {
                 builder = new VpnInstanceBuilder(optionalVpn.get());
@@ -353,7 +285,8 @@ public class NeutronvpnManager implements NeutronvpnService, AutoCloseable {
         VpnMapBuilder builder;
         InstanceIdentifier<VpnMap> vpnMapIdentifier = InstanceIdentifier.builder(VpnMaps.class)
                 .child(VpnMap.class, new VpnMapKey(vpnId)).build();
-        Optional<VpnMap> optionalVpnMap = read(LogicalDatastoreType.CONFIGURATION, vpnMapIdentifier);
+        Optional<VpnMap> optionalVpnMap = NeutronvpnUtils.read(broker, LogicalDatastoreType.CONFIGURATION,
+                vpnMapIdentifier);
         if (optionalVpnMap.isPresent()) {
             builder = new VpnMapBuilder(optionalVpnMap.get());
         } else {
@@ -386,7 +319,8 @@ public class NeutronvpnManager implements NeutronvpnService, AutoCloseable {
     private void clearFromVpnMaps(Uuid id, Uuid router, List<Uuid> networks) {
         InstanceIdentifier<VpnMap> vpnMapIdentifier = InstanceIdentifier.builder(VpnMaps.class)
                 .child(VpnMap.class, new VpnMapKey(id)).build();
-        Optional<VpnMap> optionalVpnMap = read(LogicalDatastoreType.CONFIGURATION, vpnMapIdentifier);
+        Optional<VpnMap> optionalVpnMap = NeutronvpnUtils.read(broker, LogicalDatastoreType.CONFIGURATION,
+                vpnMapIdentifier);
         if (optionalVpnMap.isPresent()) {
             VpnMap vpnMap = optionalVpnMap.get();
             VpnMapBuilder vpnMapBuilder = new VpnMapBuilder(vpnMap);
@@ -420,56 +354,6 @@ public class NeutronvpnManager implements NeutronvpnService, AutoCloseable {
         logger.debug("VPNMaps DS clear success for VPN {} ", id.getValue());
     }
 
-    private void createOfPortInterface(Port port, int portVlanId) {
-        String name = NeutronvpnUtils.uuidToTapPortName(port.getUuid());
-        //String ifname = new StringBuilder(name).append(":").append(Integer.toString(portVlanId)).toString();
-        //Network network = NeutronvpnUtils.getNeutronNetwork(broker, port.getNetworkId());
-        //Boolean isVlanTransparent = network.isVlanTransparent();
-
-        logger.debug("Creating OFPort Interface {}", name);
-        InstanceIdentifier interfaceIdentifier = NeutronvpnUtils.buildVlanInterfaceIdentifier(name);
-        try {
-            Optional<Interface> optionalInf = read(LogicalDatastoreType.CONFIGURATION, interfaceIdentifier);
-            if (!optionalInf.isPresent()) {
-                // handle these for trunkport extensions : portVlanId, isVlanTransparent
-                Interface inf = new InterfaceBuilder().setEnabled(true).setName(name).setType(L2vlan.class).build();
-                MDSALUtil.syncWrite(broker, LogicalDatastoreType.CONFIGURATION, interfaceIdentifier, inf);
-            } else {
-                logger.error("Interface {} is already present", name);
-            }
-        } catch (Exception e) {
-            logger.error("failed to create interface {} due to the exception {} ", name, e.getMessage());
-        }
-
-        InstanceIdentifier portIdentifier = NeutronvpnUtils.buildPortNameToPortUuidIdentifier(name);
-        PortNameToPortUuidBuilder builder = new PortNameToPortUuidBuilder().setPortName(name).setPortId(port.getUuid());
-        MDSALUtil.syncWrite(broker, LogicalDatastoreType.CONFIGURATION, portIdentifier, builder.build());
-        logger.debug("name-uuid map for port with name: {}, uuid: {} added to NeutronPortData DS", name, port.getUuid
-                ());
-    }
-
-    private void deleteOfPortInterface(Port port, int portVlanId) {
-        String name = NeutronvpnUtils.uuidToTapPortName(port.getUuid());
-        //String ifname = new StringBuilder(name).append(":").append(Integer.toString(portVlanId)).toString();
-        logger.debug("Removing OFPort Interface {}", name);
-        InstanceIdentifier interfaceIdentifier = NeutronvpnUtils.buildVlanInterfaceIdentifier(name);
-        try {
-            Optional<Interface> optionalInf = read(LogicalDatastoreType.CONFIGURATION, interfaceIdentifier);
-            if (optionalInf.isPresent()) {
-                MDSALUtil.syncDelete(broker, LogicalDatastoreType.CONFIGURATION, interfaceIdentifier);
-            } else {
-                logger.error("Interface {} is not present", name);
-            }
-        } catch (Exception e) {
-            logger.error("Failed to delete interface {} due to the exception {}", name, e.getMessage());
-        }
-
-        InstanceIdentifier portIdentifier = NeutronvpnUtils.buildPortNameToPortUuidIdentifier(name);
-        MDSALUtil.syncDelete(broker, LogicalDatastoreType.CONFIGURATION, portIdentifier);
-        logger.debug("name-uuid map for port with name: {}, uuid: {} deleted from NeutronPortData DS", name, port
-                .getUuid());
-    }
-
     private void deleteVpnInstance(Uuid vpnId) {
 
         InstanceIdentifier<VpnInstance> vpnIdentifier = InstanceIdentifier.builder(VpnInstances.class).
@@ -479,7 +363,7 @@ public class NeutronvpnManager implements NeutronvpnService, AutoCloseable {
     }
 
 
-    private void createVpnInterface(Uuid vpnId, Port port) {
+    protected void createVpnInterface(Uuid vpnId, Port port) {
 
         if (vpnId == null || port == null) {
             return;
@@ -531,7 +415,7 @@ public class NeutronvpnManager implements NeutronvpnService, AutoCloseable {
         }
     }
 
-    private void deleteVpnInterface(Port port) {
+    protected void deleteVpnInterface(Port port) {
 
         if (port != null) {
             String pname = NeutronvpnUtils.uuidToTapPortName(port.getUuid());
@@ -551,134 +435,6 @@ public class NeutronvpnManager implements NeutronvpnService, AutoCloseable {
         }
     }
 
-    // adds port to subnet list and creates vpnInterface
-    private Uuid addPortToSubnets(Port port) {
-        Uuid subnetId = null;
-        Uuid vpnId = null;
-        String name = NeutronvpnUtils.uuidToTapPortName(port.getUuid());
-
-        // find all subnets to which this port is associated
-        List<FixedIps> ips = port.getFixedIps();
-        for (FixedIps ip : ips) {
-            String ipValue = ip.getIpAddress().getIpv4Address().getValue();
-
-            InstanceIdentifier id = NeutronvpnUtils.buildFixedIpToPortNameIdentifier(ipValue);
-            PortFixedipToPortNameBuilder builder = new PortFixedipToPortNameBuilder().setPortFixedip(ipValue)
-                    .setPortName(name);
-            MDSALUtil.syncWrite(broker, LogicalDatastoreType.CONFIGURATION, id, builder.build());
-            logger.debug("fixedIp-name map for neutron port with fixedIp: {}, name: {} added to NeutronPortData DS",
-                    ipValue, name);
-
-            subnetId = ip.getSubnetId();
-            Subnetmap subnetmap = updateSubnetNode(subnetId, null, null, null, null, port.getUuid());
-            if (vpnId == null && subnetmap != null) {
-                vpnId = subnetmap.getVpnId();
-            }
-        }
-        return vpnId;
-    }
-
-    private Uuid removePortFromSubnets(Port port) {
-        Uuid subnetId = null;
-        Uuid vpnId = null;
-
-        // find all Subnets to which this port is associated
-        List<FixedIps> ips = port.getFixedIps();
-        for (FixedIps ip : ips) {
-            String ipValue = ip.getIpAddress().getIpv4Address().getValue();
-
-            InstanceIdentifier id = NeutronvpnUtils.buildFixedIpToPortNameIdentifier(ipValue);
-            MDSALUtil.syncDelete(broker, LogicalDatastoreType.CONFIGURATION, id);
-            logger.debug("fixedIp-name map for neutron port with fixedIp: {} deleted from NeutronPortData DS",
-                    ipValue);
-
-            subnetId = ip.getSubnetId();
-            Subnetmap subnetmap = removeFromSubnetNode(subnetId, null, null, null, port.getUuid());
-            if (vpnId == null && subnetmap != null) {
-                vpnId = subnetmap.getVpnId();
-            }
-        }
-        return vpnId;
-    }
-
-    protected void handleNeutronSubnetCreated(Uuid subnetId, Uuid networkId, Uuid tenantId) {
-        updateSubnetNode(subnetId, tenantId, networkId, null, null, null);
-        if (networkId != null && NeutronvpnUtils.getNeutronNetwork(broker, networkId) != null) {
-            createSubnetToNetworkMapping(subnetId, networkId);
-        }
-    }
-
-    protected void handleNeutronSubnetDeleted(Uuid subnetId, Uuid networkId, Uuid tenantId) {
-        Uuid vpnId = NeutronvpnUtils.getVpnForNetwork(broker, networkId);
-        if (vpnId != null) {
-            removeSubnetFromVpn(vpnId, subnetId);
-        }
-        if (networkId != null)  {
-            deleteSubnetToNetworkMapping(subnetId, networkId);
-        }
-    }
-
-    protected void handleNeutronSubnetUpdated(Uuid subnetId, Uuid networkId, Uuid tenantId) {
-        Uuid oldNetworkId = NeutronvpnUtils.getSubnetmap(broker, subnetId).getNetworkId();
-        if (oldNetworkId != null && !oldNetworkId.equals(networkId)) {
-            deleteSubnetToNetworkMapping(subnetId, oldNetworkId);
-        }
-        if (networkId != null && !networkId.equals(oldNetworkId)) {
-            createSubnetToNetworkMapping(subnetId, networkId);
-        }
-        updateSubnetNode(subnetId, tenantId, networkId, null, null, null);
-    }
-
-    protected void handleNeutronPortCreated(Port port) {
-        logger.info("Of-port-interface creation");
-        int portVlanId = NeutronvpnUtils.getVlanFromNeutronPort(port);
-        // Create of-port interface for this neutron port
-        createOfPortInterface(port, portVlanId);
-        logger.debug("Add port to subnet");
-        // add port to local Subnets DS
-        Uuid vpnId = addPortToSubnets(port);
-
-        if (vpnId != null) {
-            // create vpn-interface on this neutron port
-            logger.debug("Adding VPN Interface");
-            createVpnInterface(vpnId, port);
-        }
-    }
-
-    protected void handleNeutronPortDeleted(Port port) {
-        logger.debug("Of-port-interface removal");
-        logger.debug("Remove port from subnet");
-        // remove port from local Subnets DS
-        Uuid vpnId = removePortFromSubnets(port);
-
-        if (vpnId != null) {
-            // remove vpn-interface for this neutron port
-            logger.debug("removing VPN Interface");
-            deleteVpnInterface(port);
-        }
-        int portVlanId = NeutronvpnUtils.getVlanFromNeutronPort(port);
-        // Remove of-port interface for this neutron port
-        deleteOfPortInterface(port, portVlanId);
-
-    }
-
-    protected void handleNeutronPortUpdated(Port portoriginal, Port portupdate) {
-        logger.debug("Add port to subnet");
-        // add port FixedIPs to local Subnets DS
-        Uuid vpnIdup = addPortToSubnets(portupdate);
-
-        if (vpnIdup != null) {
-            createVpnInterface(vpnIdup, portupdate);
-        }
-
-        // remove port FixedIPs from local Subnets DS
-        Uuid vpnIdor = removePortFromSubnets(portoriginal);
-
-        if (vpnIdor != null) {
-            deleteVpnInterface(portoriginal);
-        }
-    }
-
     public void createL3Vpn(Uuid vpn, String name, Uuid tenant, List<String> rd, List<String> irt, List<String> ert,
                             Uuid router, List<Uuid> networks) {
 
@@ -772,7 +528,8 @@ public class NeutronvpnManager implements NeutronvpnService, AutoCloseable {
                 // get all vpns
                 InstanceIdentifier<VpnInstances> vpnsIdentifier =
                         InstanceIdentifier.builder(VpnInstances.class).build();
-                Optional<VpnInstances> optionalVpns = read(LogicalDatastoreType.CONFIGURATION, vpnsIdentifier);
+                Optional<VpnInstances> optionalVpns = NeutronvpnUtils.read(broker, LogicalDatastoreType.CONFIGURATION,
+                        vpnsIdentifier);
                 if (optionalVpns.isPresent()) {
                     for (VpnInstance vpn : optionalVpns.get().getVpnInstance()) {
                         vpns.add(vpn);
@@ -789,7 +546,8 @@ public class NeutronvpnManager implements NeutronvpnService, AutoCloseable {
                         InstanceIdentifier.builder(VpnInstances.class)
                                 .child(VpnInstance.class, new VpnInstanceKey(name)).build();
                 // read VpnInstance Info
-                Optional<VpnInstance> optionalVpn = read(LogicalDatastoreType.CONFIGURATION, vpnIdentifier);
+                Optional<VpnInstance> optionalVpn = NeutronvpnUtils.read(broker, LogicalDatastoreType.CONFIGURATION,
+                        vpnIdentifier);
                 if (optionalVpn.isPresent()) {
                     vpns.add(optionalVpn.get());
                 } else {
@@ -828,8 +586,8 @@ public class NeutronvpnManager implements NeutronvpnService, AutoCloseable {
                 }
 
                 l3vpn.setId(vpnId).setRouteDistinguisher(rd).setImportRT(irtList).setExportRT(ertList);
-                Optional<VpnMap> optionalVpnMap =
-                        read(LogicalDatastoreType.CONFIGURATION, vpnMapIdentifier);
+                Optional<VpnMap> optionalVpnMap = NeutronvpnUtils.read(broker, LogicalDatastoreType.CONFIGURATION,
+                        vpnMapIdentifier);
                 if (optionalVpnMap.isPresent()) {
                     VpnMap vpnMap = optionalVpnMap.get();
                     l3vpn.setRouterId(vpnMap.getRouterId()).setNetworkIds(vpnMap.getNetworkIds())
@@ -867,7 +625,8 @@ public class NeutronvpnManager implements NeutronvpnService, AutoCloseable {
                 InstanceIdentifier<VpnInstance> vpnIdentifier =
                         InstanceIdentifier.builder(VpnInstances.class)
                                 .child(VpnInstance.class, new VpnInstanceKey(vpn.getValue())).build();
-                Optional<VpnInstance> optionalVpn = read(LogicalDatastoreType.CONFIGURATION, vpnIdentifier);
+                Optional<VpnInstance> optionalVpn = NeutronvpnUtils.read(broker, LogicalDatastoreType.CONFIGURATION,
+                        vpnIdentifier);
                 if (optionalVpn.isPresent()) {
                     removeL3Vpn(vpn);
                 } else {
@@ -943,8 +702,8 @@ public class NeutronvpnManager implements NeutronvpnService, AutoCloseable {
                     }
                     InstanceIdentifier<VpnInterface> vpnIfIdentifier = InstanceIdentifier.builder(VpnInterfaces.class).
                             child(VpnInterface.class, new VpnInterfaceKey(ifname)).build();
-                    Optional<VpnInterface> optionalVpnInterface = read(LogicalDatastoreType.CONFIGURATION,
-                            vpnIfIdentifier);
+                    Optional<VpnInterface> optionalVpnInterface = NeutronvpnUtils.read(broker, LogicalDatastoreType
+                            .CONFIGURATION, vpnIfIdentifier);
                     if (optionalVpnInterface.isPresent()) {
                         Adjacencies erAdjs = new AdjacenciesBuilder().setAdjacency(Arrays.asList(erAdj)).build();
                         VpnInterface vpnIf = new VpnInterfaceBuilder().setKey(new VpnInterfaceKey(ifname))
@@ -1297,24 +1056,10 @@ public class NeutronvpnManager implements NeutronvpnService, AutoCloseable {
         return result;
     }
 
-    private <T extends DataObject> Optional<T> read(LogicalDatastoreType datastoreType, InstanceIdentifier<T> path) {
-
-        ReadOnlyTransaction tx = broker.newReadOnlyTransaction();
-
-        Optional<T> result = Optional.absent();
-        try {
-            result = tx.read(datastoreType, path).get();
-        } catch (Exception e) {
-            throw new RuntimeException(e);
-        }
-
-        return result;
-    }
-
     protected Subnet getNeutronSubnet(Uuid subnetId) {
         InstanceIdentifier<Subnet> inst = InstanceIdentifier.create(Neutron.class).
                 child(Subnets.class).child(Subnet.class, new SubnetKey(subnetId));
-        Optional<Subnet> sn = read(LogicalDatastoreType.CONFIGURATION, inst);
+        Optional<Subnet> sn = NeutronvpnUtils.read(broker, LogicalDatastoreType.CONFIGURATION, inst);
 
         if (sn.isPresent()) {
             return sn.get();
@@ -1335,7 +1080,7 @@ public class NeutronvpnManager implements NeutronvpnService, AutoCloseable {
         if (portId != null) {
             InstanceIdentifier<Port> pid = InstanceIdentifier.create(Neutron.class).
                     child(Ports.class).child(Port.class, new PortKey(portId));
-            Optional<Port> optPort = read(LogicalDatastoreType.CONFIGURATION, pid);
+            Optional<Port> optPort = NeutronvpnUtils.read(broker, LogicalDatastoreType.CONFIGURATION, pid);
             if (optPort.isPresent()) {
                 return optPort.get();
             }
@@ -1348,7 +1093,7 @@ public class NeutronvpnManager implements NeutronvpnService, AutoCloseable {
     protected Port getNeutronPort(Uuid portId) {
         InstanceIdentifier<Port> pid = InstanceIdentifier.create(Neutron.class).
                 child(Ports.class).child(Port.class, new PortKey(portId));
-        Optional<Port> optPort = read(LogicalDatastoreType.CONFIGURATION, pid);
+        Optional<Port> optPort = NeutronvpnUtils.read(broker, LogicalDatastoreType.CONFIGURATION, pid);
         if (optPort.isPresent()) {
             return optPort.get();
         }
@@ -1359,7 +1104,8 @@ public class NeutronvpnManager implements NeutronvpnService, AutoCloseable {
         List<Uuid> subnets = new ArrayList<Uuid>();
         //read subnetmaps
         InstanceIdentifier<Subnetmaps> subnetmapsid = InstanceIdentifier.builder(Subnetmaps.class).build();
-        Optional<Subnetmaps> subnetmaps = read(LogicalDatastoreType.CONFIGURATION, subnetmapsid);
+        Optional<Subnetmaps> subnetmaps = NeutronvpnUtils.read(broker, LogicalDatastoreType.CONFIGURATION,
+                subnetmapsid);
         if (subnetmaps.isPresent()) {
             Subnetmaps smaps = subnetmaps.get();
             List<Subnetmap> subnetMapList = smaps.getSubnetmap();
@@ -1379,13 +1125,13 @@ public class NeutronvpnManager implements NeutronvpnService, AutoCloseable {
         result.add("---------------------------------------------------------------------------------------");
         InstanceIdentifier<Ports> portidentifier = InstanceIdentifier.create(Neutron.class).child(Ports.class);
         try {
-            Optional<Ports> ports = read(LogicalDatastoreType.CONFIGURATION, portidentifier);
+            Optional<Ports> ports = NeutronvpnUtils.read(broker, LogicalDatastoreType.CONFIGURATION, portidentifier);
             if (ports.isPresent()) {
                 List<Port> portList = ports.get().getPort();
                 for (Port port : portList) {
                     result.add(String.format(" %-22s  %-22s  %-22s  %-6s ", NeutronvpnUtils.uuidToTapPortName(port
                             .getUuid()), port.getMacAddress(), port.getFixedIps().get(0).getIpAddress().getIpv4Address()
-                            .getValue(), getIPPrefixFromPort(port)));
+                            .getValue(), NeutronvpnUtils.getIPPrefixFromPort(broker, port)));
                 }
             }
         } catch (Exception e) {
@@ -1395,44 +1141,6 @@ public class NeutronvpnManager implements NeutronvpnService, AutoCloseable {
         return result;
     }
 
-    private Short getIPPrefixFromPort(Port port) {
-        Short prefix = new Short((short) 0);
-        String cidr = "";
-        try {
-            Uuid subnetUUID = port.getFixedIps().get(0).getSubnetId();
-
-            org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.subnets.rev150712.subnets.attributes.subnets
-                    .SubnetKey subnetkey = new org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.subnets
-                    .rev150712.subnets.attributes.subnets.SubnetKey(subnetUUID);
-            InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.subnets.rev150712.subnets
-                    .attributes.subnets.Subnet> subnetidentifier = InstanceIdentifier.create(Neutron.class).child(org
-                    .opendaylight.yang.gen.v1.urn.opendaylight.neutron.subnets.rev150712.subnets.attributes.Subnets
-                    .class).child(org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.subnets.rev150712.subnets
-                    .attributes.subnets.Subnet.class, subnetkey);
-            Optional<org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.subnets.rev150712.subnets.attributes
-                    .subnets.Subnet> subnet = read(LogicalDatastoreType.CONFIGURATION, subnetidentifier);
-
-            if (subnet.isPresent()) {
-                cidr = subnet.get().getCidr();
-                // Extract the prefix length from cidr
-                String[] parts = cidr.split("/");
-                if ((parts.length == 2)) {
-                    prefix = Short.valueOf(parts[1]);
-                    return prefix;
-                } else {
-                    logger.trace("Could not retrieve prefix from subnet CIDR");
-                    System.out.println("Could not retrieve prefix from subnet CIDR");
-                }
-            } else {
-                logger.trace("Unable to read on subnet datastore");
-            }
-        } catch (Exception e) {
-            logger.trace("Failed to retrieve IP prefix from port : ", e);
-            System.out.println("Failed to retrieve IP prefix from port : " + e.getMessage());
-        }
-        return null;
-    }
-
     public List<String> showVpnConfigCLI(Uuid vpnuuid) {
         List<String> result = new ArrayList<String>();
         if (vpnuuid == null) {
index ccfc14e80e64b0e24f5ac3f50bf71c8cdf78eaae..651ef836045f354f6dbf5f83d11a5a684085c5b9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 - 2016 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
+ * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
index 993a465337852a2a0ab1c53124b37ad4539f8c8c..042b0ea19f28dd22f0e400f892d715692b59c79b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 - 2016 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
+ * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -37,7 +37,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.neutronvpn.rev15
 import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.neutronvpn.rev150602.VpnMaps;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.neutronvpn.rev150602.networkmaps.NetworkMap;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.neutronvpn.rev150602.networkmaps.NetworkMapKey;
-
 import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.neutronvpn.rev150602.neutron.port.data
         .PortFixedipToPortName;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.neutronvpn.rev150602.neutron.port.data
@@ -80,10 +79,9 @@ public class NeutronvpnUtils {
     }
 
     protected static VpnMap getVpnMap(DataBroker broker, Uuid id) {
-        InstanceIdentifier<VpnMap> vpnMapIdentifier = InstanceIdentifier.builder(VpnMaps.class)
-                .child(VpnMap.class, new VpnMapKey(id)).build();
-        Optional<VpnMap> optionalVpnMap = read(broker, LogicalDatastoreType.CONFIGURATION,
-                vpnMapIdentifier);
+        InstanceIdentifier<VpnMap> vpnMapIdentifier = InstanceIdentifier.builder(VpnMaps.class).child(VpnMap.class,
+                new VpnMapKey(id)).build();
+        Optional<VpnMap> optionalVpnMap = read(broker, LogicalDatastoreType.CONFIGURATION, vpnMapIdentifier);
         if (optionalVpnMap.isPresent()) {
             return optionalVpnMap.get();
         }
@@ -93,8 +91,7 @@ public class NeutronvpnUtils {
 
     protected static Uuid getVpnForNetwork(DataBroker broker, Uuid network) {
         InstanceIdentifier<VpnMaps> vpnMapsIdentifier = InstanceIdentifier.builder(VpnMaps.class).build();
-        Optional<VpnMaps> optionalVpnMaps = read(broker, LogicalDatastoreType.CONFIGURATION,
-                vpnMapsIdentifier);
+        Optional<VpnMaps> optionalVpnMaps = read(broker, LogicalDatastoreType.CONFIGURATION, vpnMapsIdentifier);
         if (optionalVpnMaps.isPresent()) {
             VpnMaps vpnMaps = optionalVpnMaps.get();
             List<VpnMap> allMaps = vpnMaps.getVpnMap();
@@ -109,8 +106,7 @@ public class NeutronvpnUtils {
 
     protected static Uuid getVpnForRouter(DataBroker broker, Uuid router) {
         InstanceIdentifier<VpnMaps> vpnMapsIdentifier = InstanceIdentifier.builder(VpnMaps.class).build();
-        Optional<VpnMaps> optionalVpnMaps = read(broker, LogicalDatastoreType.CONFIGURATION,
-                vpnMapsIdentifier);
+        Optional<VpnMaps> optionalVpnMaps = read(broker, LogicalDatastoreType.CONFIGURATION, vpnMapsIdentifier);
         if (optionalVpnMaps.isPresent()) {
             VpnMaps vpnNets = optionalVpnMaps.get();
             List<VpnMap> allMaps = vpnNets.getVpnMap();
@@ -128,8 +124,7 @@ public class NeutronvpnUtils {
     protected static Uuid getRouterforVpn(DataBroker broker, Uuid vpnId) {
         InstanceIdentifier<VpnMap> vpnMapIdentifier = InstanceIdentifier.builder(VpnMaps.class)
                 .child(VpnMap.class, new VpnMapKey(vpnId)).build();
-        Optional<VpnMap> optionalVpnMap = read(broker, LogicalDatastoreType.CONFIGURATION,
-                vpnMapIdentifier);
+        Optional<VpnMap> optionalVpnMap = read(broker, LogicalDatastoreType.CONFIGURATION, vpnMapIdentifier);
         if (optionalVpnMap.isPresent()) {
             VpnMap vpnMap = optionalVpnMap.get();
             return vpnMap.getRouterId();
@@ -158,8 +153,7 @@ public class NeutronvpnUtils {
 
     protected static List<Uuid> getSubnetIdsFromNetworkId(DataBroker broker, Uuid networkId) {
         InstanceIdentifier id = buildNetworkMapIdentifier(networkId);
-        Optional<NetworkMap> optionalNetworkMap = read(broker, LogicalDatastoreType.CONFIGURATION,
-                id);
+        Optional<NetworkMap> optionalNetworkMap = read(broker, LogicalDatastoreType.CONFIGURATION, id);
         if (optionalNetworkMap.isPresent()) {
             return optionalNetworkMap.get().getSubnetIdList();
         }
@@ -184,9 +178,8 @@ public class NeutronvpnUtils {
 
     protected static Router getNeutronRouter(DataBroker broker, Uuid routerId) {
 
-        InstanceIdentifier<Router> inst = InstanceIdentifier.create(Neutron.class).
-                child(Routers.class).child(Router.class, new RouterKey(routerId));
-
+        InstanceIdentifier<Router> inst = InstanceIdentifier.create(Neutron.class).child(Routers.class).child(Router
+                .class, new RouterKey(routerId));
         Optional<Router> rtr = read(broker, LogicalDatastoreType.CONFIGURATION, inst);
         if (rtr.isPresent()) {
             return rtr.get();
@@ -196,9 +189,8 @@ public class NeutronvpnUtils {
 
     protected static Network getNeutronNetwork(DataBroker broker, Uuid networkId) {
         logger.debug("getNeutronNetwork for {}", networkId.getValue());
-        InstanceIdentifier<Network> inst = InstanceIdentifier.create(Neutron.class).
-                child(Networks.class).child(Network.class, new NetworkKey(networkId));
-
+        InstanceIdentifier<Network> inst = InstanceIdentifier.create(Neutron.class).child(Networks.class).child
+                (Network.class, new NetworkKey(networkId));
         Optional<Network> net = read(broker, LogicalDatastoreType.CONFIGURATION, inst);
         if (net.isPresent()) {
             return net.get();
@@ -263,6 +255,44 @@ public class NeutronvpnUtils {
         }
     }
 
+    protected static Short getIPPrefixFromPort(DataBroker broker, Port port) {
+        Short prefix = new Short((short) 0);
+        String cidr = "";
+        try {
+            Uuid subnetUUID = port.getFixedIps().get(0).getSubnetId();
+
+            org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.subnets.rev150712.subnets.attributes.subnets
+                    .SubnetKey subnetkey = new org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.subnets
+                    .rev150712.subnets.attributes.subnets.SubnetKey(subnetUUID);
+            InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.subnets.rev150712.subnets
+                    .attributes.subnets.Subnet> subnetidentifier = InstanceIdentifier.create(Neutron.class).child(org
+                    .opendaylight.yang.gen.v1.urn.opendaylight.neutron.subnets.rev150712.subnets.attributes.Subnets
+                    .class).child(org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.subnets.rev150712.subnets
+                    .attributes.subnets.Subnet.class, subnetkey);
+            Optional<org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.subnets.rev150712.subnets.attributes
+                    .subnets.Subnet> subnet = read(broker, LogicalDatastoreType.CONFIGURATION, subnetidentifier);
+
+            if (subnet.isPresent()) {
+                cidr = subnet.get().getCidr();
+                // Extract the prefix length from cidr
+                String[] parts = cidr.split("/");
+                if ((parts.length == 2)) {
+                    prefix = Short.valueOf(parts[1]);
+                    return prefix;
+                } else {
+                    logger.trace("Could not retrieve prefix from subnet CIDR");
+                    System.out.println("Could not retrieve prefix from subnet CIDR");
+                }
+            } else {
+                logger.trace("Unable to read on subnet datastore");
+            }
+        } catch (Exception e) {
+            logger.trace("Failed to retrieve IP prefix from port : ", e);
+            System.out.println("Failed to retrieve IP prefix from port : " + e.getMessage());
+        }
+        return null;
+    }
+
     static InstanceIdentifier<PortNameToPortUuid> buildPortNameToPortUuidIdentifier(String portname) {
         InstanceIdentifier<PortNameToPortUuid> id = InstanceIdentifier.builder(NeutronPortData.class).child
                 (PortNameToPortUuid.class, new PortNameToPortUuidKey(portname)).build();
index c6b556df03ec661801c17720b4f837b6d9b9e456..9752c8b9d88e310769deae0d7c7bd880351edca7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015-2016 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
+ * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
index d54bef15da9770c97996d8259561effc4bd9bb37..67886e585d742188b1a4d008e46a7364ee8d6ad9 100644 (file)
@@ -3,7 +3,7 @@
 *
 * Generated from: yang module name: neutronvpn-impl yang module local name: neutronvpn-impl
 * Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
-* Generated at: Thu Jan 06 10:51:12 IST 2015
+* Generated at: Thu Jan 06 10:51:12 IST 2016
 *
 * Do not modify this file unless it is present under src/main directory
 */
index 4be86556be0a675c2d41d2e5a99aa28c826f5177..2bf2a630d9e8375a64baac03924ea276004f4a0a 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- vi: set et smarttab sw=4 tabstop=4: --><!--
-Copyright (c) 2015 - 2016 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
+<!--
+Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
 
 This program and the accompanying materials are made available under the
 terms of the Eclipse Public License v1.0 which accompanies this distribution,
index 01bfeb1160133a4b15ea7041f7377d74ad3b7129..8139079b46bf4d9cc7c53e3ff2e15b129a2b3d85 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 - 2016 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
+ * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
index cf4736e485c0c68ea25f67b4290e2903e60a8a46..b10521bf9c3118a51b718dc9f0a48fb3d4251929 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 - 2016 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
+ * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
index 8801af350abc841bf8d630e90038578837c7ba79..6e8acdc1ebfdafed65505104db7864b3a3fe177f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 - 2016 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
+ * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
index 80cff0495feb94a9e47208667848f30e7c55f3ec..40f4e90a471773cf2c0f30cc38e6c16a51a410e0 100644 (file)
@@ -1,8 +1,10 @@
-<!--    * Copyright (c) 2015 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
-        *
-        * This program and the accompanying materials are made available under the
-        * terms of the Eclipse Public License v1.0 which accompanies this distribution,
-        * and is available at http://www.eclipse.org/legal/epl-v10.html
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
+
+This program and the accompanying materials are made available under the
+terms of the Eclipse Public License v1.0 which accompanies this distribution,
+and is available at http://www.eclipse.org/legal/epl-v10.html
 -->
 
 <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
index 18814e09ade4b8bacf7f8f00f75c038176fc4988..0479e185a59648fdeef8edd6522b95fcef763d1e 100644 (file)
@@ -1,9 +1,10 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
-Copyright (c) 2015 - 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
+Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
+
 This program and the accompanying materials are made available under the
 terms of the Eclipse Public License v1.0 which accompanies this distribution,
-and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
+and is available at http://www.eclipse.org/legal/epl-v10.html
 -->
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">