X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fnetworkconfiguration%2Fneutron%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetworkconfig%2Fneutron%2FNeutronSubnet_IPAllocationPool.java;h=75da310b2b63b9f967afdbc354fba1ee3871dfa3;hp=7829ba2199aac43b5e7ac99c2fa730d656436562;hb=45552a60c3b4fdf613571cdf1d5cb0677a498a14;hpb=0b3fe7299bbeccc10f2c1b859f95de07c168ac9f diff --git a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronSubnet_IPAllocationPool.java b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronSubnet_IPAllocationPool.java index 7829ba2199..75da310b2b 100644 --- a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronSubnet_IPAllocationPool.java +++ b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronSubnet_IPAllocationPool.java @@ -8,6 +8,7 @@ package org.opendaylight.controller.networkconfig.neutron; +import java.io.Serializable; import java.util.ArrayList; import java.util.List; @@ -18,7 +19,9 @@ import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) -public class NeutronSubnet_IPAllocationPool { +public class NeutronSubnet_IPAllocationPool implements Serializable { + private static final long serialVersionUID = 1L; + // See OpenStack Network API v2.0 Reference for description of // annotated attributes @@ -28,7 +31,8 @@ public class NeutronSubnet_IPAllocationPool { @XmlElement(name="end") String poolEnd; - public NeutronSubnet_IPAllocationPool() { } + public NeutronSubnet_IPAllocationPool() { + } public NeutronSubnet_IPAllocationPool(String lowAddress, String highAddress) { poolStart = lowAddress; @@ -73,15 +77,18 @@ public class NeutronSubnet_IPAllocationPool { * * @param inputString * IPv4 address in dotted decimal format - * @returns high-endian representation of the IPv4 address as a long + * @returns high-endian representation of the IPv4 address as a long. + * This method will return 0 if the input is null. */ static long convert(String inputString) { long ans = 0; - String[] parts = inputString.split("\\."); - for (String part: parts) { - ans <<= 8; - ans |= Integer.parseInt(part); + if (inputString != null) { + String[] parts = inputString.split("\\."); + for (String part: parts) { + ans <<= 8; + ans |= Integer.parseInt(part); + } } return ans; } @@ -145,6 +152,9 @@ public class NeutronSubnet_IPAllocationPool { if (i != gIP) { p.setPoolStart(poolStart); poolStarted = true; + } else { + //FIX for bug 533 + p.setPoolStart(NeutronSubnet_IPAllocationPool.longtoIP(i+1)); } } if (i == eIP) {