Merge "suppress warn log if replying 500 just for OptimisticLockFailedException"
authorJosh Hershberg <jhershbe@gmail.com>
Tue, 31 Jul 2018 09:04:45 +0000 (09:04 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Tue, 31 Jul 2018 09:04:45 +0000 (09:04 +0000)
27 files changed:
artifacts/pom.xml
features/production/features-neutron/pom.xml
features/production/odl-neutron-hostconfig-ovs/pom.xml
features/production/odl-neutron-hostconfig-vpp/pom.xml
features/production/odl-neutron-logger/pom.xml
features/production/odl-neutron-model/pom.xml [new file with mode: 0644]
features/production/odl-neutron-northbound-api/pom.xml
features/production/odl-neutron-service/pom.xml
features/production/odl-neutron-spi/pom.xml
features/production/pom.xml
features/test/features-neutron-test/pom.xml
features/test/odl-neutron-logger-test/pom.xml
features/test/pom.xml
integration/test-standalone/pom.xml
karaf/pom.xml
neutron-hostconfig/pom.xml
neutron-hostconfig/vpp/src/test/java/org/opendaylight/neutron/hostconfig/vpp/HostconfigsDataBrokerTest.java
transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronFirewallRuleInterface.java
transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronFloatingIpInterface.java
transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronLoadBalancerInterface.java
transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronLoadBalancerPoolInterface.java
transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronMeteringLabelRuleInterface.java
transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronPortInterface.java
transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronRouterInterface.java
transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronSFCFlowClassifierInterface.java
transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronSecurityRuleInterface.java
transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronSubnetInterface.java

index e28752c6cdabb7beda1429cb9a6a45ccaa312735..cd53613a3416f597c05db6b6bc5865bb0ffe1b33 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>3.1.2</version>
+        <version>3.1.3</version>
         <relativePath/>
     </parent>
 
                 <type>xml</type>
                 <classifier>features</classifier>
             </dependency>
+            <dependency>
+                <groupId>${project.groupId}</groupId>
+                <artifactId>odl-neutron-model</artifactId>
+                <version>${project.version}</version>
+                <type>xml</type>
+                <classifier>features</classifier>
+            </dependency>
             <dependency>
                 <groupId>${project.groupId}</groupId>
                 <artifactId>odl-neutron-service</artifactId>
index 6b49899eb7b828abe0ab9859891c1b29ef450204..352df752ec5223f74b00bbc53f02c83750ec67b4 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>feature-repo-parent</artifactId>
-        <version>3.1.2</version>
+        <version>3.1.3</version>
         <relativePath/>
     </parent>
 
index 222be0782ebf89455451133eb6db033c15fe72b2..84be879c41ae79a412039ffd0b8a70def79ae3ba 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.2</version>
+        <version>3.1.3</version>
         <relativePath/>
     </parent>
 
index 945c0fcfe23ccaff5ea53266171cc56f803cac62..828f38abddfff11921c5aa5389e0b74c0b4a17d3 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.2</version>
+        <version>3.1.3</version>
         <relativePath/>
     </parent>
 
index ded5227cd48b74e1495f7bfaa19e9b1e87328a26..47e59f2c404a0298f9707fa765dbd5f4467f2d48 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.2</version>
+        <version>3.1.3</version>
         <relativePath/>
     </parent>
 
         </dependency>
         <dependency>
             <groupId>${project.groupId}</groupId>
-            <artifactId>model</artifactId>
+            <artifactId>odl-neutron-model</artifactId>
             <version>${project.version}</version>
+            <type>xml</type>
+            <classifier>features</classifier>
         </dependency>
         <dependency>
             <groupId>${project.groupId}</groupId>
diff --git a/features/production/odl-neutron-model/pom.xml b/features/production/odl-neutron-model/pom.xml
new file mode 100644 (file)
index 0000000..b7bbabb
--- /dev/null
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2018 Pantheon Technologies, s.r.o. 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
+-->
+<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">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.opendaylight.odlparent</groupId>
+        <artifactId>single-feature-parent</artifactId>
+        <version>3.1.2</version>
+        <relativePath/>
+    </parent>
+
+    <groupId>org.opendaylight.neutron</groupId>
+    <artifactId>odl-neutron-model</artifactId>
+    <version>0.11.0-SNAPSHOT</version>
+    <packaging>feature</packaging>
+    <name>OpenDaylight :: Neutron :: Model</name>
+
+    <properties>
+        <explicitFeatureDependencies>true</explicitFeatureDependencies>
+    </properties>
+
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.opendaylight.mdsal.model</groupId>
+                <artifactId>mdsal-model-artifacts</artifactId>
+                <version>0.13.0-SNAPSHOT</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.opendaylight.mdsal.model</groupId>
+            <artifactId>odl-mdsal-model-rfc6991</artifactId>
+            <type>xml</type>
+            <classifier>features</classifier>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>model</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+</project>
index 46501ecb5318bdc4d6305fe0c97ed778e41135d3..4aae1b99f0b1f677d65d82dba2c17de83a5a1016 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.2</version>
+        <version>3.1.3</version>
         <relativePath/>
     </parent>
 
index 1852ca4cf9fbea4039c6bad4e2eab64ab68631cf..7f14209ae82b37983a1db39b314953e52ad6e854 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.2</version>
+        <version>3.1.3</version>
         <relativePath/>
     </parent>
 
index 94f078ecba84771ef20e80ec9e12900c88d2d332..42c3dad99138a18592f6b668fea7ef3aadbf7ea8 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.2</version>
+        <version>3.1.3</version>
         <relativePath/>
     </parent>
 
                 <type>pom</type>
                 <scope>import</scope>
             </dependency>
-            <dependency>
-                <groupId>org.opendaylight.mdsal.model</groupId>
-                <artifactId>mdsal-model-artifacts</artifactId>
-                <version>0.13.0-SNAPSHOT</version>
-                <type>pom</type>
-                <scope>import</scope>
-            </dependency>
         </dependencies>
     </dependencyManagement>
 
@@ -53,8 +46,9 @@
             <classifier>features</classifier>
         </dependency>
         <dependency>
-            <groupId>org.opendaylight.mdsal.model</groupId>
-            <artifactId>odl-mdsal-model-rfc6991</artifactId>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>odl-neutron-model</artifactId>
+            <version>${project.version}</version>
             <type>xml</type>
             <classifier>features</classifier>
         </dependency>
index edd5dece6ff577da6b8972251ff295c46026aa6a..4c9f779d8073728245d1432b098f237e581be62a 100644 (file)
@@ -11,7 +11,7 @@
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>odlparent-lite</artifactId>
-    <version>3.1.2</version>
+    <version>3.1.3</version>
     <relativePath/>
   </parent>
 
@@ -22,6 +22,7 @@
 
   <modules>
     <module>features-neutron</module>
+    <module>odl-neutron-model</module>
     <module>odl-neutron-spi</module>
     <module>odl-neutron-hostconfig-ovs</module>
     <module>odl-neutron-hostconfig-vpp</module>
index ed023e321688cf8073d73cf7f6f221a768dd842e..2829946a568d6bfab0cff2d63362bab8f6fac6cc 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>feature-repo-parent</artifactId>
-        <version>3.1.2</version>
+        <version>3.1.3</version>
         <relativePath/>
     </parent>
 
index 3e048b016659182c1ef989c4c4e50f0b843cb515..68892a78bc037c1b1ea59273ef79f41490968f8b 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>3.1.2</version>
+        <version>3.1.3</version>
         <relativePath/>
     </parent>
 
index fc9f022c59d7a4f863fd565c02e031c41cff5cb1..fc659815513edb53fc6e4bf5eacb9399c95aa468 100644 (file)
@@ -11,7 +11,7 @@
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>odlparent-lite</artifactId>
-    <version>3.1.2</version>
+    <version>3.1.3</version>
     <relativePath/>
   </parent>
 
index a0e47ca42124479b8afa0d772e2609c2be5f62cc..ac2651514c164dcafe4e7018c900c6a244349ed9 100644 (file)
@@ -5,7 +5,7 @@
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>bundle-parent</artifactId>
-    <version>3.1.2</version>
+    <version>3.1.3</version>
     <relativePath/>
   </parent>
 
index d906c37e485e02c6833430c66be96ced99b5cd53..af3bcf0623302f91b866e598339e577a2f7d902a 100644 (file)
@@ -9,7 +9,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>karaf4-parent</artifactId>
-        <version>3.1.2</version>
+        <version>3.1.3</version>
         <relativePath/>
     </parent>
     <modelVersion>4.0.0</modelVersion>
index ecedbe8becbfd13dfc619be9101b68ee2443d22f..12591131244c27673c33e5720d0bd8f56713ac59 100644 (file)
@@ -12,7 +12,7 @@
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>odlparent</artifactId>
-    <version>3.1.2</version>
+    <version>3.1.3</version>
     <relativePath/>
   </parent>
 
index f284750c3ace3261ab45592b4e55d9101a8ded0b..85921fff11c560c2181deae9236f31463c0e4475 100644 (file)
@@ -14,11 +14,11 @@ import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.ImmutableSet.Builder;
 
 import org.opendaylight.controller.md.sal.binding.test.AbstractConcurrentDataBrokerTest;
+import org.opendaylight.mdsal.binding.spec.reflect.BindingReflections;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNode;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.rev150712.Neutron;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology;
 import org.opendaylight.yangtools.yang.binding.YangModuleInfo;
-import org.opendaylight.yangtools.yang.binding.util.BindingReflections;
 
 public class HostconfigsDataBrokerTest extends AbstractConcurrentDataBrokerTest {
 
index 12a64902568d3625f21924475c6071286e4f5f08..30c1ca45877050469391b21b293a6c7ec9d29a67 100644 (file)
@@ -23,11 +23,13 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.fwaas.rev150712.Act
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.fwaas.rev150712.ActionBase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.fwaas.rev150712.ActionDeny;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.fwaas.rev150712.FirewallRuleAttributes.Protocol;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.fwaas.rev150712.FirewallRuleAttributesProtocolBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.fwaas.rev150712.rules.attributes.FirewallRules;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.fwaas.rev150712.rules.attributes.firewall.rules.FirewallRule;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.fwaas.rev150712.rules.attributes.firewall.rules.FirewallRuleBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.fwaas.rev150712.rules.attributes.firewall.rules.FirewallRuleKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.types.rev160517.IpPrefixOrAddress;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.types.rev160517.IpPrefixOrAddressBuilder;
 import org.ops4j.pax.cdi.api.OsgiServiceProvider;
 
 @Singleton
@@ -81,10 +83,10 @@ public final class NeutronFirewallRuleInterface
             answer.setFirewallRuleIpVer(IP_VERSION_MAP.get(rule.getIpVersion()));
         }
         if (rule.getSourceIpAddr() != null) {
-            answer.setFirewallRuleSrcIpAddr(String.valueOf(rule.getSourceIpAddr().getValue()));
+            answer.setFirewallRuleSrcIpAddr(rule.getSourceIpAddr().stringValue());
         }
         if (rule.getDestinationIpAddr() != null) {
-            answer.setFirewallRuleDstIpAddr(String.valueOf(rule.getDestinationIpAddr().getValue()));
+            answer.setFirewallRuleDstIpAddr(rule.getDestinationIpAddr().stringValue());
         }
         if (rule.getSourcePortRangeMin() != null) {
             answer.setFirewallRuleSrcPortRangeMin(rule.getSourcePortRangeMin());
@@ -124,7 +126,7 @@ public final class NeutronFirewallRuleInterface
         if (rule.getFirewallRuleProtocol() != null) {
             final String protocolString = rule.getFirewallRuleProtocol();
             try {
-                final Protocol protocol = new Protocol(protocolString.toCharArray());
+                final Protocol protocol = FirewallRuleAttributesProtocolBuilder.getDefaultInstance(protocolString);
                 ruleBuilder.setProtocol(protocol);
             } catch (NumberFormatException e) {
                 throw new BadRequestException("Protocol {" + rule.getFirewallRuleProtocol() + "} is not supported");
@@ -135,11 +137,13 @@ public final class NeutronFirewallRuleInterface
             ruleBuilder.setIpVersion(mapper.get(rule.getFirewallRuleIpVer()));
         }
         if (rule.getFirewallRuleSrcIpAddr() != null) {
-            final IpPrefixOrAddress ipAddress = new IpPrefixOrAddress(rule.getFirewallRuleSrcIpAddr().toCharArray());
+            final IpPrefixOrAddress ipAddress = IpPrefixOrAddressBuilder.getDefaultInstance(
+                rule.getFirewallRuleSrcIpAddr());
             ruleBuilder.setSourceIpAddr(ipAddress);
         }
         if (rule.getFirewallRuleDstIpAddr() != null) {
-            final IpPrefixOrAddress ipAddress = new IpPrefixOrAddress(rule.getFirewallRuleDstIpAddr().toCharArray());
+            final IpPrefixOrAddress ipAddress = IpPrefixOrAddressBuilder.getDefaultInstance(
+                rule.getFirewallRuleDstIpAddr());
             ruleBuilder.setDestinationIpAddr(ipAddress);
         }
         if (rule.getFirewallRuleSrcPortRangeMin() != null) {
index f4aa79804a56b3b01fa921fea2c0f7fb83df8f62..98264fc61960d48ee96a914dabf6a72d16bd494c 100644 (file)
@@ -13,7 +13,7 @@ import javax.inject.Singleton;
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.neutron.spi.INeutronFloatingIpCRUD;
 import org.opendaylight.neutron.spi.NeutronFloatingIp;
-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.neutron.l3.rev150712.floatingips.attributes.Floatingips;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.l3.rev150712.floatingips.attributes.floatingips.Floatingip;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.l3.rev150712.floatingips.attributes.floatingips.FloatingipBuilder;
@@ -43,10 +43,11 @@ public final class NeutronFloatingIpInterface
         final FloatingipBuilder floatingipBuilder = new FloatingipBuilder();
         toMdIds(floatingIp, floatingipBuilder);
         if (floatingIp.getFixedIpAddress() != null) {
-            floatingipBuilder.setFixedIpAddress(new IpAddress(floatingIp.getFixedIpAddress().toCharArray()));
+            floatingipBuilder.setFixedIpAddress(IpAddressBuilder.getDefaultInstance(floatingIp.getFixedIpAddress()));
         }
         if (floatingIp.getFloatingIpAddress() != null) {
-            floatingipBuilder.setFloatingIpAddress(new IpAddress(floatingIp.getFloatingIpAddress().toCharArray()));
+            floatingipBuilder.setFloatingIpAddress(IpAddressBuilder.getDefaultInstance(
+                floatingIp.getFloatingIpAddress()));
         }
         if (floatingIp.getFloatingNetworkUUID() != null) {
             floatingipBuilder.setFloatingNetworkId(toUuid(floatingIp.getFloatingNetworkUUID()));
@@ -74,10 +75,10 @@ public final class NeutronFloatingIpInterface
             result.setPortUUID(String.valueOf(fip.getPortId().getValue()));
         }
         if (fip.getFixedIpAddress() != null) {
-            result.setFixedIpAddress(String.valueOf(fip.getFixedIpAddress().getValue()));
+            result.setFixedIpAddress(fip.getFixedIpAddress().stringValue());
         }
         if (fip.getFloatingIpAddress() != null) {
-            result.setFloatingIpAddress(String.valueOf(fip.getFloatingIpAddress().getValue()));
+            result.setFloatingIpAddress(fip.getFloatingIpAddress().stringValue());
         }
         if (fip.getRouterId() != null) {
             result.setRouterUUID(String.valueOf(fip.getRouterId().getValue()));
index de42002240d0eeda2154670f34d770a2a80ed6dd..af44344be88bab03382d2d3933f6b4b983e58003 100644 (file)
@@ -13,7 +13,7 @@ import javax.inject.Singleton;
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.neutron.spi.INeutronLoadBalancerCRUD;
 import org.opendaylight.neutron.spi.NeutronLoadBalancer;
-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.neutron.lbaasv2.rev150712.lbaas.attributes.Loadbalancers;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.lbaasv2.rev150712.lbaas.attributes.loadbalancers.Loadbalancer;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.lbaasv2.rev150712.lbaas.attributes.loadbalancers.LoadbalancerBuilder;
@@ -41,7 +41,7 @@ public final class NeutronLoadBalancerInterface
         final NeutronLoadBalancer answer = new NeutronLoadBalancer();
         fromMdAdminAttributes(loadBalancer, answer);
         if (loadBalancer.getVipAddress() != null) {
-            answer.setLoadBalancerVipAddress(String.valueOf(loadBalancer.getVipAddress().getValue()));
+            answer.setLoadBalancerVipAddress(String.valueOf(loadBalancer.getVipAddress().stringValue()));
         }
         if (loadBalancer.getVipSubnetId() != null) {
             answer.setLoadBalancerVipSubnetID(loadBalancer.getVipSubnetId().getValue());
@@ -54,7 +54,8 @@ public final class NeutronLoadBalancerInterface
         final LoadbalancerBuilder loadBalancerBuilder = new LoadbalancerBuilder();
         toMdAdminAttributes(loadBalancer, loadBalancerBuilder);
         if (loadBalancer.getLoadBalancerVipAddress() != null) {
-            loadBalancerBuilder.setVipAddress(new IpAddress(loadBalancer.getLoadBalancerVipAddress().toCharArray()));
+            loadBalancerBuilder.setVipAddress(IpAddressBuilder.getDefaultInstance(
+                loadBalancer.getLoadBalancerVipAddress()));
         }
         if (loadBalancer.getLoadBalancerVipSubnetID() != null) {
             loadBalancerBuilder.setVipSubnetId(toUuid(loadBalancer.getLoadBalancerVipSubnetID()));
index 1f1ee0608ab0d42a15b29158742cd30337096ac5..d217a5d67bdc212489b97f658e2133d4cd778469 100644 (file)
@@ -28,6 +28,7 @@ import org.opendaylight.neutron.spi.NeutronLoadBalancerPool;
 import org.opendaylight.neutron.spi.NeutronLoadBalancerPoolMember;
 import org.opendaylight.neutron.spi.NeutronLoadBalancerSessionPersistence;
 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.neutron.constants.rev150712.ProtocolBase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.constants.rev150712.ProtocolHttp;
@@ -236,7 +237,7 @@ public final class NeutronLoadBalancerPoolInterface
             answer.setPoolMemberAdminStateIsUp(member.isAdminStateUp());
         }
         if (member.getAddress() != null) {
-            answer.setPoolMemberAddress(String.valueOf(member.getAddress().getValue()));
+            answer.setPoolMemberAddress(member.getAddress().stringValue());
         }
         if (member.getProtocolPort() != null) {
             answer.setPoolMemberProtoPort(member.getProtocolPort());
@@ -254,7 +255,7 @@ public final class NeutronLoadBalancerPoolInterface
         final MemberBuilder memberBuilder = toMdIds(member, MemberBuilder.class);
         memberBuilder.setAdminStateUp(member.getPoolMemberAdminStateIsUp());
         if (member.getPoolMemberAddress() != null) {
-            final IpAddress ipAddress = new IpAddress(member.getPoolMemberAddress().toCharArray());
+            final IpAddress ipAddress = IpAddressBuilder.getDefaultInstance(member.getPoolMemberAddress());
             memberBuilder.setAddress(ipAddress);
         }
         if (member.getPoolMemberProtoPort() != null) {
index d9affc2d2657d963a8b2b93e7c51a41e89d38e55..839c30dd011bfb8bf1b305c737c507d15f714f97 100644 (file)
@@ -14,6 +14,7 @@ import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.neutron.spi.INeutronMeteringLabelRuleCRUD;
 import org.opendaylight.neutron.spi.NeutronMeteringLabelRule;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpPrefix;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpPrefixBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.constants.rev150712.NeutronUtils.DirectionMapper;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.metering.rev150712.metering.rules.attributes.MeteringRules;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.metering.rev150712.metering.rules.attributes.metering.rules.MeteringRule;
@@ -50,8 +51,8 @@ public final class NeutronMeteringLabelRuleInterface
                     DirectionMapper.get(meteringLabelRule.getMeteringLabelRuleDirection()));
         }
         if (meteringLabelRule.getMeteringLabelRuleRemoteIpPrefix() != null) {
-            final IpPrefix ipPrefix = new IpPrefix(
-                    meteringLabelRule.getMeteringLabelRuleRemoteIpPrefix().toCharArray());
+            final IpPrefix ipPrefix = IpPrefixBuilder.getDefaultInstance(
+                    meteringLabelRule.getMeteringLabelRuleRemoteIpPrefix());
             meteringRuleBuilder.setRemoteIpPrefix(ipPrefix);
         }
         meteringRuleBuilder.setExcluded(meteringLabelRule.getMeteringLabelRuleExcluded());
@@ -69,7 +70,7 @@ public final class NeutronMeteringLabelRuleInterface
             answer.setMeteringLabelRuleDirection(DirectionMapper.getDirectionString(rule.getDirection()));
         }
         if (rule.getRemoteIpPrefix() != null) {
-            answer.setMeteringLabelRuleRemoteIpPrefix(new String(rule.getRemoteIpPrefix().getValue()));
+            answer.setMeteringLabelRuleRemoteIpPrefix(rule.getRemoteIpPrefix().stringValue());
         }
         answer.setMeteringLabelRuleExcluded(rule.isExcluded());
         return answer;
index 2dfbcb6172a087f5d9a2b4e0f4d87965277d8d54..66f9f121b49c711925acaedbcc08ffc14b6e1344 100644 (file)
@@ -23,7 +23,7 @@ import org.opendaylight.neutron.spi.NeutronPort;
 import org.opendaylight.neutron.spi.NeutronPortAllowedAddressPairs;
 import org.opendaylight.neutron.spi.NeutronPortExtraDHCPOption;
 import org.opendaylight.neutron.spi.NeutronSecurityGroup;
-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.neutron.binding.rev150712.PortBindingExtension;
@@ -47,7 +47,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.portsecurity.rev150
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.portsecurity.rev150712.PortSecurityExtensionBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.qos.ext.rev160613.QosPortExtension;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.qos.ext.rev160613.QosPortExtensionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.types.rev160517.IpPrefixOrAddress;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.types.rev160517.IpPrefixOrAddressBuilder;
 import org.ops4j.pax.cdi.api.OsgiServiceProvider;
 
 @Singleton
@@ -108,7 +108,7 @@ public final class NeutronPortInterface extends AbstractNeutronInterface<Port, P
             final List<NeutronPortAllowedAddressPairs> pairs = new ArrayList<>();
             for (final AllowedAddressPairs mdPair : port.getAllowedAddressPairs()) {
                 final NeutronPortAllowedAddressPairs pair = new NeutronPortAllowedAddressPairs();
-                pair.setIpAddress(String.valueOf(mdPair.getIpAddress().getValue()));
+                pair.setIpAddress(mdPair.getIpAddress().stringValue());
                 pair.setMacAddress(mdPair.getMacAddress().getValue());
                 pairs.add(pair);
             }
@@ -131,7 +131,7 @@ public final class NeutronPortInterface extends AbstractNeutronInterface<Port, P
             final List<NeutronIps> ips = new ArrayList<>();
             for (final FixedIps mdIp : port.getFixedIps()) {
                 final NeutronIps ip = new NeutronIps();
-                ip.setIpAddress(String.valueOf(mdIp.getIpAddress().getValue()));
+                ip.setIpAddress(mdIp.getIpAddress().stringValue());
                 ip.setSubnetUUID(mdIp.getSubnetId().getValue());
                 ips.add(ip);
             }
@@ -201,7 +201,7 @@ public final class NeutronPortInterface extends AbstractNeutronInterface<Port, P
             for (final NeutronPortAllowedAddressPairs allowedAddressPairs : neutronPort.getAllowedAddressPairs()) {
                 final AllowedAddressPairsBuilder allowedAddressPairsBuilder = new AllowedAddressPairsBuilder();
                 allowedAddressPairsBuilder
-                        .setIpAddress(new IpPrefixOrAddress(allowedAddressPairs.getIpAddress().toCharArray()));
+                        .setIpAddress(IpPrefixOrAddressBuilder.getDefaultInstance(allowedAddressPairs.getIpAddress()));
                 allowedAddressPairsBuilder.setMacAddress(new MacAddress(allowedAddressPairs.getMacAddress()));
                 listAllowedAddressPairs.add(allowedAddressPairsBuilder.build());
             }
@@ -234,7 +234,7 @@ public final class NeutronPortInterface extends AbstractNeutronInterface<Port, P
             final List<FixedIps> listNeutronIps = new ArrayList<>();
             for (final NeutronIps neutronIPs : neutronPort.getFixedIps()) {
                 final FixedIpsBuilder fixedIpsBuilder = new FixedIpsBuilder();
-                fixedIpsBuilder.setIpAddress(new IpAddress(neutronIPs.getIpAddress().toCharArray()));
+                fixedIpsBuilder.setIpAddress(IpAddressBuilder.getDefaultInstance(neutronIPs.getIpAddress()));
                 fixedIpsBuilder.setSubnetId(toUuid(neutronIPs.getSubnetUUID()));
                 listNeutronIps.add(fixedIpsBuilder.build());
             }
index f56aef457a9cc2047cee7d0f21553f035b6c59ee..f3b4e1f41e9df4ccf94ce9f4e671b8b4415f4d2f 100644 (file)
@@ -17,8 +17,8 @@ import org.opendaylight.neutron.spi.NeutronIps;
 import org.opendaylight.neutron.spi.NeutronRoute;
 import org.opendaylight.neutron.spi.NeutronRouter;
 import org.opendaylight.neutron.spi.NeutronRouterNetworkReference;
-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.IpPrefix;
+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.inet.types.rev130715.IpPrefixBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.l3.rev150712.l3.attributes.Routes;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.l3.rev150712.l3.attributes.RoutesBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.l3.rev150712.routers.attributes.Routers;
@@ -61,8 +61,8 @@ public final class NeutronRouterInterface extends AbstractNeutronInterface<Route
             final List<Routes> routes = new ArrayList<>();
             for (final NeutronRoute route : router.getRoutes()) {
                 final RoutesBuilder routeBuilder = new RoutesBuilder();
-                routeBuilder.setDestination(new IpPrefix(route.getDestination().toCharArray()));
-                routeBuilder.setNexthop(new IpAddress(route.getNextHop().toCharArray()));
+                routeBuilder.setDestination(IpPrefixBuilder.getDefaultInstance(route.getDestination()));
+                routeBuilder.setNexthop(IpAddressBuilder.getDefaultInstance(route.getNextHop()));
                 routes.add(routeBuilder.build());
             }
             routerBuilder.setRoutes(routes);
@@ -79,7 +79,7 @@ public final class NeutronRouterInterface extends AbstractNeutronInterface<Route
                     final List<ExternalFixedIps> externalFixedIps = new ArrayList<>();
                     for (final NeutronIps externalIp : externalGatewayInfos.getExternalFixedIps()) {
                         final ExternalFixedIpsBuilder eFixedIpBuilder = new ExternalFixedIpsBuilder();
-                        eFixedIpBuilder.setIpAddress(new IpAddress(externalIp.getIpAddress().toCharArray()));
+                        eFixedIpBuilder.setIpAddress(IpAddressBuilder.getDefaultInstance(externalIp.getIpAddress()));
                         eFixedIpBuilder.setSubnetId(toUuid(externalIp.getSubnetUUID()));
                         externalFixedIps.add(eFixedIpBuilder.build());
                     }
@@ -104,8 +104,8 @@ public final class NeutronRouterInterface extends AbstractNeutronInterface<Route
             final List<NeutronRoute> routes = new ArrayList<>();
             for (final Routes route : router.getRoutes()) {
                 final NeutronRoute routerRoute = new NeutronRoute();
-                routerRoute.setDestination(String.valueOf(route.getDestination().getValue()));
-                routerRoute.setNextHop(String.valueOf(route.getNexthop().getValue()));
+                routerRoute.setDestination(route.getDestination().stringValue());
+                routerRoute.setNextHop(route.getNexthop().stringValue());
                 routes.add(routerRoute);
             }
             result.setRoutes(routes);
@@ -120,7 +120,7 @@ public final class NeutronRouterInterface extends AbstractNeutronInterface<Route
                 for (final ExternalFixedIps mdFixedIp : router.getExternalGatewayInfo().getExternalFixedIps()) {
                     final NeutronIps fixedIp = new NeutronIps();
                     fixedIp.setSubnetUUID(String.valueOf(mdFixedIp.getSubnetId().getValue()));
-                    fixedIp.setIpAddress(String.valueOf(mdFixedIp.getIpAddress().getValue()));
+                    fixedIp.setIpAddress(mdFixedIp.getIpAddress().stringValue());
                     fixedIps.add(fixedIp);
                 }
                 extGwInfo.setExternalFixedIps(fixedIps);
index fa1d03d3ed13d2015786ecabec77dc665a673ece..2d809cebf65c77ff934122807589365463fab29e 100644 (file)
@@ -17,7 +17,7 @@ import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.neutron.northbound.api.BadRequestException;
 import org.opendaylight.neutron.spi.INeutronSFCFlowClassifierCRUD;
 import org.opendaylight.neutron.spi.NeutronSFCFlowClassifier;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpPrefix;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpPrefixBuilder;
 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.constants.rev150712.EthertypeBase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.constants.rev150712.EthertypeV4;
@@ -101,10 +101,11 @@ public final class NeutronSFCFlowClassifierInterface
             result.setDestinationPortRangeMax(neutronClassifier.getDestinationPortRangeMax());
         }
         if (neutronClassifier.getSourceIpPrefix() != null) {
-            result.setSourceIpPrefix(new IpPrefix(neutronClassifier.getSourceIpPrefix().toCharArray()));
+            result.setSourceIpPrefix(IpPrefixBuilder.getDefaultInstance(neutronClassifier.getSourceIpPrefix()));
         }
         if (neutronClassifier.getDestinationIpPrefix() != null) {
-            result.setDestinationIpPrefix(new IpPrefix(neutronClassifier.getDestinationIpPrefix().toCharArray()));
+            result.setDestinationIpPrefix(IpPrefixBuilder.getDefaultInstance(
+                neutronClassifier.getDestinationIpPrefix()));
         }
         if (neutronClassifier.getLogicalSourcePortUUID() != null) {
             result.setLogicalSourcePort(new Uuid(neutronClassifier.getLogicalSourcePortUUID()));
@@ -151,10 +152,10 @@ public final class NeutronSFCFlowClassifierInterface
             result.setDestinationPortRangeMax(mdClassifier.getDestinationPortRangeMax());
         }
         if (mdClassifier.getSourceIpPrefix() != null) {
-            result.setSourceIpPrefix(String.valueOf(mdClassifier.getSourceIpPrefix().getValue()));
+            result.setSourceIpPrefix(mdClassifier.getSourceIpPrefix().stringValue());
         }
         if (mdClassifier.getDestinationIpPrefix() != null) {
-            result.setDestinationIpPrefix(String.valueOf(mdClassifier.getDestinationIpPrefix().getValue()));
+            result.setDestinationIpPrefix(mdClassifier.getDestinationIpPrefix().stringValue());
         }
         if (mdClassifier.getLogicalSourcePort() != null) {
             result.setLogicalSourcePortUUID(mdClassifier.getLogicalSourcePort().getValue());
index 73015be0ae250d3d9f26a2c9b44b3f12da6c4c57..a26bc3c53c14365269248f83327bb40c551fba28 100644 (file)
@@ -19,12 +19,14 @@ import org.opendaylight.neutron.northbound.api.BadRequestException;
 import org.opendaylight.neutron.spi.INeutronSecurityRuleCRUD;
 import org.opendaylight.neutron.spi.NeutronSecurityRule;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpPrefix;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpPrefixBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.constants.rev150712.EthertypeBase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.constants.rev150712.EthertypeV4;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.constants.rev150712.EthertypeV6;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.constants.rev150712.NeutronUtils.DirectionMapper;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.constants.rev150712.NeutronUtils.ProtocolMapper;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.secgroups.rev150712.SecurityRuleAttributes.Protocol;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.secgroups.rev150712.SecurityRuleAttributesProtocolBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.secgroups.rev150712.security.rules.attributes.SecurityRules;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.secgroups.rev150712.security.rules.attributes.security.rules.SecurityRule;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.secgroups.rev150712.security.rules.attributes.security.rules.SecurityRuleBuilder;
@@ -68,7 +70,7 @@ public final class NeutronSecurityRuleInterface extends
             answer.setSecurityRemoteGroupID(rule.getRemoteGroupId().getValue());
         }
         if (rule.getRemoteIpPrefix() != null) {
-            answer.setSecurityRuleRemoteIpPrefix(new String(rule.getRemoteIpPrefix().getValue()));
+            answer.setSecurityRuleRemoteIpPrefix(rule.getRemoteIpPrefix().stringValue());
         }
         if (rule.getProtocol() != null) {
             final Protocol protocol = rule.getProtocol();
@@ -108,13 +110,13 @@ public final class NeutronSecurityRuleInterface extends
             securityRuleBuilder.setRemoteGroupId(toUuid(securityRule.getSecurityRemoteGroupID()));
         }
         if (securityRule.getSecurityRuleRemoteIpPrefix() != null) {
-            final IpPrefix ipPrefix = new IpPrefix(securityRule.getSecurityRuleRemoteIpPrefix().toCharArray());
+            final IpPrefix ipPrefix = IpPrefixBuilder.getDefaultInstance(securityRule.getSecurityRuleRemoteIpPrefix());
             securityRuleBuilder.setRemoteIpPrefix(ipPrefix);
         }
         if (securityRule.getSecurityRuleProtocol() != null) {
             final String protocolString = securityRule.getSecurityRuleProtocol();
             try {
-                final Protocol protocol = new Protocol(protocolString.toCharArray());
+                final Protocol protocol = SecurityRuleAttributesProtocolBuilder.getDefaultInstance(protocolString);
                 securityRuleBuilder.setProtocol(protocol);
             } catch (NumberFormatException e) {
                 throw new BadRequestException("Protocol {" + securityRule.getSecurityRuleProtocol()
index 136f6447a5e081b8bfb035884b1adb0278e0ee77..49d7e546b3217eac46fdf69610c595f8debb0074 100644 (file)
@@ -18,6 +18,7 @@ import org.opendaylight.neutron.spi.NeutronRoute;
 import org.opendaylight.neutron.spi.NeutronSubnet;
 import org.opendaylight.neutron.spi.NeutronSubnetIpAllocationPool;
 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.inet.types.rev130715.IpPrefix;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpPrefixBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.constants.rev150712.Dhcpv6Base;
@@ -74,9 +75,9 @@ public final class NeutronSubnetInterface extends AbstractNeutronInterface<Subne
         fromMdBaseAttributes(subnet, result);
         result.setNetworkUUID(subnet.getNetworkId().getValue());
         result.setIpVersion(IPV_MAP.get(subnet.getIpVersion()));
-        result.setCidr(String.valueOf(subnet.getCidr().getValue()));
+        result.setCidr(subnet.getCidr().stringValue());
         if (subnet.getGatewayIp() != null) {
-            result.setGatewayIp(String.valueOf(subnet.getGatewayIp().getValue()));
+            result.setGatewayIp(subnet.getGatewayIp().stringValue());
         }
         if (subnet.getIpv6RaMode() != null) {
             result.setIpV6RaMode(DHCPV6_MAP.get(subnet.getIpv6RaMode()));
@@ -89,8 +90,8 @@ public final class NeutronSubnetInterface extends AbstractNeutronInterface<Subne
             final List<NeutronSubnetIpAllocationPool> allocationPools = new ArrayList<>();
             for (final AllocationPools allocationPool : subnet.getAllocationPools()) {
                 final NeutronSubnetIpAllocationPool pool = new NeutronSubnetIpAllocationPool();
-                pool.setPoolStart(String.valueOf(allocationPool.getStart().getValue()));
-                pool.setPoolEnd(String.valueOf(allocationPool.getEnd().getValue()));
+                pool.setPoolStart(allocationPool.getStart().stringValue());
+                pool.setPoolEnd(allocationPool.getEnd().stringValue());
                 allocationPools.add(pool);
             }
             result.setAllocationPools(allocationPools);
@@ -98,7 +99,7 @@ public final class NeutronSubnetInterface extends AbstractNeutronInterface<Subne
         if (subnet.getDnsNameservers() != null) {
             final List<String> dnsNameServers = new ArrayList<>();
             for (final IpAddress dnsNameServer : subnet.getDnsNameservers()) {
-                dnsNameServers.add(String.valueOf(dnsNameServer.getValue()));
+                dnsNameServers.add(dnsNameServer.stringValue());
             }
             result.setDnsNameservers(dnsNameServers);
         }
@@ -106,8 +107,8 @@ public final class NeutronSubnetInterface extends AbstractNeutronInterface<Subne
             final List<NeutronRoute> hostRoutes = new ArrayList<>();
             for (final HostRoutes hostRoute : subnet.getHostRoutes()) {
                 final NeutronRoute nsHostRoute = new NeutronRoute();
-                nsHostRoute.setDestination(String.valueOf(hostRoute.getDestination().getValue()));
-                nsHostRoute.setNextHop(String.valueOf(hostRoute.getNexthop().getValue()));
+                nsHostRoute.setDestination(hostRoute.getDestination().stringValue());
+                nsHostRoute.setNextHop(hostRoute.getNexthop().stringValue());
                 hostRoutes.add(nsHostRoute);
             }
             result.setHostRoutes(hostRoutes);
@@ -131,7 +132,7 @@ public final class NeutronSubnetInterface extends AbstractNeutronInterface<Subne
             subnetBuilder.setCidr(ipPrefix);
         }
         if (subnet.getGatewayIp() != null) {
-            final IpAddress ipAddress = new IpAddress(subnet.getGatewayIp().toCharArray());
+            final IpAddress ipAddress = IpAddressBuilder.getDefaultInstance(subnet.getGatewayIp());
             subnetBuilder.setGatewayIp(ipAddress);
         }
         if (subnet.getIpV6RaMode() != null) {
@@ -147,8 +148,8 @@ public final class NeutronSubnetInterface extends AbstractNeutronInterface<Subne
             final List<AllocationPools> allocationPools = new ArrayList<>();
             for (final NeutronSubnetIpAllocationPool allocationPool : subnet.getAllocationPools()) {
                 final AllocationPoolsBuilder builder = new AllocationPoolsBuilder();
-                builder.setStart(new IpAddress(allocationPool.getPoolStart().toCharArray()));
-                builder.setEnd(new IpAddress(allocationPool.getPoolEnd().toCharArray()));
+                builder.setStart(IpAddressBuilder.getDefaultInstance(allocationPool.getPoolStart()));
+                builder.setEnd(IpAddressBuilder.getDefaultInstance(allocationPool.getPoolEnd()));
                 final AllocationPools temp = builder.build();
                 allocationPools.add(temp);
             }
@@ -157,7 +158,7 @@ public final class NeutronSubnetInterface extends AbstractNeutronInterface<Subne
         if (subnet.getDnsNameservers() != null) {
             final List<IpAddress> dnsNameServers = new ArrayList<>();
             for (final String dnsNameServer : subnet.getDnsNameservers()) {
-                final IpAddress ipAddress = new IpAddress(dnsNameServer.toCharArray());
+                final IpAddress ipAddress = IpAddressBuilder.getDefaultInstance(dnsNameServer);
                 dnsNameServers.add(ipAddress);
             }
             subnetBuilder.setDnsNameservers(dnsNameServers);
@@ -166,8 +167,8 @@ public final class NeutronSubnetInterface extends AbstractNeutronInterface<Subne
             final List<HostRoutes> hostRoutes = new ArrayList<>();
             for (final NeutronRoute hostRoute : subnet.getHostRoutes()) {
                 final HostRoutesBuilder hrBuilder = new HostRoutesBuilder();
-                hrBuilder.setDestination(new IpPrefix(hostRoute.getDestination().toCharArray()));
-                hrBuilder.setNexthop(new IpAddress(hostRoute.getNextHop().toCharArray()));
+                hrBuilder.setDestination(IpPrefixBuilder.getDefaultInstance(hostRoute.getDestination()));
+                hrBuilder.setNexthop(IpAddressBuilder.getDefaultInstance(hostRoute.getNextHop()));
                 hostRoutes.add(hrBuilder.build());
             }
             subnetBuilder.setHostRoutes(hostRoutes);