Updated L2Gw changes in "neutronvpn", "elanmanager" and "dhcpservice" modules
[vpnservice.git] / mdsalutil / mdsalutil-api / src / main / java / org / opendaylight / vpnservice / utils / hwvtep / HwvtepSouthboundUtils.java
index c1dae6c417673aa25c052c77f0b3977ea11a4102..cdb26525ef0b108049936fd3dbe6be5f0cf49365 100644 (file)
@@ -82,6 +82,11 @@ public class HwvtepSouthboundUtils {
                 .child(Node.class, new NodeKey(nodeId));
     }
 
+
+    public static InstanceIdentifier<TerminationPoint> createTerminationPointId(NodeId nodeId,
+                                                                                TerminationPointKey tpKey) {
+        return createInstanceIdentifier(nodeId).child(TerminationPoint.class, tpKey);
+    }
     /**
      * Creates the logical switches instance identifier.
      *
@@ -374,4 +379,21 @@ public class HwvtepSouthboundUtils {
         return vbBuilder.build();
     }
 
+    public static TerminationPointKey getTerminationPointKey(String ipAddress) {
+        TerminationPointKey tpKey = null;
+        String tpKeyStr = getTerminationPointKeyString(ipAddress);
+        if(tpKeyStr != null) {
+            tpKey = new TerminationPointKey(new TpId(tpKeyStr));
+        }
+        return tpKey;
+    }
+    public static String getTerminationPointKeyString(String ipAddress) {
+        String tpKeyStr = null;
+        if(ipAddress != null) {
+            tpKeyStr = new StringBuilder(HwvtepSouthboundConstants.TEP_PREFIX).
+                    append(ipAddress).toString();
+        }
+        return tpKeyStr;
+    }
+
 }