/*
- * Copyright IBM Corporation, 2013. All rights reserved.
+ * Copyright IBM Corporation and others, 2013. 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,
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
-public class NeutronSubnet extends ConfigurationObject implements Serializable {
+public class NeutronSubnet extends ConfigurationObject implements Serializable, INeutronObject {
private static final long serialVersionUID = 1L;
// See OpenStack Network API v2.0 Reference for description of
@XmlElement (name="tenant_id")
String tenantID;
+ @XmlElement (name="ipv6_address_mode", nillable=true)
+ String ipV6AddressMode;
+
+ @XmlElement (name="ipv6_ra_mode", nillable=true)
+ String ipV6RaMode;
+
/* stores the OpenStackPorts associated with an instance
* used to determine if that instance can be deleted.
*/
List<NeutronPort> myPorts;
- boolean gatewayIPAssigned;
+ Boolean gatewayIPAssigned;
public NeutronSubnet() {
myPorts = new ArrayList<NeutronPort>();
public String getID() { return subnetUUID; }
+ public void setID(String id) { this.subnetUUID = id; }
+
public String getSubnetUUID() {
return subnetUUID;
}
this.tenantID = tenantID;
}
+ public String getIpV6AddressMode() { return ipV6AddressMode; }
+
+ public void setIpV6AddressMode(String ipV6AddressMode) { this.ipV6AddressMode = ipV6AddressMode; }
+
+ public String getIpV6RaMode() { return ipV6RaMode; }
+
+ public void setIpV6RaMode(String ipV6RaMode) { this.ipV6RaMode = ipV6RaMode; }
+
/**
* This method copies selected fields from the object and returns them
* as a new object, suitable for marshaling.
if (s.equals("tenant_id")) {
ans.setTenantID(this.getTenantID());
}
+ if (s.equals("ipv6_address_mode")) {
+ ans.setIpV6AddressMode(this.getIpV6AddressMode());
+ }
+ if (s.equals("ipv6_ra_mode")) {
+ ans.setIpV6RaMode(this.getIpV6RaMode());
+ }
}
return ans;
}
try {
SubnetUtils util = new SubnetUtils(cidr);
SubnetInfo info = util.getInfo();
- if (gatewayIP == null) {
+ if (gatewayIP == null || ("").equals(gatewayIP)) {
gatewayIP = info.getLowAddress();
}
if (allocationPools.size() < 1) {
gatewayIPAssigned = false;
}
+ public Boolean getGatewayIPAllocated() {
+ return gatewayIPAssigned;
+ }
+
@Override
public String toString() {
return "NeutronSubnet [subnetUUID=" + subnetUUID + ", networkUUID=" + networkUUID + ", name=" + name
+ ", ipVersion=" + ipVersion + ", cidr=" + cidr + ", gatewayIP=" + gatewayIP + ", dnsNameservers="
+ dnsNameservers + ", allocationPools=" + allocationPools + ", hostRoutes=" + hostRoutes
+ ", enableDHCP=" + enableDHCP + ", tenantID=" + tenantID + ", myPorts=" + myPorts
- + ", gatewayIPAssigned=" + gatewayIPAssigned + "]";
+ + ", gatewayIPAssigned=" + gatewayIPAssigned + ", ipv6AddressMode=" + ipV6AddressMode
+ + ", ipv6RaMode=" + ipV6RaMode + "]";
}
}