package org.opendaylight.controller.networkconfig.neutron;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
@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
@XmlElement(name="end")
String poolEnd;
- public NeutronSubnet_IPAllocationPool() { }
+ public NeutronSubnet_IPAllocationPool() {
+ }
public NeutronSubnet_IPAllocationPool(String lowAddress, String highAddress) {
poolStart = lowAddress;
*
* @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;
}
if (i != gIP) {
p.setPoolStart(poolStart);
poolStarted = true;
+ } else {
+ //FIX for bug 533
+ p.setPoolStart(NeutronSubnet_IPAllocationPool.longtoIP(i+1));
}
}
if (i == eIP) {