From 3e114c7b2efdf5d4edb81890a96770d62e939c99 Mon Sep 17 00:00:00 2001 From: Andrew Donald Kennedy Date: Mon, 19 Mar 2012 13:58:23 +0000 Subject: [PATCH] Issue 830: Rename RASD to ResourceAllocationSettingData and change RASD and VSSD domain objects to OVF namespace --- .../v1_5/domain/CustomizationSection.java | 6 - .../v1_5/domain/NetworkConnectionSection.java | 26 +- .../director/v1_5/domain/RasdItemsList.java | 12 +- .../CIMResourceAllocationSettingDataType.java | 1015 ----------------- .../director/v1_5/domain/cim/CimString.java | 14 + .../cim/ResourceAllocationSettingData.java | 238 ++-- .../domain/cim/VirtualSystemSettingData.java | 166 +-- .../v1_5/domain/cim/package-info.java | 3 +- .../vcloud/director/v1_5/domain/ovf/RASD.java | 136 --- .../director/v1_5/domain/ovf/SectionType.java | 39 +- .../domain/ovf/VirtualHardwareSection.java | 98 +- .../v1_5/features/VAppAsyncClient.java | 36 +- .../director/v1_5/features/VAppClient.java | 20 +- .../vcloud/director/v1_5/domain/Checks.java | 10 +- .../features/AbstractVAppClientLiveTest.java | 12 +- .../v1_5/features/VAppClientExpectTest.java | 18 +- .../v1_5/features/VAppClientLiveTest.java | 104 +- 17 files changed, 463 insertions(+), 1490 deletions(-) delete mode 100644 labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/CIMResourceAllocationSettingDataType.java delete mode 100644 labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/RASD.java diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/CustomizationSection.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/CustomizationSection.java index c57961bea0..31bf250c43 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/CustomizationSection.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/CustomizationSection.java @@ -161,9 +161,6 @@ public class CustomizationSection extends SectionType { /** * Gets the value of the href property. - * - * @return possible object is - * {@link String } */ public URI getHref() { return href; @@ -171,9 +168,6 @@ public class CustomizationSection extends SectionType { /** * Gets the value of the type property. - * - * @return possible object is - * {@link String } */ public String getType() { return type; diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/NetworkConnectionSection.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/NetworkConnectionSection.java index 25c2adf3dd..6277b4a0c4 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/NetworkConnectionSection.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/NetworkConnectionSection.java @@ -99,6 +99,14 @@ public class NetworkConnectionSection extends SectionType { return self(); } + /** + * @see NetworkConnectionSection#getLinks() + */ + public B link(Link link) { + this.links.add(checkNotNull(link, "link")); + return self(); + } + /** * @see NetworkConnectionSection#getHref() */ @@ -133,8 +141,8 @@ public class NetworkConnectionSection extends SectionType { private NetworkConnectionSection(Builder builder) { super(builder); this.primaryNetworkConnectionIndex = builder.primaryNetworkConnectionIndex; - this.networkConnections = ImmutableSet.copyOf(builder.networkConnections); - this.links = ImmutableSet.copyOf(builder.links); + this.networkConnections = builder.networkConnections != null ? ImmutableSet.copyOf(builder.networkConnections) : Sets.newLinkedHashSet(); + this.links = builder.links != null ? ImmutableSet.copyOf(builder.links) : Sets.newLinkedHashSet(); this.href = builder.href; this.type = builder.type; } @@ -166,20 +174,16 @@ public class NetworkConnectionSection extends SectionType { /** * Gets the value of the networkConnection property. - *

- * Objects of the following type(s) are allowed in the list {@link NetworkConnection } */ public Set getNetworkConnections() { - return Collections.unmodifiableSet(this.networkConnections); + return ImmutableSet.copyOf(networkConnections); } /** * Gets the value of the link property. - *

- * Objects of the following type(s) are allowed in the list {@link Link } */ public Set getLinks() { - return Collections.unmodifiableSet(this.links); + return ImmutableSet.copyOf(links); } /** @@ -207,8 +211,10 @@ public class NetworkConnectionSection extends SectionType { NetworkConnectionSection that = NetworkConnectionSection.class.cast(o); return super.equals(that) && equal(primaryNetworkConnectionIndex, that.primaryNetworkConnectionIndex) && - equal(networkConnections, that.networkConnections) && equal(links, that.links) && - equal(href, that.href) && equal(type, that.type); + equal(networkConnections, that.networkConnections) && + equal(links, that.links) && + equal(href, that.href) && + equal(type, that.type); } @Override diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/RasdItemsList.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/RasdItemsList.java index e8b7519a4c..a3d432879b 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/RasdItemsList.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/RasdItemsList.java @@ -27,7 +27,7 @@ import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; -import org.jclouds.vcloud.director.v1_5.domain.ovf.RASD; +import org.jclouds.vcloud.director.v1_5.domain.cim.ResourceAllocationSettingData; import com.google.common.base.Objects; import com.google.common.base.Objects.ToStringHelper; @@ -59,12 +59,12 @@ public class RasdItemsList extends ResourceType { public static abstract class Builder> extends ResourceType.Builder { - private List items = Lists.newArrayList(); + private List items = Lists.newArrayList(); /** * @see RasdItemsList#getItems() */ - public B items(List items) { + public B items(List items) { this.items = checkNotNull(items, "items"); return self(); } @@ -72,7 +72,7 @@ public class RasdItemsList extends ResourceType { /** * @see RasdItemsList#getItems() */ - public B item(RASD item) { + public B item(ResourceAllocationSettingData item) { this.items.add(checkNotNull(item, "item")); return self(); } @@ -98,12 +98,12 @@ public class RasdItemsList extends ResourceType { } @XmlElement(name = "Item") - protected List items = Lists.newArrayList(); + protected List items = Lists.newArrayList(); /** * A RASD item content. */ - public List getItems() { + public List getItems() { return items; } diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/CIMResourceAllocationSettingDataType.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/CIMResourceAllocationSettingDataType.java deleted file mode 100644 index c0910b0551..0000000000 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/CIMResourceAllocationSettingDataType.java +++ /dev/null @@ -1,1015 +0,0 @@ -/* - * Licensed to jclouds, Inc. (jclouds) under one or more - * contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. jclouds licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.jclouds.vcloud.director.v1_5.domain.cim; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.xml.bind.annotation.XmlAnyAttribute; -import javax.xml.bind.annotation.XmlAnyElement; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementRef; -import javax.xml.bind.annotation.XmlType; -import javax.xml.namespace.QName; - -/** - * Java class for CIM_ResourceAllocationSettingData_Type complex type. - * - *

- * <complexType name="CIM_ResourceAllocationSettingData_Type" />
- * 
- */ -@XmlType(name = "CIM_ResourceAllocationSettingData_Type", namespace = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData") -public class CIMResourceAllocationSettingDataType { - - // TODO Add toString, hashCode and equals - - public static Builder builder() { - return new ConcreteBuilder(); - } - - public Builder toBuilder() { - return builder().fromCIMResourceAllocationSettingDataType(this); - } - - public static class Builder> { - private CimString address; - private CimString addressOnParent; - private CimString allocationUnits; - private CimBoolean automaticAllocation; - private CimBoolean automaticDeallocation; - private ResourceAllocationCaption caption; - private ResourceAllocationChangeableType changeableType; - private CimString configurationName; - private List connection; - private ConsumerVisibility consumerVisibility; - private CimString description; - private CimString elementName; - private CimUnsignedLong generation; - private List hostResource; - private CimString instanceID; - private CimUnsignedLong limit; - private MappingBehavior mappingBehavior; - private CimString otherResourceType; - private CimString parent; - private CimString poolID; - private CimUnsignedLong reservation; - private CimString resourceSubType; - private ResourceType resourceType; - private CimUnsignedLong virtualQuantity; - private CimString virtualQuantityUnits; - private CimUnsignedInt weight; - private List any; - private Map otherAttributes = new HashMap(); - - @SuppressWarnings("unchecked") - protected B self() { - return (B) this; - } - - public B address(CimString val) { - this.address = val; - return self(); - } - public B addressOnParent(CimString val) { - this.addressOnParent = val; - return self(); - } - public B allocationUnits(CimString val) { - this.allocationUnits = val; - return self(); - } - public B automaticAllocation(CimBoolean val) { - this.automaticAllocation = val; - return self(); - } - public B automaticDeallocation(CimBoolean val) { - this.automaticDeallocation = val; - return self(); - } - public B caption(ResourceAllocationCaption val) { - this.caption = val; - return self(); - } - public B changeableType(ResourceAllocationChangeableType val) { - this.changeableType = val; - return self(); - } - public B configurationName(CimString val) { - this.configurationName = val; - return self(); - } - public B connection(List val) { - this.connection = val; - return self(); - } - public B consumerVisibility(ConsumerVisibility val) { - this.consumerVisibility = val; - return self(); - } - public B description(CimString val) { - this.description = val; - return self(); - } - public B elementName(CimString val) { - this.elementName = val; - return self(); - } - public B generation(CimUnsignedLong val) { - this.generation = val; - return self(); - } - public B hostResource(List val) { - this.hostResource = val; - return self(); - } - public B instanceID(CimString val) { - this.instanceID = val; - return self(); - } - public B limit(CimUnsignedLong val) { - this.limit = val; - return self(); - } - public B mappingBehavior(MappingBehavior val) { - this.mappingBehavior = val; - return self(); - } - public B otherResourceType(CimString val) { - this.otherResourceType = val; - return self(); - } - public B parent(CimString val) { - this.parent = val; - return self(); - } - public B poolID(CimString val) { - this.poolID = val; - return self(); - } - public B reservation(CimUnsignedLong val) { - this.reservation = val; - return self(); - } - public B resourceSubType(CimString val) { - this.resourceSubType = val; - return self(); - } - public B resourceType(ResourceType val) { - this.resourceType = val; - return self(); - } - public B virtualQuantity(CimUnsignedLong val) { - this.virtualQuantity = val; - return self(); - } - public B virtualQuantityUnits(CimString val) { - this.virtualQuantityUnits = val; - return self(); - } - public B weight(CimUnsignedInt val) { - this.weight = val; - return self(); - } - public B any(List val) { - this.any = val; - return self(); - } - public B otherAttributes(Map val) { - this.otherAttributes = val; - return self(); - } - - public B fromCIMResourceAllocationSettingDataType(CIMResourceAllocationSettingDataType val) { - return self().address(val.getAddress()). - addressOnParent(val.getAddressOnParent()). - allocationUnits(val.getAllocationUnits()). - allocationUnits(val.getAllocationUnits()). - automaticAllocation(val.getAutomaticAllocation()). - automaticDeallocation(val.getAutomaticDeallocation()). - caption(val.getCaption()). - changeableType(val.getChangeableType()). - configurationName(val.getConfigurationName()). - connection(val.getConnection()). - consumerVisibility(val.getConsumerVisibility()). - description(val.getDescription()). - elementName(val.getElementName()). - generation(val.getGeneration()). - hostResource(val.getHostResource()). - instanceID(val.getInstanceID()). - limit(val.getLimit()). - mappingBehavior(val.getMappingBehavior()). - otherResourceType(val.getOtherResourceType()). - parent(val.getParent()). - poolID(val.getPoolID()). - reservation(val.getReservation()). - resourceSubType(val.getResourceSubType()). - resourceType(val.getResourceType()). - virtualQuantity(val.getVirtualQuantity()). - virtualQuantityUnits(val.getVirtualQuantityUnits()). - weight(val.getWeight()). - any(val.getAny()). - otherAttributes(val.getOtherAttributes()); - } - - public CIMResourceAllocationSettingDataType build() { - return new CIMResourceAllocationSettingDataType(this); - } - } - - private static class ConcreteBuilder extends Builder { - } - - @XmlElement(name = "Address", nillable = true) - private CimString address; - @XmlElement(name = "AddressOnParent", nillable = true) - private CimString addressOnParent; - @XmlElement(name = "AllocationUnits", nillable = true) - private CimString allocationUnits; - @XmlElement(name = "AutomaticAllocation", nillable = true) - private CimBoolean automaticAllocation; - @XmlElement(name = "AutomaticDeallocation", nillable = true) - private CimBoolean automaticDeallocation; - @XmlElement(name = "Caption", nillable = true, namespace = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData") - private ResourceAllocationCaption caption; - @XmlElement(name = "ChangeableType", nillable = true, namespace = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData") - private ResourceAllocationChangeableType changeableType; - @XmlElement(name = "ConfigurationName", nillable = true) - private CimString configurationName; - @XmlElement(name = "Connection", nillable = true) - private List connection; - @XmlElement(name = "ConsumerVisibility", nillable = true) - private ConsumerVisibility consumerVisibility; - @XmlElement(name = "Description", nillable = true) - private CimString description; - @XmlElement(name = "ElementName", required = true) - private CimString elementName; - @XmlElement(name = "Generation", nillable = true) - private CimUnsignedLong generation; - @XmlElement(name = "HostResource", nillable = true) - private List hostResource; - @XmlElement(name = "InstanceID", required = true) - private CimString instanceID; - @XmlElement(name = "Limit", nillable = true) - private CimUnsignedLong limit; - @XmlElement(name = "MappingBehavior", nillable = true) - private MappingBehavior mappingBehavior; - @XmlElement(name = "OtherResourceType", nillable = true) - private CimString otherResourceType; - @XmlElement(name = "Parent", nillable = true) - private CimString parent; - @XmlElement(name = "PoolID", nillable = true) - private CimString poolID; - @XmlElement(name = "Reservation", nillable = true) - private CimUnsignedLong reservation; - @XmlElement(name = "ResourceSubType", nillable = true) - private CimString resourceSubType; - @XmlElement(name = "ResourceType", nillable = true) - private ResourceType resourceType; - @XmlElement(name = "VirtualQuantity", nillable = true) - private CimUnsignedLong virtualQuantity; - @XmlElement(name = "VirtualQuantityUnits", nillable = true) - private CimString virtualQuantityUnits; - @XmlElement(name = "Weight", nillable = true) - private CimUnsignedInt weight; - @XmlAnyElement(lax = true) - private List any; - @XmlAnyAttribute - private Map otherAttributes = new HashMap(); - - protected CIMResourceAllocationSettingDataType() { - // For JAXB - } - - protected CIMResourceAllocationSettingDataType(Builder builder) { - this.address = builder.address; - this.addressOnParent = builder.addressOnParent; - this.allocationUnits = builder.allocationUnits; - this.automaticAllocation = builder.automaticAllocation; - this.automaticDeallocation = builder.automaticDeallocation; - this.caption = builder.caption; - this.changeableType = builder.changeableType; - this.configurationName = builder.configurationName; - this.connection = builder.connection; - this.consumerVisibility = builder.consumerVisibility; - this.description = builder.description; - this.elementName = builder.elementName; - this.generation = builder.generation; - this.hostResource = builder.hostResource; - this.instanceID = builder.instanceID; - this.limit = builder.limit; - this.mappingBehavior = builder.mappingBehavior; - this.otherResourceType = builder.otherResourceType; - this.parent = builder.parent; - this.poolID = builder.poolID; - this.reservation = builder.reservation; - this.resourceSubType = builder.resourceSubType; - this.resourceType = builder.resourceType; - this.virtualQuantity = builder.virtualQuantity; - this.virtualQuantityUnits = builder.virtualQuantityUnits; - this.weight = builder.weight; - this.any = builder.any; - this.otherAttributes = builder.otherAttributes; - } - - /** - * Gets the value of the address property. - * - * @return - * possible object is - * {@link CimString } - * - */ - public CimString getAddress() { - return address; - } - - /** - * Sets the value of the address property. - * - * @param value - * allowed object is - * {@link CimString } - * - */ - public void setAddress(CimString value) { - this.address = value; - } - - /** - * Gets the value of the addressOnParent property. - * - * @return - * possible object is - * {@link CimString } - * - */ - public CimString getAddressOnParent() { - return addressOnParent; - } - - /** - * Sets the value of the addressOnParent property. - * - * @param value - * allowed object is - * {@link CimString } - * - */ - public void setAddressOnParent(CimString value) { - this.addressOnParent = value; - } - - /** - * Gets the value of the allocationUnits property. - * - * @return - * possible object is - * {@link CimString } - * - */ - public CimString getAllocationUnits() { - return allocationUnits; - } - - /** - * Sets the value of the allocationUnits property. - * - * @param value - * allowed object is - * {@link CimString } - * - */ - public void setAllocationUnits(CimString value) { - this.allocationUnits = value; - } - - /** - * Gets the value of the automaticAllocation property. - * - * @return - * possible object is - * {@link CimBoolean } - * - */ - public CimBoolean getAutomaticAllocation() { - return automaticAllocation; - } - - /** - * Sets the value of the automaticAllocation property. - * - * @param value - * allowed object is - * {@link CimBoolean } - * - */ - public void setAutomaticAllocation(CimBoolean value) { - this.automaticAllocation = value; - } - - /** - * Gets the value of the automaticDeallocation property. - * - * @return - * possible object is - * {@link CimBoolean } - * - */ - public CimBoolean getAutomaticDeallocation() { - return automaticDeallocation; - } - - /** - * Sets the value of the automaticDeallocation property. - * - * @param value - * allowed object is - * {@link CimBoolean } - * - */ - public void setAutomaticDeallocation(CimBoolean value) { - this.automaticDeallocation = value; - } - - /** - * Gets the value of the caption property. - * - * @return - * possible object is - * {@link ResourceAllocationCaption } - * - */ - public ResourceAllocationCaption getCaption() { - return caption; - } - - /** - * Sets the value of the caption property. - * - * @param value - * allowed object is - * {@link ResourceAllocationCaption } - * - */ - public void setCaption(ResourceAllocationCaption value) { - this.caption = value; - } - - /** - * Gets the value of the changeableType property. - * - * @return - * possible object is - * {@link ResourceAllocationChangeableType } - * - */ - public ResourceAllocationChangeableType getChangeableType() { - return changeableType; - } - - /** - * Sets the value of the changeableType property. - * - * @param value - * allowed object is - * {@link ResourceAllocationChangeableType } - * - */ - public void setChangeableType(ResourceAllocationChangeableType value) { - this.changeableType = value; - } - - /** - * Gets the value of the configurationName property. - * - * @return - * possible object is - * {@link CimString } - * - */ - public CimString getConfigurationName() { - return configurationName; - } - - /** - * Sets the value of the configurationName property. - * - * @param value - * allowed object is - * {@link CimString } - * - */ - public void setConfigurationName(CimString value) { - this.configurationName = value; - } - - /** - * Gets the value of the connection property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the connection property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getConnection().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link CimString } - * - * - */ - public List getConnection() { - if (connection == null) { - connection = new ArrayList(); - } - return this.connection; - } - - /** - * Gets the value of the consumerVisibility property. - * - * @return - * possible object is - * {@link ConsumerVisibility } - * - */ - public ConsumerVisibility getConsumerVisibility() { - return consumerVisibility; - } - - /** - * Sets the value of the consumerVisibility property. - * - * @param value - * allowed object is - * {@link ConsumerVisibility } - * - */ - public void setConsumerVisibility(ConsumerVisibility value) { - this.consumerVisibility = value; - } - - /** - * Gets the value of the description property. - * - * @return - * possible object is - * {@link CimString } - * - */ - public CimString getDescription() { - return description; - } - - /** - * Sets the value of the description property. - * - * @param value - * allowed object is - * {@link CimString } - * - */ - public void setDescription(CimString value) { - this.description = value; - } - - /** - * Gets the value of the elementName property. - * - * @return - * possible object is - * {@link CimString } - * - */ - public CimString getElementName() { - return elementName; - } - - /** - * Sets the value of the elementName property. - * - * @param value - * allowed object is - * {@link CimString } - * - */ - public void setElementName(CimString value) { - this.elementName = value; - } - - /** - * Gets the value of the generation property. - * - * @return - * possible object is - * {@link CimUnsignedLong } - * - */ - public CimUnsignedLong getGeneration() { - return generation; - } - - /** - * Sets the value of the generation property. - * - * @param value - * allowed object is - * {@link CimUnsignedLong } - * - */ - public void setGeneration(CimUnsignedLong value) { - this.generation = value; - } - - /** - * Gets the value of the hostResource property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the hostResource property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getHostResource().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link CimString } - * - * - */ - public List getHostResource() { - if (hostResource == null) { - hostResource = new ArrayList(); - } - return this.hostResource; - } - - /** - * Gets the value of the instanceID property. - * - * @return - * possible object is - * {@link CimString } - * - */ - public CimString getInstanceID() { - return instanceID; - } - - /** - * Sets the value of the instanceID property. - * - * @param value - * allowed object is - * {@link CimString } - * - */ - public void setInstanceID(CimString value) { - this.instanceID = value; - } - - /** - * Gets the value of the limit property. - * - * @return - * possible object is - * {@link CimUnsignedLong } - * - */ - public CimUnsignedLong getLimit() { - return limit; - } - - /** - * Sets the value of the limit property. - * - * @param value - * allowed object is - * {@link CimUnsignedLong } - * - */ - public void setLimit(CimUnsignedLong value) { - this.limit = value; - } - - /** - * Gets the value of the mappingBehavior property. - * - * @return - * possible object is - * {@link MappingBehavior } - * - */ - public MappingBehavior getMappingBehavior() { - return mappingBehavior; - } - - /** - * Sets the value of the mappingBehavior property. - * - * @param value - * allowed object is - * {@link MappingBehavior } - * - */ - public void setMappingBehavior(MappingBehavior value) { - this.mappingBehavior = value; - } - - /** - * Gets the value of the otherResourceType property. - * - * @return - * possible object is - * {@link CimString } - * - */ - public CimString getOtherResourceType() { - return otherResourceType; - } - - /** - * Sets the value of the otherResourceType property. - * - * @param value - * allowed object is - * {@link CimString } - * - */ - public void setOtherResourceType(CimString value) { - this.otherResourceType = value; - } - - /** - * Gets the value of the parent property. - * - * @return - * possible object is - * {@link CimString } - * - */ - public CimString getParent() { - return parent; - } - - /** - * Sets the value of the parent property. - * - * @param value - * allowed object is - * {@link CimString } - * - */ - public void setParent(CimString value) { - this.parent = value; - } - - /** - * Gets the value of the poolID property. - * - * @return - * possible object is - * {@link CimString } - * - */ - public CimString getPoolID() { - return poolID; - } - - /** - * Sets the value of the poolID property. - * - * @param value - * allowed object is - * {@link CimString } - * - */ - public void setPoolID(CimString value) { - this.poolID = value; - } - - /** - * Gets the value of the reservation property. - * - * @return - * possible object is - * {@link CimUnsignedLong } - * - */ - public CimUnsignedLong getReservation() { - return reservation; - } - - /** - * Sets the value of the reservation property. - * - * @param value - * allowed object is - * {@link CimUnsignedLong } - * - */ - public void setReservation(CimUnsignedLong value) { - this.reservation = value; - } - - /** - * Gets the value of the resourceSubType property. - * - * @return - * possible object is - * {@link CimString } - * - */ - public CimString getResourceSubType() { - return resourceSubType; - } - - /** - * Sets the value of the resourceSubType property. - * - * @param value - * allowed object is - * {@link CimString } - * - */ - public void setResourceSubType(CimString value) { - this.resourceSubType = value; - } - - /** - * Gets the value of the resourceType property. - * - * @return - * possible object is - * {@link ResourceType } - * - */ - public ResourceType getResourceType() { - return resourceType; - } - - /** - * Sets the value of the resourceType property. - * - * @param value - * allowed object is - * {@link ResourceType } - * - */ - public void setResourceType(ResourceType value) { - this.resourceType = value; - } - - /** - * Gets the value of the virtualQuantity property. - * - * @return - * possible object is - * {@link CimUnsignedLong } - * - */ - public CimUnsignedLong getVirtualQuantity() { - return virtualQuantity; - } - - /** - * Sets the value of the virtualQuantity property. - * - * @param value - * allowed object is - * {@link CimUnsignedLong } - * - */ - public void setVirtualQuantity(CimUnsignedLong value) { - this.virtualQuantity = value; - } - - /** - * Gets the value of the virtualQuantityUnits property. - * - * @return - * possible object is - * {@link CimString } - * - */ - public CimString getVirtualQuantityUnits() { - return virtualQuantityUnits; - } - - /** - * Sets the value of the virtualQuantityUnits property. - * - * @param value - * allowed object is - * {@link CimString } - * - */ - public void setVirtualQuantityUnits(CimString value) { - this.virtualQuantityUnits = value; - } - - /** - * Gets the value of the weight property. - * - * @return - * possible object is - * {@link CimUnsignedInt } - * - */ - public CimUnsignedInt getWeight() { - return weight; - } - - /** - * Sets the value of the weight property. - * - * @param value - * allowed object is - * {@link CimUnsignedInt } - * - */ - public void setWeight(CimUnsignedInt value) { - this.weight = value; - } - - /** - * Gets the value of the any property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the any property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getAny().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link Object } - * {@link Element } - * - * - */ - public List getAny() { - if (any == null) { - any = new ArrayList(); - } - return this.any; - } - - /** - * Gets a map that contains attributes that aren't bound to any typed property on this class. - * - *

- * the map is keyed by the name of the attribute and - * the value is the string value of the attribute. - * - * the map returned by this method is live, and you can add new attribute - * by updating the map directly. Because of this design, there's no setter. - * - * - * @return - * always non-null - */ - public Map getOtherAttributes() { - return otherAttributes; - } - -} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/CimString.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/CimString.java index 4be7bc9e50..08c9f20323 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/CimString.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/CimString.java @@ -20,8 +20,13 @@ package org.jclouds.vcloud.director.v1_5.domain.cim; import static com.google.common.base.Objects.equal; +import java.util.HashMap; +import java.util.Map; + +import javax.xml.bind.annotation.XmlAnyAttribute; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlValue; +import javax.xml.namespace.QName; import com.google.common.base.Objects; @@ -45,6 +50,8 @@ public class CimString { @XmlValue protected String value; + @XmlAnyAttribute + private Map otherAttributes = new HashMap(); /** * Gets the value of the value property. @@ -57,6 +64,13 @@ public class CimString { this.value = value; } + /** + * Gets a map that contains attributes that aren't bound to any typed property on this class. + */ + public Map getOtherAttributes() { + return otherAttributes; + } + @Override public int hashCode() { return Objects.hashCode(value); diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/ResourceAllocationSettingData.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/ResourceAllocationSettingData.java index 4fcbee23f6..67dbd71f64 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/ResourceAllocationSettingData.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/ResourceAllocationSettingData.java @@ -22,7 +22,9 @@ import static com.google.common.base.Objects.equal; import static com.google.common.base.Preconditions.checkNotNull; import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_1_5_NS; import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_CIM_RASD_NS; +import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_OVF_NS; +import java.math.BigInteger; import java.net.URI; import java.util.Collections; import java.util.List; @@ -33,6 +35,7 @@ import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; +import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import org.jclouds.vcloud.director.v1_5.domain.Link; @@ -60,7 +63,35 @@ import com.google.common.collect.Sets; * @author grkvlt@apache.org * @see http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2.22.0/CIM_ResourceAllocationSettingData.xsd */ -@XmlType(name = "CIM_ResourceAllocationSettingData_Type", namespace = VCLOUD_CIM_RASD_NS) +@XmlRootElement(name = "Item", namespace = VCLOUD_1_5_NS) +@XmlType(name = "CIM_ResourceAllocationSettingData_Type", namespace = VCLOUD_OVF_NS, + propOrder = { + "address", + "addressOnParent", + "allocationUnits", + "automaticAllocation", + "automaticDeallocation", + "caption", + "connections", + "consumerVisibility", + "description", + "elementName", + "hostResources", + "instanceID", + "limit", + "mappingBehavior", + "otherResourceType", + "parent", + "poolID", + "reservation", + "resourceSubType", + "resourceType", + "virtualQuantity", + "virtualQuantityUnits", + "weight", + "links" + } +) public class ResourceAllocationSettingData { public static Builder builder() { @@ -73,37 +104,37 @@ public class ResourceAllocationSettingData { public static class Builder { - protected CimString elementName; - protected CimString instanceID; - protected CimString caption; - protected CimString description; - protected CimString address; - protected CimString addressOnParent; - protected CimString allocationUnits; - protected CimBoolean automaticAllocation; - protected CimBoolean automaticDeallocation; - protected ConsumerVisibility consumerVisibility; - protected CimUnsignedLong limit; - protected MappingBehavior mappingBehavior; - protected CimString otherResourceType; - protected CimString parent; - protected CimString poolID; - protected CimUnsignedLong reservation; - protected CimString resourceSubType; - protected ResourceType resourceType; - protected CimUnsignedLong virtualQuantity; - protected CimString virtualQuantityUnits; - protected CimUnsignedInt weight; - protected List connections = Lists.newArrayList(); - protected List hostResources = Lists.newArrayList(); - protected URI href; - protected String type; + private String elementName; + private String instanceID; + private String caption; + private String description; + private String address; + private String addressOnParent; + private String allocationUnits; + private Boolean automaticAllocation; + private Boolean automaticDeallocation; + private ConsumerVisibility consumerVisibility; + private BigInteger limit; + private MappingBehavior mappingBehavior; + private String otherResourceType; + private String parent; + private String poolID; + private BigInteger reservation; + private String resourceSubType; + private ResourceType resourceType; + private BigInteger virtualQuantity; + private String virtualQuantityUnits; + private Long weight; + private List connections = Lists.newArrayList(); + private List hostResources = Lists.newArrayList(); + private URI href; + private String type; private Set links = Sets.newLinkedHashSet(); /** * @see ResourceAllocationSettingData#getElementName() */ - public Builder elementName(CimString elementName) { + public Builder elementName(String elementName) { this.elementName = elementName; return this; } @@ -111,7 +142,7 @@ public class ResourceAllocationSettingData { /** *@see ResourceAllocationSettingData#getInstanceId() */ - public Builder instanceID(CimString instanceID) { + public Builder instanceID(String instanceID) { this.instanceID = instanceID; return this; } @@ -119,7 +150,7 @@ public class ResourceAllocationSettingData { /** * @see ResourceAllocationSettingData#getCaption() */ - public Builder caption(CimString caption) { + public Builder caption(String caption) { this.caption = caption; return this; } @@ -127,7 +158,7 @@ public class ResourceAllocationSettingData { /** * @see ResourceAllocationSettingData#getDescription() */ - public Builder description(CimString description) { + public Builder description(String description) { this.description = description; return this; } @@ -135,7 +166,7 @@ public class ResourceAllocationSettingData { /** * @see ResourceAllocationSettingData#getAddress */ - public Builder address(CimString address) { + public Builder address(String address) { this.address = address; return this; } @@ -143,7 +174,7 @@ public class ResourceAllocationSettingData { /** * @see ResourceAllocationSettingData#getAddressOnParent */ - public Builder addressOnParent(CimString addressOnParent) { + public Builder addressOnParent(String addressOnParent) { this.addressOnParent = addressOnParent; return this; } @@ -151,7 +182,7 @@ public class ResourceAllocationSettingData { /** * @see ResourceAllocationSettingData#getAllocationUnits */ - public Builder allocationUnits(CimString allocationUnits) { + public Builder allocationUnits(String allocationUnits) { this.allocationUnits = allocationUnits; return this; } @@ -159,7 +190,7 @@ public class ResourceAllocationSettingData { /** * @see ResourceAllocationSettingData#isAutomaticAllocation() */ - public Builder automaticAllocation(CimBoolean automaticAllocation) { + public Builder automaticAllocation(Boolean automaticAllocation) { this.automaticAllocation = automaticAllocation; return this; } @@ -167,7 +198,7 @@ public class ResourceAllocationSettingData { /** * @see ResourceAllocationSettingData#isAutomaticDeallocation() */ - public Builder automaticDeallocation(CimBoolean automaticDeallocation) { + public Builder automaticDeallocation(Boolean automaticDeallocation) { this.automaticDeallocation = automaticDeallocation; return this; } @@ -183,7 +214,7 @@ public class ResourceAllocationSettingData { /** * @see ResourceAllocationSettingData#getLimit */ - public Builder limit(CimUnsignedLong limit) { + public Builder limit(BigInteger limit) { this.limit = limit; return this; } @@ -199,7 +230,7 @@ public class ResourceAllocationSettingData { /** * @see ResourceAllocationSettingData#getOtherResourceType */ - public Builder otherResourceType(CimString otherResourceType) { + public Builder otherResourceType(String otherResourceType) { this.otherResourceType = otherResourceType; return this; } @@ -207,7 +238,7 @@ public class ResourceAllocationSettingData { /** * @see ResourceAllocationSettingData#getParent */ - public Builder parent(CimString parent) { + public Builder parent(String parent) { this.parent = parent; return this; } @@ -215,7 +246,7 @@ public class ResourceAllocationSettingData { /** * @see ResourceAllocationSettingData#getPoolID */ - public Builder poolID(CimString poolID) { + public Builder poolID(String poolID) { this.poolID = poolID; return this; } @@ -223,7 +254,7 @@ public class ResourceAllocationSettingData { /** * @see ResourceAllocationSettingData#getReservation */ - public Builder reservation(CimUnsignedLong reservation) { + public Builder reservation(BigInteger reservation) { this.reservation = reservation; return this; } @@ -231,7 +262,7 @@ public class ResourceAllocationSettingData { /** * @see ResourceAllocationSettingData#getResourceSubType */ - public Builder resourceSubType(CimString resourceSubType) { + public Builder resourceSubType(String resourceSubType) { this.resourceSubType = resourceSubType; return this; } @@ -247,7 +278,7 @@ public class ResourceAllocationSettingData { /** * @see ResourceAllocationSettingData#getVirtualQuantity */ - public Builder virtualQuantity(CimUnsignedLong virtualQuantity) { + public Builder virtualQuantity(BigInteger virtualQuantity) { this.virtualQuantity = virtualQuantity; return this; } @@ -255,7 +286,7 @@ public class ResourceAllocationSettingData { /** * @see ResourceAllocationSettingData#getVirtualQuantityUnits */ - public Builder virtualQuantityUnits(CimString virtualQuantityUnits) { + public Builder virtualQuantityUnits(String virtualQuantityUnits) { this.virtualQuantityUnits = virtualQuantityUnits; return this; } @@ -263,7 +294,7 @@ public class ResourceAllocationSettingData { /** * @see ResourceAllocationSettingData#getWeight */ - public Builder weight(CimUnsignedInt weight) { + public Builder weight(Long weight) { this.weight = weight; return this; } @@ -276,14 +307,6 @@ public class ResourceAllocationSettingData { return this; } - /** - * @see ResourceAllocationSettingData#getHostResources() - */ - public Builder hostResource(CimString hostResource) { - this.hostResources.add(checkNotNull(hostResource, "hostResource")); - return this; - } - /** * @see ResourceAllocationSettingData#getConnections */ @@ -292,6 +315,14 @@ public class ResourceAllocationSettingData { return this; } + /** + * @see ResourceAllocationSettingData#getHostResources() + */ + public Builder hostResource(CimString hostResource) { + this.hostResources.add(checkNotNull(hostResource, "hostResource")); + return this; + } + /** * @see ResourceAllocationSettingData#getHostResources */ @@ -528,66 +559,68 @@ public class ResourceAllocationSettingData { return MAPPING_BEHAVIOR_BY_ID.get(Integer.valueOf(checkNotNull(behavior, "behavior"))); } } + + // foo @XmlElement(name = "ElementName", namespace = VCLOUD_CIM_RASD_NS) - protected CimString elementName; + private String elementName; @XmlElement(name = "InstanceID", namespace = VCLOUD_CIM_RASD_NS) - protected CimString instanceID; + private String instanceID; @XmlElement(name = "Caption", namespace = VCLOUD_CIM_RASD_NS) - protected CimString caption; + private String caption; @XmlElement(name = "Description", namespace = VCLOUD_CIM_RASD_NS) - protected CimString description; + private String description; @XmlElement(name = "Address", namespace = VCLOUD_CIM_RASD_NS) - protected CimString address; + private String address; @XmlElement(name = "AddressOnParent", namespace = VCLOUD_CIM_RASD_NS) - protected CimString addressOnParent; + private String addressOnParent; @XmlElement(name = "AllocationUnits", namespace = VCLOUD_CIM_RASD_NS) - protected CimString allocationUnits; + private String allocationUnits; @XmlElement(name = "AutomaticAllocation", namespace = VCLOUD_CIM_RASD_NS) - protected CimBoolean automaticAllocation; + private Boolean automaticAllocation; @XmlElement(name = "AutomaticDeallocation", namespace = VCLOUD_CIM_RASD_NS) - protected CimBoolean automaticDeallocation; + private Boolean automaticDeallocation; @XmlElement(name = "ConsumerVisibility", namespace = VCLOUD_CIM_RASD_NS) - protected ConsumerVisibility consumerVisibility; + private ConsumerVisibility consumerVisibility; @XmlElement(name = "Limit", namespace = VCLOUD_CIM_RASD_NS) - protected CimUnsignedLong limit; + private BigInteger limit; @XmlElement(name = "MappingBehavior", namespace = VCLOUD_CIM_RASD_NS) - protected MappingBehavior mappingBehavior; + private MappingBehavior mappingBehavior; @XmlElement(name = "OtherResourceType", namespace = VCLOUD_CIM_RASD_NS) - protected CimString otherResourceType; + private String otherResourceType; @XmlElement(name = "Parent", namespace = VCLOUD_CIM_RASD_NS) - protected CimString parent; + private String parent; @XmlElement(name = "PoolID", namespace = VCLOUD_CIM_RASD_NS) - protected CimString poolID; + private String poolID; @XmlElement(name = "Reservation", namespace = VCLOUD_CIM_RASD_NS) - protected CimUnsignedLong reservation; + private BigInteger reservation; @XmlElement(name = "ResourceSubType", namespace = VCLOUD_CIM_RASD_NS) - protected CimString resourceSubType; + private String resourceSubType; @XmlElement(name = "ResourceType", namespace = VCLOUD_CIM_RASD_NS) - protected ResourceType resourceType; + private ResourceType resourceType; @XmlElement(name = "VirtualQuantity", namespace = VCLOUD_CIM_RASD_NS) - protected CimUnsignedLong virtualQuantity; + private BigInteger virtualQuantity; @XmlElement(name = "VirtualQuantityUnits", namespace = VCLOUD_CIM_RASD_NS) - protected CimString virtualQuantityUnits; + private String virtualQuantityUnits; @XmlElement(name = "Weight", namespace = VCLOUD_CIM_RASD_NS) - protected CimUnsignedInt weight; + private Long weight; @XmlElement(name = "Connection", namespace = VCLOUD_CIM_RASD_NS) - protected List connections; + private List connections = Lists.newArrayList(); @XmlElement(name = "HostResource", namespace = VCLOUD_CIM_RASD_NS) - protected List hostResources; + private List hostResources = Lists.newArrayList(); @XmlAttribute(name = "type", namespace = VCLOUD_1_5_NS) - protected String type; + private String type; @XmlAttribute(name = "href", namespace = VCLOUD_1_5_NS) - protected URI href; + private URI href; @XmlElement(name = "Link", namespace = VCLOUD_1_5_NS) private Set links = Sets.newLinkedHashSet(); - private ResourceAllocationSettingData(CimString elementName, CimString instanceID, CimString caption, CimString description, - CimString address, CimString addressOnParent, CimString allocationUnits, CimBoolean automaticAllocation, - CimBoolean automaticDeallocation, ConsumerVisibility consumerVisibility, CimUnsignedLong limit, - MappingBehavior mappingBehavior, CimString otherResourceType, CimString parent, CimString poolID, CimUnsignedLong reservation, - CimString resourceSubType, ResourceType resourceType, CimUnsignedLong virtualQuantity, CimString virtualQuantityUnits, - CimUnsignedInt weight, List connections, List hostResources, String type, URI href, Set links) { + private ResourceAllocationSettingData(String elementName, String instanceID, String caption, String description, + String address, String addressOnParent, String allocationUnits, Boolean automaticAllocation, + Boolean automaticDeallocation, ConsumerVisibility consumerVisibility, BigInteger limit, + MappingBehavior mappingBehavior, String otherResourceType, String parent, String poolID, BigInteger reservation, + String resourceSubType, ResourceType resourceType, BigInteger virtualQuantity, String virtualQuantityUnits, + Long weight, List connections, List hostResources, String type, URI href, Set links) { this.elementName = elementName; this.instanceID = instanceID; this.caption = caption; @@ -625,7 +658,7 @@ public class ResourceAllocationSettingData { * can be used as an index property for a search or query. (Note: The name does not have to be * unique within a namespace.) */ - public CimString getElementName() { + public String getElementName() { return elementName; } @@ -633,21 +666,21 @@ public class ResourceAllocationSettingData { * Within the scope of the instantiating Namespace, InstanceID opaquely and uniquely identifies * an instance of this class. */ - public CimString getInstanceID() { + public String getInstanceID() { return instanceID; } /** * The Caption property is a short textual description (one- line string) of the object. */ - public CimString getCaption() { + public String getCaption() { return caption; } /** * The Description property provides a textual description of the object. */ - public CimString getDescription() { + public String getDescription() { return description; } @@ -655,7 +688,7 @@ public class ResourceAllocationSettingData { * The address of the resource. For example, the MAC address of a Ethernet * port. */ - public CimString getAddress() { + public String getAddress() { return address; } @@ -666,7 +699,7 @@ public class ResourceAllocationSettingData { * if the parent is a PCI Controller, this property would specify the PCI * slot of this child device. */ - public CimString getAddressOnParent() { + public String getAddressOnParent() { return addressOnParent; } @@ -680,7 +713,7 @@ public class ResourceAllocationSettingData { * value of the Programmatic Units qualifier as defined in Annex C.1 of * DSP0004 V2.5 or later. */ - public CimString getAllocationUnits() { + public String getAllocationUnits() { return allocationUnits; } @@ -693,7 +726,7 @@ public class ResourceAllocationSettingData { * on time, the media is not present. An explicit operation is required to * allocate the resource. */ - public CimBoolean isAutomaticAllocation() { + public Boolean isAutomaticAllocation() { return automaticAllocation; } @@ -704,7 +737,7 @@ public class ResourceAllocationSettingData { * set to false, the resource will remain allocated and must be explicitly * de-allocated. */ - public CimBoolean isAutomaticDeallocation() { + public Boolean isAutomaticDeallocation() { return automaticDeallocation; } @@ -723,7 +756,7 @@ public class ResourceAllocationSettingData { * for this allocation. The value of the Limit property is expressed in the * unit specified by the value of the AllocationUnits property. */ - public CimUnsignedLong getLimit() { + public BigInteger getLimit() { return limit; } @@ -740,7 +773,7 @@ public class ResourceAllocationSettingData { * A string that describes the resource type when a well defined value is not * available and ResourceType has the value "Other". */ - public CimString getOtherResourceType() { + public String getOtherResourceType() { return otherResourceType; } @@ -748,7 +781,7 @@ public class ResourceAllocationSettingData { * The Parent of the resource. For example, a controller for the current * allocation */ - public CimString getParent() { + public String getParent() { return parent; } @@ -757,7 +790,7 @@ public class ResourceAllocationSettingData { * allocated from, or which ResourcePool the resource will be allocated from * when the allocation occurs. */ - public CimString getPoolID() { + public String getPoolID() { return poolID; } @@ -769,7 +802,7 @@ public class ResourceAllocationSettingData { * the Reservation property is expressed in the unit specified by the value * of the AllocationUnits property. */ - public CimUnsignedLong getReservation() { + public BigInteger getReservation() { return reservation; } @@ -777,7 +810,7 @@ public class ResourceAllocationSettingData { * A string describing an implementation specific sub-type for this resource. * F */ - public CimString getResourceSubType() { + public String getResourceSubType() { return resourceSubType; } @@ -797,7 +830,7 @@ public class ResourceAllocationSettingData { * VirtualQuantity property should be expressed in units as defined by the * value of the VirtualQuantityUnits property. */ - public CimUnsignedLong getVirtualQuantity() { + public BigInteger getVirtualQuantity() { return virtualQuantity; } @@ -813,7 +846,7 @@ public class ResourceAllocationSettingData { * this property shall be a legal value of the Programmatic Units qualifier * as defined in Annex C.1 of DSP0004 V2.5 or later. */ - public CimString getVirtualQuantityUnits() { + public String getVirtualQuantityUnits() { return virtualQuantityUnits; } @@ -823,7 +856,7 @@ public class ResourceAllocationSettingData { * has no unit of measure, and is only relevant when compared to other * allocations vying for the same host resources. */ - public CimUnsignedInt getWeight() { + public Long getWeight() { return weight; } @@ -918,7 +951,7 @@ public class ResourceAllocationSettingData { public boolean equals(Object obj) { if (this == obj) return true; - if (!super.equals(obj)) + if (obj == null) return false; if (getClass() != obj.getClass()) return false; @@ -949,7 +982,6 @@ public class ResourceAllocationSettingData { equal(this.type, that.type) && equal(this.href, that.href) && equal(this.links, that.links); - } } \ No newline at end of file diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/VirtualSystemSettingData.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/VirtualSystemSettingData.java index c31d88dd47..81b6a584c8 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/VirtualSystemSettingData.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/VirtualSystemSettingData.java @@ -21,7 +21,9 @@ package org.jclouds.vcloud.director.v1_5.domain.cim; import static com.google.common.base.Objects.equal; import static com.google.common.base.Preconditions.checkNotNull; import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_CIM_VSSD_NS; +import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_OVF_NS; +import java.math.BigInteger; import java.util.Date; import java.util.Map; @@ -58,7 +60,7 @@ import com.google.common.collect.Maps; * @author grkvlt@apache.org * @see http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2.22.0/CIM_VirtualSystemSettingData.xsd */ -@XmlType(name = "CIM_VirtualSystemSettingData_Type", namespace = VCLOUD_CIM_VSSD_NS) +@XmlType(name = "CIM_VirtualSystemSettingData_Type", namespace = VCLOUD_OVF_NS) public class VirtualSystemSettingData { public static Builder builder() { @@ -71,44 +73,44 @@ public class VirtualSystemSettingData { public static class Builder { - protected CimString elementName; - protected CimString instanceID; - private CimString caption; - private CimString description; + private String elementName; + private String instanceID; + private String caption; + private String description; private AutomaticRecoveryAction automaticRecoveryAction; private AutomaticShutdownAction automaticShutdownAction; private AutomaticStartupAction automaticStartupAction; - private CimUnsignedLong automaticStartupActionDelay; - private CimUnsignedInt automaticStartupActionSequenceNumber; - private CimString configurationDataRoot; - private CimString configurationFile; - private CimString configurationID; + private BigInteger automaticStartupActionDelay; + private Long automaticStartupActionSequenceNumber; + private String configurationDataRoot; + private String configurationFile; + private String configurationID; private Date creationTime; - private CimString logDataRoot; - private CimString recoveryFile; - private CimString snapshotDataRoot; - private CimString suspendDataRoot; - private CimString swapFileDataRoot; - private CimString virtualSystemIdentifier; - private CimString virtualSystemType; - private CimString notes; + private String logDataRoot; + private String recoveryFile; + private String snapshotDataRoot; + private String suspendDataRoot; + private String swapFileDataRoot; + private String virtualSystemIdentifier; + private String virtualSystemType; + private String notes; - public Builder elementName(CimString elementName) { + public Builder elementName(String elementName) { this.elementName = elementName; return this; } - public Builder instanceID(CimString instanceID) { + public Builder instanceID(String instanceID) { this.instanceID = instanceID; return this; } - public Builder caption(CimString caption) { + public Builder caption(String caption) { this.caption = caption; return this; } - public Builder description(CimString description) { + public Builder description(String description) { this.description = description; return this; } @@ -128,27 +130,27 @@ public class VirtualSystemSettingData { return this; } - public Builder automaticStartupActionDelay(CimUnsignedLong automaticStartupActionDelay) { + public Builder automaticStartupActionDelay(BigInteger automaticStartupActionDelay) { this.automaticStartupActionDelay = automaticStartupActionDelay; return this; } - public Builder automaticStartupActionSequenceNumber(CimUnsignedInt automaticStartupActionSequenceNumber) { + public Builder automaticStartupActionSequenceNumber(Long automaticStartupActionSequenceNumber) { this.automaticStartupActionSequenceNumber = automaticStartupActionSequenceNumber; return this; } - public Builder configurationDataRoot(CimString configurationDataRoot) { + public Builder configurationDataRoot(String configurationDataRoot) { this.configurationDataRoot = configurationDataRoot; return this; } - public Builder configurationFile(CimString configurationFile) { + public Builder configurationFile(String configurationFile) { this.configurationFile = configurationFile; return this; } - public Builder configurationID(CimString configurationID) { + public Builder configurationID(String configurationID) { this.configurationID = configurationID; return this; } @@ -158,42 +160,42 @@ public class VirtualSystemSettingData { return this; } - public Builder logDataRoot(CimString logDataRoot) { + public Builder logDataRoot(String logDataRoot) { this.logDataRoot = logDataRoot; return this; } - public Builder recoveryFile(CimString recoveryFile) { + public Builder recoveryFile(String recoveryFile) { this.recoveryFile = recoveryFile; return this; } - public Builder snapshotDataRoot(CimString snapshotDataRoot) { + public Builder snapshotDataRoot(String snapshotDataRoot) { this.snapshotDataRoot = snapshotDataRoot; return this; } - public Builder suspendDataRoot(CimString suspendDataRoot) { + public Builder suspendDataRoot(String suspendDataRoot) { this.suspendDataRoot = suspendDataRoot; return this; } - public Builder swapFileDataRoot(CimString swapFileDataRoot) { + public Builder swapFileDataRoot(String swapFileDataRoot) { this.swapFileDataRoot = swapFileDataRoot; return this; } - public Builder virtualSystemIdentifier(CimString virtualSystemIdentifier) { + public Builder virtualSystemIdentifier(String virtualSystemIdentifier) { this.virtualSystemIdentifier = virtualSystemIdentifier; return this; } - public Builder virtualSystemType(CimString virtualSystemType) { + public Builder virtualSystemType(String virtualSystemType) { this.virtualSystemType = virtualSystemType; return this; } - public Builder notes(CimString notes) { + public Builder notes(String notes) { this.notes = notes; return this; } @@ -338,17 +340,17 @@ public class VirtualSystemSettingData { } @XmlElement(name = "ElementName", namespace = VCLOUD_CIM_VSSD_NS) - protected CimString elementName; + private String elementName; @XmlElement(name = "InstanceID", namespace = VCLOUD_CIM_VSSD_NS) - protected CimString instanceID; + private String instanceID; @XmlElement(name = "Caption", namespace = VCLOUD_CIM_VSSD_NS) - protected CimString caption; + private String caption; @XmlElement(name = "Description", namespace = VCLOUD_CIM_VSSD_NS) - protected CimString description; + private String description; @XmlElement(name = "VirtualSystemIdentifier", namespace = VCLOUD_CIM_VSSD_NS) - private CimString virtualSystemIdentifier; + private String virtualSystemIdentifier; @XmlElement(name = "VirtualSystemType", namespace = VCLOUD_CIM_VSSD_NS) - private CimString virtualSystemType; + private String virtualSystemType; @XmlElement(name = "AutomaticRecoveryAction", namespace = VCLOUD_CIM_VSSD_NS) private AutomaticRecoveryAction automaticRecoveryAction; @XmlElement(name = "AutomaticShutdownAction", namespace = VCLOUD_CIM_VSSD_NS) @@ -356,37 +358,37 @@ public class VirtualSystemSettingData { @XmlElement(name = "AutomaticStartupAction", namespace = VCLOUD_CIM_VSSD_NS) private AutomaticStartupAction automaticStartupAction; @XmlElement(name = "AutomaticStartupActionDelay", namespace = VCLOUD_CIM_VSSD_NS) - private CimUnsignedLong automaticStartupActionDelay; + private BigInteger automaticStartupActionDelay; @XmlElement(name = "AutomaticStartupActionSequenceNumber", namespace = VCLOUD_CIM_VSSD_NS) - private CimUnsignedInt automaticStartupActionSequenceNumber; + private Long automaticStartupActionSequenceNumber; @XmlElement(name = "ConfigurationDataRoot", namespace = VCLOUD_CIM_VSSD_NS) - private CimString configurationDataRoot; + private String configurationDataRoot; @XmlElement(name = "ConfigurationFile", namespace = VCLOUD_CIM_VSSD_NS) - private CimString configurationFile; + private String configurationFile; @XmlElement(name = "ConfigurationID", namespace = VCLOUD_CIM_VSSD_NS) - private CimString configurationID; + private String configurationID; @XmlElement(name = "CreationTime", namespace = VCLOUD_CIM_VSSD_NS) private Date creationTime; @XmlElement(name = "LogDataRoot", namespace = VCLOUD_CIM_VSSD_NS) - private CimString logDataRoot; + private String logDataRoot; @XmlElement(name = "RecoveryFile", namespace = VCLOUD_CIM_VSSD_NS) - private CimString recoveryFile; + private String recoveryFile; @XmlElement(name = "SnapshotDataRoot", namespace = VCLOUD_CIM_VSSD_NS) - private CimString snapshotDataRoot; + private String snapshotDataRoot; @XmlElement(name = "SuspendDataRoot", namespace = VCLOUD_CIM_VSSD_NS) - private CimString suspendDataRoot; + private String suspendDataRoot; @XmlElement(name = "SwapFileDataRoot", namespace = VCLOUD_CIM_VSSD_NS) - private CimString swapFileDataRoot; + private String swapFileDataRoot; @XmlElement(name = "Notes", namespace = VCLOUD_CIM_VSSD_NS) - private CimString notes; + private String notes; - private VirtualSystemSettingData(CimString elementName, CimString instanceID, CimString caption, CimString description, + private VirtualSystemSettingData(String elementName, String instanceID, String caption, String description, AutomaticRecoveryAction automaticRecoveryAction, AutomaticShutdownAction automaticShutdownAction, - AutomaticStartupAction automaticStartupAction, CimUnsignedLong automaticStartupActionDelay, - CimUnsignedInt automaticStartupActionSequenceNumber, CimString configurationDataRoot, CimString configurationFile, - CimString configurationID, Date creationTime, CimString logDataRoot, CimString recoveryFile, CimString snapshotDataRoot, - CimString suspendDataRoot, CimString swapFileDataRoot, CimString virtualSystemIdentifier, - CimString virtualSystemType, CimString notes) { + AutomaticStartupAction automaticStartupAction, BigInteger automaticStartupActionDelay, + Long automaticStartupActionSequenceNumber, String configurationDataRoot, String configurationFile, + String configurationID, Date creationTime, String logDataRoot, String recoveryFile, String snapshotDataRoot, + String suspendDataRoot, String swapFileDataRoot, String virtualSystemIdentifier, + String virtualSystemType, String notes) { this.elementName = elementName; this.instanceID = instanceID; this.caption = caption; @@ -419,7 +421,7 @@ public class VirtualSystemSettingData { * can be used as an index property for a search or query. (Note: The name does not have to be * unique within a namespace.) */ - public CimString getElementName() { + public String getElementName() { return elementName; } @@ -427,21 +429,21 @@ public class VirtualSystemSettingData { * Within the scope of the instantiating Namespace, InstanceID opaquely and uniquely identifies * an instance of this class. */ - public CimString getInstanceID() { + public String getInstanceID() { return instanceID; } /** * The Caption property is a short textual description (one- line string) of the object. */ - public CimString getCaption() { + public String getCaption() { return caption; } /** * The Description property provides a textual description of the object. */ - public CimString getDescription() { + public String getDescription() { return description; } @@ -472,7 +474,7 @@ public class VirtualSystemSettingData { * Delay applicable to startup action. The value shall be in the interval variant of the datetime * datatype. */ - public CimUnsignedLong getAutomaticStartupActionDelay() { + public BigInteger getAutomaticStartupActionDelay() { return automaticStartupActionDelay; } @@ -482,7 +484,7 @@ public class VirtualSystemSettingData { * same value, the sequence is implementation dependent. A value of 0 indicates that the sequence * is implementation dependent. */ - public CimUnsignedInt getAutomaticStartupActionSequenceNumber() { + public Long getAutomaticStartupActionSequenceNumber() { return automaticStartupActionSequenceNumber; } @@ -490,9 +492,9 @@ public class VirtualSystemSettingData { * Filepath of a directory where information about the virtual system configuration is * stored. * - * Format shall be CimString based on RFC-2079. + * Format shall be String based on RFC-2079. */ - public CimString getConfigurationDataRoot() { + public String getConfigurationDataRoot() { return configurationDataRoot; } @@ -501,9 +503,9 @@ public class VirtualSystemSettingData { * * A relative path appends to the value of the {@link #getConfigurationDataRoot()} property. *

- * Format shall be CimString based on RFC-2079. + * Format shall be String based on RFC-2079. */ - public CimString getConfigurationFile() { + public String getConfigurationFile() { return configurationFile; } @@ -512,7 +514,7 @@ public class VirtualSystemSettingData { * the InstanceID as it is assigned by the implementation to a virtual system or a virtual system * configuration. It is not a key, and the same value may occur within more than one instance. */ - public CimString getConfigurationID() { + public String getConfigurationID() { return configurationID; } @@ -528,18 +530,18 @@ public class VirtualSystemSettingData { * * A relative path appends to the value of the {@link #getConfigurationDataRoot()} property. *

- * Format shall be CimString based on RFC-2079. + * Format shall be String based on RFC-2079. */ - public CimString getLogDataRoot() { + public String getLogDataRoot() { return logDataRoot; } /** * Filepath of a file where recovery relateded information of the virtual system is stored. * - * Format shall be CimString based on RFC-2079. + * Format shall be String based on RFC-2079. */ - public CimString getRecoveryFile() { + public String getRecoveryFile() { return recoveryFile; } @@ -548,9 +550,9 @@ public class VirtualSystemSettingData { * * A relative path appends to the value of the {@link #getConfigurationDataRoot()} property. *

- * Format shall be CimString based on RFC-2079. + * Format shall be String based on RFC-2079. */ - public CimString getSnapshotDataRoot() { + public String getSnapshotDataRoot() { return snapshotDataRoot; } @@ -559,9 +561,9 @@ public class VirtualSystemSettingData { * * A relative path appends to the value of the {@link #getConfigurationDataRoot()} property. *

- * Format shall be CimString based on RFC-2079. + * Format shall be String based on RFC-2079. */ - public CimString getSuspendDataRoot() { + public String getSuspendDataRoot() { return suspendDataRoot; } @@ -570,9 +572,9 @@ public class VirtualSystemSettingData { * * A relative path appends to the value of the {@link #getConfigurationDataRoot()} property. *

- * Format shall be CimString based on RFC-2079. + * Format shall be String based on RFC-2079. */ - public CimString getSwapFileDataRoot() { + public String getSwapFileDataRoot() { return swapFileDataRoot; } @@ -586,21 +588,21 @@ public class VirtualSystemSettingData { * may contain implementation specific rules (like simple patterns or regular expresssion) that * may be interpreted by the implementation when assigning a VirtualSystemIdentifier. */ - public CimString getVirtualSystemIdentifier() { + public String getVirtualSystemIdentifier() { return virtualSystemIdentifier; } /** * VirtualSystemType shall reflect a particular type of virtual system. */ - public CimString getVirtualSystemType() { + public String getVirtualSystemType() { return virtualSystemType; } /** * End-user supplied notes that are related to the virtual system. */ - public CimString getNotes() { + public String getNotes() { return notes; } diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/package-info.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/package-info.java index ae71227f60..f0e64b476d 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/package-info.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/package-info.java @@ -19,18 +19,19 @@ @XmlSchema(namespace = VCLOUD_CIM_NS, elementFormDefault = XmlNsForm.QUALIFIED, xmlns = { @XmlNs(prefix = "cim", namespaceURI = VCLOUD_CIM_NS), + @XmlNs(prefix = "ovf", namespaceURI = VCLOUD_OVF_NS), @XmlNs(prefix = "vssd", namespaceURI = VCLOUD_CIM_VSSD_NS), @XmlNs(prefix = "rasd", namespaceURI = VCLOUD_CIM_RASD_NS), @XmlNs(prefix = "vcloud", namespaceURI = VCLOUD_1_5_NS) } ) -// http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData @XmlAccessorType(XmlAccessType.FIELD) package org.jclouds.vcloud.director.v1_5.domain.cim; import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_1_5_NS; import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_CIM_NS; import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_CIM_VSSD_NS; import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_CIM_RASD_NS; +import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_OVF_NS; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/RASD.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/RASD.java deleted file mode 100644 index 2f7b528d1e..0000000000 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/RASD.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Licensed to jclouds, Inc. (jclouds) under one or more - * contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. jclouds licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.jclouds.vcloud.director.v1_5.domain.ovf; - -import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_OVF_NS; -import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_1_5_NS; - -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; - -import org.jclouds.vcloud.director.v1_5.domain.cim.CIMResourceAllocationSettingDataType; - -/** - * Wrapper for CIM_ResourceAllocationSettingData_Type - * - *

- * <complexType name="RASD_Type" />
- * 
- * - * @author grkvlt@apache.org - */ -@XmlType(name = "RASD_Type") -@XmlRootElement(name = "Item", namespace = VCLOUD_1_5_NS) -public class RASD extends CIMResourceAllocationSettingDataType { - - // TODO Add toString, hashCode and equals - - public static Builder builder() { - return new ConcreteBuilder(); - } - - @Override - public Builder toBuilder() { - return builder().fromRASD(this); - } - - public static class Builder> extends CIMResourceAllocationSettingDataType.Builder { - - private Boolean required; - private String configuration; - private String bound; - - public B required(Boolean val) { - this.required = val; - return self(); - } - - public B configuration(String val) { - this.configuration = val; - return self(); - } - - public B bound(String val) { - this.bound = val; - return self(); - } - - public B fromRASD(RASD val) { - return fromCIMResourceAllocationSettingDataType(val).required(val.isRequired()).configuration(val.getConfiguration()).bound(val.getBound()); - } - - @Override - public RASD build() { - return new RASD(this); - } - } - - private static class ConcreteBuilder extends Builder { - } - - @XmlAttribute(namespace = VCLOUD_OVF_NS) - private Boolean required; - @XmlAttribute(namespace = VCLOUD_OVF_NS) - private String configuration; - @XmlAttribute(namespace = VCLOUD_OVF_NS) - private String bound; - - protected RASD() { - // For JAXB - } - - protected RASD(Builder builder) { - super(builder); - this.required = builder.required; - this.configuration = builder.configuration; - this.bound = builder.bound; - } - - /** - * Gets the value of the required property. - * - * @return possible object is {@link Boolean } - */ - public boolean isRequired() { - if (required == null) { - return true; - } else { - return required; - } - } - - /** - * Gets the value of the configuration property. - * - * @return possible object is {@link String } - */ - public String getConfiguration() { - return configuration; - } - - /** - * Gets the value of the bound property. - * - * @return possible object is {@link String } - */ - public String getBound() { - return bound; - } -} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/SectionType.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/SectionType.java index 5cfc8bfb82..70ae7d6d09 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/SectionType.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/SectionType.java @@ -73,7 +73,6 @@ public abstract class SectionType { public static abstract class Builder> { private String info; private Boolean required; - private Set links = Sets.newLinkedHashSet(); @SuppressWarnings("unchecked") protected B self() { @@ -114,40 +113,19 @@ public abstract class SectionType { return self(); } - /** - * @see ResourceType#getLinks() - */ - public B links(Set links) { - this.links = Sets.newLinkedHashSet(checkNotNull(links, "links")); - return self(); - } - - /** - * @see ResourceType#getLinks() - */ - public B link(Link link) { - if (links == null) - links = Sets.newLinkedHashSet(); - this.links.add(checkNotNull(link, "link")); - return self(); - } - public B fromSectionType(SectionType in) { - return info(in.getInfo()).required(in.isRequired()).links(Sets.newLinkedHashSet(in.getLinks())); + return info(in.getInfo()).required(in.isRequired()); } } @XmlElement(name = "Info", required = true) private String info; - @XmlAttribute(namespace = VCLOUD_OVF_NS) + @XmlAttribute private Boolean required; - @XmlElement(name = "Link", namespace = VCLOUD_1_5_NS) - private Set links = Sets.newLinkedHashSet(); protected SectionType(Builder builder) { this.info = builder.info; this.required = builder.required; - this.links = builder.links != null ? ImmutableSet.copyOf(builder.links) : Collections.emptySet(); } protected SectionType() { @@ -171,16 +149,9 @@ public abstract class SectionType { return required; } - /** - * Set of optional links to an entity or operation associated with this object. - */ - public Set getLinks() { - return links != null ? ImmutableSet.copyOf(links) : Collections.emptySet(); - } - @Override public int hashCode() { - return Objects.hashCode(info, required, links); + return Objects.hashCode(info, required); } @Override @@ -192,7 +163,7 @@ public abstract class SectionType { if (getClass() != obj.getClass()) return false; SectionType other = (SectionType) obj; - return equal(this.info, other.info) && equal(this.required, other.required) && equal(this.links, other.links); + return equal(this.info, other.info) && equal(this.required, other.required); } @Override @@ -201,7 +172,7 @@ public abstract class SectionType { } protected Objects.ToStringHelper string() { - return Objects.toStringHelper("").add("info", info).add("required", required).add("links", links); + return Objects.toStringHelper("").add("info", info).add("required", required); } } \ No newline at end of file diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/VirtualHardwareSection.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/VirtualHardwareSection.java index 0b0d493840..1a24c165cd 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/VirtualHardwareSection.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/VirtualHardwareSection.java @@ -20,15 +20,19 @@ package org.jclouds.vcloud.director.v1_5.domain.ovf; import static com.google.common.base.Objects.equal; import static com.google.common.base.Preconditions.checkNotNull; +import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_1_5_NS; +import java.net.URI; import java.util.Collections; import java.util.Set; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlSchemaType; import javax.xml.bind.annotation.XmlType; +import org.jclouds.vcloud.director.v1_5.domain.Link; import org.jclouds.vcloud.director.v1_5.domain.cim.ResourceAllocationSettingData; import org.jclouds.vcloud.director.v1_5.domain.cim.VirtualSystemSettingData; @@ -65,9 +69,12 @@ public class VirtualHardwareSection extends SectionType { public static class Builder> extends SectionType.Builder { - protected VirtualSystemSettingData virtualSystem; - protected String transport; - protected Set items = Sets.newLinkedHashSet(); + private VirtualSystemSettingData virtualSystem; + private String transport; + private Set items = Sets.newLinkedHashSet(); + private Set links = Sets.newLinkedHashSet(); + private URI href; + private String type; /** * @see VirtualHardwareSection#getSystem @@ -117,6 +124,38 @@ public class VirtualHardwareSection extends SectionType { return self(); } + /** + * @see VirtualHardwareSection#getLinks() + */ + public B links(Set links) { + this.links = checkNotNull(links, "links"); + return self(); + } + + /** + * @see VirtualHardwareSection#getLinks() + */ + public B link(Link link) { + this.links.add(checkNotNull(link, "link")); + return self(); + } + + /** + * @see VirtualHardwareSection#getHref() + */ + public B href(URI href) { + this.href = href; + return self(); + } + + /** + * @see VirtualHardwareSection#getType() + */ + public B type(String type) { + this.type = type; + return self(); + } + /** * {@inheritDoc} */ @@ -129,7 +168,10 @@ public class VirtualHardwareSection extends SectionType { return fromSectionType(in) .items(in.getItems()) .transport(in.getTransport()) - .system(in.getSystem()); + .system(in.getSystem()) + .links(Sets.newLinkedHashSet(in.getLinks())) + .href(in.getHref()) + .type(in.getType()); } } @@ -139,12 +181,22 @@ public class VirtualHardwareSection extends SectionType { private String transport; @XmlElement(name = "Item") private Set items = Sets.newLinkedHashSet(); + @XmlElement(name = "Link", namespace = VCLOUD_1_5_NS) + protected Set links = Sets.newLinkedHashSet(); + @XmlAttribute(namespace = VCLOUD_1_5_NS) + @XmlSchemaType(name = "anyURI") + protected URI href; + @XmlAttribute(namespace = VCLOUD_1_5_NS) + protected String type; private VirtualHardwareSection(Builder builder) { super(builder); this.virtualSystem = builder.virtualSystem; this.transport = builder.transport; - this.items = builder.items != null ? ImmutableSet.copyOf(builder.items) : Collections.emptySet(); + this.items = builder.items != null ? ImmutableSet.copyOf(builder.items) : Sets.newLinkedHashSet(); + this.links = builder.links != null ? ImmutableSet.copyOf(builder.links) : Sets.newLinkedHashSet(); + this.href = builder.href; + this.type = builder.type; } private VirtualHardwareSection() { @@ -178,13 +230,36 @@ public class VirtualHardwareSection extends SectionType { return virtualSystem; } - public Set getItems() { - return items; + public Set getItems() { + return ImmutableSet.copyOf(items); + } + + /** + * Gets the value of the link property. + */ + public Set getLinks() { + return ImmutableSet.copyOf(links); + } + + /** + * @return the value of the href property. + */ + public URI getHref() { + return href; + } + + /** + * Gets the value of the type property. + * + * @return possible object is {@link String } + */ + public String getType() { + return type; } @Override public int hashCode() { - return Objects.hashCode(super.hashCode(), transport, virtualSystem, items); + return Objects.hashCode(super.hashCode(), transport, virtualSystem, items, links, href, type); } @Override @@ -196,11 +271,14 @@ public class VirtualHardwareSection extends SectionType { return super.equals(that) && equal(this.transport, that.transport) && equal(this.virtualSystem, that.virtualSystem) && - equal(this.items, that.items); + equal(this.items, that.items) && + equal(this.links, that.links) && + equal(this.href, that.href) && + equal(this.type, that.type); } @Override protected Objects.ToStringHelper string() { - return super.string().add("transport", transport).add("virtualSystem", virtualSystem).add("items", items); + return super.string().add("transport", transport).add("virtualSystem", virtualSystem).add("items", items).add("links", links).add("href", href).add("type", type); } } \ No newline at end of file diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VAppAsyncClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VAppAsyncClient.java index 06b7ef068b..3c946292c0 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VAppAsyncClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VAppAsyncClient.java @@ -18,7 +18,27 @@ */ package org.jclouds.vcloud.director.v1_5.features; -import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.*; +import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.ANY_IMAGE; +import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.CONTROL_ACCESS; +import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.DEPLOY_VAPP_PARAMS; +import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.GUEST_CUSTOMIZATION_SECTION; +import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.LEASE_SETTINGS_SECTION; +import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.MEDIA_PARAMS; +import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.NETWORK_CONFIG_SECTION; +import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.NETWORK_CONNECTION_SECTION; +import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.OPERATING_SYSTEM_SECTION; +import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.OVF_RASD_ITEM; +import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.OVF_RASD_ITEMS_LIST; +import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.OWNER; +import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.PRODUCT_SECTION_LIST; +import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.RECOMPOSE_VAPP_PARAMS; +import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.RELOCATE_VM_PARAMS; +import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.STARTUP_SECTION; +import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.TASK; +import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.UNDEPLOY_VAPP_PARAMS; +import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.VAPP; +import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.VIRTUAL_HARDWARE_SECTION; +import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.VM_PENDING_ANSWER; import java.net.URI; @@ -56,9 +76,9 @@ import org.jclouds.vcloud.director.v1_5.domain.UndeployVAppParams; import org.jclouds.vcloud.director.v1_5.domain.VApp; import org.jclouds.vcloud.director.v1_5.domain.VmPendingQuestion; import org.jclouds.vcloud.director.v1_5.domain.VmQuestionAnswer; +import org.jclouds.vcloud.director.v1_5.domain.cim.ResourceAllocationSettingData; import org.jclouds.vcloud.director.v1_5.domain.ovf.NetworkSection; import org.jclouds.vcloud.director.v1_5.domain.ovf.OperatingSystemSection; -import org.jclouds.vcloud.director.v1_5.domain.ovf.RASD; import org.jclouds.vcloud.director.v1_5.domain.ovf.StartupSection; import org.jclouds.vcloud.director.v1_5.domain.ovf.VirtualHardwareSection; import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest; @@ -590,10 +610,10 @@ public interface VAppAsyncClient { @Consumes @JAXBResponseParser @ExceptionParser(ThrowVCloudErrorOn4xx.class) - ListenableFuture getVirtualHardwareSectionCpu(@EndpointParam URI vAppURI); + ListenableFuture getVirtualHardwareSectionCpu(@EndpointParam URI vAppURI); /** - * @see VAppClient#modifyVirtualHardwareSectionCpu(URI, RASD) + * @see VAppClient#modifyVirtualHardwareSectionCpu(URI, ResourceAllocationSettingData) */ @PUT @Path("/virtualHardwareSection/cpu") @@ -602,7 +622,7 @@ public interface VAppAsyncClient { @JAXBResponseParser @ExceptionParser(ThrowVCloudErrorOn4xx.class) ListenableFuture modifyVirtualHardwareSectionCpu(@EndpointParam URI vAppURI, - @BinderParam(BindToXMLPayload.class) RASD rasd); + @BinderParam(BindToXMLPayload.class) ResourceAllocationSettingData rasd); /** * @see VAppClient#getVirtualHardwareSectionDisks(URI) @@ -644,10 +664,10 @@ public interface VAppAsyncClient { @Consumes @JAXBResponseParser @ExceptionParser(ThrowVCloudErrorOn4xx.class) - ListenableFuture getVirtualHardwareSectionMemory(@EndpointParam URI vAppURI); + ListenableFuture getVirtualHardwareSectionMemory(@EndpointParam URI vAppURI); /** - * @see VAppClient#modifyVirtualHardwareSectionMemory(URI, RASD) + * @see VAppClient#modifyVirtualHardwareSectionMemory(URI, ResourceAllocationSettingData) */ @PUT @Path("/virtualHardwareSection/memory") @@ -656,7 +676,7 @@ public interface VAppAsyncClient { @JAXBResponseParser @ExceptionParser(ThrowVCloudErrorOn4xx.class) ListenableFuture modifyVirtualHardwareSectionMemory(@EndpointParam URI vAppURI, - @BinderParam(BindToXMLPayload.class) RASD rasd); + @BinderParam(BindToXMLPayload.class) ResourceAllocationSettingData rasd); /** * @see VAppClient#getVirtualHardwareSectionNetworkCards(URI) diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VAppClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VAppClient.java index da01403c97..6d94b75837 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VAppClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VAppClient.java @@ -42,9 +42,9 @@ import org.jclouds.vcloud.director.v1_5.domain.UndeployVAppParams; import org.jclouds.vcloud.director.v1_5.domain.VApp; import org.jclouds.vcloud.director.v1_5.domain.VmPendingQuestion; import org.jclouds.vcloud.director.v1_5.domain.VmQuestionAnswer; +import org.jclouds.vcloud.director.v1_5.domain.cim.ResourceAllocationSettingData; import org.jclouds.vcloud.director.v1_5.domain.ovf.NetworkSection; import org.jclouds.vcloud.director.v1_5.domain.ovf.OperatingSystemSection; -import org.jclouds.vcloud.director.v1_5.domain.ovf.RASD; import org.jclouds.vcloud.director.v1_5.domain.ovf.StartupSection; import org.jclouds.vcloud.director.v1_5.domain.ovf.VirtualHardwareSection; @@ -680,7 +680,7 @@ public interface VAppClient { * * @since 0.9 */ - RASD getVirtualHardwareSectionCpu(URI vAppURI); + ResourceAllocationSettingData getVirtualHardwareSectionCpu(URI vAppURI); /** * Modifies the CPU properties in virtual hardware section of a VM. @@ -691,10 +691,10 @@ public interface VAppClient { * * @since 0.9 */ - Task modifyVirtualHardwareSectionCpu(URI vAppURI, RASD rasd); + Task modifyVirtualHardwareSectionCpu(URI vAppURI, ResourceAllocationSettingData rasd); /** - * Retrieves a list of RASD items for disks from virtual hardware section of a VM. + * Retrieves a list of ResourceAllocationSettingData items for disks from virtual hardware section of a VM. * *
     * GET /vApp/{id}/virtualHardwareSection/disks
@@ -716,7 +716,7 @@ public interface VAppClient {
    Task modifyVirtualHardwareSectionDisks(URI vAppURI, RasdItemsList rasdItemsList);
 
    /**
-    * Retrieves the list of RASD items that represents the floppies and CD/DVD drives in a VM.
+    * Retrieves the list of ResourceAllocationSettingData items that represents the floppies and CD/DVD drives in a VM.
     *
     * 
     * GET /vApp/{id}/virtualHardwareSection/media
@@ -727,7 +727,7 @@ public interface VAppClient {
    RasdItemsList getVirtualHardwareSectionMedia(URI vAppURI);
 
    /**
-    * Retrieves the RASD item that contains memory information from virtual hardware section of a VM.
+    * Retrieves the ResourceAllocationSettingData item that contains memory information from virtual hardware section of a VM.
     *
     * 
     * GET /vApp/{id}/virtualHardwareSection/memory
@@ -735,7 +735,7 @@ public interface VAppClient {
     *
     * @since 0.9
     */
-   RASD getVirtualHardwareSectionMemory(URI vAppURI);
+   ResourceAllocationSettingData getVirtualHardwareSectionMemory(URI vAppURI);
 
    /**
     * Modifies the memory properties in virtual hardware section of a VM.
@@ -746,10 +746,10 @@ public interface VAppClient {
     *
     * @since 0.9
     */
-   Task modifyVirtualHardwareSectionMemory(URI vAppURI, RASD rasd);
+   Task modifyVirtualHardwareSectionMemory(URI vAppURI, ResourceAllocationSettingData rasd);
 
    /**
-    * Retrieves a list of RASD items for network cards from virtual hardware section of a VM.
+    * Retrieves a list of ResourceAllocationSettingData items for network cards from virtual hardware section of a VM.
     *
     * 
     * GET /vApp/{id}/virtualHardwareSection/networkCards
@@ -771,7 +771,7 @@ public interface VAppClient {
    Task modifyVirtualHardwareSectionNetworkCards(URI vAppURI, RasdItemsList rasdItemsList);
 
    /**
-    * Retrieves a list of RASD items for serial ports from virtual hardware section of a VM.
+    * Retrieves a list of ResourceAllocationSettingData items for serial ports from virtual hardware section of a VM.
     *
     * 
     * GET /vApp/{id}/virtualHardwareSection/serialPorts
diff --git a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/domain/Checks.java b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/domain/Checks.java
index e75cc953c2..e0b3cb712a 100644
--- a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/domain/Checks.java
+++ b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/domain/Checks.java
@@ -58,7 +58,6 @@ import org.jclouds.vcloud.director.v1_5.domain.ovf.Envelope;
 import org.jclouds.vcloud.director.v1_5.domain.ovf.NetworkSection;
 import org.jclouds.vcloud.director.v1_5.domain.ovf.OperatingSystemSection;
 import org.jclouds.vcloud.director.v1_5.domain.ovf.ProductSection;
-import org.jclouds.vcloud.director.v1_5.domain.ovf.RASD;
 import org.jclouds.vcloud.director.v1_5.domain.ovf.SectionType;
 import org.jclouds.vcloud.director.v1_5.domain.ovf.StartupSection;
 import org.jclouds.vcloud.director.v1_5.domain.ovf.VirtualHardwareSection;
@@ -1252,17 +1251,12 @@ public class Checks {
       }
    }
 
-   public static void checkRASD(RASD rasd) {
-      // Check fields
-      // TODO
-   }
-
    public static void checkRasdItemsList(RasdItemsList items) {
       // Check fields
       // TODO
 
-      for (RASD item : items.getItems()) {
-         checkRASD(item);
+      for (ResourceAllocationSettingData item : items.getItems()) {
+         checkResourceAllocationSettingData(item);
       }
    }
 
diff --git a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/AbstractVAppClientLiveTest.java b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/AbstractVAppClientLiveTest.java
index d116f2ca02..5a049a9a6a 100644
--- a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/AbstractVAppClientLiveTest.java
+++ b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/AbstractVAppClientLiveTest.java
@@ -49,7 +49,7 @@ import org.jclouds.vcloud.director.v1_5.domain.cim.CimBoolean;
 import org.jclouds.vcloud.director.v1_5.domain.cim.CimString;
 import org.jclouds.vcloud.director.v1_5.domain.cim.CimUnsignedInt;
 import org.jclouds.vcloud.director.v1_5.domain.cim.CimUnsignedLong;
-import org.jclouds.vcloud.director.v1_5.domain.ovf.RASD;
+import org.jclouds.vcloud.director.v1_5.domain.cim.ResourceAllocationSettingData;
 import org.jclouds.vcloud.director.v1_5.internal.BaseVCloudDirectorClientLiveTest;
 import org.jclouds.vcloud.director.v1_5.predicates.ReferenceTypePredicates;
 import org.jclouds.xml.internal.JAXBParser;
@@ -249,13 +249,13 @@ public abstract class AbstractVAppClientLiveTest extends BaseVCloudDirectorClien
    }
 
    protected void checkHasMatchingItem(final String context, final RasdItemsList items, final String instanceId, final String elementName) {
-      Optional found = Iterables.tryFind(items.getItems(), new Predicate() {
+      Optional found = Iterables.tryFind(items.getItems(), new Predicate() {
          @Override
-         public boolean apply(RASD item) {
-            String itemInstanceId = item.getInstanceID().getValue();
+         public boolean apply(ResourceAllocationSettingData item) {
+            String itemInstanceId = item.getInstanceID();
             if (itemInstanceId.equals(instanceId)) {
-               Assert.assertEquals(item.getElementName().getValue(), elementName,
-                     String.format(OBJ_FIELD_EQ, VAPP, context + "/" + instanceId + "/elementName", elementName, item.getElementName().getValue()));
+               Assert.assertEquals(item.getElementName(), elementName,
+                     String.format(OBJ_FIELD_EQ, VAPP, context + "/" + instanceId + "/elementName", elementName, item.getElementName()));
 
                return true;
             }
diff --git a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/VAppClientExpectTest.java b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/VAppClientExpectTest.java
index e1ee390566..612f913b0e 100644
--- a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/VAppClientExpectTest.java
+++ b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/VAppClientExpectTest.java
@@ -46,9 +46,9 @@ import org.jclouds.vcloud.director.v1_5.domain.UndeployVAppParams;
 import org.jclouds.vcloud.director.v1_5.domain.VApp;
 import org.jclouds.vcloud.director.v1_5.domain.VmPendingQuestion;
 import org.jclouds.vcloud.director.v1_5.domain.VmQuestionAnswer;
+import org.jclouds.vcloud.director.v1_5.domain.cim.ResourceAllocationSettingData;
 import org.jclouds.vcloud.director.v1_5.domain.ovf.NetworkSection;
 import org.jclouds.vcloud.director.v1_5.domain.ovf.OperatingSystemSection;
-import org.jclouds.vcloud.director.v1_5.domain.ovf.RASD;
 import org.jclouds.vcloud.director.v1_5.domain.ovf.StartupSection;
 import org.jclouds.vcloud.director.v1_5.domain.ovf.VirtualHardwareSection;
 import org.jclouds.vcloud.director.v1_5.internal.BaseVCloudDirectorRestClientExpectTest;
@@ -898,7 +898,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
             .xmlFilePayload("/vApp/getVirtualHardwareSectionCpu.xml", VCloudDirectorMediaType.OVF_RASD_ITEM)
             .httpResponseBuilder().build());
 
-         RASD expected = getVirtualHardwareSectionCpu();
+      ResourceAllocationSettingData expected = getVirtualHardwareSectionCpu();
 
          assertEquals(client.getVAppClient().getVirtualHardwareSectionCpu(vAppURI), expected);
    }
@@ -915,7 +915,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
             .xmlFilePayload("/vApp/modifyVirtualHardwareSectionCpuTask.xml", VCloudDirectorMediaType.TASK)
             .httpResponseBuilder().build());
 
-         RASD cpu = getVirtualHardwareSectionCpu(); // .toBuilder();
+      ResourceAllocationSettingData cpu = getVirtualHardwareSectionCpu(); // .toBuilder();
 //               .build();
 
          Task expected = modifyVirtualHardwareSectionCpuTask();
@@ -986,7 +986,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
             .xmlFilePayload("/vApp/getVirtualHardwareSectionMemory.xml", VCloudDirectorMediaType.OVF_RASD_ITEM)
             .httpResponseBuilder().build());
 
-         RASD expected = getVirtualHardwareSectionMemory();
+      ResourceAllocationSettingData expected = getVirtualHardwareSectionMemory();
 
          assertEquals(client.getVAppClient().getVirtualHardwareSectionMemory(vAppURI), expected);
    }
@@ -1003,7 +1003,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
             .xmlFilePayload("/vApp/modifyVirtualHardwareSectionMemoryTask.xml", VCloudDirectorMediaType.TASK)
             .httpResponseBuilder().build());
 
-         RASD memory = getVirtualHardwareSectionCpu(); // .toBuilder();
+      ResourceAllocationSettingData memory = getVirtualHardwareSectionCpu(); // .toBuilder();
 //               .build();
 
          Task expected = modifyVirtualHardwareSectionMemoryTask();
@@ -1414,8 +1414,8 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
       return task;
    }
 
-   public static RASD getVirtualHardwareSectionCpu() {
-      RASD cpu = RASD.builder()
+   public static ResourceAllocationSettingData getVirtualHardwareSectionCpu() {
+      ResourceAllocationSettingData cpu = ResourceAllocationSettingData.builder()
             .build();
 
       return cpu;
@@ -1449,8 +1449,8 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
       return media;
    }
 
-   public static RASD getVirtualHardwareSectionMemory() {
-      RASD memory = RASD.builder()
+   public static ResourceAllocationSettingData getVirtualHardwareSectionMemory() {
+      ResourceAllocationSettingData memory = ResourceAllocationSettingData.builder()
             .build();
 
       return memory;
diff --git a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/VAppClientLiveTest.java b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/VAppClientLiveTest.java
index c248b44232..8a65a89150 100644
--- a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/VAppClientLiveTest.java
+++ b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/VAppClientLiveTest.java
@@ -37,8 +37,8 @@ import static org.jclouds.vcloud.director.v1_5.domain.Checks.checkNetworkSection
 import static org.jclouds.vcloud.director.v1_5.domain.Checks.checkOperatingSystemSection;
 import static org.jclouds.vcloud.director.v1_5.domain.Checks.checkOwner;
 import static org.jclouds.vcloud.director.v1_5.domain.Checks.checkProductSectionList;
-import static org.jclouds.vcloud.director.v1_5.domain.Checks.checkRASD;
 import static org.jclouds.vcloud.director.v1_5.domain.Checks.checkRasdItemsList;
+import static org.jclouds.vcloud.director.v1_5.domain.Checks.checkResourceAllocationSettingData;
 import static org.jclouds.vcloud.director.v1_5.domain.Checks.checkRuntimeInfoSection;
 import static org.jclouds.vcloud.director.v1_5.domain.Checks.checkScreenTicket;
 import static org.jclouds.vcloud.director.v1_5.domain.Checks.checkStartupSection;
@@ -55,7 +55,6 @@ import java.math.BigInteger;
 import java.net.URI;
 import java.util.Map;
 import java.util.Set;
-import java.util.UUID;
 import java.util.concurrent.TimeUnit;
 
 import org.jclouds.vcloud.director.v1_5.VCloudDirectorException;
@@ -89,12 +88,10 @@ import org.jclouds.vcloud.director.v1_5.domain.VApp;
 import org.jclouds.vcloud.director.v1_5.domain.VmPendingQuestion;
 import org.jclouds.vcloud.director.v1_5.domain.cim.OSType;
 import org.jclouds.vcloud.director.v1_5.domain.cim.ResourceAllocationSettingData;
-import org.jclouds.vcloud.director.v1_5.domain.cim.ResourceAllocationSettingData.ResourceType;
 import org.jclouds.vcloud.director.v1_5.domain.ovf.MsgType;
 import org.jclouds.vcloud.director.v1_5.domain.ovf.NetworkSection;
 import org.jclouds.vcloud.director.v1_5.domain.ovf.OperatingSystemSection;
 import org.jclouds.vcloud.director.v1_5.domain.ovf.ProductSection;
-import org.jclouds.vcloud.director.v1_5.domain.ovf.RASD;
 import org.jclouds.vcloud.director.v1_5.domain.ovf.StartupSection;
 import org.jclouds.vcloud.director.v1_5.domain.ovf.VirtualHardwareSection;
 import org.jclouds.vcloud.director.v1_5.domain.query.QueryResultRecordType;
@@ -102,11 +99,11 @@ import org.jclouds.vcloud.director.v1_5.domain.query.QueryResultRecords;
 import org.testng.annotations.Test;
 
 import com.google.common.base.Function;
-import com.google.common.base.Optional;
 import com.google.common.base.Predicate;
 import com.google.common.base.Strings;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Iterables;
+import com.google.common.collect.Sets;
 
 /**
  * Tests behavior of the {@link VAppClient}.
@@ -343,7 +340,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
       assertTrue(retryTaskSuccess.apply(discardSuspendedState), String.format(TASK_COMPLETE_TIMELY, "discardSuspendedState"));
    }
 
-   @Test(testName = "POST /vApp/{id}/action/enterMaintenanceMode", dependsOnMethods = { "testGetVApp" })
+   @Test(testName = "POST /vApp/{id}/action/enterMaintenanceMode", dependsOnMethods = { "testPowerOnVApp" })
    public void testEnterMaintenanceMode() {
       // The method under test
       vAppClient.enterMaintenanceMode(vApp.getHref());
@@ -763,10 +760,13 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
       checkRuntimeInfoSection(section);
    }
 
-   @Test(testName = "GET /vApp/{id}/screen", dependsOnMethods = { "testGetVApp" })
+   @Test(testName = "GET /vApp/{id}/screen", dependsOnMethods = { "testPowerOnVApp" })
    public void testGetScreenImage() {
+      // Get URI for child VM
+      URI vmURI = Iterables.getOnlyElement(vApp.getChildren().getVms()).getHref();
+
       // The method under test
-      byte[] image = vAppClient.getScreenImage(vApp.getHref());
+      byte[] image = vAppClient.getScreenImage(vmURI);
 
       // Check returned bytes against PNG header magic number
       byte[] pngHeaderBytes = new byte[] { (byte) 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A };
@@ -779,8 +779,11 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
 
    @Test(testName = "GET /vApp/{id}/screen/action/acquireTicket", dependsOnMethods = { "testGetVApp" })
    public void testGetScreenTicket() {
+      // Get URI for child VM
+      URI vmURI = Iterables.getOnlyElement(vApp.getChildren().getVms()).getHref();
+
       // The method under test
-      ScreenTicket ticket = vAppClient.getScreenTicket(vApp.getHref());
+      ScreenTicket ticket = vAppClient.getScreenTicket(vmURI);
 
       // Check the retrieved object is well formed
       checkScreenTicket(ticket);
@@ -835,23 +838,22 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
 
       // Copy existing section and update fields
       VirtualHardwareSection oldSection = vAppClient.getVirtualHardwareSection(vmURI);
-      Optional memory = Iterables.tryFind(oldSection.getItems(),
-            new Predicate() {
-		         @Override
-		         public boolean apply(ResourceAllocationSettingData item) {
-		            return item.getResourceType() == ResourceType.MEMORY;
-		         }
-	      });
-      if (memory.isPresent()) debug(memory);
+      Set oldItems = oldSection.getItems();
+      ResourceAllocationSettingData oldMemory = Iterables.find(oldItems, new Predicate() {
+         @Override
+         public boolean apply(ResourceAllocationSettingData rasd) {
+            return rasd.getResourceType() == ResourceAllocationSettingData.ResourceType.MEMORY;
+         }
+      });
+      ResourceAllocationSettingData newMemory = oldMemory.toBuilder()
+            .elementName("1024 MB of memory")
+            .virtualQuantity(BigInteger.valueOf(1024L))
+            .build();
+      Set newItems = Sets.newLinkedHashSet(oldItems);
+      newItems.remove(oldMemory);
+      newItems.add(newMemory);
       VirtualHardwareSection newSection = oldSection.toBuilder()
-            .item(ResourceAllocationSettingData.builder()
-                  .elementName(cimString("Memory"))
-                  .instanceID(cimString(UUID.randomUUID().toString()))
-                  .allocationUnits(cimString("byte * 2^20"))
-                  .reservation(cimUnsignedLong(BigInteger.valueOf(0L)))
-                  .virtualQuantity(cimUnsignedLong(BigInteger.valueOf(1024L)))
-                  .weight(cimUnsignedInt(0L))
-                  .build())
+            .items(newItems)
             .build();
 
       // The method under test
@@ -859,14 +861,22 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
       assertTrue(retryTaskSuccess.apply(modifyVirtualHardwareSection), String.format(TASK_COMPLETE_TIMELY, "modifyVirtualHardwareSection"));
 
       // Retrieve the modified section
-      VirtualHardwareSection modified = vAppClient.getVirtualHardwareSection(vmURI);
+      VirtualHardwareSection modifiedSection = vAppClient.getVirtualHardwareSection(vmURI);
 
       // Check the retrieved object is well formed
-      checkVirtualHardwareSection(modified);
+      checkVirtualHardwareSection(modifiedSection);
 
       // Check the modified section fields are set correctly
-      // assertEquals(modified.getX(), "");
-      assertEquals(modified, newSection);
+      Set modifiedItems = modifiedSection.getItems();
+      ResourceAllocationSettingData modifiedMemory = Iterables.find(modifiedItems, new Predicate() {
+         @Override
+         public boolean apply(ResourceAllocationSettingData rasd) {
+            return rasd.getResourceType() == ResourceAllocationSettingData.ResourceType.MEMORY;
+         }
+      });
+      assertEquals(modifiedMemory.getVirtualQuantity(), BigInteger.valueOf(1024L));
+      assertEquals(modifiedMemory, newMemory);
+      assertEquals(modifiedSection, newSection);
    }
 
    @Test(testName = "GET /vApp/{id}/virtualHardwareSection/cpu", dependsOnMethods = { "testGetVirtualHardwareSection" })
@@ -875,10 +885,10 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
       URI vmURI = Iterables.getOnlyElement(vApp.getChildren().getVms()).getHref();
       
       // Method under test
-      RASD rasd = vAppClient.getVirtualHardwareSectionCpu(vmURI);
+      ResourceAllocationSettingData rasd = vAppClient.getVirtualHardwareSectionCpu(vmURI);
 
       // Check the retrieved object is well formed
-      checkRASD(rasd);
+      checkResourceAllocationSettingData(rasd);
    }
 
    @Test(testName = "PUT /vApp/{id}/virtualHardwareSection/cpu", dependsOnMethods = { "testGetVirtualHardwareSectionCpu" })
@@ -886,24 +896,26 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
       // Get URI for child VM
       URI vmURI = Iterables.getOnlyElement(vApp.getChildren().getVms()).getHref();
       
-      RASD origSection = vAppClient.getVirtualHardwareSectionCpu(vmURI);
-      RASD newSection = origSection.toBuilder().build();
+      // Copy existing section and update fields
+      ResourceAllocationSettingData oldItem = vAppClient.getVirtualHardwareSectionCpu(vmURI);
+      ResourceAllocationSettingData newItem = oldItem.toBuilder()
+            .build();
       
       // Method under test
-      Task modifyVirtualHardwareSectionCpu = vAppClient.modifyVirtualHardwareSectionCpu(vmURI, newSection);
+      Task modifyVirtualHardwareSectionCpu = vAppClient.modifyVirtualHardwareSectionCpu(vmURI, newItem);
       assertTrue(retryTaskSuccess.apply(modifyVirtualHardwareSectionCpu), String.format(TASK_COMPLETE_TIMELY, "modifyVirtualHardwareSectionCpu"));
 
       // Retrieve the modified section
-      RASD modified = vAppClient.getVirtualHardwareSectionCpu(vmURI);
+      ResourceAllocationSettingData modified = vAppClient.getVirtualHardwareSectionCpu(vmURI);
       
       // Check the retrieved object
-      checkRASD(modified);
+      checkResourceAllocationSettingData(modified);
       
       // TODO What is modifiable? What can we change, so we can assert the change took effect? 
       // I tried changing "weight", but it continued to have the value zero when looked up post-modify.
       //
       // long weight = random.nextInt(Integer.MAX_VALUE);
-      // RASD newSection = origSection.toBuilder()
+      // ResourceAllocationSettingData newSection = origSection.toBuilder()
       //         .weight(newCimUnsignedInt(weight))
       //         .build();
       // ...
@@ -944,8 +956,8 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
       // TODO What is modifiable? What can we change, so we can assert the change took effect? 
       // I tried changing "elementName" of one of the items, but it continued to have the old value when looked up post-modify.
       //
-      // List newItems = new ArrayList(oldSection.getItems());
-      // RASD item0 = newItems.get(0);
+      // List newItems = new ArrayList(oldSection.getItems());
+      // ResourceAllocationSettingData item0 = newItems.get(0);
       // String item0InstanceId = item0.getInstanceID().getValue();
       // String item0ElementName = item0.getElementName().getValue()+"-"+random.nextInt(Integer.MAX_VALUE);
       // newItems.set(0, item0.toBuilder().elementName(newCimString(item0ElementName)).build());
@@ -954,7 +966,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
       //       .build();
       // ...
       // long weight = random.nextInt(Integer.MAX_VALUE);
-      // RASD newSection = origSection.toBuilder()
+      // ResourceAllocationSettingData newSection = origSection.toBuilder()
       //         .weight(newCimUnsignedInt(weight))
       //         .build();
       // ...
@@ -979,10 +991,10 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
       URI vmURI = Iterables.getOnlyElement(vApp.getChildren().getVms()).getHref();
       
       // Method under test
-      RASD rasd = vAppClient.getVirtualHardwareSectionCpu(vmURI);
+      ResourceAllocationSettingData rasd = vAppClient.getVirtualHardwareSectionCpu(vmURI);
 
       // Check the retrieved object is well formed
-      checkRASD(rasd);
+      checkResourceAllocationSettingData(rasd);
    }
 
    @Test(testName = "PUT /vApp/{id}/virtualHardwareSection/memory", dependsOnMethods = { "testGetVirtualHardwareSectionMemory" })
@@ -990,18 +1002,18 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
       // Get URI for child VM
       URI vmURI = Iterables.getOnlyElement(vApp.getChildren().getVms()).getHref();
       
-      RASD origSection = vAppClient.getVirtualHardwareSectionMemory(vmURI);
-      RASD newSection = origSection.toBuilder().build();
+      ResourceAllocationSettingData origSection = vAppClient.getVirtualHardwareSectionMemory(vmURI);
+      ResourceAllocationSettingData newSection = origSection.toBuilder().build();
       
       // Method under test
       Task modifyVirtualHardwareSectionMemory = vAppClient.modifyVirtualHardwareSectionMemory(vmURI, newSection);
       assertTrue(retryTaskSuccess.apply(modifyVirtualHardwareSectionMemory), String.format(TASK_COMPLETE_TIMELY, "modifyVirtualHardwareSectionMemory"));
 
       // Retrieve the modified section
-      RASD modified = vAppClient.getVirtualHardwareSectionMemory(vmURI);
+      ResourceAllocationSettingData modified = vAppClient.getVirtualHardwareSectionMemory(vmURI);
       
       // Check the retrieved object
-      checkRASD(modified);
+      checkResourceAllocationSettingData(modified);
       
       // TODO What is modifiable? What can we change, so we can assert the change took effect? 
       // I tried changing "weight", but it continued to have the value zero when looked up post-modify.