Use union's stringValue() method 61/74061/25
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 16 Jul 2018 09:34:08 +0000 (11:34 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 18 Jul 2018 17:44:57 +0000 (19:44 +0200)
getValue() clashes which user-derived names, migrate to stringValue(),
which also has a better type.

Change-Id: I66ca094de9fa378f576e75f1dbb057e7daee70f8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 files changed:
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepSouthboundMapper.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepSouthboundUtil.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/LogicalRouterUpdateCommand.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/TransactUtils.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transactions/md/HwvtepMcastMacsLocalUpdateCommand.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transactions/md/HwvtepMcastMacsRemoteUpdateCommand.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transactions/md/HwvtepPhysicalLocatorUpdateCommand.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transactions/md/HwvtepPhysicalSwitchUpdateCommand.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transactions/md/HwvtepUcastMacsLocalUpdateCommand.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transactions/md/HwvtepUcastMacsRemoteUpdateCommand.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/test/java/org/opendaylight/ovsdb/hwvtepsouthbound/TestBuilders.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/SouthboundUtil.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbBridgeUpdateCommand.java
utils/hwvtepsouthbound-utils/src/main/java/org/opendaylight/ovsdb/utils/hwvtepsouthbound/utils/HwvtepSouthboundUtils.java
utils/southbound-utils/src/main/java/org/opendaylight/ovsdb/utils/southbound/utils/SouthboundUtils.java

index 259df1fb0d2fadb20fef7c52cdd28ef93dae3cd8..a64d2120bff05b4461b5f353a817093a1536e58b 100644 (file)
@@ -76,7 +76,7 @@ public final class HwvtepSouthboundMapper {
 
     private static InstanceIdentifier<Node> createInstanceIdentifier(IpAddress ip, PortNumber port) {
         String uriString = HwvtepSouthboundConstants.HWVTEP_URI_PREFIX + "://"
-                + String.valueOf(ip.getValue()) + ":" + port.getValue();
+                + ip.stringValue() + ":" + port.getValue();
         Uri uri = new Uri(uriString);
         NodeId nodeId = new NodeId(uri);
         InstanceIdentifier<Node> path = InstanceIdentifier.create(NetworkTopology.class)
index a6598d7fd03e4814e574863f436d99701db1588a..415fce8eac08f3fba3c7df504980af9f4c4f7c9c 100644 (file)
@@ -130,8 +130,7 @@ public final class HwvtepSouthboundUtil {
     }
 
     public static String connectionInfoToString(final ConnectionInfo connectionInfo) {
-        return String.valueOf(
-                connectionInfo.getRemoteIp().getValue()) + ":" + connectionInfo.getRemotePort().getValue();
+        return connectionInfo.getRemoteIp().stringValue() + ":" + connectionInfo.getRemotePort().getValue();
     }
 
 
index 4b641bb66de256c6cbeebb53bf5b069984b59dc1..93b971a696def80b96ba2a325a7c00ae2b822a07 100644 (file)
@@ -145,10 +145,10 @@ public class LogicalRouterUpdateCommand extends AbstractTransactCommand<LogicalR
                         getOperationalState().getAcls(aclIid);
                 if (operationalAclOptional.isPresent()) {
                     Uuid aclUuid = operationalAclOptional.get().getAclUuid();
-                    bindingMap.put(String.valueOf(aclBinding.getRouterInterface().getValue()),
+                    bindingMap.put(aclBinding.getRouterInterface().stringValue(),
                             new UUID(aclUuid.getValue()));
                 } else {
-                    bindingMap.put(String.valueOf(aclBinding.getRouterInterface().getValue()),
+                    bindingMap.put(aclBinding.getRouterInterface().stringValue(),
                             TransactUtils.getAclUUID(aclIid));
                 }
             }
@@ -161,8 +161,8 @@ public class LogicalRouterUpdateCommand extends AbstractTransactCommand<LogicalR
         if (staticRoutes != null) {
             Map<String, String> staticRoutesMap = new HashMap<>();
             for (StaticRoutes staticRoute : staticRoutes) {
-                staticRoutesMap.put(String.valueOf(staticRoute.getDestinationAddress().getValue()),
-                        String.valueOf(staticRoute.getNexthopAddress().getValue()));
+                staticRoutesMap.put(staticRoute.getDestinationAddress().stringValue(),
+                        staticRoute.getNexthopAddress().stringValue());
             }
             logicalRouter.setStaticRoutes(staticRoutesMap);
         }
index 580445e12d57b396c86c8a328a468c4a19ea4949..dd357ea2fd69d372930393f19bc28079a5501e4e 100644 (file)
@@ -30,7 +30,7 @@ import org.opendaylight.ovsdb.lib.schema.typed.TyperUtils;
 import org.opendaylight.ovsdb.schema.hardwarevtep.PhysicalLocator;
 import org.opendaylight.ovsdb.schema.hardwarevtep.PhysicalLocatorSet;
 import org.opendaylight.ovsdb.utils.mdsal.utils.MdsalUtils;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.EncapsulationTypeVxlanOverIpv4;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepNodeName;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepPhysicalLocatorAugmentation;
@@ -162,7 +162,7 @@ public final class TransactUtils {
         builder.setEncapsulationType(EncapsulationTypeVxlanOverIpv4.class);
         String tepKey = iid.firstKeyOf(TerminationPoint.class).getTpId().getValue();
         String ip = tepKey.substring(tepKey.indexOf(":") + 1);
-        builder.setDstIp(new IpAddress(ip.toCharArray()));
+        builder.setDstIp(IpAddressBuilder.getDefaultInstance(ip));
         locatorAugmentation = builder.build();
         locatorUuid = TransactUtils.createPhysicalLocator(transaction, locatorAugmentation);
         operationalState.updateCurrentTxData(TerminationPoint.class, iid, locatorUuid);
@@ -230,7 +230,7 @@ public final class TransactUtils {
             }
             return null;
         }
-        LogicalSwitchUpdateCommand cmd = new LogicalSwitchUpdateCommand(operationalState, Collections.EMPTY_LIST);
+        LogicalSwitchUpdateCommand cmd = new LogicalSwitchUpdateCommand(operationalState, Collections.emptyList());
         MdsalUtils mdsalUtils = new MdsalUtils(operationalState.getDataBroker());
         LogicalSwitches ls = mdsalUtils.read(LogicalDatastoreType.CONFIGURATION, lswitchIid);
         if (ls != null) {
index e58c358fbdec0df47058a69575874db47188c678..eb617b811a145fe1f019d533345dd11fd5c964f4 100644 (file)
@@ -24,7 +24,7 @@ import org.opendaylight.ovsdb.schema.hardwarevtep.LogicalSwitch;
 import org.opendaylight.ovsdb.schema.hardwarevtep.McastMacsLocal;
 import org.opendaylight.ovsdb.schema.hardwarevtep.PhysicalLocator;
 import org.opendaylight.ovsdb.schema.hardwarevtep.PhysicalLocatorSet;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressBuilder;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress;
 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.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepGlobalAugmentation;
@@ -105,7 +105,7 @@ public class HwvtepMcastMacsLocalUpdateCommand extends AbstractTransactionComman
 
     private void setIpAddress(LocalMcastMacsBuilder macLocalBuilder, McastMacsLocal macLocal) {
         if (macLocal.getIpAddr() != null && !macLocal.getIpAddr().isEmpty()) {
-            macLocalBuilder.setIpaddr(new IpAddress(macLocal.getIpAddr().toCharArray()));
+            macLocalBuilder.setIpaddr(IpAddressBuilder.getDefaultInstance(macLocal.getIpAddr()));
         }
     }
 
index 0ca3811338f7371df7baf650bb432b785bd0a517..9099504e19fe579ba651d5996450a67099a025fe 100644 (file)
@@ -25,7 +25,7 @@ import org.opendaylight.ovsdb.schema.hardwarevtep.LogicalSwitch;
 import org.opendaylight.ovsdb.schema.hardwarevtep.McastMacsRemote;
 import org.opendaylight.ovsdb.schema.hardwarevtep.PhysicalLocator;
 import org.opendaylight.ovsdb.schema.hardwarevtep.PhysicalLocatorSet;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressBuilder;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress;
 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.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepGlobalAugmentation;
@@ -118,7 +118,7 @@ public class HwvtepMcastMacsRemoteUpdateCommand extends AbstractTransactionComma
 
     private void setIpAddress(RemoteMcastMacsBuilder macRemoteBuilder, McastMacsRemote macRemote) {
         if (macRemote.getIpAddr() != null && !macRemote.getIpAddr().isEmpty()) {
-            macRemoteBuilder.setIpaddr(new IpAddress(macRemote.getIpAddr().toCharArray()));
+            macRemoteBuilder.setIpaddr(IpAddressBuilder.getDefaultInstance(macRemote.getIpAddr()));
         }
     }
 
index 24badcd5d8e5361afb20a209328785cd55b917e3..f721d6d9e14fdc504b3eb5dd23d8ad1f8d80852d 100644 (file)
@@ -21,7 +21,7 @@ import org.opendaylight.ovsdb.lib.notation.UUID;
 import org.opendaylight.ovsdb.lib.schema.DatabaseSchema;
 import org.opendaylight.ovsdb.lib.schema.typed.TyperUtils;
 import org.opendaylight.ovsdb.schema.hardwarevtep.PhysicalLocator;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressBuilder;
 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.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepPhysicalLocatorAugmentation;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepPhysicalLocatorAugmentationBuilder;
@@ -95,8 +95,7 @@ public class HwvtepPhysicalLocatorUpdateCommand extends AbstractTransactionComma
 
     private void setDstIp(HwvtepPhysicalLocatorAugmentationBuilder tpAugmentationBuilder,
             PhysicalLocator locator) {
-        IpAddress ip = new IpAddress(locator.getDstIpColumn().getData().toCharArray());
-        tpAugmentationBuilder.setDstIp(ip);
+        tpAugmentationBuilder.setDstIp(IpAddressBuilder.getDefaultInstance(locator.getDstIpColumn().getData()));
     }
 
 }
index b6a156807cfcc8637bf56ab28d65aedf9292051c..ed4e802e21eff861f9ce8688e616ff90d3c56047 100644 (file)
@@ -30,6 +30,7 @@ import org.opendaylight.ovsdb.lib.schema.typed.TyperUtils;
 import org.opendaylight.ovsdb.schema.hardwarevtep.PhysicalSwitch;
 import org.opendaylight.ovsdb.schema.hardwarevtep.Tunnel;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressBuilder;
 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.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepGlobalAugmentation;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepGlobalAugmentationBuilder;
@@ -113,8 +114,9 @@ public class HwvtepPhysicalSwitchUpdateCommand extends AbstractTransactionComman
         }
     }
 
-    private InstanceIdentifier<TunnelIps> getTunnelIpIid(final String tunnelIp, final InstanceIdentifier<Node> psIid) {
-        IpAddress ip = new IpAddress(tunnelIp.toCharArray());
+    private InstanceIdentifier<TunnelIps> getTunnelIpIid(final String tunnelIp,
+            final InstanceIdentifier<Node> psIid) {
+        IpAddress ip = IpAddressBuilder.getDefaultInstance(tunnelIp);
         TunnelIps tunnelIps = new TunnelIpsBuilder().withKey(new TunnelIpsKey(ip)).setTunnelIpsKey(ip).build();
         return psIid.augmentation(PhysicalSwitchAugmentation.class).child(TunnelIps.class, tunnelIps.key());
     }
@@ -135,7 +137,7 @@ public class HwvtepPhysicalSwitchUpdateCommand extends AbstractTransactionComman
             transaction.delete(LogicalDatastoreType.OPERATIONAL, tunnelIpsInstanceIdentifier);
         }
         for (String tunnelIp : addedTunnelIps) {
-            IpAddress ip = new IpAddress(tunnelIp.toCharArray());
+            IpAddress ip = IpAddressBuilder.getDefaultInstance(tunnelIp);
             InstanceIdentifier<TunnelIps> tunnelIpsInstanceIdentifier = getTunnelIpIid(tunnelIp, psIid);
             TunnelIps tunnelIps = new TunnelIpsBuilder().withKey(new TunnelIpsKey(ip)).setTunnelIpsKey(ip).build();
             transaction.put(LogicalDatastoreType.OPERATIONAL, tunnelIpsInstanceIdentifier, tunnelIps, true);
@@ -185,12 +187,13 @@ public class HwvtepPhysicalSwitchUpdateCommand extends AbstractTransactionComman
         }
     }
 
-    private void setManagementIps(PhysicalSwitchAugmentationBuilder psAugmentationBuilder, PhysicalSwitch phySwitch) {
+    private void setManagementIps(PhysicalSwitchAugmentationBuilder psAugmentationBuilder,
+            PhysicalSwitch phySwitch) {
         if (phySwitch.getManagementIpsColumn() != null && phySwitch.getManagementIpsColumn().getData() != null
                 && !phySwitch.getManagementIpsColumn().getData().isEmpty()) {
             List<ManagementIps> mgmtIps = new ArrayList<>();
             for (String mgmtIp : phySwitch.getManagementIpsColumn().getData()) {
-                IpAddress ip = new IpAddress(mgmtIp.toCharArray());
+                IpAddress ip = IpAddressBuilder.getDefaultInstance(mgmtIp);
                 mgmtIps.add(
                         new ManagementIpsBuilder().withKey(new ManagementIpsKey(ip)).setManagementIpsKey(ip).build());
             }
index af15e2bad593b329d732746e2fa9d9e98f2b961e..e039437d3f20c07cdd3843ee048c58b20e289491 100644 (file)
@@ -23,7 +23,7 @@ import org.opendaylight.ovsdb.lib.schema.typed.TyperUtils;
 import org.opendaylight.ovsdb.schema.hardwarevtep.LogicalSwitch;
 import org.opendaylight.ovsdb.schema.hardwarevtep.PhysicalLocator;
 import org.opendaylight.ovsdb.schema.hardwarevtep.UcastMacsLocal;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressBuilder;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress;
 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.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepGlobalAugmentation;
@@ -82,7 +82,7 @@ public class HwvtepUcastMacsLocalUpdateCommand extends AbstractTransactionComman
         InstanceIdentifier<Node> nodeIid = getOvsdbConnectionInstance().getInstanceIdentifier();
         LocalUcastMacsBuilder ucmlBuilder = new LocalUcastMacsBuilder();
         if (ucml.getIpAddr() != null && !ucml.getIpAddr().isEmpty()) {
-            ucmlBuilder.setIpaddr(new IpAddress(ucml.getIpAddr().toCharArray()));
+            ucmlBuilder.setIpaddr(IpAddressBuilder.getDefaultInstance(ucml.getIpAddr()));
         }
         ucmlBuilder.setMacEntryKey(new MacAddress(ucml.getMac()));
         ucmlBuilder.setMacEntryUuid(new Uuid(ucml.getUuid().toString()));
index 3a0752a78ede56ed82c71568e87b150496995e3c..be1b0cd3cbbfcf47ab3ad7dc571ca5b46f1cc9b1 100644 (file)
@@ -23,7 +23,7 @@ import org.opendaylight.ovsdb.lib.schema.typed.TyperUtils;
 import org.opendaylight.ovsdb.schema.hardwarevtep.LogicalSwitch;
 import org.opendaylight.ovsdb.schema.hardwarevtep.PhysicalLocator;
 import org.opendaylight.ovsdb.schema.hardwarevtep.UcastMacsRemote;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressBuilder;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress;
 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.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepGlobalAugmentation;
@@ -80,7 +80,7 @@ public class HwvtepUcastMacsRemoteUpdateCommand extends AbstractTransactionComma
         rumBuilder.setMacEntryKey(new MacAddress(macRemote.getMac()));
         rumBuilder.setMacEntryUuid(new Uuid(macRemote.getUuid().toString()));
         if (macRemote.getIpAddr() != null && !macRemote.getIpAddr().isEmpty()) {
-            rumBuilder.setIpaddr(new IpAddress(macRemote.getIpAddr().toCharArray()));
+            rumBuilder.setIpaddr(IpAddressBuilder.getDefaultInstance(macRemote.getIpAddr()));
         }
         if (macRemote.getLocatorColumn() != null
                 && macRemote.getLocatorColumn().getData() != null) {
index fab3290ddc21f3bd553dd6424aede21c0071c937..63ac489213f8c67c1a7793da7f57dbbce0570a07 100644 (file)
@@ -12,7 +12,7 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 import java.util.UUID;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressBuilder;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress;
 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.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepGlobalAugmentation;
@@ -97,7 +97,7 @@ public final class TestBuilders {
     public static RemoteUcastMacs buildRemoteUcastMacs(InstanceIdentifier<Node> nodeIid, String vmMac,
                                                        String vmip, String tepIp, String logicalSwitchName) {
         RemoteUcastMacsBuilder ucmlBuilder = new RemoteUcastMacsBuilder();
-        ucmlBuilder.setIpaddr(new IpAddress(vmip.toCharArray()));
+        ucmlBuilder.setIpaddr(IpAddressBuilder.getDefaultInstance(vmip));
         ucmlBuilder.setMacEntryKey(new MacAddress(vmMac));
         ucmlBuilder.setMacEntryUuid(getUUid(vmMac));
         ucmlBuilder.setLocatorRef(buildLocatorRef(nodeIid, tepIp));
@@ -115,7 +115,7 @@ public final class TestBuilders {
                     new HwvtepPhysicalLocatorAugmentationBuilder();
             tpAugmentationBuilder.setPhysicalLocatorUuid(getUUid(ip));
             tpAugmentationBuilder.setEncapsulationType(HwvtepSouthboundMapper.createEncapsulationType(VXLAN_OVER_IPV4));
-            tpAugmentationBuilder.setDstIp(new IpAddress(ip.toCharArray()));
+            tpAugmentationBuilder.setDstIp(IpAddressBuilder.getDefaultInstance(ip));
             tpBuilder.addAugmentation(HwvtepPhysicalLocatorAugmentation.class, tpAugmentationBuilder.build());
         }
         return tpBuilder.build();
index c3b306f856781eb599abdd05c24fff89f40f642c..5411a0fd76b8de53e03b0acddd2cbef7e48fb164 100644 (file)
@@ -129,7 +129,7 @@ public final class SouthboundUtil {
         ConnectionInfo connectionInfo = ovsdbNodeAugmentation.getConnectionInfo();
         LOG.info("connectionInfo: {}", connectionInfo);
         if (connectionInfo != null && connectionInfo.getLocalIp() != null) {
-            ipAddr = String.valueOf(connectionInfo.getLocalIp().getValue());
+            ipAddr = connectionInfo.getLocalIp().stringValue();
         }
         if (ipAddr == null) {
             ipAddr = getLocalControllerHostIpAddress();
@@ -144,8 +144,7 @@ public final class SouthboundUtil {
     }
 
     public static String connectionInfoToString(final ConnectionInfo connectionInfo) {
-        return String.valueOf(
-                connectionInfo.getRemoteIp().getValue()) + ":" + connectionInfo.getRemotePort().getValue();
+        return connectionInfo.getRemoteIp().stringValue() + ":" + connectionInfo.getRemotePort().getValue();
     }
 
     public static void schemaMismatchLog(String column, String table, SchemaVersionMismatchException ex) {
index 8a2e48373296dc33cd50bb38023c3b3e69e2f587..f16596d4413d564f5aa1a4c5af99ab22213fbe38 100644 (file)
@@ -38,6 +38,7 @@ import org.opendaylight.ovsdb.southbound.SouthboundConstants;
 import org.opendaylight.ovsdb.southbound.SouthboundMapper;
 import org.opendaylight.ovsdb.southbound.SouthboundUtil;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressBuilder;
 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.params.xml.ns.yang.ovsdb.rev150105.DatapathId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeAugmentation;
@@ -363,7 +364,7 @@ public class OvsdbBridgeUpdateCommand extends AbstractTransactionCommand {
                 IpAddress bridgeControllerIpAddress = null;
                 for (String targetElement : controllerTarget) {
                     if (InetAddresses.isInetAddress(targetElement)) {
-                        bridgeControllerIpAddress = new IpAddress(targetElement.toCharArray());
+                        bridgeControllerIpAddress = IpAddressBuilder.getDefaultInstance(targetElement);
                         continue;
                     }
                     if (NumberUtils.isNumber(targetElement)) {
@@ -403,12 +404,14 @@ public class OvsdbBridgeUpdateCommand extends AbstractTransactionCommand {
         return nodeKey.getNodeId();
     }
 
+    @Override
     public void onSuccess() {
         for (InstanceIdentifier<Node> updatedBridge : updatedBridges) {
             LOG.debug("Updated bridge {} in operational datastore", updatedBridge);
         }
     }
 
+    @Override
     public void onFailure(Throwable throwable) {
         for (InstanceIdentifier<Node> updatedBridge : updatedBridges) {
             LOG.error("Failed to update bridge {} in operational datastore", updatedBridge);
index 05fc11cf3f603ea0193ba7f434bc94f09ac25e89..d08d7ef186727d1c3b6926f91e710b7ff9fed3b4 100644 (file)
@@ -36,7 +36,7 @@ public final class HwvtepSouthboundUtils {
 
     public static NodeId createNodeId(IpAddress ip, PortNumber port) {
         String uriString = HwvtepSouthboundConstants.HWVTEP_URI_PREFIX + "://"
-                + String.valueOf(ip.getValue()) + ":" + port.getValue();
+                + ip.stringValue() + ":" + port.getValue();
         Uri uri = new Uri(uriString);
         return new NodeId(uri);
     }
@@ -87,8 +87,7 @@ public final class HwvtepSouthboundUtils {
     }
 
     public static Object connectionInfoToString(ConnectionInfo connectionInfo) {
-        return String.valueOf(
-                        connectionInfo.getRemoteIp().getValue()) + ":" + connectionInfo.getRemotePort().getValue();
+        return connectionInfo.getRemoteIp().stringValue() + ":" + connectionInfo.getRemotePort().getValue();
     }
 
 }
index bd8cf7cde166510add39f476437c61df17374527..1bae8e118f88cc81d6b3f58bd4e3d7e4fe4d3b63 100644 (file)
@@ -166,8 +166,7 @@ public class SouthboundUtils {
             .build();
 
     public static NodeId createNodeId(IpAddress ip, PortNumber port) {
-        String uriString = OVSDB_URI_PREFIX + "://"
-                + String.valueOf(ip.getValue()) + ":" + port.getValue();
+        String uriString = OVSDB_URI_PREFIX + "://" + ip.stringValue() + ":" + port.getValue();
         Uri uri = new Uri(uriString);
         return new NodeId(uri);
     }
@@ -306,8 +305,7 @@ public class SouthboundUtils {
     }
 
     public static String connectionInfoToString(final ConnectionInfo connectionInfo) {
-        return String.valueOf(
-                connectionInfo.getRemoteIp().getValue()) + ":" + connectionInfo.getRemotePort().getValue();
+        return connectionInfo.getRemoteIp().stringValue() + ":" + connectionInfo.getRemotePort().getValue();
     }
 
     public boolean addOvsdbNode(final ConnectionInfo connectionInfo) {
@@ -880,7 +878,7 @@ public class SouthboundUtils {
                         } else if (tokens[0].equalsIgnoreCase("ptcp")) {
                             ConnectionInfo connectionInfo = ovsdbNodeAugmentation.getConnectionInfo();
                             if (connectionInfo != null && connectionInfo.getLocalIp() != null) {
-                                controllerIpStr = String.valueOf(connectionInfo.getLocalIp().getValue());
+                                controllerIpStr = connectionInfo.getLocalIp().stringValue();
                                 controllersStr.add(OPENFLOW_CONNECTION_PROTOCOL
                                         + ":" + controllerIpStr + ":" + OPENFLOW_PORT);
                             } else {
@@ -892,7 +890,7 @@ public class SouthboundUtils {
                         } else if (tokens[0].equalsIgnoreCase("pssl")) {
                             ConnectionInfo connectionInfo = ovsdbNodeAugmentation.getConnectionInfo();
                             if (connectionInfo != null && connectionInfo.getLocalIp() != null) {
-                                controllerIpStr = String.valueOf(connectionInfo.getLocalIp().getValue());
+                                controllerIpStr = connectionInfo.getLocalIp().stringValue();
                                 controllersStr.add(OPENFLOW_SECURE_PROTOCOL
                                         + ":" + controllerIpStr + ":" + OPENFLOW_PORT);
                             } else {