mirror of https://github.com/apache/jclouds.git
VCloud Director 1.5: making domain objects immutable and fixing a number of de/serialization problems
This commit is contained in:
parent
8cd642af6b
commit
cc4a27072b
|
@ -22,26 +22,23 @@ package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.Collection;
|
||||||
|
import java.util.Set;
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlType;
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Sets;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Represents a list of references to available networks.
|
||||||
* Represents a list of references to available networks.
|
* <p/>
|
||||||
*
|
* <p/>
|
||||||
*
|
|
||||||
* <p>Java class for AvailableNetworks complex type.
|
* <p>Java class for AvailableNetworks complex type.
|
||||||
*
|
* <p/>
|
||||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
*
|
* <p/>
|
||||||
* <pre>
|
* <pre>
|
||||||
* <complexType name="AvailableNetworks">
|
* <complexType name="AvailableNetworks">
|
||||||
* <complexContent>
|
* <complexContent>
|
||||||
|
@ -54,12 +51,9 @@ import com.google.common.collect.Lists;
|
||||||
* </complexContent>
|
* </complexContent>
|
||||||
* </complexType>
|
* </complexType>
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
|
||||||
@XmlType(name = "AvailableNetworks", propOrder = {
|
@XmlType(name = "AvailableNetworks", propOrder = {
|
||||||
"networks"
|
"networks"
|
||||||
})
|
})
|
||||||
public class AvailableNetworks {
|
public class AvailableNetworks {
|
||||||
public static Builder builder() {
|
public static Builder builder() {
|
||||||
|
@ -71,14 +65,13 @@ public class AvailableNetworks {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Builder {
|
public static class Builder {
|
||||||
|
private Set<Reference> networks = Sets.newLinkedHashSet();
|
||||||
private List<Reference> networks = Lists.newArrayList();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see AvailableNetworks#getNetworks()
|
* @see AvailableNetworks#getNetworks()
|
||||||
*/
|
*/
|
||||||
public Builder networks(List<Reference> networks) {
|
public Builder networks(Collection<Reference> networks) {
|
||||||
this.networks = Lists.newArrayList(checkNotNull(networks, "networks"));
|
this.networks = Sets.newLinkedHashSet(checkNotNull(networks, "networks"));
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,51 +94,28 @@ public class AvailableNetworks {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private AvailableNetworks() {
|
@XmlElement(name = "Network")
|
||||||
// For JAXB and builder use
|
protected Set<Reference> networks = Sets.newLinkedHashSet();
|
||||||
}
|
|
||||||
|
|
||||||
private AvailableNetworks(List<Reference> networks) {
|
private AvailableNetworks(Set<Reference> networks) {
|
||||||
this.networks = networks;
|
this.networks = networks;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private AvailableNetworks() {
|
||||||
|
// For JAXB
|
||||||
|
}
|
||||||
|
|
||||||
@XmlElement(name = "Network")
|
/**
|
||||||
protected List<Reference> networks;
|
* Gets the value of the network property.
|
||||||
|
*/
|
||||||
/**
|
public Set<Reference> getNetworks() {
|
||||||
* Gets the value of the network property.
|
return this.networks;
|
||||||
*
|
}
|
||||||
* <p>
|
|
||||||
* 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 <CODE>set</CODE> method for the network property.
|
|
||||||
*
|
|
||||||
* <p>
|
|
||||||
* For example, to add a new item, do as follows:
|
|
||||||
* <pre>
|
|
||||||
* getNetwork().add(newItem);
|
|
||||||
* </pre>
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* <p>
|
|
||||||
* Objects of the following type(s) are allowed in the list
|
|
||||||
* {@link ReferenceType }
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public List<Reference> getNetworks() {
|
|
||||||
if (networks == null) {
|
|
||||||
networks = Lists.newArrayList();
|
|
||||||
}
|
|
||||||
return this.networks;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
return true;
|
return true;
|
||||||
if (o == null || getClass() != o.getClass())
|
if (o == null || getClass() != o.getClass())
|
||||||
return false;
|
return false;
|
||||||
AvailableNetworks that = AvailableNetworks.class.cast(o);
|
AvailableNetworks that = AvailableNetworks.class.cast(o);
|
||||||
|
|
|
@ -21,8 +21,6 @@ package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlType;
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
|
||||||
|
@ -30,14 +28,13 @@ import com.google.common.base.Objects;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Collection of supported hardware capabilities.
|
||||||
* Collection of supported hardware capabilities.
|
* <p/>
|
||||||
*
|
* <p/>
|
||||||
*
|
|
||||||
* <p>Java class for Capabilities complex type.
|
* <p>Java class for Capabilities complex type.
|
||||||
*
|
* <p/>
|
||||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
*
|
* <p/>
|
||||||
* <pre>
|
* <pre>
|
||||||
* <complexType name="Capabilities">
|
* <complexType name="Capabilities">
|
||||||
* <complexContent>
|
* <complexContent>
|
||||||
|
@ -50,12 +47,9 @@ import com.google.common.base.Objects;
|
||||||
* </complexContent>
|
* </complexContent>
|
||||||
* </complexType>
|
* </complexType>
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
|
||||||
@XmlType(name = "Capabilities", propOrder = {
|
@XmlType(name = "Capabilities", propOrder = {
|
||||||
"supportedHardwareVersions"
|
"supportedHardwareVersions"
|
||||||
})
|
})
|
||||||
public class Capabilities {
|
public class Capabilities {
|
||||||
public static Builder builder() {
|
public static Builder builder() {
|
||||||
|
@ -67,7 +61,7 @@ public class Capabilities {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Builder {
|
public static class Builder {
|
||||||
|
|
||||||
private SupportedHardwareVersions supportedHardwareVersions;
|
private SupportedHardwareVersions supportedHardwareVersions;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -80,9 +74,7 @@ public class Capabilities {
|
||||||
|
|
||||||
|
|
||||||
public Capabilities build() {
|
public Capabilities build() {
|
||||||
Capabilities capabilities = new Capabilities();
|
return new Capabilities(supportedHardwareVersions);
|
||||||
capabilities.setSupportedHardwareVersions(supportedHardwareVersions);
|
|
||||||
return capabilities;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -91,43 +83,32 @@ public class Capabilities {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Capabilities(SupportedHardwareVersions supportedHardwareVersions) {
|
||||||
|
this.supportedHardwareVersions = supportedHardwareVersions;
|
||||||
|
}
|
||||||
|
|
||||||
private Capabilities() {
|
private Capabilities() {
|
||||||
// For JAXB and builder use
|
// For JAXB
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@XmlElement(name = "SupportedHardwareVersions")
|
||||||
|
protected SupportedHardwareVersions supportedHardwareVersions;
|
||||||
|
|
||||||
@XmlElement(name = "SupportedHardwareVersions")
|
/**
|
||||||
protected SupportedHardwareVersions supportedHardwareVersions;
|
* Gets the value of the supportedHardwareVersions property.
|
||||||
|
*
|
||||||
/**
|
* @return possible object is
|
||||||
* Gets the value of the supportedHardwareVersions property.
|
* {@link SupportedHardwareVersions }
|
||||||
*
|
*/
|
||||||
* @return
|
public SupportedHardwareVersions getSupportedHardwareVersions() {
|
||||||
* possible object is
|
return supportedHardwareVersions;
|
||||||
* {@link SupportedHardwareVersions }
|
}
|
||||||
*
|
|
||||||
*/
|
|
||||||
public SupportedHardwareVersions getSupportedHardwareVersions() {
|
|
||||||
return supportedHardwareVersions;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the supportedHardwareVersions property.
|
|
||||||
*
|
|
||||||
* @param value
|
|
||||||
* allowed object is
|
|
||||||
* {@link SupportedHardwareVersions }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setSupportedHardwareVersions(SupportedHardwareVersions value) {
|
|
||||||
this.supportedHardwareVersions = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
return true;
|
return true;
|
||||||
if (o == null || getClass() != o.getClass())
|
if (o == null || getClass() != o.getClass())
|
||||||
return false;
|
return false;
|
||||||
Capabilities that = Capabilities.class.cast(o);
|
Capabilities that = Capabilities.class.cast(o);
|
||||||
|
|
|
@ -21,8 +21,6 @@ package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlSeeAlso;
|
import javax.xml.bind.annotation.XmlSeeAlso;
|
||||||
import javax.xml.bind.annotation.XmlType;
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
@ -31,14 +29,13 @@ import com.google.common.base.Objects;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Represents a capacity of a given resource.
|
||||||
* Represents a capacity of a given resource.
|
* <p/>
|
||||||
*
|
* <p/>
|
||||||
*
|
|
||||||
* <p>Java class for Capacity complex type.
|
* <p>Java class for Capacity complex type.
|
||||||
*
|
* <p/>
|
||||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
*
|
* <p/>
|
||||||
* <pre>
|
* <pre>
|
||||||
* <complexType name="Capacity">
|
* <complexType name="Capacity">
|
||||||
* <complexContent>
|
* <complexContent>
|
||||||
|
@ -53,20 +50,17 @@ import com.google.common.base.Objects;
|
||||||
* </complexContent>
|
* </complexContent>
|
||||||
* </complexType>
|
* </complexType>
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
|
||||||
@XmlType(name = "Capacity", propOrder = {
|
@XmlType(name = "Capacity", propOrder = {
|
||||||
"units",
|
"units",
|
||||||
"allocated",
|
"allocated",
|
||||||
"limit"
|
"limit"
|
||||||
})
|
})
|
||||||
@XmlSeeAlso({
|
@XmlSeeAlso({
|
||||||
// CapacityWithUsageType.class
|
CapacityWithUsage.class
|
||||||
})
|
})
|
||||||
public class CapacityType<T extends CapacityType<T>> {
|
public class CapacityType<T extends CapacityType<T>> {
|
||||||
|
|
||||||
public static <T extends CapacityType<T>> Builder<T> builder() {
|
public static <T extends CapacityType<T>> Builder<T> builder() {
|
||||||
return new Builder<T>();
|
return new Builder<T>();
|
||||||
}
|
}
|
||||||
|
@ -76,7 +70,7 @@ public class CapacityType<T extends CapacityType<T>> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Builder<T extends CapacityType<T>> {
|
public static class Builder<T extends CapacityType<T>> {
|
||||||
|
|
||||||
protected String units;
|
protected String units;
|
||||||
protected Long allocated;
|
protected Long allocated;
|
||||||
protected Long limit;
|
protected Long limit;
|
||||||
|
@ -107,119 +101,78 @@ public class CapacityType<T extends CapacityType<T>> {
|
||||||
|
|
||||||
|
|
||||||
public CapacityType<T> build() {
|
public CapacityType<T> build() {
|
||||||
CapacityType<T> capacity = new CapacityType<T>();
|
return new CapacityType<T>(units, allocated, limit);
|
||||||
capacity.setUnits(units);
|
|
||||||
capacity.setAllocated(allocated);
|
|
||||||
capacity.setLimit(limit);
|
|
||||||
return capacity;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Builder<T> fromCapacityType(CapacityType<T> in) {
|
public Builder<T> fromCapacityType(CapacityType<T> in) {
|
||||||
return units(in.getUnits())
|
return units(in.getUnits())
|
||||||
.allocated(in.getAllocated())
|
.allocated(in.getAllocated())
|
||||||
.limit(in.getLimit());
|
.limit(in.getLimit());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected CapacityType(String units, Long allocated, Long limit) {
|
||||||
|
this.units = units;
|
||||||
|
this.allocated = allocated;
|
||||||
|
this.limit = limit;
|
||||||
|
}
|
||||||
|
|
||||||
protected CapacityType() {
|
protected CapacityType() {
|
||||||
// For JAXB and builder use
|
// For JAXB and builder use
|
||||||
}
|
}
|
||||||
|
|
||||||
protected CapacityType(String units) {
|
@XmlElement(name = "Units", required = true)
|
||||||
this.units = units;
|
protected String units;
|
||||||
|
@XmlElement(name = "Allocated")
|
||||||
|
protected Long allocated;
|
||||||
|
@XmlElement(name = "Limit")
|
||||||
|
protected Long limit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the units property.
|
||||||
|
*
|
||||||
|
* @return possible object is
|
||||||
|
* {@link String }
|
||||||
|
*/
|
||||||
|
public String getUnits() {
|
||||||
|
return units;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the allocated property.
|
||||||
|
*
|
||||||
|
* @return possible object is
|
||||||
|
* {@link Long }
|
||||||
|
*/
|
||||||
|
public Long getAllocated() {
|
||||||
|
return allocated;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
@XmlElement(name = "Units", required = true)
|
* Gets the value of the limit property.
|
||||||
protected String units;
|
*/
|
||||||
@XmlElement(name = "Allocated")
|
public Long getLimit() {
|
||||||
protected Long allocated;
|
return limit;
|
||||||
@XmlElement(name = "Limit")
|
}
|
||||||
protected Long limit;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the value of the units property.
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
* possible object is
|
|
||||||
* {@link String }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public String getUnits() {
|
|
||||||
return units;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the units property.
|
|
||||||
*
|
|
||||||
* @param value
|
|
||||||
* allowed object is
|
|
||||||
* {@link String }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setUnits(String value) {
|
|
||||||
this.units = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the value of the allocated property.
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
* possible object is
|
|
||||||
* {@link Long }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public Long getAllocated() {
|
|
||||||
return allocated;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the allocated property.
|
|
||||||
*
|
|
||||||
* @param value
|
|
||||||
* allowed object is
|
|
||||||
* {@link Long }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setAllocated(Long value) {
|
|
||||||
this.allocated = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the value of the limit property.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public Long getLimit() {
|
|
||||||
return limit;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the limit property.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setLimit(Long value) {
|
|
||||||
this.limit = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
return true;
|
return true;
|
||||||
if (o == null || getClass() != o.getClass())
|
if (o == null || getClass() != o.getClass())
|
||||||
return false;
|
return false;
|
||||||
CapacityType<?> that = CapacityType.class.cast(o);
|
CapacityType<?> that = CapacityType.class.cast(o);
|
||||||
return equal(units, that.units) &&
|
return equal(units, that.units) &&
|
||||||
equal(allocated, that.allocated) &&
|
equal(allocated, that.allocated) &&
|
||||||
equal(limit, that.limit);
|
equal(limit, that.limit);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hashCode(units,
|
return Objects.hashCode(units,
|
||||||
allocated,
|
allocated,
|
||||||
limit);
|
limit);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -21,8 +21,6 @@ package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlType;
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
|
||||||
|
@ -30,14 +28,13 @@ import com.google.common.base.Objects;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Represents a capacity and usage of a given resource.
|
||||||
* Represents a capacity and usage of a given resource.
|
* <p/>
|
||||||
*
|
* <p/>
|
||||||
*
|
|
||||||
* <p>Java class for CapacityWithUsage complex type.
|
* <p>Java class for CapacityWithUsage complex type.
|
||||||
*
|
* <p/>
|
||||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
*
|
* <p/>
|
||||||
* <pre>
|
* <pre>
|
||||||
* <complexType name="CapacityWithUsage">
|
* <complexType name="CapacityWithUsage">
|
||||||
* <complexContent>
|
* <complexContent>
|
||||||
|
@ -51,13 +48,10 @@ import com.google.common.base.Objects;
|
||||||
* </complexContent>
|
* </complexContent>
|
||||||
* </complexType>
|
* </complexType>
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
|
||||||
@XmlType(name = "CapacityWithUsage", propOrder = {
|
@XmlType(name = "CapacityWithUsage", propOrder = {
|
||||||
"used",
|
"used",
|
||||||
"overhead"
|
"overhead"
|
||||||
})
|
})
|
||||||
public class CapacityWithUsage extends CapacityType<CapacityWithUsage>
|
public class CapacityWithUsage extends CapacityType<CapacityWithUsage>
|
||||||
|
|
||||||
|
@ -72,7 +66,7 @@ public class CapacityWithUsage extends CapacityType<CapacityWithUsage>
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Builder extends CapacityType.Builder<CapacityWithUsage> {
|
public static class Builder extends CapacityType.Builder<CapacityWithUsage> {
|
||||||
|
|
||||||
private Long used;
|
private Long used;
|
||||||
private Long overhead;
|
private Long overhead;
|
||||||
|
|
||||||
|
@ -91,15 +85,10 @@ public class CapacityWithUsage extends CapacityType<CapacityWithUsage>
|
||||||
this.overhead = overhead;
|
this.overhead = overhead;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public CapacityWithUsage build() {
|
public CapacityWithUsage build() {
|
||||||
CapacityWithUsage capacityWithUsage = new CapacityWithUsage(units);
|
return new CapacityWithUsage(units, allocated, limit, used, overhead);
|
||||||
capacityWithUsage.setUsed(used);
|
|
||||||
capacityWithUsage.setOverhead(overhead);
|
|
||||||
capacityWithUsage.setAllocated(allocated);
|
|
||||||
capacityWithUsage.setLimit(limit);
|
|
||||||
return capacityWithUsage;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -125,96 +114,70 @@ public class CapacityWithUsage extends CapacityType<CapacityWithUsage>
|
||||||
this.limit = limit;
|
this.limit = limit;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Builder fromCapacityType(CapacityType<CapacityWithUsage> in) {
|
public Builder fromCapacityType(CapacityType<CapacityWithUsage> in) {
|
||||||
return Builder.class.cast(super.fromCapacityType(in));
|
return Builder.class.cast(super.fromCapacityType(in));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder fromCapacityWithUsage(CapacityWithUsage in) {
|
public Builder fromCapacityWithUsage(CapacityWithUsage in) {
|
||||||
return fromCapacityType(in)
|
return fromCapacityType(in)
|
||||||
.used(in.getUsed())
|
.used(in.getUsed())
|
||||||
.overhead(in.getOverhead());
|
.overhead(in.getOverhead());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected CapacityWithUsage() {
|
private CapacityWithUsage(String units, Long allocated, Long limit, Long used, Long overhead) {
|
||||||
|
super(units, allocated, limit);
|
||||||
|
this.used = used;
|
||||||
|
this.overhead = overhead;
|
||||||
|
}
|
||||||
|
|
||||||
|
private CapacityWithUsage() {
|
||||||
// For JAXB and builder use
|
// For JAXB and builder use
|
||||||
}
|
}
|
||||||
|
|
||||||
public CapacityWithUsage(String units) {
|
@XmlElement(name = "Used")
|
||||||
super(units);
|
protected Long used;
|
||||||
|
@XmlElement(name = "Overhead")
|
||||||
|
protected Long overhead;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the used property.
|
||||||
|
*
|
||||||
|
* @return possible object is
|
||||||
|
* {@link Long }
|
||||||
|
*/
|
||||||
|
public Long getUsed() {
|
||||||
|
return used;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
@XmlElement(name = "Used")
|
* Gets the value of the overhead property.
|
||||||
protected Long used;
|
*
|
||||||
@XmlElement(name = "Overhead")
|
* @return possible object is
|
||||||
protected Long overhead;
|
* {@link Long }
|
||||||
|
*/
|
||||||
/**
|
public Long getOverhead() {
|
||||||
* Gets the value of the used property.
|
return overhead;
|
||||||
*
|
}
|
||||||
* @return
|
|
||||||
* possible object is
|
|
||||||
* {@link Long }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public Long getUsed() {
|
|
||||||
return used;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the used property.
|
|
||||||
*
|
|
||||||
* @param value
|
|
||||||
* allowed object is
|
|
||||||
* {@link Long }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setUsed(Long value) {
|
|
||||||
this.used = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the value of the overhead property.
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
* possible object is
|
|
||||||
* {@link Long }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public Long getOverhead() {
|
|
||||||
return overhead;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the overhead property.
|
|
||||||
*
|
|
||||||
* @param value
|
|
||||||
* allowed object is
|
|
||||||
* {@link Long }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setOverhead(Long value) {
|
|
||||||
this.overhead = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
return true;
|
return true;
|
||||||
if (o == null || getClass() != o.getClass())
|
if (o == null || getClass() != o.getClass())
|
||||||
return false;
|
return false;
|
||||||
CapacityWithUsage that = CapacityWithUsage.class.cast(o);
|
CapacityWithUsage that = CapacityWithUsage.class.cast(o);
|
||||||
return equal(used, that.used) &&
|
return equal(used, that.used) &&
|
||||||
equal(overhead, that.overhead);
|
equal(overhead, that.overhead);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hashCode(used,
|
return Objects.hashCode(used,
|
||||||
overhead);
|
overhead);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -20,13 +20,10 @@
|
||||||
package org.jclouds.vcloud.director.v1_5.domain;
|
package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.Set;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import javax.xml.bind.JAXBElement;
|
import javax.xml.bind.JAXBElement;
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlElementRef;
|
import javax.xml.bind.annotation.XmlElementRef;
|
||||||
import javax.xml.bind.annotation.XmlType;
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
@ -40,17 +37,18 @@ import org.jclouds.ovf.VirtualHardwareSection;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.ovf.NetworkSection;
|
import org.jclouds.vcloud.director.v1_5.domain.ovf.NetworkSection;
|
||||||
|
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
|
import com.google.common.collect.ImmutableSet;
|
||||||
|
import com.google.common.collect.Sets;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Represents the parameters for capturing a vApp to a vApp template.
|
||||||
* Represents the parameters for capturing a vApp to a vApp template.
|
* <p/>
|
||||||
*
|
* <p/>
|
||||||
*
|
|
||||||
* <p>Java class for CaptureVAppParams complex type.
|
* <p>Java class for CaptureVAppParams complex type.
|
||||||
*
|
* <p/>
|
||||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
*
|
* <p/>
|
||||||
* <pre>
|
* <pre>
|
||||||
* <complexType name="CaptureVAppParams">
|
* <complexType name="CaptureVAppParams">
|
||||||
* <complexContent>
|
* <complexContent>
|
||||||
|
@ -64,16 +62,13 @@ import com.google.common.base.Objects;
|
||||||
* </complexContent>
|
* </complexContent>
|
||||||
* </complexType>
|
* </complexType>
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
|
||||||
@XmlType(name = "CaptureVAppParams", propOrder = {
|
@XmlType(name = "CaptureVAppParams", propOrder = {
|
||||||
"source",
|
"source",
|
||||||
"section"
|
"section"
|
||||||
})
|
})
|
||||||
public class CaptureVAppParams
|
public class CaptureVAppParams
|
||||||
extends ParamsType<CaptureVAppParams>
|
extends ParamsType<CaptureVAppParams>
|
||||||
|
|
||||||
{
|
{
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
|
@ -86,9 +81,9 @@ public class CaptureVAppParams
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Builder extends ParamsType.Builder<CaptureVAppParams> {
|
public static class Builder extends ParamsType.Builder<CaptureVAppParams> {
|
||||||
|
|
||||||
private Reference source;
|
private Reference source;
|
||||||
private List<JAXBElement<? extends Section<?>>> sections;
|
private Set<? extends Section<?>> sections = ImmutableSet.of();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see CaptureVAppParams#getSource()
|
* @see CaptureVAppParams#getSource()
|
||||||
|
@ -101,130 +96,115 @@ public class CaptureVAppParams
|
||||||
/**
|
/**
|
||||||
* @see CaptureVAppParams#getSections()
|
* @see CaptureVAppParams#getSections()
|
||||||
*/
|
*/
|
||||||
public Builder sections(List<JAXBElement<? extends Section<?>>> sections) {
|
public Builder sections(Set<? extends Section<?>> sections) {
|
||||||
this.sections = sections;
|
this.sections = checkNotNull(sections, "sections");
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public CaptureVAppParams build() {
|
public CaptureVAppParams build() {
|
||||||
CaptureVAppParams captureVAppParams = new CaptureVAppParams(sections);
|
return new CaptureVAppParams(description, name, source, sections);
|
||||||
captureVAppParams.setSource(source);
|
|
||||||
return captureVAppParams;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Builder fromParamsType(ParamsType<CaptureVAppParams> in) {
|
public Builder fromParamsType(ParamsType<CaptureVAppParams> in) {
|
||||||
return Builder.class.cast(super.fromParamsType(in));
|
return Builder.class.cast(super.fromParamsType(in));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder fromCaptureVAppParams(CaptureVAppParams in) {
|
public Builder fromCaptureVAppParams(CaptureVAppParams in) {
|
||||||
return fromParamsType(in)
|
return fromParamsType(in)
|
||||||
.source(in.getSource())
|
.source(in.getSource())
|
||||||
.sections(in.getSections());
|
.sections(in.getSections());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private CaptureVAppParams(String description, String name, Reference source, Set<? extends Section<?>> sections) {
|
||||||
|
super(description, name);
|
||||||
|
this.source = source;
|
||||||
|
this.sections = sections;
|
||||||
|
}
|
||||||
|
|
||||||
private CaptureVAppParams() {
|
private CaptureVAppParams() {
|
||||||
// For JAXB and builder use
|
// For JAXB and builder use
|
||||||
}
|
}
|
||||||
|
|
||||||
private CaptureVAppParams(List<JAXBElement<? extends Section<?>>> sections) {
|
private CaptureVAppParams(Set<? extends Section<?>> sections) {
|
||||||
this.sections = sections;
|
this.sections = ImmutableSet.copyOf(sections);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@XmlElement(name = "Source", required = true)
|
@XmlElement(name = "Source", required = true)
|
||||||
protected Reference source;
|
protected Reference source;
|
||||||
@XmlElementRef(name = "Section", namespace = "http://schemas.dmtf.org/ovf/envelope/1", type = JAXBElement.class)
|
@XmlElementRef
|
||||||
protected List<JAXBElement<? extends Section<?>>> sections;
|
protected Set<? extends Section<?>> sections = Sets.newLinkedHashSet();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the source property.
|
* Gets the value of the source property.
|
||||||
*
|
*
|
||||||
* @return
|
* @return possible object is
|
||||||
* possible object is
|
* {@link Reference }
|
||||||
* {@link Reference }
|
*/
|
||||||
*
|
public Reference getSource() {
|
||||||
*/
|
return source;
|
||||||
public Reference getSource() {
|
}
|
||||||
return source;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the value of the source property.
|
* An ovf:Section to configure the captured vAppTemplate.
|
||||||
*
|
* Gets the value of the section property.
|
||||||
* @param value
|
* <p/>
|
||||||
* allowed object is
|
* <p/>
|
||||||
* {@link Reference }
|
* 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.
|
||||||
public void setSource(Reference value) {
|
* This is why there is not a <CODE>set</CODE> method for the section property.
|
||||||
this.source = value;
|
* <p/>
|
||||||
}
|
* <p/>
|
||||||
|
* For example, to add a new item, do as follows:
|
||||||
/**
|
* <pre>
|
||||||
*
|
* getSection().add(newItem);
|
||||||
* An ovf:Section to configure the captured vAppTemplate.
|
* </pre>
|
||||||
* Gets the value of the section property.
|
* <p/>
|
||||||
*
|
* <p/>
|
||||||
* <p>
|
* <p/>
|
||||||
* This accessor method returns a reference to the live list,
|
* Objects of the following type(s) are allowed in the list
|
||||||
* not a snapshot. Therefore any modification you make to the
|
* {@link JAXBElement }{@code <}{@link Section> }{@code >}
|
||||||
* returned list will be present inside the JAXB object.
|
* {@link JAXBElement }{@code <}{@link VirtualHardwareSection > }{@code >}
|
||||||
* This is why there is not a <CODE>set</CODE> method for the section property.
|
* {@link JAXBElement }{@code <}{@link LeaseSettingsSection> }{@code >}
|
||||||
*
|
* {@link JAXBElement }{@code <}{@link EulaSection> }{@code >}
|
||||||
* <p>
|
* {@link JAXBElement }{@code <}{@link RuntimeInfoSection> }{@code >}
|
||||||
* For example, to add a new item, do as follows:
|
* {@link JAXBElement }{@code <}{@link AnnotationSection> }{@code >}
|
||||||
* <pre>
|
* {@link JAXBElement }{@code <}{@link DeploymentOptionSection > }{@code >}
|
||||||
* getSection().add(newItem);
|
* {@link JAXBElement }{@code <}{@link StartupSection> }{@code >}
|
||||||
* </pre>
|
* {@link JAXBElement }{@code <}{@link ResourceAllocationSection> }{@code >}
|
||||||
*
|
* {@link JAXBElement }{@code <}{@link NetworkConnectionSection> }{@code >}
|
||||||
*
|
* {@link JAXBElement }{@code <}{@link CustomizationSection> }{@code >}
|
||||||
* <p>
|
* {@link JAXBElement }{@code <}{@link ProductSection > }{@code >}
|
||||||
* Objects of the following type(s) are allowed in the list
|
* {@link JAXBElement }{@code <}{@link GuestCustomizationSection> }{@code >}
|
||||||
* {@link JAXBElement }{@code <}{@link Section> }{@code >}
|
* {@link JAXBElement }{@code <}{@link OperatingSystemSection > }{@code >}
|
||||||
* {@link JAXBElement }{@code <}{@link VirtualHardwareSection > }{@code >}
|
* {@link JAXBElement }{@code <}{@link NetworkConfigSection> }{@code >}
|
||||||
* {@link JAXBElement }{@code <}{@link LeaseSettingsSection> }{@code >}
|
* {@link JAXBElement }{@code <}{@link NetworkSection > }{@code >}
|
||||||
* {@link JAXBElement }{@code <}{@link EulaSection> }{@code >}
|
* {@link JAXBElement }{@code <}{@link DiskSection > }{@code >}
|
||||||
* {@link JAXBElement }{@code <}{@link RuntimeInfoSection> }{@code >}
|
* {@link JAXBElement }{@code <}{@link InstallSection> }{@code >}
|
||||||
* {@link JAXBElement }{@code <}{@link AnnotationSection> }{@code >}
|
*/
|
||||||
* {@link JAXBElement }{@code <}{@link DeploymentOptionSection > }{@code >}
|
public Set<? extends Section<?>> getSections() {
|
||||||
* {@link JAXBElement }{@code <}{@link StartupSection> }{@code >}
|
return this.sections;
|
||||||
* {@link JAXBElement }{@code <}{@link ResourceAllocationSection> }{@code >}
|
}
|
||||||
* {@link JAXBElement }{@code <}{@link NetworkConnectionSection> }{@code >}
|
|
||||||
* {@link JAXBElement }{@code <}{@link CustomizationSection> }{@code >}
|
|
||||||
* {@link JAXBElement }{@code <}{@link ProductSection > }{@code >}
|
|
||||||
* {@link JAXBElement }{@code <}{@link GuestCustomizationSection> }{@code >}
|
|
||||||
* {@link JAXBElement }{@code <}{@link OperatingSystemSection > }{@code >}
|
|
||||||
* {@link JAXBElement }{@code <}{@link NetworkConfigSection> }{@code >}
|
|
||||||
* {@link JAXBElement }{@code <}{@link NetworkSection > }{@code >}
|
|
||||||
* {@link JAXBElement }{@code <}{@link DiskSection > }{@code >}
|
|
||||||
* {@link JAXBElement }{@code <}{@link InstallSection> }{@code >}
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public List<JAXBElement<? extends Section<?>>> getSections() {
|
|
||||||
if (sections == null) {
|
|
||||||
sections = new ArrayList<JAXBElement<? extends Section<?>>>();
|
|
||||||
}
|
|
||||||
return this.sections;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
return true;
|
return true;
|
||||||
if (o == null || getClass() != o.getClass())
|
if (o == null || getClass() != o.getClass())
|
||||||
return false;
|
return false;
|
||||||
CaptureVAppParams that = CaptureVAppParams.class.cast(o);
|
CaptureVAppParams that = CaptureVAppParams.class.cast(o);
|
||||||
return equal(source, that.source) &&
|
return equal(source, that.source) &&
|
||||||
equal(sections, that.sections);
|
equal(sections, that.sections);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hashCode(source,
|
return Objects.hashCode(source,
|
||||||
sections);
|
sections);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,11 +19,9 @@
|
||||||
package org.jclouds.vcloud.director.v1_5.domain;
|
package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
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.net.URI;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@ -33,14 +31,14 @@ import com.google.common.collect.Sets;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Container for references to VappTemplate and Media objects.
|
* Container for references to VappTemplate and Media objects.
|
||||||
*
|
* <p/>
|
||||||
* <pre>
|
* <pre>
|
||||||
* <complexType name="CatalogType" />
|
* <complexType name="CatalogType" />
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author grkvlt@apache.org
|
* @author grkvlt@apache.org
|
||||||
*/
|
*/
|
||||||
@XmlRootElement(namespace = VCLOUD_1_5_NS, name = "Catalog")
|
@XmlRootElement(name = "Catalog")
|
||||||
public class Catalog extends EntityType<Catalog> {
|
public class Catalog extends EntityType<Catalog> {
|
||||||
|
|
||||||
public static final String MEDIA_TYPE = VCloudDirectorMediaType.CATALOG;
|
public static final String MEDIA_TYPE = VCloudDirectorMediaType.CATALOG;
|
||||||
|
@ -95,16 +93,7 @@ public class Catalog extends EntityType<Catalog> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Catalog build() {
|
public Catalog build() {
|
||||||
Catalog catalog = new Catalog(href, name);
|
return new Catalog(href, type, links, description, tasksInProgress, id, name, owner, catalogItems, isPublished);
|
||||||
catalog.setOwner(owner);
|
|
||||||
catalog.setCatalogItems(catalogItems);
|
|
||||||
catalog.setIsPublished(isPublished);
|
|
||||||
catalog.setDescription(description);
|
|
||||||
catalog.setId(id);
|
|
||||||
catalog.setType(type);
|
|
||||||
catalog.setLinks(links);
|
|
||||||
catalog.setTasksInProgress(tasksInProgress);
|
|
||||||
return catalog;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -162,7 +151,7 @@ public class Catalog extends EntityType<Catalog> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ReferenceType#getLinks()
|
* @see EntityType#getLinks()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder links(Set<Link> links) {
|
public Builder links(Set<Link> links) {
|
||||||
|
@ -171,7 +160,7 @@ public class Catalog extends EntityType<Catalog> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ReferenceType#getLinks()
|
* @see EntityType#getLinks()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder link(Link link) {
|
public Builder link(Link link) {
|
||||||
|
@ -189,12 +178,16 @@ public class Catalog extends EntityType<Catalog> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Catalog() {
|
public Catalog(URI href, String type, Set<Link> links, String description, TasksInProgress tasksInProgress, String id,
|
||||||
// For JAXB and builder use
|
String name, Entity owner, CatalogItems catalogItems, Boolean published) {
|
||||||
|
super(href, type, links, description, tasksInProgress, id, name);
|
||||||
|
this.owner = owner;
|
||||||
|
this.catalogItems = catalogItems;
|
||||||
|
this.isPublished = published;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Catalog(URI href, String name) {
|
private Catalog() {
|
||||||
super(href, name);
|
// For JAXB and builder use
|
||||||
}
|
}
|
||||||
|
|
||||||
@XmlElement(name = "Owner")
|
@XmlElement(name = "Owner")
|
||||||
|
@ -211,10 +204,6 @@ public class Catalog extends EntityType<Catalog> {
|
||||||
return owner;
|
return owner;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setOwner(Entity value) {
|
|
||||||
this.owner = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the catalogItems property.
|
* Gets the value of the catalogItems property.
|
||||||
*/
|
*/
|
||||||
|
@ -222,10 +211,6 @@ public class Catalog extends EntityType<Catalog> {
|
||||||
return catalogItems;
|
return catalogItems;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCatalogItems(CatalogItems value) {
|
|
||||||
this.catalogItems = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the isPublished property.
|
* Gets the value of the isPublished property.
|
||||||
*/
|
*/
|
||||||
|
@ -233,7 +218,4 @@ public class Catalog extends EntityType<Catalog> {
|
||||||
return isPublished;
|
return isPublished;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setIsPublished(Boolean value) {
|
|
||||||
this.isPublished = value;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,31 +19,27 @@
|
||||||
package org.jclouds.vcloud.director.v1_5.domain;
|
package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
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.net.URI;
|
||||||
import java.util.List;
|
import java.util.Collections;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
|
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* Contains a reference to a VappTemplate or Media object and related metadata.
|
* Contains a reference to a VappTemplate or Media object and related metadata.
|
||||||
*
|
* <p/>
|
||||||
* <pre>
|
* <pre>
|
||||||
* <complexType name="CatalogItemType" />
|
* <complexType name="CatalogItemType" />
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author grkvlt@apache.org
|
* @author grkvlt@apache.org
|
||||||
*/
|
*/
|
||||||
@XmlRootElement(namespace = VCLOUD_1_5_NS, name = "CatalogItem")
|
@XmlRootElement(name = "CatalogItem")
|
||||||
public class CatalogItem extends EntityType<CatalogItem> {
|
public class CatalogItem extends EntityType<CatalogItem> {
|
||||||
|
|
||||||
public static final String MEDIA_TYPE = VCloudDirectorMediaType.CATALOG_ITEM;
|
public static final String MEDIA_TYPE = VCloudDirectorMediaType.CATALOG_ITEM;
|
||||||
|
@ -61,7 +57,7 @@ public class CatalogItem extends EntityType<CatalogItem> {
|
||||||
public static class Builder extends EntityType.Builder<CatalogItem> {
|
public static class Builder extends EntityType.Builder<CatalogItem> {
|
||||||
|
|
||||||
private Reference entity;
|
private Reference entity;
|
||||||
private List<Property> properties = Lists.newArrayList();
|
private Set<Property> properties = Sets.newLinkedHashSet();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see CatalogItem#getEntity()
|
* @see CatalogItem#getEntity()
|
||||||
|
@ -74,8 +70,8 @@ public class CatalogItem extends EntityType<CatalogItem> {
|
||||||
/**
|
/**
|
||||||
* @see CatalogItem#getProperties()
|
* @see CatalogItem#getProperties()
|
||||||
*/
|
*/
|
||||||
public Builder properties(List<Property> properties) {
|
public Builder properties(Set<Property> properties) {
|
||||||
this.properties = Lists.newArrayList(checkNotNull(properties, "properties"));
|
this.properties = Sets.newLinkedHashSet(checkNotNull(properties, "properties"));
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,14 +85,7 @@ public class CatalogItem extends EntityType<CatalogItem> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CatalogItem build() {
|
public CatalogItem build() {
|
||||||
CatalogItem catalog = new CatalogItem(href, name, entity);
|
return new CatalogItem(href, type, links, description, tasksInProgress, id, name, entity, properties);
|
||||||
catalog.setProperties(properties);
|
|
||||||
catalog.setDescription(description);
|
|
||||||
catalog.setId(id);
|
|
||||||
catalog.setType(type);
|
|
||||||
catalog.setLinks(links);
|
|
||||||
catalog.setTasksInProgress(tasksInProgress);
|
|
||||||
return catalog;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -154,7 +143,7 @@ public class CatalogItem extends EntityType<CatalogItem> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ReferenceType#getLinks()
|
* @see EntityType#getLinks()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder links(Set<Link> links) {
|
public Builder links(Set<Link> links) {
|
||||||
|
@ -163,7 +152,7 @@ public class CatalogItem extends EntityType<CatalogItem> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ReferenceType#getLinks()
|
* @see EntityType#getLinks()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder link(Link link) {
|
public Builder link(Link link) {
|
||||||
|
@ -181,20 +170,20 @@ public class CatalogItem extends EntityType<CatalogItem> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private CatalogItem() {
|
private CatalogItem(URI href, String type, Set<Link> links, String description, TasksInProgress tasksInProgress, String id, String name, Reference entity, Set<Property> properties) {
|
||||||
// For JAXB and builder use
|
super(href, type, links, description, tasksInProgress, id, name);
|
||||||
|
this.entity = entity;
|
||||||
|
this.properties = properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
private CatalogItem(URI href, String name, Reference entity) {
|
private CatalogItem() {
|
||||||
super(href, name);
|
// For JAXB and builder use
|
||||||
this.entity = entity;
|
|
||||||
this.setProperties(properties);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@XmlElement(name = "Entity", required = true)
|
@XmlElement(name = "Entity", required = true)
|
||||||
private Reference entity;
|
private Reference entity;
|
||||||
@XmlElement(name = "Property")
|
@XmlElement(name = "Property")
|
||||||
private List<Property> properties = Lists.newArrayList();
|
private Set<Property> properties = Sets.newLinkedHashSet();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A reference to a VappTemplate or Media object.
|
* A reference to a VappTemplate or Media object.
|
||||||
|
@ -205,18 +194,10 @@ public class CatalogItem extends EntityType<CatalogItem> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* User-specified key/value pair.
|
* User-specified key/value pair.
|
||||||
*
|
* <p/>
|
||||||
* This element has been superseded by the {@link Metadata} element, which is the preferred way to specify key/value pairs for objects.
|
* This element has been superseded by the {@link Metadata} element, which is the preferred way to specify key/value pairs for objects.
|
||||||
*/
|
*/
|
||||||
public List<Property> getProperties() {
|
public Set<Property> getProperties() {
|
||||||
return this.properties;
|
return Collections.unmodifiableSet(this.properties);
|
||||||
}
|
|
||||||
|
|
||||||
public void setProperties(List<Property> properties) {
|
|
||||||
this.properties = Lists.newArrayList(checkNotNull(properties, "properties"));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addProperty(Property property) {
|
|
||||||
this.properties.add(checkNotNull(property, "property"));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,31 +19,27 @@
|
||||||
package org.jclouds.vcloud.director.v1_5.domain;
|
package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_1_5_NS;
|
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.Collections;
|
||||||
|
import java.util.Set;
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
|
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Sets;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a list of catalog item references.
|
* Represents a list of catalog item references.
|
||||||
*
|
* <p/>
|
||||||
* <pre>
|
* <pre>
|
||||||
* <complexType name="CatalogItemsType" />
|
* <complexType name="CatalogItemsType" />
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author grkvlt@apache.org
|
* @author grkvlt@apache.org
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
@XmlRootElement(name = "CatalogItems")
|
||||||
@XmlRootElement(namespace = VCLOUD_1_5_NS, name = "CatalogItems")
|
|
||||||
public class CatalogItems {
|
public class CatalogItems {
|
||||||
|
|
||||||
public static final String MEDIA_TYPE = VCloudDirectorMediaType.CATALOG_ITEMS;
|
public static final String MEDIA_TYPE = VCloudDirectorMediaType.CATALOG_ITEMS;
|
||||||
|
@ -58,13 +54,13 @@ public class CatalogItems {
|
||||||
|
|
||||||
public static class Builder {
|
public static class Builder {
|
||||||
|
|
||||||
private List<Reference> catalogItems = Lists.newArrayList();
|
private Set<Reference> catalogItems = Sets.newLinkedHashSet();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see CatalogItems#getCatalogItems()
|
* @see CatalogItems#getCatalogItems()
|
||||||
*/
|
*/
|
||||||
public Builder items(List<Reference> catalogItems) {
|
public Builder items(Collection<Reference> catalogItems) {
|
||||||
this.catalogItems = Lists.newArrayList(checkNotNull(catalogItems, "catalogItems"));
|
this.catalogItems = Sets.newLinkedHashSet(checkNotNull(catalogItems, "catalogItems"));
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,24 +86,16 @@ public class CatalogItems {
|
||||||
}
|
}
|
||||||
|
|
||||||
private CatalogItems(Collection<Reference> tasks) {
|
private CatalogItems(Collection<Reference> tasks) {
|
||||||
this.catalogItems = Lists.newArrayList(checkNotNull(catalogItems, "catalogItems"));
|
this.catalogItems = catalogItems;
|
||||||
}
|
}
|
||||||
|
|
||||||
@XmlElement(name = "CatalogItem")
|
@XmlElement(name = "CatalogItem")
|
||||||
private List<Reference> catalogItems = Lists.newArrayList();
|
private Set<Reference> catalogItems = Sets.newLinkedHashSet();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the catalogItems property.
|
* Gets the value of the catalogItems property.
|
||||||
*/
|
*/
|
||||||
public List<Reference> getCatalogItems() {
|
public Set<Reference> getCatalogItems() {
|
||||||
return this.catalogItems;
|
return Collections.unmodifiableSet(this.catalogItems);
|
||||||
}
|
|
||||||
|
|
||||||
public void setCatalogItems(List<Reference> catalogItems) {
|
|
||||||
this.catalogItems = Lists.newArrayList(checkNotNull(catalogItems, "catalogItems"));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addCatalogItem(Reference catalogItem) {
|
|
||||||
this.catalogItems.add(checkNotNull(catalogItem, "catalogItem"));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,9 @@
|
||||||
package org.jclouds.vcloud.director.v1_5.domain;
|
package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_1_5_NS;
|
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
@XmlRootElement(namespace = VCLOUD_1_5_NS, name = "CatalogReference")
|
@XmlRootElement(name = "CatalogReference")
|
||||||
public class CatalogReference extends ReferenceType<CatalogReference> {
|
public class CatalogReference extends ReferenceType<CatalogReference> {
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
|
@ -23,11 +20,7 @@ public class CatalogReference extends ReferenceType<CatalogReference> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CatalogReference build() {
|
public CatalogReference build() {
|
||||||
CatalogReference reference = new CatalogReference(href);
|
return new CatalogReference(href, id, name, type);
|
||||||
reference.setId(id);
|
|
||||||
reference.setName(name);
|
|
||||||
reference.setType(type);
|
|
||||||
return reference;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -76,8 +69,8 @@ public class CatalogReference extends ReferenceType<CatalogReference> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected CatalogReference(URI href) {
|
public CatalogReference(URI href, String id, String name, String type) {
|
||||||
super(href);
|
super(href, id, name, type);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected CatalogReference() {
|
protected CatalogReference() {
|
||||||
|
|
|
@ -19,31 +19,27 @@
|
||||||
package org.jclouds.vcloud.director.v1_5.domain;
|
package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_1_5_NS;
|
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
|
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.ImmutableSet;
|
||||||
|
import com.google.common.collect.Sets;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Container for ReferenceType elements that reference catalogs.
|
* Container for ReferenceType elements that reference catalogs.
|
||||||
*
|
* <p/>
|
||||||
* <pre>
|
* <pre>
|
||||||
* <complexType name="CatalogsListType" />
|
* <complexType name="CatalogsListType" />
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author grkvlt@apache.org
|
* @author grkvlt@apache.org
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
@XmlRootElement(name = "CatalogsList")
|
||||||
@XmlRootElement(namespace = VCLOUD_1_5_NS, name = "CatalogsList")
|
|
||||||
public class CatalogsList {
|
public class CatalogsList {
|
||||||
|
|
||||||
public static final String MEDIA_TYPE = VCloudDirectorMediaType.CATALOG_ITEMS;
|
public static final String MEDIA_TYPE = VCloudDirectorMediaType.CATALOG_ITEMS;
|
||||||
|
@ -58,13 +54,13 @@ public class CatalogsList {
|
||||||
|
|
||||||
public static class Builder {
|
public static class Builder {
|
||||||
|
|
||||||
private List<Reference> catalogReferences = Lists.newArrayList();
|
private Set<Reference> catalogReferences = Sets.newLinkedHashSet();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see CatalogsList#getCatalogItems()
|
* @see CatalogsList#getCatalogItems()
|
||||||
*/
|
*/
|
||||||
public Builder catalogs(List<Reference> catalogReferences) {
|
public Builder catalogs(Collection<Reference> catalogReferences) {
|
||||||
this.catalogReferences = Lists.newArrayList(checkNotNull(catalogReferences, "catalogReferences"));
|
this.catalogReferences = Sets.newLinkedHashSet(checkNotNull(catalogReferences, "catalogReferences"));
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,7 +77,7 @@ public class CatalogsList {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder fromCatalogsList(CatalogsList in) {
|
public Builder fromCatalogsList(CatalogsList in) {
|
||||||
return catalogs(in.getCatalogsList());
|
return catalogs(in.getCatalogItems());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,25 +85,18 @@ public class CatalogsList {
|
||||||
// For JAXB and builder use
|
// For JAXB and builder use
|
||||||
}
|
}
|
||||||
|
|
||||||
private CatalogsList(Collection<Reference> tasks) {
|
private CatalogsList(Set<Reference> tasks) {
|
||||||
this.catalogReferences = Lists.newArrayList(checkNotNull(catalogReferences, "catalogReferences"));
|
this.catalogReferences = ImmutableSet.copyOf(checkNotNull(catalogReferences, "catalogReferences"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@XmlElement(name = "CatalogReference")
|
@XmlElement(name = "CatalogReference")
|
||||||
private List<Reference> catalogReferences = Lists.newArrayList();
|
private Set<Reference> catalogReferences = Sets.newLinkedHashSet();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the catalogReferences property.
|
* Gets the value of the catalogReferences property.
|
||||||
*/
|
*/
|
||||||
public List<Reference> getCatalogsList() {
|
public Set<Reference> getCatalogItems() {
|
||||||
return this.catalogReferences;
|
return this.catalogReferences;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCatalogsList(List<Reference> catalogReferences) {
|
|
||||||
this.catalogReferences = Lists.newArrayList(checkNotNull(catalogReferences, "catalogReferences"));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addCatalog(Reference catalog) {
|
|
||||||
this.catalogReferences.add(checkNotNull(catalog, "catalog"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,8 +21,6 @@ package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlType;
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
|
||||||
|
@ -30,15 +28,14 @@ import com.google.common.base.Objects;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Represents parameters for copying a media resource and optionally
|
||||||
* Represents parameters for copying a media resource and optionally
|
* deleting the source.
|
||||||
* deleting the source.
|
* <p/>
|
||||||
*
|
* <p/>
|
||||||
*
|
|
||||||
* <p>Java class for CloneMediaParams complex type.
|
* <p>Java class for CloneMediaParams complex type.
|
||||||
*
|
* <p/>
|
||||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
*
|
* <p/>
|
||||||
* <pre>
|
* <pre>
|
||||||
* <complexType name="CloneMediaParams">
|
* <complexType name="CloneMediaParams">
|
||||||
* <complexContent>
|
* <complexContent>
|
||||||
|
@ -52,16 +49,13 @@ import com.google.common.base.Objects;
|
||||||
* </complexContent>
|
* </complexContent>
|
||||||
* </complexType>
|
* </complexType>
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
|
||||||
@XmlType(name = "CloneMediaParams", propOrder = {
|
@XmlType(name = "CloneMediaParams", propOrder = {
|
||||||
"source",
|
"source",
|
||||||
"isSourceDelete"
|
"isSourceDelete"
|
||||||
})
|
})
|
||||||
public class CloneMediaParams
|
public class CloneMediaParams
|
||||||
extends ParamsType<CloneMediaParams>
|
extends ParamsType<CloneMediaParams>
|
||||||
|
|
||||||
{
|
{
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
|
@ -74,7 +68,7 @@ public class CloneMediaParams
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Builder extends ParamsType.Builder<CloneMediaParams> {
|
public static class Builder extends ParamsType.Builder<CloneMediaParams> {
|
||||||
|
|
||||||
private Reference source;
|
private Reference source;
|
||||||
private Boolean isSourceDelete;
|
private Boolean isSourceDelete;
|
||||||
|
|
||||||
|
@ -87,107 +81,80 @@ public class CloneMediaParams
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see CloneMediaParams#getIsSourceDelete()
|
* @see CloneMediaParams#isSourceDelete()
|
||||||
*/
|
*/
|
||||||
public Builder isSourceDelete(Boolean isSourceDelete) {
|
public Builder isSourceDelete(Boolean isSourceDelete) {
|
||||||
this.isSourceDelete = isSourceDelete;
|
this.isSourceDelete = isSourceDelete;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public CloneMediaParams build() {
|
public CloneMediaParams build() {
|
||||||
CloneMediaParams cloneMediaParams = new CloneMediaParams();
|
return new CloneMediaParams(description, name, source, isSourceDelete);
|
||||||
cloneMediaParams.setSource(source);
|
|
||||||
cloneMediaParams.setIsSourceDelete(isSourceDelete);
|
|
||||||
return cloneMediaParams;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Builder fromParamsType(ParamsType<CloneMediaParams> in) {
|
public Builder fromParamsType(ParamsType<CloneMediaParams> in) {
|
||||||
return Builder.class.cast(super.fromParamsType(in));
|
return Builder.class.cast(super.fromParamsType(in));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder fromCloneMediaParams(CloneMediaParams in) {
|
public Builder fromCloneMediaParams(CloneMediaParams in) {
|
||||||
return fromParamsType(in)
|
return fromParamsType(in)
|
||||||
.source(in.getSource())
|
.source(in.getSource())
|
||||||
.isSourceDelete(in.isSourceDelete());
|
.isSourceDelete(in.isSourceDelete());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private CloneMediaParams(String description, String name, Reference source, Boolean sourceDelete) {
|
||||||
|
super(description, name);
|
||||||
|
this.source = source;
|
||||||
|
isSourceDelete = sourceDelete;
|
||||||
|
}
|
||||||
|
|
||||||
private CloneMediaParams() {
|
private CloneMediaParams() {
|
||||||
// For JAXB and builder use
|
// For JAXB and builder use
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@XmlElement(name = "Source", required = true)
|
||||||
|
protected Reference source;
|
||||||
|
@XmlElement(name = "IsSourceDelete")
|
||||||
|
protected Boolean isSourceDelete;
|
||||||
|
|
||||||
@XmlElement(name = "Source", required = true)
|
/**
|
||||||
protected Reference source;
|
* Gets the value of the source property.
|
||||||
@XmlElement(name = "IsSourceDelete")
|
*
|
||||||
protected Boolean isSourceDelete;
|
* @return possible object is
|
||||||
|
* {@link Reference }
|
||||||
|
*/
|
||||||
|
public Reference getSource() {
|
||||||
|
return source;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the source property.
|
* Gets the value of the isSourceDelete property.
|
||||||
*
|
*
|
||||||
* @return
|
* @return possible object is
|
||||||
* possible object is
|
* {@link Boolean }
|
||||||
* {@link Reference }
|
*/
|
||||||
*
|
public Boolean isSourceDelete() {
|
||||||
*/
|
return isSourceDelete;
|
||||||
public Reference getSource() {
|
}
|
||||||
return source;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the source property.
|
|
||||||
*
|
|
||||||
* @param value
|
|
||||||
* allowed object is
|
|
||||||
* {@link Reference }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setSource(Reference value) {
|
|
||||||
this.source = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the value of the isSourceDelete property.
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
* possible object is
|
|
||||||
* {@link Boolean }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public Boolean isSourceDelete() {
|
|
||||||
return isSourceDelete;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the isSourceDelete property.
|
|
||||||
*
|
|
||||||
* @param value
|
|
||||||
* allowed object is
|
|
||||||
* {@link Boolean }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setIsSourceDelete(Boolean value) {
|
|
||||||
this.isSourceDelete = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
return true;
|
return true;
|
||||||
if (o == null || getClass() != o.getClass())
|
if (o == null || getClass() != o.getClass())
|
||||||
return false;
|
return false;
|
||||||
CloneMediaParams that = CloneMediaParams.class.cast(o);
|
CloneMediaParams that = CloneMediaParams.class.cast(o);
|
||||||
return equal(source, that.source) &&
|
return equal(source, that.source) &&
|
||||||
equal(isSourceDelete, that.isSourceDelete);
|
equal(isSourceDelete, that.isSourceDelete);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hashCode(source,
|
return Objects.hashCode(source,
|
||||||
isSourceDelete);
|
isSourceDelete);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -19,22 +19,19 @@
|
||||||
|
|
||||||
package org.jclouds.vcloud.director.v1_5.domain;
|
package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlType;
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Represents parameters for copying a vApp and optionally deleting the source.
|
||||||
* Represents parameters for copying a vApp and optionally deleting the source.
|
* <p/>
|
||||||
*
|
* <p/>
|
||||||
*
|
|
||||||
* <p>Java class for CloneVAppParams complex type.
|
* <p>Java class for CloneVAppParams complex type.
|
||||||
*
|
* <p/>
|
||||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
*
|
* <p/>
|
||||||
* <pre>
|
* <pre>
|
||||||
* <complexType name="CloneVAppParams">
|
* <complexType name="CloneVAppParams">
|
||||||
* <complexContent>
|
* <complexContent>
|
||||||
|
@ -44,13 +41,10 @@ import com.google.common.base.Objects;
|
||||||
* </complexContent>
|
* </complexContent>
|
||||||
* </complexType>
|
* </complexType>
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
|
||||||
@XmlType(name = "CloneVAppParams")
|
@XmlType(name = "CloneVAppParams")
|
||||||
public class CloneVAppParams
|
public class CloneVAppParams
|
||||||
extends InstantiateVAppParamsType<CloneVAppParams>
|
extends InstantiateVAppParamsType<CloneVAppParams>
|
||||||
|
|
||||||
{
|
{
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
|
@ -63,7 +57,7 @@ public class CloneVAppParams
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Builder extends InstantiateVAppParamsType.Builder<CloneVAppParams> {
|
public static class Builder extends InstantiateVAppParamsType.Builder<CloneVAppParams> {
|
||||||
|
|
||||||
|
|
||||||
public CloneVAppParams build() {
|
public CloneVAppParams build() {
|
||||||
CloneVAppParams cloneVAppParams = new CloneVAppParams();
|
CloneVAppParams cloneVAppParams = new CloneVAppParams();
|
||||||
|
@ -85,7 +79,7 @@ public class CloneVAppParams
|
||||||
super.name(name);
|
super.name(name);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppCreationParamsType#getVAppParent()
|
* @see VAppCreationParamsType#getVAppParent()
|
||||||
*/
|
*/
|
||||||
|
@ -117,7 +111,7 @@ public class CloneVAppParams
|
||||||
super.powerOn(powerOn);
|
super.powerOn(powerOn);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see InstantiateVAppParamsType#getSource()
|
* @see InstantiateVAppParamsType#getSource()
|
||||||
*/
|
*/
|
||||||
|
@ -144,8 +138,9 @@ public class CloneVAppParams
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Builder fromInstantiateVAppParamsType(InstantiateVAppParamsType<CloneVAppParams> in) {
|
public Builder fromInstantiateVAppParamsType(InstantiateVAppParamsType<CloneVAppParams> in) {
|
||||||
return Builder.class.cast(super.fromInstantiateVAppParamsType(in));
|
return Builder.class.cast(super.fromInstantiateVAppParamsType(in));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder fromCloneVAppParams(CloneVAppParams in) {
|
public Builder fromCloneVAppParams(CloneVAppParams in) {
|
||||||
return fromInstantiateVAppParamsType(in);
|
return fromInstantiateVAppParamsType(in);
|
||||||
}
|
}
|
||||||
|
@ -158,7 +153,7 @@ public class CloneVAppParams
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
return true;
|
return true;
|
||||||
if (o == null || getClass() != o.getClass())
|
if (o == null || getClass() != o.getClass())
|
||||||
return false;
|
return false;
|
||||||
CloneVAppParams that = CloneVAppParams.class.cast(o);
|
CloneVAppParams that = CloneVAppParams.class.cast(o);
|
||||||
|
|
|
@ -21,8 +21,6 @@ package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlType;
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
|
||||||
|
@ -30,15 +28,14 @@ import com.google.common.base.Objects;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Represents parameters for copying a vApp template and optionally
|
||||||
* Represents parameters for copying a vApp template and optionally
|
* deleting the source.
|
||||||
* deleting the source.
|
* <p/>
|
||||||
*
|
* <p/>
|
||||||
*
|
|
||||||
* <p>Java class for CloneVAppTemplateParams complex type.
|
* <p>Java class for CloneVAppTemplateParams complex type.
|
||||||
*
|
* <p/>
|
||||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
*
|
* <p/>
|
||||||
* <pre>
|
* <pre>
|
||||||
* <complexType name="CloneVAppTemplateParams">
|
* <complexType name="CloneVAppTemplateParams">
|
||||||
* <complexContent>
|
* <complexContent>
|
||||||
|
@ -52,16 +49,13 @@ import com.google.common.base.Objects;
|
||||||
* </complexContent>
|
* </complexContent>
|
||||||
* </complexType>
|
* </complexType>
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
|
||||||
@XmlType(name = "CloneVAppTemplateParams", propOrder = {
|
@XmlType(name = "CloneVAppTemplateParams", propOrder = {
|
||||||
"source",
|
"source",
|
||||||
"isSourceDelete"
|
"isSourceDelete"
|
||||||
})
|
})
|
||||||
public class CloneVAppTemplateParams
|
public class CloneVAppTemplateParams
|
||||||
extends ParamsType<CloneVAppTemplateParams>
|
extends ParamsType<CloneVAppTemplateParams>
|
||||||
|
|
||||||
{
|
{
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
|
@ -74,7 +68,7 @@ public class CloneVAppTemplateParams
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Builder extends ParamsType.Builder<CloneVAppTemplateParams> {
|
public static class Builder extends ParamsType.Builder<CloneVAppTemplateParams> {
|
||||||
|
|
||||||
private Reference source;
|
private Reference source;
|
||||||
private Boolean isSourceDelete;
|
private Boolean isSourceDelete;
|
||||||
|
|
||||||
|
@ -87,107 +81,80 @@ public class CloneVAppTemplateParams
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see CloneVAppTemplateParams#getIsSourceDelete()
|
* @see CloneVAppTemplateParams#isSourceDelete()
|
||||||
*/
|
*/
|
||||||
public Builder isSourceDelete(Boolean isSourceDelete) {
|
public Builder isSourceDelete(Boolean isSourceDelete) {
|
||||||
this.isSourceDelete = isSourceDelete;
|
this.isSourceDelete = isSourceDelete;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public CloneVAppTemplateParams build() {
|
public CloneVAppTemplateParams build() {
|
||||||
CloneVAppTemplateParams cloneVAppTemplateParams = new CloneVAppTemplateParams();
|
return new CloneVAppTemplateParams(description, name, source, isSourceDelete);
|
||||||
cloneVAppTemplateParams.setSource(source);
|
|
||||||
cloneVAppTemplateParams.setIsSourceDelete(isSourceDelete);
|
|
||||||
return cloneVAppTemplateParams;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Builder fromParamsType(ParamsType<CloneVAppTemplateParams> in) {
|
public Builder fromParamsType(ParamsType<CloneVAppTemplateParams> in) {
|
||||||
return Builder.class.cast(super.fromParamsType(in));
|
return Builder.class.cast(super.fromParamsType(in));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder fromCloneVAppTemplateParams(CloneVAppTemplateParams in) {
|
public Builder fromCloneVAppTemplateParams(CloneVAppTemplateParams in) {
|
||||||
return fromParamsType(in)
|
return fromParamsType(in)
|
||||||
.source(in.getSource())
|
.source(in.getSource())
|
||||||
.isSourceDelete(in.isSourceDelete());
|
.isSourceDelete(in.isSourceDelete());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public CloneVAppTemplateParams(String description, String name, Reference source, Boolean sourceDelete) {
|
||||||
|
super(description, name);
|
||||||
|
this.source = source;
|
||||||
|
isSourceDelete = sourceDelete;
|
||||||
|
}
|
||||||
|
|
||||||
private CloneVAppTemplateParams() {
|
private CloneVAppTemplateParams() {
|
||||||
// For JAXB and builder use
|
// For JAXB and builder use
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@XmlElement(name = "Source", required = true)
|
||||||
|
protected Reference source;
|
||||||
|
@XmlElement(name = "IsSourceDelete")
|
||||||
|
protected Boolean isSourceDelete;
|
||||||
|
|
||||||
@XmlElement(name = "Source", required = true)
|
/**
|
||||||
protected Reference source;
|
* Gets the value of the source property.
|
||||||
@XmlElement(name = "IsSourceDelete")
|
*
|
||||||
protected Boolean isSourceDelete;
|
* @return possible object is
|
||||||
|
* {@link Reference }
|
||||||
|
*/
|
||||||
|
public Reference getSource() {
|
||||||
|
return source;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the source property.
|
* Gets the value of the isSourceDelete property.
|
||||||
*
|
*
|
||||||
* @return
|
* @return possible object is
|
||||||
* possible object is
|
* {@link Boolean }
|
||||||
* {@link Reference }
|
*/
|
||||||
*
|
public Boolean isSourceDelete() {
|
||||||
*/
|
return isSourceDelete;
|
||||||
public Reference getSource() {
|
}
|
||||||
return source;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the source property.
|
|
||||||
*
|
|
||||||
* @param value
|
|
||||||
* allowed object is
|
|
||||||
* {@link Reference }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setSource(Reference value) {
|
|
||||||
this.source = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the value of the isSourceDelete property.
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
* possible object is
|
|
||||||
* {@link Boolean }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public Boolean isSourceDelete() {
|
|
||||||
return isSourceDelete;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the isSourceDelete property.
|
|
||||||
*
|
|
||||||
* @param value
|
|
||||||
* allowed object is
|
|
||||||
* {@link Boolean }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setIsSourceDelete(Boolean value) {
|
|
||||||
this.isSourceDelete = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
return true;
|
return true;
|
||||||
if (o == null || getClass() != o.getClass())
|
if (o == null || getClass() != o.getClass())
|
||||||
return false;
|
return false;
|
||||||
CloneVAppTemplateParams that = CloneVAppTemplateParams.class.cast(o);
|
CloneVAppTemplateParams that = CloneVAppTemplateParams.class.cast(o);
|
||||||
return equal(source, that.source) &&
|
return equal(source, that.source) &&
|
||||||
equal(isSourceDelete, that.isSourceDelete);
|
equal(isSourceDelete, that.isSourceDelete);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hashCode(source,
|
return Objects.hashCode(source,
|
||||||
isSourceDelete);
|
isSourceDelete);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -20,29 +20,27 @@
|
||||||
package org.jclouds.vcloud.director.v1_5.domain;
|
package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.Set;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlSeeAlso;
|
import javax.xml.bind.annotation.XmlSeeAlso;
|
||||||
import javax.xml.bind.annotation.XmlType;
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
|
import com.google.common.collect.ImmutableSet;
|
||||||
|
import com.google.common.collect.Sets;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Represents vApp composition parameters.
|
||||||
* Represents vApp composition parameters.
|
* <p/>
|
||||||
*
|
* <p/>
|
||||||
*
|
|
||||||
* <p>Java class for ComposeVAppParams complex type.
|
* <p>Java class for ComposeVAppParams complex type.
|
||||||
*
|
* <p/>
|
||||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
*
|
* <p/>
|
||||||
* <pre>
|
* <pre>
|
||||||
* <complexType name="ComposeVAppParams">
|
* <complexType name="ComposeVAppParams">
|
||||||
* <complexContent>
|
* <complexContent>
|
||||||
|
@ -57,19 +55,16 @@ import com.google.common.base.Objects;
|
||||||
* </complexContent>
|
* </complexContent>
|
||||||
* </complexType>
|
* </complexType>
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
|
||||||
@XmlType(name = "ComposeVAppParams", propOrder = {
|
@XmlType(name = "ComposeVAppParams", propOrder = {
|
||||||
"sourcedItem",
|
"sourcedItem",
|
||||||
"allEULAsAccepted"
|
"allEULAsAccepted"
|
||||||
})
|
})
|
||||||
@XmlSeeAlso({
|
@XmlSeeAlso({
|
||||||
// RecomposeVAppParamsType.class
|
// RecomposeVAppParamsType.class
|
||||||
})
|
})
|
||||||
public class ComposeVAppParams
|
public class ComposeVAppParams
|
||||||
extends VAppCreationParamsType<ComposeVAppParams>
|
extends VAppCreationParamsType<ComposeVAppParams>
|
||||||
|
|
||||||
{
|
{
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
|
@ -82,21 +77,21 @@ public class ComposeVAppParams
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Builder extends VAppCreationParamsType.Builder<ComposeVAppParams> {
|
public static class Builder extends VAppCreationParamsType.Builder<ComposeVAppParams> {
|
||||||
|
|
||||||
private List<SourcedCompositionItemParam> sourcedItem;
|
private Set<SourcedCompositionItemParam> sourcedItem = Sets.newLinkedHashSet();
|
||||||
private Boolean allEULAsAccepted;
|
private Boolean allEULAsAccepted;
|
||||||
private Boolean linkedClone;
|
private Boolean linkedClone;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ComposeVAppParams#getSourcedItem()
|
* @see ComposeVAppParams#getSourcedItem()
|
||||||
*/
|
*/
|
||||||
public Builder sourcedItem(List<SourcedCompositionItemParam> sourcedItem) {
|
public Builder sourcedItem(Set<SourcedCompositionItemParam> sourcedItem) {
|
||||||
this.sourcedItem = sourcedItem;
|
this.sourcedItem = checkNotNull(sourcedItem, "sourcedItem");
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ComposeVAppParams#getAllEULAsAccepted()
|
* @see ComposeVAppParams#isAllEULAsAccepted()
|
||||||
*/
|
*/
|
||||||
public Builder allEULAsAccepted(Boolean allEULAsAccepted) {
|
public Builder allEULAsAccepted(Boolean allEULAsAccepted) {
|
||||||
this.allEULAsAccepted = allEULAsAccepted;
|
this.allEULAsAccepted = allEULAsAccepted;
|
||||||
|
@ -104,7 +99,7 @@ public class ComposeVAppParams
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ComposeVAppParams#getLinkedClone()
|
* @see ComposeVAppParams#isLinkedClone() ()
|
||||||
*/
|
*/
|
||||||
public Builder linkedClone(Boolean linkedClone) {
|
public Builder linkedClone(Boolean linkedClone) {
|
||||||
this.linkedClone = linkedClone;
|
this.linkedClone = linkedClone;
|
||||||
|
@ -113,141 +108,109 @@ public class ComposeVAppParams
|
||||||
|
|
||||||
|
|
||||||
public ComposeVAppParams build() {
|
public ComposeVAppParams build() {
|
||||||
ComposeVAppParams composeVAppParams = new ComposeVAppParams(sourcedItem);
|
return new ComposeVAppParams(description, name, vAppParent, instantiationParams, deploy, powerOn,
|
||||||
composeVAppParams.setAllEULAsAccepted(allEULAsAccepted);
|
sourcedItem, allEULAsAccepted, linkedClone);
|
||||||
composeVAppParams.setLinkedClone(linkedClone);
|
|
||||||
return composeVAppParams;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Builder fromVAppCreationParamsType(VAppCreationParamsType<ComposeVAppParams> in) {
|
public Builder fromVAppCreationParamsType(VAppCreationParamsType<ComposeVAppParams> in) {
|
||||||
return Builder.class.cast(super.fromVAppCreationParamsType(in));
|
return Builder.class.cast(super.fromVAppCreationParamsType(in));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder fromComposeVAppParams(ComposeVAppParams in) {
|
public Builder fromComposeVAppParams(ComposeVAppParams in) {
|
||||||
return fromVAppCreationParamsType(in)
|
return fromVAppCreationParamsType(in)
|
||||||
.sourcedItem(in.getSourcedItem())
|
.sourcedItem(in.getSourcedItem())
|
||||||
.allEULAsAccepted(in.isAllEULAsAccepted())
|
.allEULAsAccepted(in.isAllEULAsAccepted())
|
||||||
.linkedClone(in.isLinkedClone());
|
.linkedClone(in.isLinkedClone());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ComposeVAppParams(String description, String name, Reference vAppParent, InstantiationParams instantiationParams,
|
||||||
|
Boolean deploy, Boolean powerOn, Set<SourcedCompositionItemParam> sourcedItem, Boolean allEULAsAccepted, Boolean linkedClone) {
|
||||||
|
super(description, name, vAppParent, instantiationParams, deploy, powerOn);
|
||||||
|
this.sourcedItem = ImmutableSet.copyOf(sourcedItem);
|
||||||
|
this.allEULAsAccepted = allEULAsAccepted;
|
||||||
|
this.linkedClone = linkedClone;
|
||||||
|
}
|
||||||
|
|
||||||
private ComposeVAppParams() {
|
private ComposeVAppParams() {
|
||||||
// For JAXB and builder use
|
// For JAXB and builder use
|
||||||
}
|
}
|
||||||
|
|
||||||
private ComposeVAppParams(List<SourcedCompositionItemParam> sourcedItem) {
|
|
||||||
this.sourcedItem = sourcedItem;
|
@XmlElement(name = "SourcedItem")
|
||||||
|
protected Set<SourcedCompositionItemParam> sourcedItem = Sets.newLinkedHashSet();
|
||||||
|
@XmlElement(name = "AllEULAsAccepted")
|
||||||
|
protected Boolean allEULAsAccepted;
|
||||||
|
@XmlAttribute
|
||||||
|
protected Boolean linkedClone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the sourcedItem property.
|
||||||
|
* <p/>
|
||||||
|
* <p/>
|
||||||
|
* 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 <CODE>set</CODE> method for the sourcedItem property.
|
||||||
|
* <p/>
|
||||||
|
* <p/>
|
||||||
|
* For example, to add a new item, do as follows:
|
||||||
|
* <pre>
|
||||||
|
* getSourcedItem().add(newItem);
|
||||||
|
* </pre>
|
||||||
|
* <p/>
|
||||||
|
* <p/>
|
||||||
|
* <p/>
|
||||||
|
* Objects of the following type(s) are allowed in the list
|
||||||
|
* {@link SourcedCompositionItemParam }
|
||||||
|
*/
|
||||||
|
public Set<SourcedCompositionItemParam> getSourcedItem() {
|
||||||
|
return this.sourcedItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Used to confirm acceptance of all EULAs in a
|
||||||
|
* vApp template. Instantiation fails if this
|
||||||
|
* element is missing, empty, or set to false
|
||||||
|
* and one or more EulaSection elements are
|
||||||
|
* present.
|
||||||
|
*
|
||||||
|
* @return possible object is
|
||||||
|
* {@link Boolean }
|
||||||
|
*/
|
||||||
|
public Boolean isAllEULAsAccepted() {
|
||||||
|
return allEULAsAccepted;
|
||||||
|
}
|
||||||
|
|
||||||
@XmlElement(name = "SourcedItem")
|
/**
|
||||||
protected List<SourcedCompositionItemParam> sourcedItem;
|
* Gets the value of the linkedClone property.
|
||||||
@XmlElement(name = "AllEULAsAccepted")
|
*
|
||||||
protected Boolean allEULAsAccepted;
|
* @return possible object is
|
||||||
@XmlAttribute
|
* {@link Boolean }
|
||||||
protected Boolean linkedClone;
|
*/
|
||||||
|
public Boolean isLinkedClone() {
|
||||||
/**
|
return linkedClone;
|
||||||
* Gets the value of the sourcedItem property.
|
}
|
||||||
*
|
|
||||||
* <p>
|
|
||||||
* 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 <CODE>set</CODE> method for the sourcedItem property.
|
|
||||||
*
|
|
||||||
* <p>
|
|
||||||
* For example, to add a new item, do as follows:
|
|
||||||
* <pre>
|
|
||||||
* getSourcedItem().add(newItem);
|
|
||||||
* </pre>
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* <p>
|
|
||||||
* Objects of the following type(s) are allowed in the list
|
|
||||||
* {@link SourcedCompositionItemParamType }
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public List<SourcedCompositionItemParam> getSourcedItem() {
|
|
||||||
if (sourcedItem == null) {
|
|
||||||
sourcedItem = new ArrayList<SourcedCompositionItemParam>();
|
|
||||||
}
|
|
||||||
return this.sourcedItem;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* Used to confirm acceptance of all EULAs in a
|
|
||||||
* vApp template. Instantiation fails if this
|
|
||||||
* element is missing, empty, or set to false
|
|
||||||
* and one or more EulaSection elements are
|
|
||||||
* present.
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
* possible object is
|
|
||||||
* {@link Boolean }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public Boolean isAllEULAsAccepted() {
|
|
||||||
return allEULAsAccepted;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the allEULAsAccepted property.
|
|
||||||
*
|
|
||||||
* @param value
|
|
||||||
* allowed object is
|
|
||||||
* {@link Boolean }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setAllEULAsAccepted(Boolean value) {
|
|
||||||
this.allEULAsAccepted = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the value of the linkedClone property.
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
* possible object is
|
|
||||||
* {@link Boolean }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public Boolean isLinkedClone() {
|
|
||||||
return linkedClone;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the linkedClone property.
|
|
||||||
*
|
|
||||||
* @param value
|
|
||||||
* allowed object is
|
|
||||||
* {@link Boolean }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setLinkedClone(Boolean value) {
|
|
||||||
this.linkedClone = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
return true;
|
return true;
|
||||||
if (o == null || getClass() != o.getClass())
|
if (o == null || getClass() != o.getClass())
|
||||||
return false;
|
return false;
|
||||||
ComposeVAppParams that = ComposeVAppParams.class.cast(o);
|
ComposeVAppParams that = ComposeVAppParams.class.cast(o);
|
||||||
return equal(sourcedItem, that.sourcedItem) &&
|
return equal(sourcedItem, that.sourcedItem) &&
|
||||||
equal(allEULAsAccepted, that.allEULAsAccepted) &&
|
equal(allEULAsAccepted, that.allEULAsAccepted) &&
|
||||||
equal(linkedClone, that.linkedClone);
|
equal(linkedClone, that.linkedClone);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hashCode(sourcedItem,
|
return Objects.hashCode(sourcedItem,
|
||||||
allEULAsAccepted,
|
allEULAsAccepted,
|
||||||
linkedClone);
|
linkedClone);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -21,8 +21,6 @@ package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlType;
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
|
||||||
|
@ -30,14 +28,13 @@ import com.google.common.base.Objects;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Represents a compute capacity with units.
|
||||||
* Represents a compute capacity with units.
|
* <p/>
|
||||||
*
|
* <p/>
|
||||||
*
|
|
||||||
* <p>Java class for ComputeCapacity complex type.
|
* <p>Java class for ComputeCapacity complex type.
|
||||||
*
|
* <p/>
|
||||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
*
|
* <p/>
|
||||||
* <pre>
|
* <pre>
|
||||||
* <complexType name="ComputeCapacity">
|
* <complexType name="ComputeCapacity">
|
||||||
* <complexContent>
|
* <complexContent>
|
||||||
|
@ -51,13 +48,10 @@ import com.google.common.base.Objects;
|
||||||
* </complexContent>
|
* </complexContent>
|
||||||
* </complexType>
|
* </complexType>
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
|
||||||
@XmlType(name = "ComputeCapacity", propOrder = {
|
@XmlType(name = "ComputeCapacity", propOrder = {
|
||||||
"cpu",
|
"cpu",
|
||||||
"memory"
|
"memory"
|
||||||
})
|
})
|
||||||
public class ComputeCapacity {
|
public class ComputeCapacity {
|
||||||
public static Builder builder() {
|
public static Builder builder() {
|
||||||
|
@ -69,7 +63,7 @@ public class ComputeCapacity {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Builder {
|
public static class Builder {
|
||||||
|
|
||||||
private CapacityWithUsage cpu;
|
private CapacityWithUsage cpu;
|
||||||
private CapacityWithUsage memory;
|
private CapacityWithUsage memory;
|
||||||
|
|
||||||
|
@ -89,95 +83,66 @@ public class ComputeCapacity {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public ComputeCapacity build() {
|
public ComputeCapacity build() {
|
||||||
ComputeCapacity computeCapacity = new ComputeCapacity();
|
return new ComputeCapacity(cpu, memory);
|
||||||
computeCapacity.setCpu(cpu);
|
|
||||||
computeCapacity.setMemory(memory);
|
|
||||||
return computeCapacity;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Builder fromComputeCapacity(ComputeCapacity in) {
|
public Builder fromComputeCapacity(ComputeCapacity in) {
|
||||||
return cpu(in.getCpu())
|
return cpu(in.getCpu())
|
||||||
.memory(in.getMemory());
|
.memory(in.getMemory());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private ComputeCapacity(CapacityWithUsage cpu, CapacityWithUsage memory) {
|
||||||
|
this.cpu = cpu;
|
||||||
|
this.memory = memory;
|
||||||
|
}
|
||||||
|
|
||||||
private ComputeCapacity() {
|
private ComputeCapacity() {
|
||||||
// For JAXB and builder use
|
// For JAXB and builder use
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@XmlElement(name = "Cpu", required = true)
|
||||||
|
protected CapacityWithUsage cpu;
|
||||||
|
@XmlElement(name = "Memory", required = true)
|
||||||
|
protected CapacityWithUsage memory;
|
||||||
|
|
||||||
@XmlElement(name = "Cpu", required = true)
|
/**
|
||||||
protected CapacityWithUsage cpu;
|
* Gets the value of the cpu property.
|
||||||
@XmlElement(name = "Memory", required = true)
|
*
|
||||||
protected CapacityWithUsage memory;
|
* @return possible object is
|
||||||
|
* {@link CapacityWithUsage }
|
||||||
/**
|
*/
|
||||||
* Gets the value of the cpu property.
|
public CapacityWithUsage getCpu() {
|
||||||
*
|
return cpu;
|
||||||
* @return
|
}
|
||||||
* possible object is
|
|
||||||
* {@link CapacityWithUsage }
|
/**
|
||||||
*
|
* Gets the value of the memory property.
|
||||||
*/
|
*
|
||||||
public CapacityWithUsage getCpu() {
|
* @return possible object is
|
||||||
return cpu;
|
* {@link CapacityWithUsage }
|
||||||
}
|
*/
|
||||||
|
public CapacityWithUsage getMemory() {
|
||||||
/**
|
return memory;
|
||||||
* Sets the value of the cpu property.
|
}
|
||||||
*
|
|
||||||
* @param value
|
|
||||||
* allowed object is
|
|
||||||
* {@link CapacityWithUsage }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setCpu(CapacityWithUsage value) {
|
|
||||||
this.cpu = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the value of the memory property.
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
* possible object is
|
|
||||||
* {@link CapacityWithUsage }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public CapacityWithUsage getMemory() {
|
|
||||||
return memory;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the memory property.
|
|
||||||
*
|
|
||||||
* @param value
|
|
||||||
* allowed object is
|
|
||||||
* {@link CapacityWithUsage }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setMemory(CapacityWithUsage value) {
|
|
||||||
this.memory = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
return true;
|
return true;
|
||||||
if (o == null || getClass() != o.getClass())
|
if (o == null || getClass() != o.getClass())
|
||||||
return false;
|
return false;
|
||||||
ComputeCapacity that = ComputeCapacity.class.cast(o);
|
ComputeCapacity that = ComputeCapacity.class.cast(o);
|
||||||
return equal(cpu, that.cpu) &&
|
return equal(cpu, that.cpu) &&
|
||||||
equal(memory, that.memory);
|
equal(memory, that.memory);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hashCode(cpu,
|
return Objects.hashCode(cpu,
|
||||||
memory);
|
memory);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -20,23 +20,22 @@
|
||||||
package org.jclouds.vcloud.director.v1_5.domain;
|
package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.ArrayList;
|
import java.util.Set;
|
||||||
import java.util.List;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlAnyElement;
|
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
import javax.xml.bind.annotation.XmlSchemaType;
|
import javax.xml.bind.annotation.XmlSchemaType;
|
||||||
import javax.xml.bind.annotation.XmlType;
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
|
||||||
|
import org.jclouds.javax.annotation.Nullable;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.ovf.SectionType;
|
import org.jclouds.vcloud.director.v1_5.domain.ovf.SectionType;
|
||||||
import org.w3c.dom.Element;
|
|
||||||
|
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
|
import com.google.common.collect.ImmutableSet;
|
||||||
|
import com.google.common.collect.Sets;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -64,12 +63,10 @@ import com.google.common.base.Objects;
|
||||||
* </complexType>
|
* </complexType>
|
||||||
* </pre>
|
* </pre>
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
|
||||||
@XmlRootElement(name = "CustomizationSection")
|
@XmlRootElement(name = "CustomizationSection")
|
||||||
@XmlType(propOrder = {
|
@XmlType(propOrder = {
|
||||||
"customizeOnInstantiate",
|
"customizeOnInstantiate",
|
||||||
"link",
|
"links"
|
||||||
"any"
|
|
||||||
})
|
})
|
||||||
public class CustomizationSection extends SectionType<CustomizationSection> {
|
public class CustomizationSection extends SectionType<CustomizationSection> {
|
||||||
public static Builder builder() {
|
public static Builder builder() {
|
||||||
|
@ -82,8 +79,7 @@ public class CustomizationSection extends SectionType<CustomizationSection> {
|
||||||
|
|
||||||
public static class Builder extends SectionType.Builder<CustomizationSection> {
|
public static class Builder extends SectionType.Builder<CustomizationSection> {
|
||||||
private boolean customizeOnInstantiate;
|
private boolean customizeOnInstantiate;
|
||||||
private List<Link> link;
|
private Set<Link> links = Sets.newLinkedHashSet();
|
||||||
private List<Object> any;
|
|
||||||
private URI href;
|
private URI href;
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
|
@ -96,18 +92,10 @@ public class CustomizationSection extends SectionType<CustomizationSection> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see CustomizationSection#getLink()
|
* @see CustomizationSection#getLinks()
|
||||||
*/
|
*/
|
||||||
public Builder link(List<Link> link) {
|
public Builder links(Set<Link> links) {
|
||||||
this.link = link;
|
this.links = checkNotNull(links, "links");
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @see CustomizationSection#getAny()
|
|
||||||
*/
|
|
||||||
public Builder any(List<Object> any) {
|
|
||||||
this.any = any;
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,18 +117,13 @@ public class CustomizationSection extends SectionType<CustomizationSection> {
|
||||||
|
|
||||||
|
|
||||||
public CustomizationSection build() {
|
public CustomizationSection build() {
|
||||||
CustomizationSection customizationSection = new CustomizationSection(info, link, any);
|
return new CustomizationSection(info, required, customizeOnInstantiate, links, href, type);
|
||||||
customizationSection.setCustomizeOnInstantiate(customizeOnInstantiate);
|
|
||||||
customizationSection.setHref(href);
|
|
||||||
customizationSection.setType(type);
|
|
||||||
return customizationSection;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder fromCustomizationSection(CustomizationSection in) {
|
public Builder fromCustomizationSection(CustomizationSection in) {
|
||||||
return fromSection(in)
|
return fromSection(in)
|
||||||
.customizeOnInstantiate(in.isCustomizeOnInstantiate())
|
.customizeOnInstantiate(in.isCustomizeOnInstantiate())
|
||||||
.link(in.getLink())
|
.links(in.getLinks())
|
||||||
.any(in.getAny())
|
|
||||||
.href(in.getHref())
|
.href(in.getHref())
|
||||||
.type(in.getType());
|
.type(in.getType());
|
||||||
}
|
}
|
||||||
|
@ -160,13 +143,23 @@ public class CustomizationSection extends SectionType<CustomizationSection> {
|
||||||
public Builder info(String info) {
|
public Builder info(String info) {
|
||||||
return Builder.class.cast(super.info(info));
|
return Builder.class.cast(super.info(info));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Builder required(Boolean required) {
|
||||||
|
return Builder.class.cast(super.required(required));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private CustomizationSection(String info, List<Link> link, List<Object> any) {
|
private CustomizationSection(@Nullable String info, @Nullable Boolean required, boolean customizeOnInstantiate, Set<Link> links,
|
||||||
super(info);
|
URI href, String type) {
|
||||||
this.link = link;
|
super(info, required);
|
||||||
this.any = any;
|
this.customizeOnInstantiate = customizeOnInstantiate;
|
||||||
|
this.links = ImmutableSet.copyOf(links);
|
||||||
|
this.href = href;
|
||||||
|
this.type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
private CustomizationSection() {
|
private CustomizationSection() {
|
||||||
|
@ -176,9 +169,7 @@ public class CustomizationSection extends SectionType<CustomizationSection> {
|
||||||
@XmlElement(name = "CustomizeOnInstantiate")
|
@XmlElement(name = "CustomizeOnInstantiate")
|
||||||
protected boolean customizeOnInstantiate;
|
protected boolean customizeOnInstantiate;
|
||||||
@XmlElement(name = "Link")
|
@XmlElement(name = "Link")
|
||||||
protected List<Link> link;
|
protected Set<Link> links = Sets.newLinkedHashSet();
|
||||||
@XmlAnyElement(lax = true)
|
|
||||||
protected List<Object> any;
|
|
||||||
@XmlAttribute
|
@XmlAttribute
|
||||||
@XmlSchemaType(name = "anyURI")
|
@XmlSchemaType(name = "anyURI")
|
||||||
protected URI href;
|
protected URI href;
|
||||||
|
@ -193,65 +184,10 @@ public class CustomizationSection extends SectionType<CustomizationSection> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the value of the customizeOnInstantiate property.
|
* Gets the value of the links property.
|
||||||
*/
|
*/
|
||||||
public void setCustomizeOnInstantiate(boolean value) {
|
public Set<Link> getLinks() {
|
||||||
this.customizeOnInstantiate = value;
|
return this.links;
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the value of the link property.
|
|
||||||
* <p/>
|
|
||||||
* <p/>
|
|
||||||
* 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 <CODE>set</CODE> method for the link property.
|
|
||||||
* <p/>
|
|
||||||
* <p/>
|
|
||||||
* For example, to add a new item, do as follows:
|
|
||||||
* <pre>
|
|
||||||
* getLink().add(newItem);
|
|
||||||
* </pre>
|
|
||||||
* <p/>
|
|
||||||
* <p/>
|
|
||||||
* <p/>
|
|
||||||
* Objects of the following type(s) are allowed in the list
|
|
||||||
* {@link Link }
|
|
||||||
*/
|
|
||||||
public List<Link> getLink() {
|
|
||||||
if (link == null) {
|
|
||||||
link = new ArrayList<Link>();
|
|
||||||
}
|
|
||||||
return this.link;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the value of the any property.
|
|
||||||
* <p/>
|
|
||||||
* <p/>
|
|
||||||
* 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 <CODE>set</CODE> method for the any property.
|
|
||||||
* <p/>
|
|
||||||
* <p/>
|
|
||||||
* For example, to add a new item, do as follows:
|
|
||||||
* <pre>
|
|
||||||
* getAny().add(newItem);
|
|
||||||
* </pre>
|
|
||||||
* <p/>
|
|
||||||
* <p/>
|
|
||||||
* <p/>
|
|
||||||
* Objects of the following type(s) are allowed in the list
|
|
||||||
* {@link Object }
|
|
||||||
* {@link Element }
|
|
||||||
*/
|
|
||||||
public List<Object> getAny() {
|
|
||||||
if (any == null) {
|
|
||||||
any = new ArrayList<Object>();
|
|
||||||
}
|
|
||||||
return this.any;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -264,16 +200,6 @@ public class CustomizationSection extends SectionType<CustomizationSection> {
|
||||||
return href;
|
return href;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the href property.
|
|
||||||
*
|
|
||||||
* @param value allowed object is
|
|
||||||
* {@link String }
|
|
||||||
*/
|
|
||||||
public void setHref(URI value) {
|
|
||||||
this.href = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the type property.
|
* Gets the value of the type property.
|
||||||
*
|
*
|
||||||
|
@ -284,16 +210,6 @@ public class CustomizationSection extends SectionType<CustomizationSection> {
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the type property.
|
|
||||||
*
|
|
||||||
* @param value allowed object is
|
|
||||||
* {@link String }
|
|
||||||
*/
|
|
||||||
public void setType(String value) {
|
|
||||||
this.type = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
|
@ -301,30 +217,30 @@ public class CustomizationSection extends SectionType<CustomizationSection> {
|
||||||
if (o == null || getClass() != o.getClass())
|
if (o == null || getClass() != o.getClass())
|
||||||
return false;
|
return false;
|
||||||
CustomizationSection that = CustomizationSection.class.cast(o);
|
CustomizationSection that = CustomizationSection.class.cast(o);
|
||||||
return equal(customizeOnInstantiate, that.customizeOnInstantiate) &&
|
return super.equals(that) &&
|
||||||
equal(link, that.link) &&
|
equal(customizeOnInstantiate, that.customizeOnInstantiate) &&
|
||||||
equal(any, that.any) &&
|
equal(links, that.links) &&
|
||||||
equal(href, that.href) &&
|
equal(href, that.href) &&
|
||||||
equal(type, that.type);
|
equal(type, that.type);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hashCode(customizeOnInstantiate,
|
return Objects.hashCode(
|
||||||
link,
|
super.hashCode(),
|
||||||
any,
|
customizeOnInstantiate,
|
||||||
|
links,
|
||||||
href,
|
href,
|
||||||
type);
|
type);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public Objects.ToStringHelper string() {
|
||||||
return Objects.toStringHelper("")
|
return super.string()
|
||||||
.add("customizeOnInstantiate", customizeOnInstantiate)
|
.add("customizeOnInstantiate", customizeOnInstantiate)
|
||||||
.add("link", link)
|
.add("links", links)
|
||||||
.add("any", any)
|
|
||||||
.add("href", href)
|
.add("href", href)
|
||||||
.add("type", type).toString();
|
.add("type", type);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,10 +29,10 @@ import com.google.common.collect.Sets;
|
||||||
* An entity.
|
* An entity.
|
||||||
*
|
*
|
||||||
* @author grkvlt@apache.org
|
* @author grkvlt@apache.org
|
||||||
|
* @author Adam Lowe
|
||||||
*/
|
*/
|
||||||
public class Entity extends EntityType<Entity> {
|
public class Entity extends EntityType<Entity> {
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public static Builder builder() {
|
public static Builder builder() {
|
||||||
return new Builder();
|
return new Builder();
|
||||||
}
|
}
|
||||||
|
@ -46,13 +46,7 @@ public class Entity extends EntityType<Entity> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Entity build() {
|
public Entity build() {
|
||||||
Entity entity = new Entity(href, name);
|
return new Entity(href, type, links, description, tasksInProgress, id, name);
|
||||||
entity.setDescription(description);
|
|
||||||
entity.setTasksInProgress(tasksInProgress);
|
|
||||||
entity.setId(id);
|
|
||||||
entity.setType(type);
|
|
||||||
entity.setLinks(links);
|
|
||||||
return entity;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -110,7 +104,7 @@ public class Entity extends EntityType<Entity> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ReferenceType#getLinks()
|
* @see EntityType#getLinks()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder links(Set<Link> links) {
|
public Builder links(Set<Link> links) {
|
||||||
|
@ -119,7 +113,7 @@ public class Entity extends EntityType<Entity> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ReferenceType#getLinks()
|
* @see EntityType#getLinks()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder link(Link link) {
|
public Builder link(Link link) {
|
||||||
|
@ -137,21 +131,11 @@ public class Entity extends EntityType<Entity> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Entity(URI href, String name) {
|
private Entity(URI href, String type, Set<Link> links, String description, TasksInProgress tasksInProgress, String id, String name) {
|
||||||
super(href, name);
|
super(href, type, links, description, tasksInProgress, id, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Entity() {
|
private Entity() {
|
||||||
// For JAXB
|
// For JAXB
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean equals(Object o) {
|
|
||||||
if (this == o)
|
|
||||||
return true;
|
|
||||||
if (o == null || getClass() != o.getClass())
|
|
||||||
return false;
|
|
||||||
Entity that = Entity.class.cast(o);
|
|
||||||
return super.equals(that);
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -20,11 +20,9 @@ package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
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.net.URI;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
|
|
||||||
|
@ -34,27 +32,19 @@ import com.google.common.collect.Sets;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Basic entity type in the vCloud object model.
|
* Basic entity type in the vCloud object model.
|
||||||
*
|
* <p/>
|
||||||
* Includes a name, an optional description, and an optional list of links
|
* Includes a name, an optional description, and an optional list of links
|
||||||
*
|
* <p/>
|
||||||
* <pre>
|
* <pre>
|
||||||
* <xs:complexType name="EntityType">
|
* <xs:complexType name="EntityType">
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author grkvlt@apache.org
|
* @author grkvlt@apache.org
|
||||||
|
* @author Adam Lowe
|
||||||
*/
|
*/
|
||||||
public class EntityType<T extends EntityType<T>> extends ResourceType<T> {
|
public abstract class EntityType<T extends EntityType<T>> extends ResourceType<T> {
|
||||||
|
|
||||||
public static <T extends EntityType<T>> Builder<T> builder() {
|
public static abstract class Builder<T extends EntityType<T>> extends ResourceType.Builder<T> {
|
||||||
return new Builder<T>();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Builder<T> toBuilder() {
|
|
||||||
return new Builder<T>().fromEntityType(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class Builder<T extends EntityType<T>> extends ResourceType.Builder<T> {
|
|
||||||
|
|
||||||
protected String description;
|
protected String description;
|
||||||
protected TasksInProgress tasksInProgress;
|
protected TasksInProgress tasksInProgress;
|
||||||
|
@ -93,17 +83,6 @@ public class EntityType<T extends EntityType<T>> extends ResourceType<T> {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public EntityType<T> build() {
|
|
||||||
EntityType<T> entity = new EntityType<T>(href, name);
|
|
||||||
entity.setDescription(description);
|
|
||||||
entity.setTasksInProgress(tasksInProgress);
|
|
||||||
entity.setId(id);
|
|
||||||
entity.setType(type);
|
|
||||||
entity.setLinks(links);
|
|
||||||
return entity;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ResourceType#getHref()
|
* @see ResourceType#getHref()
|
||||||
*/
|
*/
|
||||||
|
@ -151,22 +130,25 @@ public class EntityType<T extends EntityType<T>> extends ResourceType<T> {
|
||||||
|
|
||||||
public Builder<T> fromEntityType(EntityType<T> in) {
|
public Builder<T> fromEntityType(EntityType<T> in) {
|
||||||
return fromResourceType(in)
|
return fromResourceType(in)
|
||||||
.description(in.getDescription()).tasksInProgress(in.getTasksInProgress())
|
.description(in.getDescription()).tasksInProgress(in.getTasksInProgress())
|
||||||
.id(in.getId()).name(in.getName());
|
.id(in.getId()).name(in.getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@XmlElement(namespace = VCLOUD_1_5_NS, name = "Description")
|
@XmlElement(name = "Description")
|
||||||
private String description;
|
private String description;
|
||||||
@XmlElement(namespace = VCLOUD_1_5_NS, name = "TasksInProgress")
|
@XmlElement(name = "TasksInProgress")
|
||||||
private TasksInProgress tasksInProgress;
|
private TasksInProgress tasksInProgress;
|
||||||
@XmlAttribute
|
@XmlAttribute
|
||||||
private String id;
|
private String id;
|
||||||
@XmlAttribute(required = true)
|
@XmlAttribute(required = true)
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
protected EntityType(URI href, String name) {
|
public EntityType(URI href, String type, Set<Link> links, String description, TasksInProgress tasksInProgress, String id, String name) {
|
||||||
super(href);
|
super(href, type, links);
|
||||||
|
this.description = description;
|
||||||
|
this.tasksInProgress = tasksInProgress;
|
||||||
|
this.id = id;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -181,10 +163,6 @@ public class EntityType<T extends EntityType<T>> extends ResourceType<T> {
|
||||||
return description;
|
return description;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDescription(String description) {
|
|
||||||
this.description = description;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A list of queued, running, or recently completed tasks associated with this entity.
|
* A list of queued, running, or recently completed tasks associated with this entity.
|
||||||
*/
|
*/
|
||||||
|
@ -192,13 +170,9 @@ public class EntityType<T extends EntityType<T>> extends ResourceType<T> {
|
||||||
return tasksInProgress;
|
return tasksInProgress;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTasksInProgress(TasksInProgress tasksInProgress) {
|
|
||||||
this.tasksInProgress = tasksInProgress;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The resource identifier, expressed in URN format.
|
* The resource identifier, expressed in URN format.
|
||||||
*
|
* <p/>
|
||||||
* The value of this attribute uniquely identifies the resource, persists for the life of the
|
* The value of this attribute uniquely identifies the resource, persists for the life of the
|
||||||
* resource, and is never reused.
|
* resource, and is never reused.
|
||||||
*/
|
*/
|
||||||
|
@ -206,20 +180,12 @@ public class EntityType<T extends EntityType<T>> extends ResourceType<T> {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setId(String id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Contains the name of the the entity.
|
* Contains the name of the the entity.
|
||||||
*/
|
*/
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setName(String name) {
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
|
|
|
@ -20,10 +20,7 @@ package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_1_5_NS;
|
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@ -33,17 +30,16 @@ import com.google.common.base.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The standard error message type used in the vCloud REST API.
|
* The standard error message type used in the vCloud REST API.
|
||||||
*
|
* <p/>
|
||||||
* <pre>
|
* <pre>
|
||||||
* <xs:complexType name="ErrorType">
|
* <xs:complexType name="ErrorType">
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author grkvlt@apache.org
|
* @author grkvlt@apache.org
|
||||||
*/
|
*/
|
||||||
@XmlRootElement(namespace = VCLOUD_1_5_NS, name = "Error")
|
@XmlRootElement(name = "Error")
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
|
||||||
public class Error {
|
public class Error {
|
||||||
|
|
||||||
public static final String MEDIA_TYPE = VCloudDirectorMediaType.ERROR;
|
public static final String MEDIA_TYPE = VCloudDirectorMediaType.ERROR;
|
||||||
|
|
||||||
public static Builder builder() {
|
public static Builder builder() {
|
||||||
|
@ -103,10 +99,7 @@ public class Error {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Error build() {
|
public Error build() {
|
||||||
Error error = new Error(message, majorErrorCode, minorErrorCode);
|
return new Error(message, majorErrorCode, minorErrorCode, vendorSpecificErrorCode, stackTrace);
|
||||||
error.setVendorSpecificErrorCode(vendorSpecificErrorCode);
|
|
||||||
error.setStackTrace(stackTrace);
|
|
||||||
return error;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder fromError(Error in) {
|
public Builder fromError(Error in) {
|
||||||
|
@ -129,10 +122,12 @@ public class Error {
|
||||||
@XmlAttribute
|
@XmlAttribute
|
||||||
private String stackTrace;
|
private String stackTrace;
|
||||||
|
|
||||||
private Error(String message, Integer majorErrorCode, String minorErrorCode) {
|
private Error(String message, Integer majorErrorCode, String minorErrorCode, String vendorSpecificErrorCode, String stackTrace) {
|
||||||
this.message = checkNotNull(message, "message");
|
this.message = checkNotNull(message, "message");
|
||||||
this.majorErrorCode = checkNotNull(majorErrorCode, "majorErrorCode");
|
this.majorErrorCode = checkNotNull(majorErrorCode, "majorErrorCode");
|
||||||
this.minorErrorCode = checkNotNull(minorErrorCode, "minorErrorCode");
|
this.minorErrorCode = checkNotNull(minorErrorCode, "minorErrorCode");
|
||||||
|
this.vendorSpecificErrorCode = vendorSpecificErrorCode;
|
||||||
|
this.stackTrace = stackTrace;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Error() {
|
private Error() {
|
||||||
|
@ -155,7 +150,7 @@ public class Error {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specific API error code.
|
* Specific API error code.
|
||||||
*
|
* <p/>
|
||||||
* For example - can indicate that vApp power on failed by some reason.
|
* For example - can indicate that vApp power on failed by some reason.
|
||||||
*/
|
*/
|
||||||
public String getMinorErrorCode() {
|
public String getMinorErrorCode() {
|
||||||
|
@ -170,10 +165,6 @@ public class Error {
|
||||||
return vendorSpecificErrorCode;
|
return vendorSpecificErrorCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setVendorSpecificErrorCode(String vendorSpecificErrorCode) {
|
|
||||||
this.vendorSpecificErrorCode = vendorSpecificErrorCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The stack trace of the exception which when examined might make problem
|
* The stack trace of the exception which when examined might make problem
|
||||||
* diagnostics easier.
|
* diagnostics easier.
|
||||||
|
@ -182,10 +173,6 @@ public class Error {
|
||||||
return stackTrace;
|
return stackTrace;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setStackTrace(String stackTrace) {
|
|
||||||
this.stackTrace = stackTrace;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
|
|
|
@ -24,9 +24,6 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import javax.xml.bind.annotation.XmlSchemaType;
|
import javax.xml.bind.annotation.XmlSchemaType;
|
||||||
import javax.xml.bind.annotation.XmlType;
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
@ -38,14 +35,13 @@ import com.google.common.collect.Sets;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Represents a file to be transferred (uploaded or downloaded).
|
||||||
* Represents a file to be transferred (uploaded or downloaded).
|
* <p/>
|
||||||
*
|
* <p/>
|
||||||
*
|
|
||||||
* <p>Java class for File complex type.
|
* <p>Java class for File complex type.
|
||||||
*
|
* <p/>
|
||||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
*
|
* <p/>
|
||||||
* <pre>
|
* <pre>
|
||||||
* <complexType name="File">
|
* <complexType name="File">
|
||||||
* <complexContent>
|
* <complexContent>
|
||||||
|
@ -58,26 +54,21 @@ import com.google.common.collect.Sets;
|
||||||
* </complexContent>
|
* </complexContent>
|
||||||
* </complexType>
|
* </complexType>
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
|
||||||
@XmlType(name = "File")
|
@XmlType(name = "File")
|
||||||
public class File
|
public class File extends EntityType<File> {
|
||||||
extends EntityType<File>
|
|
||||||
|
|
||||||
{
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public static Builder builder() {
|
public static Builder builder() {
|
||||||
return new Builder();
|
return new Builder();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Builder toBuilder() {
|
public Builder toBuilder() {
|
||||||
return new Builder().fromFile(this);
|
return new Builder().fromFile(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Builder extends EntityType.Builder<File> {
|
public static class Builder extends EntityType.Builder<File> {
|
||||||
|
|
||||||
private Long size;
|
private Long size;
|
||||||
private Long bytesTransferred;
|
private Long bytesTransferred;
|
||||||
private String checksum;
|
private String checksum;
|
||||||
|
@ -106,16 +97,10 @@ public class File
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public File build() {
|
public File build() {
|
||||||
File file = new File();
|
return new File(href, type, links, description, tasksInProgress, id, name, size, bytesTransferred, checksum);
|
||||||
file.setSize(size);
|
|
||||||
file.setBytesTransferred(bytesTransferred);
|
|
||||||
file.setChecksum(checksum);
|
|
||||||
return file;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see EntityType#getId()
|
* @see EntityType#getId()
|
||||||
*/
|
*/
|
||||||
|
@ -153,7 +138,7 @@ public class File
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ReferenceType#getLinks()
|
* @see EntityType#getLinks()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder links(Set<Link> links) {
|
public Builder links(Set<Link> links) {
|
||||||
|
@ -162,7 +147,7 @@ public class File
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ReferenceType#getLinks()
|
* @see EntityType#getLinks()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder link(Link link) {
|
public Builder link(Link link) {
|
||||||
|
@ -173,120 +158,86 @@ public class File
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Builder fromEntityType(EntityType<File> in) {
|
public Builder fromEntityType(EntityType<File> in) {
|
||||||
return Builder.class.cast(super.fromEntityType(in));
|
return Builder.class.cast(super.fromEntityType(in));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder fromFile(File in) {
|
public Builder fromFile(File in) {
|
||||||
return fromEntityType(in)
|
return fromEntityType(in)
|
||||||
.size(in.getSize())
|
.size(in.getSize())
|
||||||
.bytesTransferred(in.getBytesTransferred())
|
.bytesTransferred(in.getBytesTransferred())
|
||||||
.checksum(in.getChecksum());
|
.checksum(in.getChecksum());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public File(URI href, String type, Set<Link> links, String description, TasksInProgress tasksInProgress, String id,
|
||||||
|
String name, Long size, Long bytesTransferred, String checksum) {
|
||||||
|
super(href, type, links, description, tasksInProgress, id, name);
|
||||||
|
this.size = size;
|
||||||
|
this.bytesTransferred = bytesTransferred;
|
||||||
|
this.checksum = checksum;
|
||||||
|
}
|
||||||
|
|
||||||
private File() {
|
private File() {
|
||||||
// For JAXB and builder use
|
// For JAXB and builder use
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@XmlAttribute
|
||||||
|
protected Long size;
|
||||||
|
@XmlAttribute
|
||||||
|
protected Long bytesTransferred;
|
||||||
|
@XmlAttribute
|
||||||
|
@XmlJavaTypeAdapter(NormalizedStringAdapter.class)
|
||||||
|
@XmlSchemaType(name = "normalizedString")
|
||||||
|
protected String checksum;
|
||||||
|
|
||||||
@XmlAttribute
|
/**
|
||||||
protected Long size;
|
* Gets the value of the size property.
|
||||||
@XmlAttribute
|
*
|
||||||
protected Long bytesTransferred;
|
* @return possible object is
|
||||||
@XmlAttribute
|
* {@link Long }
|
||||||
@XmlJavaTypeAdapter(NormalizedStringAdapter.class)
|
*/
|
||||||
@XmlSchemaType(name = "normalizedString")
|
public Long getSize() {
|
||||||
protected String checksum;
|
return size;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the size property.
|
* Gets the value of the bytesTransferred property.
|
||||||
*
|
*
|
||||||
* @return
|
* @return possible object is
|
||||||
* possible object is
|
* {@link Long }
|
||||||
* {@link Long }
|
*/
|
||||||
*
|
public Long getBytesTransferred() {
|
||||||
*/
|
return bytesTransferred;
|
||||||
public Long getSize() {
|
}
|
||||||
return size;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the value of the size property.
|
* Gets the value of the checksum property.
|
||||||
*
|
*
|
||||||
* @param value
|
* @return possible object is
|
||||||
* allowed object is
|
* {@link String }
|
||||||
* {@link Long }
|
*/
|
||||||
*
|
public String getChecksum() {
|
||||||
*/
|
return checksum;
|
||||||
public void setSize(Long value) {
|
}
|
||||||
this.size = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the value of the bytesTransferred property.
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
* possible object is
|
|
||||||
* {@link Long }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public Long getBytesTransferred() {
|
|
||||||
return bytesTransferred;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the bytesTransferred property.
|
|
||||||
*
|
|
||||||
* @param value
|
|
||||||
* allowed object is
|
|
||||||
* {@link Long }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setBytesTransferred(Long value) {
|
|
||||||
this.bytesTransferred = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the value of the checksum property.
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
* possible object is
|
|
||||||
* {@link String }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public String getChecksum() {
|
|
||||||
return checksum;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the checksum property.
|
|
||||||
*
|
|
||||||
* @param value
|
|
||||||
* allowed object is
|
|
||||||
* {@link String }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setChecksum(String value) {
|
|
||||||
this.checksum = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
return true;
|
return true;
|
||||||
if (o == null || getClass() != o.getClass())
|
if (o == null || getClass() != o.getClass())
|
||||||
return false;
|
return false;
|
||||||
File that = File.class.cast(o);
|
File that = File.class.cast(o);
|
||||||
return equal(size, that.size) &&
|
return equal(size, that.size) &&
|
||||||
equal(bytesTransferred, that.bytesTransferred) &&
|
equal(bytesTransferred, that.bytesTransferred) &&
|
||||||
equal(checksum, that.checksum);
|
equal(checksum, that.checksum);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hashCode(size,
|
return Objects.hashCode(size,
|
||||||
bytesTransferred,
|
bytesTransferred,
|
||||||
checksum);
|
checksum);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -21,27 +21,24 @@ package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.Set;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlType;
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
|
import com.google.common.collect.ImmutableSet;
|
||||||
|
import com.google.common.collect.Sets;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Represents a list of files to be transferred (uploaded
|
||||||
* Represents a list of files to be transferred (uploaded
|
* or downloaded).
|
||||||
* or downloaded).
|
* <p/>
|
||||||
*
|
* <p/>
|
||||||
*
|
|
||||||
* <p>Java class for FilesList complex type.
|
* <p>Java class for FilesList complex type.
|
||||||
*
|
* <p/>
|
||||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
*
|
* <p/>
|
||||||
* <pre>
|
* <pre>
|
||||||
* <complexType name="FilesList">
|
* <complexType name="FilesList">
|
||||||
* <complexContent>
|
* <complexContent>
|
||||||
|
@ -54,12 +51,9 @@ import com.google.common.base.Objects;
|
||||||
* </complexContent>
|
* </complexContent>
|
||||||
* </complexType>
|
* </complexType>
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
|
||||||
@XmlType(name = "FilesList", propOrder = {
|
@XmlType(name = "FilesList", propOrder = {
|
||||||
"files"
|
"files"
|
||||||
})
|
})
|
||||||
public class FilesList {
|
public class FilesList {
|
||||||
public static Builder builder() {
|
public static Builder builder() {
|
||||||
|
@ -71,14 +65,14 @@ public class FilesList {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Builder {
|
public static class Builder {
|
||||||
|
|
||||||
private List<File> files;
|
private Set<File> files = Sets.newLinkedHashSet();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see FilesList#getFiles()
|
* @see FilesList#getFiles()
|
||||||
*/
|
*/
|
||||||
public Builder file(List<File> file) {
|
public Builder files(Set<File> files) {
|
||||||
this.files = file;
|
this.files = files;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,7 +84,7 @@ public class FilesList {
|
||||||
|
|
||||||
|
|
||||||
public Builder fromFilesList(FilesList in) {
|
public Builder fromFilesList(FilesList in) {
|
||||||
return file(in.getFiles());
|
return files(in.getFiles());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -98,47 +92,25 @@ public class FilesList {
|
||||||
// For JAXB and builder use
|
// For JAXB and builder use
|
||||||
}
|
}
|
||||||
|
|
||||||
private FilesList(List<File> files) {
|
private FilesList(Set<File> files) {
|
||||||
this.files = files;
|
this.files = ImmutableSet.copyOf(files);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@XmlElement(name = "File", required = true)
|
@XmlElement(name = "File", required = true)
|
||||||
protected List<File> files;
|
protected Set<File> files = Sets.newLinkedHashSet();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the file property.
|
* Gets the value of the file property.
|
||||||
*
|
*/
|
||||||
* <p>
|
public Set<File> getFiles() {
|
||||||
* This accessor method returns a reference to the live list,
|
return this.files;
|
||||||
* 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 <CODE>set</CODE> method for the file property.
|
|
||||||
*
|
|
||||||
* <p>
|
|
||||||
* For example, to add a new item, do as follows:
|
|
||||||
* <pre>
|
|
||||||
* getFile().add(newItem);
|
|
||||||
* </pre>
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* <p>
|
|
||||||
* Objects of the following type(s) are allowed in the list
|
|
||||||
* {@link FileType }
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public List<File> getFiles() {
|
|
||||||
if (files == null) {
|
|
||||||
files = new ArrayList<File>();
|
|
||||||
}
|
|
||||||
return this.files;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
return true;
|
return true;
|
||||||
if (o == null || getClass() != o.getClass())
|
if (o == null || getClass() != o.getClass())
|
||||||
return false;
|
return false;
|
||||||
FilesList that = FilesList.class.cast(o);
|
FilesList that = FilesList.class.cast(o);
|
||||||
|
|
|
@ -20,13 +20,11 @@
|
||||||
package org.jclouds.vcloud.director.v1_5.domain;
|
package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.ArrayList;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.Set;
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlAnyElement;
|
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
@ -37,6 +35,8 @@ import org.jclouds.javax.annotation.Nullable;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.ovf.SectionType;
|
import org.jclouds.vcloud.director.v1_5.domain.ovf.SectionType;
|
||||||
|
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
|
import com.google.common.collect.ImmutableSet;
|
||||||
|
import com.google.common.collect.Sets;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -77,7 +77,6 @@ import com.google.common.base.Objects;
|
||||||
* </complexType>
|
* </complexType>
|
||||||
* </pre>
|
* </pre>
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
|
||||||
@XmlRootElement(name = "GuestCustomizationSection")
|
@XmlRootElement(name = "GuestCustomizationSection")
|
||||||
@XmlType(propOrder = {
|
@XmlType(propOrder = {
|
||||||
"enabled",
|
"enabled",
|
||||||
|
@ -94,8 +93,7 @@ import com.google.common.base.Objects;
|
||||||
"resetPasswordRequired",
|
"resetPasswordRequired",
|
||||||
"customizationScript",
|
"customizationScript",
|
||||||
"computerName",
|
"computerName",
|
||||||
"link",
|
"links"
|
||||||
"any"
|
|
||||||
})
|
})
|
||||||
public class GuestCustomizationSection extends SectionType<GuestCustomizationSection> {
|
public class GuestCustomizationSection extends SectionType<GuestCustomizationSection> {
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
|
@ -108,7 +106,6 @@ public class GuestCustomizationSection extends SectionType<GuestCustomizationSec
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Builder extends SectionType.Builder<GuestCustomizationSection> {
|
public static class Builder extends SectionType.Builder<GuestCustomizationSection> {
|
||||||
|
|
||||||
private Boolean enabled;
|
private Boolean enabled;
|
||||||
private Boolean changeSid;
|
private Boolean changeSid;
|
||||||
private String virtualMachineId;
|
private String virtualMachineId;
|
||||||
|
@ -123,8 +120,7 @@ public class GuestCustomizationSection extends SectionType<GuestCustomizationSec
|
||||||
private Boolean resetPasswordRequired;
|
private Boolean resetPasswordRequired;
|
||||||
private String customizationScript;
|
private String customizationScript;
|
||||||
private String computerName;
|
private String computerName;
|
||||||
private List<Link> link;
|
private Set<Link> links = Sets.newLinkedHashSet();
|
||||||
private List<Object> any;
|
|
||||||
private URI href;
|
private URI href;
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
|
@ -243,16 +239,8 @@ public class GuestCustomizationSection extends SectionType<GuestCustomizationSec
|
||||||
/**
|
/**
|
||||||
* @see org.jclouds.vcloud.director.v1_5.domain.GuestCustomizationSection#getLink()
|
* @see org.jclouds.vcloud.director.v1_5.domain.GuestCustomizationSection#getLink()
|
||||||
*/
|
*/
|
||||||
public Builder link(List<Link> link) {
|
public Builder links(Set<Link> links) {
|
||||||
this.link = link;
|
this.links = checkNotNull(links, "links");
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @see org.jclouds.vcloud.director.v1_5.domain.GuestCustomizationSection#getAny()
|
|
||||||
*/
|
|
||||||
public Builder any(List<Object> any) {
|
|
||||||
this.any = any;
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -274,25 +262,13 @@ public class GuestCustomizationSection extends SectionType<GuestCustomizationSec
|
||||||
|
|
||||||
|
|
||||||
public GuestCustomizationSection build() {
|
public GuestCustomizationSection build() {
|
||||||
GuestCustomizationSection guestCustomizationSection = new GuestCustomizationSection(info, resetPasswordRequired, link, any);
|
return new GuestCustomizationSection(info, required, enabled, changeSid, virtualMachineId,
|
||||||
guestCustomizationSection.setEnabled(enabled);
|
joinDomainEnabled, useOrgSettings, domainName, domainUserName,
|
||||||
guestCustomizationSection.setChangeSid(changeSid);
|
domainUserPassword, adminPasswordEnabled, adminPasswordAuto,
|
||||||
guestCustomizationSection.setVirtualMachineId(virtualMachineId);
|
adminPassword, resetPasswordRequired, customizationScript,
|
||||||
guestCustomizationSection.setJoinDomainEnabled(joinDomainEnabled);
|
computerName, links, href, type);
|
||||||
guestCustomizationSection.setUseOrgSettings(useOrgSettings);
|
|
||||||
guestCustomizationSection.setDomainName(domainName);
|
|
||||||
guestCustomizationSection.setDomainUserName(domainUserName);
|
|
||||||
guestCustomizationSection.setDomainUserPassword(domainUserPassword);
|
|
||||||
guestCustomizationSection.setAdminPasswordEnabled(adminPasswordEnabled);
|
|
||||||
guestCustomizationSection.setAdminPasswordAuto(adminPasswordAuto);
|
|
||||||
guestCustomizationSection.setAdminPassword(adminPassword);
|
|
||||||
guestCustomizationSection.setCustomizationScript(customizationScript);
|
|
||||||
guestCustomizationSection.setComputerName(computerName);
|
|
||||||
guestCustomizationSection.setHref(href);
|
|
||||||
guestCustomizationSection.setType(type);
|
|
||||||
return guestCustomizationSection;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder fromGuestCustomizationSection(GuestCustomizationSection in) {
|
public Builder fromGuestCustomizationSection(GuestCustomizationSection in) {
|
||||||
return fromSection(in)
|
return fromSection(in)
|
||||||
.enabled(in.isEnabled())
|
.enabled(in.isEnabled())
|
||||||
|
@ -309,8 +285,7 @@ public class GuestCustomizationSection extends SectionType<GuestCustomizationSec
|
||||||
.resetPasswordRequired(in.isResetPasswordRequired())
|
.resetPasswordRequired(in.isResetPasswordRequired())
|
||||||
.customizationScript(in.getCustomizationScript())
|
.customizationScript(in.getCustomizationScript())
|
||||||
.computerName(in.getComputerName())
|
.computerName(in.getComputerName())
|
||||||
.link(in.getLink())
|
.links(in.getLink())
|
||||||
.any(in.getAny())
|
|
||||||
.href(in.getHref())
|
.href(in.getHref())
|
||||||
.type(in.getType());
|
.type(in.getType());
|
||||||
}
|
}
|
||||||
|
@ -331,58 +306,80 @@ public class GuestCustomizationSection extends SectionType<GuestCustomizationSec
|
||||||
return Builder.class.cast(super.info(info));
|
return Builder.class.cast(super.info(info));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Builder required(Boolean required) {
|
||||||
|
return Builder.class.cast(super.required(required));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private GuestCustomizationSection(@Nullable String info, @Nullable Boolean required, Boolean enabled, Boolean changeSid, String virtualMachineId,
|
||||||
|
Boolean joinDomainEnabled, Boolean useOrgSettings, String domainName, String domainUserName,
|
||||||
|
String domainUserPassword, Boolean adminPasswordEnabled, Boolean adminPasswordAuto,
|
||||||
|
String adminPassword, Boolean resetPasswordRequired, String customizationScript,
|
||||||
|
String computerName, Set<Link> links, URI href, String type) {
|
||||||
|
super(info, required);
|
||||||
|
this.enabled = enabled;
|
||||||
|
this.changeSid = changeSid;
|
||||||
|
this.virtualMachineId = virtualMachineId;
|
||||||
|
this.joinDomainEnabled = joinDomainEnabled;
|
||||||
|
this.useOrgSettings = useOrgSettings;
|
||||||
|
this.domainName = domainName;
|
||||||
|
this.domainUserName = domainUserName;
|
||||||
|
this.domainUserPassword = domainUserPassword;
|
||||||
|
this.adminPasswordEnabled = adminPasswordEnabled;
|
||||||
|
this.adminPasswordAuto = adminPasswordAuto;
|
||||||
|
this.adminPassword = adminPassword;
|
||||||
|
this.resetPasswordRequired = resetPasswordRequired;
|
||||||
|
this.customizationScript = customizationScript;
|
||||||
|
this.computerName = computerName;
|
||||||
|
this.links = ImmutableSet.copyOf(links);
|
||||||
|
this.href = href;
|
||||||
|
this.type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
private GuestCustomizationSection() {
|
private GuestCustomizationSection() {
|
||||||
// For JAXB and builder use
|
// For JAXB and builder use
|
||||||
super(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
private GuestCustomizationSection(@Nullable String info, Boolean resetPasswordRequired, List<Link> link, List<Object> any) {
|
|
||||||
super(info);
|
|
||||||
this.resetPasswordRequired = resetPasswordRequired;
|
|
||||||
this.link = link;
|
|
||||||
this.any = any;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@XmlElement(name = "Enabled")
|
@XmlElement(name = "Enabled")
|
||||||
protected Boolean enabled;
|
private Boolean enabled;
|
||||||
@XmlElement(name = "ChangeSid")
|
@XmlElement(name = "ChangeSid")
|
||||||
protected Boolean changeSid;
|
private Boolean changeSid;
|
||||||
@XmlElement(name = "VirtualMachineId")
|
@XmlElement(name = "VirtualMachineId")
|
||||||
protected String virtualMachineId;
|
private String virtualMachineId;
|
||||||
@XmlElement(name = "JoinDomainEnabled")
|
@XmlElement(name = "JoinDomainEnabled")
|
||||||
protected Boolean joinDomainEnabled;
|
private Boolean joinDomainEnabled;
|
||||||
@XmlElement(name = "UseOrgSettings")
|
@XmlElement(name = "UseOrgSettings")
|
||||||
protected Boolean useOrgSettings;
|
private Boolean useOrgSettings;
|
||||||
@XmlElement(name = "DomainName")
|
@XmlElement(name = "DomainName")
|
||||||
protected String domainName;
|
private String domainName;
|
||||||
@XmlElement(name = "DomainUserName")
|
@XmlElement(name = "DomainUserName")
|
||||||
protected String domainUserName;
|
private String domainUserName;
|
||||||
@XmlElement(name = "DomainUserPassword")
|
@XmlElement(name = "DomainUserPassword")
|
||||||
protected String domainUserPassword;
|
private String domainUserPassword;
|
||||||
@XmlElement(name = "AdminPasswordEnabled")
|
@XmlElement(name = "AdminPasswordEnabled")
|
||||||
protected Boolean adminPasswordEnabled;
|
private Boolean adminPasswordEnabled;
|
||||||
@XmlElement(name = "AdminPasswordAuto")
|
@XmlElement(name = "AdminPasswordAuto")
|
||||||
protected Boolean adminPasswordAuto;
|
private Boolean adminPasswordAuto;
|
||||||
@XmlElement(name = "AdminPassword")
|
@XmlElement(name = "AdminPassword")
|
||||||
protected String adminPassword;
|
private String adminPassword;
|
||||||
@XmlElement(name = "ResetPasswordRequired")
|
@XmlElement(name = "ResetPasswordRequired")
|
||||||
protected Boolean resetPasswordRequired;
|
private Boolean resetPasswordRequired;
|
||||||
@XmlElement(name = "CustomizationScript")
|
@XmlElement(name = "CustomizationScript")
|
||||||
protected String customizationScript;
|
private String customizationScript;
|
||||||
@XmlElement(name = "ComputerName")
|
@XmlElement(name = "ComputerName")
|
||||||
protected String computerName;
|
private String computerName;
|
||||||
@XmlElement(name = "Link")
|
@XmlElement(name = "Link")
|
||||||
protected List<Link> link;
|
private Set<Link> links = Sets.newLinkedHashSet();
|
||||||
@XmlAnyElement(lax = true)
|
|
||||||
protected List<Object> any;
|
|
||||||
@XmlAttribute
|
@XmlAttribute
|
||||||
@XmlSchemaType(name = "anyURI")
|
@XmlSchemaType(name = "anyURI")
|
||||||
protected URI href;
|
private URI href;
|
||||||
@XmlAttribute
|
@XmlAttribute
|
||||||
protected String type;
|
private String type;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the enabled property.
|
* Gets the value of the enabled property.
|
||||||
|
@ -394,16 +391,6 @@ public class GuestCustomizationSection extends SectionType<GuestCustomizationSec
|
||||||
return enabled;
|
return enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the enabled property.
|
|
||||||
*
|
|
||||||
* @param value allowed object is
|
|
||||||
* {@link Boolean }
|
|
||||||
*/
|
|
||||||
public void setEnabled(Boolean value) {
|
|
||||||
this.enabled = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the changeSid property.
|
* Gets the value of the changeSid property.
|
||||||
*
|
*
|
||||||
|
@ -414,16 +401,6 @@ public class GuestCustomizationSection extends SectionType<GuestCustomizationSec
|
||||||
return changeSid;
|
return changeSid;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the changeSid property.
|
|
||||||
*
|
|
||||||
* @param value allowed object is
|
|
||||||
* {@link Boolean }
|
|
||||||
*/
|
|
||||||
public void setChangeSid(Boolean value) {
|
|
||||||
this.changeSid = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the virtualMachineId property.
|
* Gets the value of the virtualMachineId property.
|
||||||
*
|
*
|
||||||
|
@ -434,16 +411,6 @@ public class GuestCustomizationSection extends SectionType<GuestCustomizationSec
|
||||||
return virtualMachineId;
|
return virtualMachineId;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the virtualMachineId property.
|
|
||||||
*
|
|
||||||
* @param value allowed object is
|
|
||||||
* {@link String }
|
|
||||||
*/
|
|
||||||
public void setVirtualMachineId(String value) {
|
|
||||||
this.virtualMachineId = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the joinDomainEnabled property.
|
* Gets the value of the joinDomainEnabled property.
|
||||||
*
|
*
|
||||||
|
@ -454,16 +421,6 @@ public class GuestCustomizationSection extends SectionType<GuestCustomizationSec
|
||||||
return joinDomainEnabled;
|
return joinDomainEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the joinDomainEnabled property.
|
|
||||||
*
|
|
||||||
* @param value allowed object is
|
|
||||||
* {@link Boolean }
|
|
||||||
*/
|
|
||||||
public void setJoinDomainEnabled(Boolean value) {
|
|
||||||
this.joinDomainEnabled = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the useOrgSettings property.
|
* Gets the value of the useOrgSettings property.
|
||||||
*
|
*
|
||||||
|
@ -474,15 +431,6 @@ public class GuestCustomizationSection extends SectionType<GuestCustomizationSec
|
||||||
return useOrgSettings;
|
return useOrgSettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the useOrgSettings property.
|
|
||||||
*
|
|
||||||
* @param value allowed object is
|
|
||||||
* {@link Boolean }
|
|
||||||
*/
|
|
||||||
public void setUseOrgSettings(Boolean value) {
|
|
||||||
this.useOrgSettings = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the domainName property.
|
* Gets the value of the domainName property.
|
||||||
|
@ -494,16 +442,6 @@ public class GuestCustomizationSection extends SectionType<GuestCustomizationSec
|
||||||
return domainName;
|
return domainName;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the domainName property.
|
|
||||||
*
|
|
||||||
* @param value allowed object is
|
|
||||||
* {@link String }
|
|
||||||
*/
|
|
||||||
public void setDomainName(String value) {
|
|
||||||
this.domainName = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the domainUserName property.
|
* Gets the value of the domainUserName property.
|
||||||
*
|
*
|
||||||
|
@ -514,16 +452,6 @@ public class GuestCustomizationSection extends SectionType<GuestCustomizationSec
|
||||||
return domainUserName;
|
return domainUserName;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the domainUserName property.
|
|
||||||
*
|
|
||||||
* @param value allowed object is
|
|
||||||
* {@link String }
|
|
||||||
*/
|
|
||||||
public void setDomainUserName(String value) {
|
|
||||||
this.domainUserName = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the domainUserPassword property.
|
* Gets the value of the domainUserPassword property.
|
||||||
*
|
*
|
||||||
|
@ -534,16 +462,6 @@ public class GuestCustomizationSection extends SectionType<GuestCustomizationSec
|
||||||
return domainUserPassword;
|
return domainUserPassword;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the domainUserPassword property.
|
|
||||||
*
|
|
||||||
* @param value allowed object is
|
|
||||||
* {@link String }
|
|
||||||
*/
|
|
||||||
public void setDomainUserPassword(String value) {
|
|
||||||
this.domainUserPassword = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the adminPasswordEnabled property.
|
* Gets the value of the adminPasswordEnabled property.
|
||||||
*
|
*
|
||||||
|
@ -554,16 +472,6 @@ public class GuestCustomizationSection extends SectionType<GuestCustomizationSec
|
||||||
return adminPasswordEnabled;
|
return adminPasswordEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the adminPasswordEnabled property.
|
|
||||||
*
|
|
||||||
* @param value allowed object is
|
|
||||||
* {@link Boolean }
|
|
||||||
*/
|
|
||||||
public void setAdminPasswordEnabled(Boolean value) {
|
|
||||||
this.adminPasswordEnabled = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the adminPasswordAuto property.
|
* Gets the value of the adminPasswordAuto property.
|
||||||
*
|
*
|
||||||
|
@ -574,16 +482,6 @@ public class GuestCustomizationSection extends SectionType<GuestCustomizationSec
|
||||||
return adminPasswordAuto;
|
return adminPasswordAuto;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the adminPasswordAuto property.
|
|
||||||
*
|
|
||||||
* @param value allowed object is
|
|
||||||
* {@link Boolean }
|
|
||||||
*/
|
|
||||||
public void setAdminPasswordAuto(Boolean value) {
|
|
||||||
this.adminPasswordAuto = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the adminPassword property.
|
* Gets the value of the adminPassword property.
|
||||||
*
|
*
|
||||||
|
@ -594,16 +492,6 @@ public class GuestCustomizationSection extends SectionType<GuestCustomizationSec
|
||||||
return adminPassword;
|
return adminPassword;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the adminPassword property.
|
|
||||||
*
|
|
||||||
* @param value allowed object is
|
|
||||||
* {@link String }
|
|
||||||
*/
|
|
||||||
public void setAdminPassword(String value) {
|
|
||||||
this.adminPassword = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the resetPasswordRequired property.
|
* Gets the value of the resetPasswordRequired property.
|
||||||
*
|
*
|
||||||
|
@ -614,16 +502,6 @@ public class GuestCustomizationSection extends SectionType<GuestCustomizationSec
|
||||||
return resetPasswordRequired;
|
return resetPasswordRequired;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the resetPasswordRequired property.
|
|
||||||
*
|
|
||||||
* @param value allowed object is
|
|
||||||
* {@link Boolean }
|
|
||||||
*/
|
|
||||||
public void setResetPasswordRequired(Boolean value) {
|
|
||||||
this.resetPasswordRequired = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the customizationScript property.
|
* Gets the value of the customizationScript property.
|
||||||
*
|
*
|
||||||
|
@ -634,16 +512,6 @@ public class GuestCustomizationSection extends SectionType<GuestCustomizationSec
|
||||||
return customizationScript;
|
return customizationScript;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the customizationScript property.
|
|
||||||
*
|
|
||||||
* @param value allowed object is
|
|
||||||
* {@link String }
|
|
||||||
*/
|
|
||||||
public void setCustomizationScript(String value) {
|
|
||||||
this.customizationScript = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the computerName property.
|
* Gets the value of the computerName property.
|
||||||
*
|
*
|
||||||
|
@ -654,69 +522,14 @@ public class GuestCustomizationSection extends SectionType<GuestCustomizationSec
|
||||||
return computerName;
|
return computerName;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the computerName property.
|
|
||||||
*
|
|
||||||
* @param value allowed object is
|
|
||||||
* {@link String }
|
|
||||||
*/
|
|
||||||
public void setComputerName(String value) {
|
|
||||||
this.computerName = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the link property.
|
* Gets the value of the link property.
|
||||||
* <p/>
|
* <p/>
|
||||||
* <p/>
|
|
||||||
* 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 <CODE>set</CODE> method for the link property.
|
|
||||||
* <p/>
|
|
||||||
* <p/>
|
|
||||||
* For example, to add a new item, do as follows:
|
|
||||||
* <pre>
|
|
||||||
* getLink().add(newItem);
|
|
||||||
* </pre>
|
|
||||||
* <p/>
|
|
||||||
* <p/>
|
|
||||||
* <p/>
|
|
||||||
* Objects of the following type(s) are allowed in the list
|
* Objects of the following type(s) are allowed in the list
|
||||||
* {@link Link }
|
* {@link Link }
|
||||||
*/
|
*/
|
||||||
public List<Link> getLink() {
|
public Set<Link> getLink() {
|
||||||
if (link == null) {
|
return Collections.unmodifiableSet(this.links);
|
||||||
link = new ArrayList<Link>();
|
|
||||||
}
|
|
||||||
return this.link;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the value of the any property.
|
|
||||||
* <p/>
|
|
||||||
* <p/>
|
|
||||||
* 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 <CODE>set</CODE> method for the any property.
|
|
||||||
* <p/>
|
|
||||||
* <p/>
|
|
||||||
* For example, to add a new item, do as follows:
|
|
||||||
* <pre>
|
|
||||||
* getAny().add(newItem);
|
|
||||||
* </pre>
|
|
||||||
* <p/>
|
|
||||||
* <p/>
|
|
||||||
* <p/>
|
|
||||||
* Objects of the following type(s) are allowed in the list
|
|
||||||
* {@link Object }
|
|
||||||
* {@link org.w3c.dom.Element }
|
|
||||||
*/
|
|
||||||
public List<Object> getAny() {
|
|
||||||
if (any == null) {
|
|
||||||
any = new ArrayList<Object>();
|
|
||||||
}
|
|
||||||
return this.any;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -726,13 +539,6 @@ public class GuestCustomizationSection extends SectionType<GuestCustomizationSec
|
||||||
return href;
|
return href;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the href property.
|
|
||||||
*/
|
|
||||||
public void setHref(URI value) {
|
|
||||||
this.href = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the type property.
|
* Gets the value of the type property.
|
||||||
*
|
*
|
||||||
|
@ -743,16 +549,6 @@ public class GuestCustomizationSection extends SectionType<GuestCustomizationSec
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the type property.
|
|
||||||
*
|
|
||||||
* @param value allowed object is
|
|
||||||
* {@link String }
|
|
||||||
*/
|
|
||||||
public void setType(String value) {
|
|
||||||
this.type = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
|
@ -760,7 +556,8 @@ public class GuestCustomizationSection extends SectionType<GuestCustomizationSec
|
||||||
if (o == null || getClass() != o.getClass())
|
if (o == null || getClass() != o.getClass())
|
||||||
return false;
|
return false;
|
||||||
GuestCustomizationSection that = GuestCustomizationSection.class.cast(o);
|
GuestCustomizationSection that = GuestCustomizationSection.class.cast(o);
|
||||||
return equal(enabled, that.enabled) &&
|
return super.equals(that) &&
|
||||||
|
equal(enabled, that.enabled) &&
|
||||||
equal(changeSid, that.changeSid) &&
|
equal(changeSid, that.changeSid) &&
|
||||||
equal(virtualMachineId, that.virtualMachineId) &&
|
equal(virtualMachineId, that.virtualMachineId) &&
|
||||||
equal(joinDomainEnabled, that.joinDomainEnabled) &&
|
equal(joinDomainEnabled, that.joinDomainEnabled) &&
|
||||||
|
@ -774,15 +571,15 @@ public class GuestCustomizationSection extends SectionType<GuestCustomizationSec
|
||||||
equal(resetPasswordRequired, that.resetPasswordRequired) &&
|
equal(resetPasswordRequired, that.resetPasswordRequired) &&
|
||||||
equal(customizationScript, that.customizationScript) &&
|
equal(customizationScript, that.customizationScript) &&
|
||||||
equal(computerName, that.computerName) &&
|
equal(computerName, that.computerName) &&
|
||||||
equal(link, that.link) &&
|
equal(links, that.links) &&
|
||||||
equal(any, that.any) &&
|
|
||||||
equal(href, that.href) &&
|
equal(href, that.href) &&
|
||||||
equal(type, that.type);
|
equal(type, that.type);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hashCode(enabled,
|
return Objects.hashCode(super.hashCode(),
|
||||||
|
enabled,
|
||||||
changeSid,
|
changeSid,
|
||||||
virtualMachineId,
|
virtualMachineId,
|
||||||
joinDomainEnabled,
|
joinDomainEnabled,
|
||||||
|
@ -796,15 +593,14 @@ public class GuestCustomizationSection extends SectionType<GuestCustomizationSec
|
||||||
resetPasswordRequired,
|
resetPasswordRequired,
|
||||||
customizationScript,
|
customizationScript,
|
||||||
computerName,
|
computerName,
|
||||||
link,
|
links,
|
||||||
any,
|
|
||||||
href,
|
href,
|
||||||
type);
|
type);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public Objects.ToStringHelper string() {
|
||||||
return Objects.toStringHelper("")
|
return super.string()
|
||||||
.add("enabled", enabled)
|
.add("enabled", enabled)
|
||||||
.add("changeSid", changeSid)
|
.add("changeSid", changeSid)
|
||||||
.add("virtualMachineId", virtualMachineId)
|
.add("virtualMachineId", virtualMachineId)
|
||||||
|
@ -819,10 +615,9 @@ public class GuestCustomizationSection extends SectionType<GuestCustomizationSec
|
||||||
.add("resetPasswordRequired", resetPasswordRequired)
|
.add("resetPasswordRequired", resetPasswordRequired)
|
||||||
.add("customizationScript", customizationScript)
|
.add("customizationScript", customizationScript)
|
||||||
.add("computerName", computerName)
|
.add("computerName", computerName)
|
||||||
.add("link", link)
|
.add("links", links)
|
||||||
.add("any", any)
|
|
||||||
.add("href", href)
|
.add("href", href)
|
||||||
.add("type", type).toString();
|
.add("type", type);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,15 +20,14 @@
|
||||||
package org.jclouds.vcloud.director.v1_5.domain;
|
package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parameters for Instantiating a vApp
|
* Parameters for Instantiating a vApp
|
||||||
*
|
*
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
public class InstantiateVAppParams
|
public class InstantiateVAppParams
|
||||||
extends InstantiateVAppParamsType<InstantiateVAppParams> {
|
extends InstantiateVAppParamsType<InstantiateVAppParams> {
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public static Builder builder() {
|
public static Builder builder() {
|
||||||
return new Builder();
|
return new Builder();
|
||||||
|
@ -39,23 +38,13 @@ public class InstantiateVAppParams
|
||||||
return new Builder();
|
return new Builder();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Builder
|
public static class Builder
|
||||||
extends InstantiateVAppParamsType.Builder<InstantiateVAppParams> {
|
extends InstantiateVAppParamsType.Builder<InstantiateVAppParams> {
|
||||||
|
|
||||||
public InstantiateVAppParams build() {
|
public InstantiateVAppParams build() {
|
||||||
InstantiateVAppParams instantiateVAppParams = new InstantiateVAppParams();
|
return new InstantiateVAppParams(description, name, vAppParent, instantiationParams, deploy, powerOn, source, isSourceDelete, linkedClone);
|
||||||
instantiateVAppParams.setSource(source);
|
|
||||||
instantiateVAppParams.setIsSourceDelete(isSourceDelete);
|
|
||||||
instantiateVAppParams.setLinkedClone(linkedClone);
|
|
||||||
instantiateVAppParams.setVAppParent(vAppParent);
|
|
||||||
instantiateVAppParams.setInstantiationParams(instantiationParams);
|
|
||||||
instantiateVAppParams.setDeploy(deploy);
|
|
||||||
instantiateVAppParams.setPowerOn(powerOn);
|
|
||||||
instantiateVAppParams.setDescription(description);
|
|
||||||
instantiateVAppParams.setName(name);
|
|
||||||
return instantiateVAppParams;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see InstantiateVAppParams#getSource()
|
* @see InstantiateVAppParams#getSource()
|
||||||
*/
|
*/
|
||||||
|
@ -65,7 +54,7 @@ public class InstantiateVAppParams
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see InstantiateVAppParams#getIsSourceDelete()
|
* @see InstantiateVAppParams#isSourceDelete()
|
||||||
*/
|
*/
|
||||||
public Builder isSourceDelete(Boolean isSourceDelete) {
|
public Builder isSourceDelete(Boolean isSourceDelete) {
|
||||||
super.isSourceDelete(isSourceDelete);
|
super.isSourceDelete(isSourceDelete);
|
||||||
|
@ -73,13 +62,13 @@ public class InstantiateVAppParams
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see InstantiateVAppParams#getLinkedClone()
|
* @see InstantiateVAppParams#isLinkedClone()
|
||||||
*/
|
*/
|
||||||
public Builder linkedClone(Boolean linkedClone) {
|
public Builder linkedClone(Boolean linkedClone) {
|
||||||
super.linkedClone(linkedClone);
|
super.linkedClone(linkedClone);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ParamsType#getDescription()
|
* @see ParamsType#getDescription()
|
||||||
*/
|
*/
|
||||||
|
@ -95,7 +84,7 @@ public class InstantiateVAppParams
|
||||||
super.name(name);
|
super.name(name);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppCreationParamsType#getVAppParent()
|
* @see VAppCreationParamsType#getVAppParent()
|
||||||
*/
|
*/
|
||||||
|
@ -113,7 +102,7 @@ public class InstantiateVAppParams
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppCreationParamsType#getDeploy()
|
* @see VAppCreationParamsType#isDeploy()
|
||||||
*/
|
*/
|
||||||
public Builder deploy(Boolean deploy) {
|
public Builder deploy(Boolean deploy) {
|
||||||
super.deploy(deploy);
|
super.deploy(deploy);
|
||||||
|
@ -121,7 +110,7 @@ public class InstantiateVAppParams
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppCreationParamsType#getPowerOn()
|
* @see VAppCreationParamsType#isPowerOn()
|
||||||
*/
|
*/
|
||||||
public Builder powerOn(Boolean powerOn) {
|
public Builder powerOn(Boolean powerOn) {
|
||||||
super.powerOn(powerOn);
|
super.powerOn(powerOn);
|
||||||
|
@ -134,13 +123,19 @@ public class InstantiateVAppParams
|
||||||
@Override
|
@Override
|
||||||
public Builder fromInstantiateVAppParamsType(
|
public Builder fromInstantiateVAppParamsType(
|
||||||
InstantiateVAppParamsType<InstantiateVAppParams> in) {
|
InstantiateVAppParamsType<InstantiateVAppParams> in) {
|
||||||
return Builder.class.cast(super.fromVAppCreationParamsType(in));
|
return Builder.class.cast(super.fromVAppCreationParamsType(in));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder fromInstantiateVAppParams(InstantiateVAppParams in) {
|
public Builder fromInstantiateVAppParams(InstantiateVAppParams in) {
|
||||||
return fromInstantiateVAppParamsType(in);
|
return fromInstantiateVAppParamsType(in);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private InstantiateVAppParams(String description, String name, Reference vAppParent, InstantiationParams instantiationParams,
|
||||||
|
Boolean deploy, Boolean powerOn, Reference source, Boolean sourceDelete, Boolean linkedClone) {
|
||||||
|
super(description, name, vAppParent, instantiationParams, deploy, powerOn, source, sourceDelete, linkedClone);
|
||||||
|
}
|
||||||
|
|
||||||
protected InstantiateVAppParams() {
|
protected InstantiateVAppParams() {
|
||||||
// For JAXB and builder use
|
// For JAXB and builder use
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,8 +21,6 @@ package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlSeeAlso;
|
import javax.xml.bind.annotation.XmlSeeAlso;
|
||||||
|
@ -32,14 +30,13 @@ import com.google.common.base.Objects;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Represents vApp instantiation parameters.
|
||||||
* Represents vApp instantiation parameters.
|
* <p/>
|
||||||
*
|
* <p/>
|
||||||
*
|
|
||||||
* <p>Java class for InstantiateVAppParams complex type.
|
* <p>Java class for InstantiateVAppParams complex type.
|
||||||
*
|
* <p/>
|
||||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
*
|
* <p/>
|
||||||
* <pre>
|
* <pre>
|
||||||
* <complexType name="InstantiateVAppParams">
|
* <complexType name="InstantiateVAppParams">
|
||||||
* <complexContent>
|
* <complexContent>
|
||||||
|
@ -54,20 +51,17 @@ import com.google.common.base.Objects;
|
||||||
* </complexContent>
|
* </complexContent>
|
||||||
* </complexType>
|
* </complexType>
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
|
||||||
@XmlType(name = "InstantiateVAppParams", propOrder = {
|
@XmlType(name = "InstantiateVAppParams", propOrder = {
|
||||||
"source",
|
"source",
|
||||||
"isSourceDelete"
|
"isSourceDelete"
|
||||||
})
|
})
|
||||||
@XmlSeeAlso({
|
@XmlSeeAlso({
|
||||||
// InstantiateVAppTemplateParamsType.class,
|
// InstantiateVAppTemplateParamsType.class,
|
||||||
// CloneVAppParamsType.class
|
// CloneVAppParamsType.class
|
||||||
})
|
})
|
||||||
public class InstantiateVAppParamsType<T extends InstantiateVAppParamsType<T>>
|
public class InstantiateVAppParamsType<T extends InstantiateVAppParamsType<T>>
|
||||||
extends VAppCreationParamsType<T>
|
extends VAppCreationParamsType<T>
|
||||||
|
|
||||||
{
|
{
|
||||||
public static <T extends InstantiateVAppParamsType<T>> Builder<T> builder() {
|
public static <T extends InstantiateVAppParamsType<T>> Builder<T> builder() {
|
||||||
|
@ -79,7 +73,7 @@ public class InstantiateVAppParamsType<T extends InstantiateVAppParamsType<T>>
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Builder<T extends InstantiateVAppParamsType<T>> extends VAppCreationParamsType.Builder<T> {
|
public static class Builder<T extends InstantiateVAppParamsType<T>> extends VAppCreationParamsType.Builder<T> {
|
||||||
|
|
||||||
protected Reference source;
|
protected Reference source;
|
||||||
protected Boolean isSourceDelete;
|
protected Boolean isSourceDelete;
|
||||||
protected Boolean linkedClone;
|
protected Boolean linkedClone;
|
||||||
|
@ -93,7 +87,7 @@ public class InstantiateVAppParamsType<T extends InstantiateVAppParamsType<T>>
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see InstantiateVAppParamsType#getIsSourceDelete()
|
* @see InstantiateVAppParamsType#isSourceDelete()
|
||||||
*/
|
*/
|
||||||
public Builder<T> isSourceDelete(Boolean isSourceDelete) {
|
public Builder<T> isSourceDelete(Boolean isSourceDelete) {
|
||||||
this.isSourceDelete = isSourceDelete;
|
this.isSourceDelete = isSourceDelete;
|
||||||
|
@ -101,28 +95,17 @@ public class InstantiateVAppParamsType<T extends InstantiateVAppParamsType<T>>
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see InstantiateVAppParamsType#getLinkedClone()
|
* @see InstantiateVAppParamsType#isLinkedClone()
|
||||||
*/
|
*/
|
||||||
public Builder<T> linkedClone(Boolean linkedClone) {
|
public Builder<T> linkedClone(Boolean linkedClone) {
|
||||||
this.linkedClone = linkedClone;
|
this.linkedClone = linkedClone;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public InstantiateVAppParamsType<T> build() {
|
public InstantiateVAppParamsType<T> build() {
|
||||||
InstantiateVAppParamsType<T> instantiateVAppParams = new InstantiateVAppParamsType<T>();
|
return new InstantiateVAppParamsType<T>(description, name, vAppParent, instantiationParams, deploy, powerOn, source, isSourceDelete, linkedClone);
|
||||||
instantiateVAppParams.setSource(source);
|
|
||||||
instantiateVAppParams.setIsSourceDelete(isSourceDelete);
|
|
||||||
instantiateVAppParams.setLinkedClone(linkedClone);
|
|
||||||
instantiateVAppParams.setVAppParent(vAppParent);
|
|
||||||
instantiateVAppParams.setInstantiationParams(instantiationParams);
|
|
||||||
instantiateVAppParams.setDeploy(deploy);
|
|
||||||
instantiateVAppParams.setPowerOn(powerOn);
|
|
||||||
instantiateVAppParams.setDescription(description);
|
|
||||||
instantiateVAppParams.setName(name);
|
|
||||||
return instantiateVAppParams;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ParamsType#getDescription()
|
* @see ParamsType#getDescription()
|
||||||
*/
|
*/
|
||||||
|
@ -138,7 +121,7 @@ public class InstantiateVAppParamsType<T extends InstantiateVAppParamsType<T>>
|
||||||
super.name(name);
|
super.name(name);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppCreationParamsType#getVAppParent()
|
* @see VAppCreationParamsType#getVAppParent()
|
||||||
*/
|
*/
|
||||||
|
@ -156,7 +139,7 @@ public class InstantiateVAppParamsType<T extends InstantiateVAppParamsType<T>>
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppCreationParamsType#getDeploy()
|
* @see VAppCreationParamsType#isDeploy()
|
||||||
*/
|
*/
|
||||||
public Builder<T> deploy(Boolean deploy) {
|
public Builder<T> deploy(Boolean deploy) {
|
||||||
super.deploy(deploy);
|
super.deploy(deploy);
|
||||||
|
@ -164,7 +147,7 @@ public class InstantiateVAppParamsType<T extends InstantiateVAppParamsType<T>>
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppCreationParamsType#getPowerOn()
|
* @see VAppCreationParamsType#isPowerOn()
|
||||||
*/
|
*/
|
||||||
public Builder<T> powerOn(Boolean powerOn) {
|
public Builder<T> powerOn(Boolean powerOn) {
|
||||||
super.powerOn(powerOn);
|
super.powerOn(powerOn);
|
||||||
|
@ -177,118 +160,84 @@ public class InstantiateVAppParamsType<T extends InstantiateVAppParamsType<T>>
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
public Builder<T> fromVAppCreationParamsType(VAppCreationParamsType<T> in) {
|
public Builder<T> fromVAppCreationParamsType(VAppCreationParamsType<T> in) {
|
||||||
return Builder.class.cast(super.fromVAppCreationParamsType(in));
|
return Builder.class.cast(super.fromVAppCreationParamsType(in));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder<T> fromInstantiateVAppParamsType(InstantiateVAppParamsType<T> in) {
|
public Builder<T> fromInstantiateVAppParamsType(InstantiateVAppParamsType<T> in) {
|
||||||
return fromVAppCreationParamsType(in)
|
return fromVAppCreationParamsType(in)
|
||||||
.source(in.getSource())
|
.source(in.getSource())
|
||||||
.isSourceDelete(in.isSourceDelete())
|
.isSourceDelete(in.isSourceDelete())
|
||||||
.linkedClone(in.isLinkedClone());
|
.linkedClone(in.isLinkedClone());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public InstantiateVAppParamsType(String description, String name, Reference vAppParent, InstantiationParams instantiationParams,
|
||||||
|
Boolean deploy, Boolean powerOn, Reference source, Boolean sourceDelete, Boolean linkedClone) {
|
||||||
|
super(description, name, vAppParent, instantiationParams, deploy, powerOn);
|
||||||
|
this.source = source;
|
||||||
|
isSourceDelete = sourceDelete;
|
||||||
|
this.linkedClone = linkedClone;
|
||||||
|
}
|
||||||
|
|
||||||
protected InstantiateVAppParamsType() {
|
protected InstantiateVAppParamsType() {
|
||||||
// For JAXB and builder use
|
// For JAXB and builder use
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@XmlElement(name = "Source", required = true)
|
||||||
|
protected Reference source;
|
||||||
|
@XmlElement(name = "IsSourceDelete")
|
||||||
|
protected Boolean isSourceDelete;
|
||||||
|
@XmlAttribute
|
||||||
|
protected Boolean linkedClone;
|
||||||
|
|
||||||
@XmlElement(name = "Source", required = true)
|
/**
|
||||||
protected Reference source;
|
* Gets the value of the source property.
|
||||||
@XmlElement(name = "IsSourceDelete")
|
*
|
||||||
protected Boolean isSourceDelete;
|
* @return possible object is
|
||||||
@XmlAttribute
|
* {@link Reference }
|
||||||
protected Boolean linkedClone;
|
*/
|
||||||
|
public Reference getSource() {
|
||||||
|
return source;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the source property.
|
* Gets the value of the isSourceDelete property.
|
||||||
*
|
*
|
||||||
* @return
|
* @return possible object is
|
||||||
* possible object is
|
* {@link Boolean }
|
||||||
* {@link Reference }
|
*/
|
||||||
*
|
public Boolean isSourceDelete() {
|
||||||
*/
|
return isSourceDelete;
|
||||||
public Reference getSource() {
|
}
|
||||||
return source;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the value of the source property.
|
* Gets the value of the linkedClone property.
|
||||||
*
|
*
|
||||||
* @param value
|
* @return possible object is
|
||||||
* allowed object is
|
* {@link Boolean }
|
||||||
* {@link Reference }
|
*/
|
||||||
*
|
public Boolean isLinkedClone() {
|
||||||
*/
|
return linkedClone;
|
||||||
public void setSource(Reference value) {
|
}
|
||||||
this.source = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the value of the isSourceDelete property.
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
* possible object is
|
|
||||||
* {@link Boolean }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public Boolean isSourceDelete() {
|
|
||||||
return isSourceDelete;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the isSourceDelete property.
|
|
||||||
*
|
|
||||||
* @param value
|
|
||||||
* allowed object is
|
|
||||||
* {@link Boolean }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setIsSourceDelete(Boolean value) {
|
|
||||||
this.isSourceDelete = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the value of the linkedClone property.
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
* possible object is
|
|
||||||
* {@link Boolean }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public Boolean isLinkedClone() {
|
|
||||||
return linkedClone;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the linkedClone property.
|
|
||||||
*
|
|
||||||
* @param value
|
|
||||||
* allowed object is
|
|
||||||
* {@link Boolean }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setLinkedClone(Boolean value) {
|
|
||||||
this.linkedClone = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
return true;
|
return true;
|
||||||
if (o == null || getClass() != o.getClass())
|
if (o == null || getClass() != o.getClass())
|
||||||
return false;
|
return false;
|
||||||
InstantiateVAppParamsType<?> that = InstantiateVAppParamsType.class.cast(o);
|
InstantiateVAppParamsType<?> that = InstantiateVAppParamsType.class.cast(o);
|
||||||
return equal(source, that.source) &&
|
return equal(source, that.source) &&
|
||||||
equal(isSourceDelete, that.isSourceDelete) &&
|
equal(isSourceDelete, that.isSourceDelete) &&
|
||||||
equal(linkedClone, that.linkedClone);
|
equal(linkedClone, that.linkedClone);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hashCode(source,
|
return Objects.hashCode(source,
|
||||||
isSourceDelete,
|
isSourceDelete,
|
||||||
linkedClone);
|
linkedClone);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -21,8 +21,6 @@ package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlType;
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
|
||||||
|
@ -30,14 +28,13 @@ import com.google.common.base.Objects;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Represents vApp template instantiation parameters.
|
||||||
* Represents vApp template instantiation parameters.
|
* <p/>
|
||||||
*
|
* <p/>
|
||||||
*
|
|
||||||
* <p>Java class for InstantiateVAppTemplateParams complex type.
|
* <p>Java class for InstantiateVAppTemplateParams complex type.
|
||||||
*
|
* <p/>
|
||||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
*
|
* <p/>
|
||||||
* <pre>
|
* <pre>
|
||||||
* <complexType name="InstantiateVAppTemplateParams">
|
* <complexType name="InstantiateVAppTemplateParams">
|
||||||
* <complexContent>
|
* <complexContent>
|
||||||
|
@ -50,16 +47,13 @@ import com.google.common.base.Objects;
|
||||||
* </complexContent>
|
* </complexContent>
|
||||||
* </complexType>
|
* </complexType>
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
|
||||||
@XmlType(name = "InstantiateVAppTemplateParams", propOrder = {
|
@XmlType(name = "InstantiateVAppTemplateParams", propOrder = {
|
||||||
"allEULAsAccepted"
|
"allEULAsAccepted"
|
||||||
})
|
})
|
||||||
public class InstantiateVAppTemplateParams
|
public class InstantiateVAppTemplateParams
|
||||||
extends InstantiateVAppParamsType<InstantiateVAppTemplateParams> {
|
extends InstantiateVAppParamsType<InstantiateVAppTemplateParams> {
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public static Builder builder() {
|
public static Builder builder() {
|
||||||
return new Builder();
|
return new Builder();
|
||||||
|
@ -70,11 +64,11 @@ public class InstantiateVAppTemplateParams
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Builder extends InstantiateVAppParamsType.Builder<InstantiateVAppTemplateParams> {
|
public static class Builder extends InstantiateVAppParamsType.Builder<InstantiateVAppTemplateParams> {
|
||||||
|
|
||||||
private Boolean allEULAsAccepted;
|
private Boolean allEULAsAccepted;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see InstantiateVAppTemplateParamsType#getAllEULAsAccepted()
|
* @see InstantiateVAppTemplateParams#isAllEULAsAccepted()
|
||||||
*/
|
*/
|
||||||
public Builder allEULAsAccepted(Boolean allEULAsAccepted) {
|
public Builder allEULAsAccepted(Boolean allEULAsAccepted) {
|
||||||
this.allEULAsAccepted = allEULAsAccepted;
|
this.allEULAsAccepted = allEULAsAccepted;
|
||||||
|
@ -82,11 +76,9 @@ public class InstantiateVAppTemplateParams
|
||||||
}
|
}
|
||||||
|
|
||||||
public InstantiateVAppTemplateParams build() {
|
public InstantiateVAppTemplateParams build() {
|
||||||
InstantiateVAppTemplateParams instantiateVAppTemplateParams = new InstantiateVAppTemplateParams();
|
return new InstantiateVAppTemplateParams(description, name, vAppParent, instantiationParams, deploy, powerOn, source, isSourceDelete, linkedClone, allEULAsAccepted);
|
||||||
instantiateVAppTemplateParams.setAllEULAsAccepted(allEULAsAccepted);
|
|
||||||
return instantiateVAppTemplateParams;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ParamsType#getDescription()
|
* @see ParamsType#getDescription()
|
||||||
*/
|
*/
|
||||||
|
@ -102,7 +94,7 @@ public class InstantiateVAppTemplateParams
|
||||||
super.name(name);
|
super.name(name);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppCreationParamsType#getVAppParent()
|
* @see VAppCreationParamsType#getVAppParent()
|
||||||
*/
|
*/
|
||||||
|
@ -120,7 +112,7 @@ public class InstantiateVAppTemplateParams
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppCreationParamsType#getDeploy()
|
* @see VAppCreationParamsType#isDeploy()
|
||||||
*/
|
*/
|
||||||
public Builder deploy(Boolean deploy) {
|
public Builder deploy(Boolean deploy) {
|
||||||
super.deploy(deploy);
|
super.deploy(deploy);
|
||||||
|
@ -128,7 +120,7 @@ public class InstantiateVAppTemplateParams
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppCreationParamsType#getPowerOn()
|
* @see VAppCreationParamsType#isPowerOn()
|
||||||
*/
|
*/
|
||||||
public Builder powerOn(Boolean powerOn) {
|
public Builder powerOn(Boolean powerOn) {
|
||||||
super.powerOn(powerOn);
|
super.powerOn(powerOn);
|
||||||
|
@ -140,58 +132,47 @@ public class InstantiateVAppTemplateParams
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder fromInstantiateVAppParamsType(InstantiateVAppParamsType<InstantiateVAppTemplateParams> in) {
|
public Builder fromInstantiateVAppParamsType(InstantiateVAppParamsType<InstantiateVAppTemplateParams> in) {
|
||||||
return Builder.class.cast(super.fromInstantiateVAppParamsType(in));
|
return Builder.class.cast(super.fromInstantiateVAppParamsType(in));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder fromInstantiateVAppTemplateParams(InstantiateVAppTemplateParams in) {
|
public Builder fromInstantiateVAppTemplateParams(InstantiateVAppTemplateParams in) {
|
||||||
return fromInstantiateVAppParamsType(in)
|
return fromInstantiateVAppParamsType(in)
|
||||||
.allEULAsAccepted(in.isAllEULAsAccepted());
|
.allEULAsAccepted(in.isAllEULAsAccepted());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public InstantiateVAppTemplateParams(String description, String name, Reference vAppParent, InstantiationParams instantiationParams,
|
||||||
|
Boolean deploy, Boolean powerOn, Reference source, Boolean sourceDelete, Boolean linkedClone, Boolean allEULAsAccepted) {
|
||||||
|
super(description, name, vAppParent, instantiationParams, deploy, powerOn, source, sourceDelete, linkedClone);
|
||||||
|
this.allEULAsAccepted = allEULAsAccepted;
|
||||||
|
}
|
||||||
|
|
||||||
private InstantiateVAppTemplateParams() {
|
private InstantiateVAppTemplateParams() {
|
||||||
// For JAXB and builder use
|
// For JAXB and builder use
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@XmlElement(name = "AllEULAsAccepted")
|
||||||
|
protected Boolean allEULAsAccepted;
|
||||||
|
|
||||||
@XmlElement(name = "AllEULAsAccepted")
|
/**
|
||||||
protected Boolean allEULAsAccepted;
|
* Used to confirm acceptance of all EULAs in a
|
||||||
|
* vApp template. Instantiation fails if this
|
||||||
/**
|
* element is missing, empty, or set to false
|
||||||
*
|
* and one or more EulaSection elements are
|
||||||
* Used to confirm acceptance of all EULAs in a
|
* present.
|
||||||
* vApp template. Instantiation fails if this
|
*
|
||||||
* element is missing, empty, or set to false
|
* @return possible object is
|
||||||
* and one or more EulaSection elements are
|
* {@link Boolean }
|
||||||
* present.
|
*/
|
||||||
*
|
public Boolean isAllEULAsAccepted() {
|
||||||
*
|
return allEULAsAccepted;
|
||||||
* @return
|
}
|
||||||
* possible object is
|
|
||||||
* {@link Boolean }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public Boolean isAllEULAsAccepted() {
|
|
||||||
return allEULAsAccepted;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the allEULAsAccepted property.
|
|
||||||
*
|
|
||||||
* @param value
|
|
||||||
* allowed object is
|
|
||||||
* {@link Boolean }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setAllEULAsAccepted(Boolean value) {
|
|
||||||
this.allEULAsAccepted = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
return true;
|
return true;
|
||||||
if (o == null || getClass() != o.getClass())
|
if (o == null || getClass() != o.getClass())
|
||||||
return false;
|
return false;
|
||||||
InstantiateVAppTemplateParams that = InstantiateVAppTemplateParams.class.cast(o);
|
InstantiateVAppTemplateParams that = InstantiateVAppTemplateParams.class.cast(o);
|
||||||
|
|
|
@ -20,13 +20,12 @@
|
||||||
package org.jclouds.vcloud.director.v1_5.domain;
|
package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
import javax.xml.bind.JAXBElement;
|
import javax.xml.bind.JAXBElement;
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlElementRef;
|
import javax.xml.bind.annotation.XmlElementRef;
|
||||||
import javax.xml.bind.annotation.XmlType;
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
|
||||||
|
@ -38,17 +37,17 @@ import org.jclouds.vcloud.director.v1_5.domain.ovf.SectionType;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.ovf.VirtualHardwareSection;
|
import org.jclouds.vcloud.director.v1_5.domain.ovf.VirtualHardwareSection;
|
||||||
|
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
|
import com.google.common.collect.Sets;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Represents a list of ovf:Section to configure for instantiating a VApp.
|
||||||
* Represents a list of ovf:Section to configure for instantiating a VApp.
|
* <p/>
|
||||||
*
|
* <p/>
|
||||||
*
|
|
||||||
* <p>Java class for InstantiationParams complex type.
|
* <p>Java class for InstantiationParams complex type.
|
||||||
*
|
* <p/>
|
||||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
*
|
* <p/>
|
||||||
* <pre>
|
* <pre>
|
||||||
* <complexType name="InstantiationParams">
|
* <complexType name="InstantiationParams">
|
||||||
* <complexContent>
|
* <complexContent>
|
||||||
|
@ -61,12 +60,9 @@ import com.google.common.base.Objects;
|
||||||
* </complexContent>
|
* </complexContent>
|
||||||
* </complexType>
|
* </complexType>
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
|
||||||
@XmlType(name = "InstantiationParams", propOrder = {
|
@XmlType(name = "InstantiationParams", propOrder = {
|
||||||
"section"
|
"section"
|
||||||
})
|
})
|
||||||
public class InstantiationParams {
|
public class InstantiationParams {
|
||||||
public static Builder builder() {
|
public static Builder builder() {
|
||||||
|
@ -78,14 +74,13 @@ public class InstantiationParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Builder {
|
public static class Builder {
|
||||||
|
private Set<? extends SectionType<?>> sections = Sets.newLinkedHashSet();
|
||||||
private List<JAXBElement<? extends SectionType<?>>> sections;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see InstantiationParams#getSections()
|
* @see InstantiationParams#getSections()
|
||||||
*/
|
*/
|
||||||
public Builder sections(List<JAXBElement<? extends SectionType<?>>> sections) {
|
public Builder sections(Set<? extends SectionType<?>> sections) {
|
||||||
this.sections = sections;
|
this.sections = checkNotNull(sections, "sections");
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,67 +100,61 @@ public class InstantiationParams {
|
||||||
// For JAXB and builder use
|
// For JAXB and builder use
|
||||||
}
|
}
|
||||||
|
|
||||||
private InstantiationParams(List<JAXBElement<? extends SectionType<?>>> sections) {
|
private InstantiationParams(Set<? extends SectionType<?>> sections) {
|
||||||
this.sections = sections;
|
this.sections = sections;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@XmlElementRef(name = "Section", namespace = "http://schemas.dmtf.org/ovf/envelope/1", type = JAXBElement.class)
|
@XmlElementRef(name = "Section", namespace = "http://schemas.dmtf.org/ovf/envelope/1", type = JAXBElement.class)
|
||||||
protected List<JAXBElement<? extends SectionType<?>>> sections;
|
protected Set<? extends SectionType<?>> sections = Sets.newLinkedHashSet();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* An ovf:Section to configure for instantiation.
|
||||||
* An ovf:Section to configure for instantiation.
|
* <p/>
|
||||||
*
|
* Gets the value of the section property.
|
||||||
* Gets the value of the section property.
|
* <p/>
|
||||||
*
|
* <p/>
|
||||||
* <p>
|
* This accessor method returns a reference to the live list,
|
||||||
* This accessor method returns a reference to the live list,
|
* not a snapshot. Therefore any modification you make to the
|
||||||
* not a snapshot. Therefore any modification you make to the
|
* returned list will be present inside the JAXB object.
|
||||||
* returned list will be present inside the JAXB object.
|
* This is why there is not a <CODE>set</CODE> method for the section property.
|
||||||
* This is why there is not a <CODE>set</CODE> method for the section property.
|
* <p/>
|
||||||
*
|
* <p/>
|
||||||
* <p>
|
* For example, to add a new item, do as follows:
|
||||||
* For example, to add a new item, do as follows:
|
* <pre>
|
||||||
* <pre>
|
* getSection().add(newItem);
|
||||||
* getSection().add(newItem);
|
* </pre>
|
||||||
* </pre>
|
* <p/>
|
||||||
*
|
* <p/>
|
||||||
*
|
* <p/>
|
||||||
* <p>
|
* Objects of the following type(s) are allowed in the list
|
||||||
* Objects of the following type(s) are allowed in the list
|
* {@link JAXBElement }{@code <}{@link SectionType }{@code >}
|
||||||
* {@link JAXBElement }{@code <}{@link SectionType }{@code >}
|
* {@link JAXBElement }{@code <}{@link VirtualHardwareSection }{@code >}
|
||||||
* {@link JAXBElement }{@code <}{@link VirtualHardwareSection }{@code >}
|
* {@link JAXBElement }{@code <}{@link LeaseSettingsSection }{@code >}
|
||||||
* {@link JAXBElement }{@code <}{@link LeaseSettingsSection }{@code >}
|
* {@link JAXBElement }{@code <}{@link EulaSection }{@code >}
|
||||||
* {@link JAXBElement }{@code <}{@link EulaSection }{@code >}
|
* {@link JAXBElement }{@code <}{@link RuntimeInfoSection }{@code >}
|
||||||
* {@link JAXBElement }{@code <}{@link RuntimeInfoSection }{@code >}
|
* {@link JAXBElement }{@code <}{@link AnnotationSection }{@code >}
|
||||||
* {@link JAXBElement }{@code <}{@link AnnotationSection }{@code >}
|
* {@link JAXBElement }{@code <}{@link DeploymentOptionSection }{@code >}
|
||||||
* {@link JAXBElement }{@code <}{@link DeploymentOptionSection }{@code >}
|
* {@link JAXBElement }{@code <}{@link StartupSection }{@code >}
|
||||||
* {@link JAXBElement }{@code <}{@link StartupSection }{@code >}
|
* {@link JAXBElement }{@code <}{@link ResourceAllocationSection }{@code >}
|
||||||
* {@link JAXBElement }{@code <}{@link ResourceAllocationSection }{@code >}
|
* {@link JAXBElement }{@code <}{@link NetworkConnectionSection }{@code >}
|
||||||
* {@link JAXBElement }{@code <}{@link NetworkConnectionSection }{@code >}
|
* {@link JAXBElement }{@code <}{@link CustomizationSection }{@code >}
|
||||||
* {@link JAXBElement }{@code <}{@link CustomizationSection }{@code >}
|
* {@link JAXBElement }{@code <}{@link ProductSection }{@code >}
|
||||||
* {@link JAXBElement }{@code <}{@link ProductSection }{@code >}
|
* {@link JAXBElement }{@code <}{@link GuestCustomizationSection }{@code >}
|
||||||
* {@link JAXBElement }{@code <}{@link GuestCustomizationSection }{@code >}
|
* {@link JAXBElement }{@code <}{@link org.jclouds.ovf.OperatingSystemSection }{@code >}
|
||||||
* {@link JAXBElement }{@code <}{@link org.jclouds.ovf.OperatingSystemSection }{@code >}
|
* {@link JAXBElement }{@code <}{@link NetworkConfigSection }{@code >}
|
||||||
* {@link JAXBElement }{@code <}{@link NetworkConfigSection }{@code >}
|
* {@link JAXBElement }{@code <}{@link NetworkSection }{@code >}
|
||||||
* {@link JAXBElement }{@code <}{@link NetworkSection }{@code >}
|
* {@link JAXBElement }{@code <}{@link DiskSection }{@code >}
|
||||||
* {@link JAXBElement }{@code <}{@link DiskSection }{@code >}
|
* {@link JAXBElement }{@code <}{@link InstallSection }{@code >}
|
||||||
* {@link JAXBElement }{@code <}{@link InstallSection }{@code >}
|
*/
|
||||||
*
|
public Set<? extends SectionType<?>> getSections() {
|
||||||
*
|
return this.sections;
|
||||||
*/
|
}
|
||||||
public List<JAXBElement<? extends SectionType<?>>> getSections() {
|
|
||||||
if (sections == null) {
|
|
||||||
sections = new ArrayList<JAXBElement<? extends SectionType<?>>>();
|
|
||||||
}
|
|
||||||
return this.sections;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
return true;
|
return true;
|
||||||
if (o == null || getClass() != o.getClass())
|
if (o == null || getClass() != o.getClass())
|
||||||
return false;
|
return false;
|
||||||
InstantiationParams that = InstantiationParams.class.cast(o);
|
InstantiationParams that = InstantiationParams.class.cast(o);
|
||||||
|
|
|
@ -20,10 +20,8 @@ package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_1_5_NS;
|
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@ -33,10 +31,10 @@ import com.google.common.collect.Sets;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A list of IpAddresses.
|
* A list of IpAddresses.
|
||||||
*
|
*
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
@XmlRootElement(namespace = VCLOUD_1_5_NS, name = "IpAddresses")
|
@XmlRootElement(name = "IpAddresses")
|
||||||
public class IpAddresses {
|
public class IpAddresses {
|
||||||
|
|
||||||
public static Builder builder() {
|
public static Builder builder() {
|
||||||
|
@ -83,7 +81,7 @@ public class IpAddresses {
|
||||||
this.ipAddresses = ImmutableSet.copyOf(orgs);
|
this.ipAddresses = ImmutableSet.copyOf(orgs);
|
||||||
}
|
}
|
||||||
|
|
||||||
@XmlElement(namespace = VCLOUD_1_5_NS, name = "IpAddress")
|
@XmlElement(name = "IpAddress")
|
||||||
private Set<String> ipAddresses = Sets.newLinkedHashSet();
|
private Set<String> ipAddresses = Sets.newLinkedHashSet();
|
||||||
|
|
||||||
public Set<String> getIpAddresses() {
|
public Set<String> getIpAddresses() {
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
package org.jclouds.vcloud.director.v1_5.domain;
|
package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_1_5_NS;
|
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
@ -28,12 +27,12 @@ import com.google.common.base.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a range of IP addresses, start and end inclusive.
|
* Represents a range of IP addresses, start and end inclusive.
|
||||||
*
|
*
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
@XmlRootElement(namespace = VCLOUD_1_5_NS, name = "IpRange")
|
@XmlRootElement(name = "IpRange")
|
||||||
public class IpRange {
|
public class IpRange {
|
||||||
|
|
||||||
public static Builder builder() {
|
public static Builder builder() {
|
||||||
return new Builder();
|
return new Builder();
|
||||||
}
|
}
|
||||||
|
@ -43,7 +42,7 @@ public class IpRange {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Builder {
|
public static class Builder {
|
||||||
|
|
||||||
private String startAddress;
|
private String startAddress;
|
||||||
private String endAddress;
|
private String endAddress;
|
||||||
|
|
||||||
|
@ -71,7 +70,7 @@ public class IpRange {
|
||||||
return startAddress(in.getStartAddress()).endAddress(in.getEndAddress());
|
return startAddress(in.getStartAddress()).endAddress(in.getEndAddress());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private IpRange() {
|
private IpRange() {
|
||||||
// For JAXB and builder use
|
// For JAXB and builder use
|
||||||
}
|
}
|
||||||
|
@ -80,27 +79,26 @@ public class IpRange {
|
||||||
this.startAddress = startAddress;
|
this.startAddress = startAddress;
|
||||||
this.endAddress = endAddress;
|
this.endAddress = endAddress;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@XmlElement(name = "StartAddress")
|
||||||
@XmlElement(namespace = VCLOUD_1_5_NS, name = "StartAddress")
|
|
||||||
private String startAddress;
|
private String startAddress;
|
||||||
@XmlElement(namespace = VCLOUD_1_5_NS, name = "EndAddress")
|
@XmlElement(name = "EndAddress")
|
||||||
private String endAddress;
|
private String endAddress;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Start address of the IP range.
|
* @return Start address of the IP range.
|
||||||
*/
|
*/
|
||||||
public String getStartAddress() {
|
public String getStartAddress() {
|
||||||
return startAddress;
|
return startAddress;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return End address of the IP range.
|
* @return End address of the IP range.
|
||||||
*/
|
*/
|
||||||
public String getEndAddress() {
|
public String getEndAddress() {
|
||||||
return endAddress;
|
return endAddress;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
|
|
|
@ -20,11 +20,9 @@ package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_1_5_NS;
|
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
import javax.xml.bind.annotation.XmlElementRef;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
|
@ -33,10 +31,10 @@ import com.google.common.collect.Sets;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A list of IpAddresses.
|
* A list of IpAddresses.
|
||||||
*
|
*
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
@XmlRootElement(namespace = VCLOUD_1_5_NS, name = "IpRanges")
|
@XmlRootElement(name = "IpRanges")
|
||||||
public class IpRanges {
|
public class IpRanges {
|
||||||
|
|
||||||
public static Builder builder() {
|
public static Builder builder() {
|
||||||
|
@ -83,7 +81,7 @@ public class IpRanges {
|
||||||
this.ipRanges = ImmutableSet.copyOf(ipRanges);
|
this.ipRanges = ImmutableSet.copyOf(ipRanges);
|
||||||
}
|
}
|
||||||
|
|
||||||
@XmlElement(namespace = VCLOUD_1_5_NS, name = "IpRange")
|
@XmlElementRef
|
||||||
private Set<IpRange> ipRanges = Sets.newLinkedHashSet();
|
private Set<IpRange> ipRanges = Sets.newLinkedHashSet();
|
||||||
|
|
||||||
public Set<IpRange> getIpRanges() {
|
public Set<IpRange> getIpRanges() {
|
||||||
|
|
|
@ -19,10 +19,7 @@
|
||||||
package org.jclouds.vcloud.director.v1_5.domain;
|
package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_1_5_NS;
|
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@ -30,13 +27,12 @@ import com.google.common.base.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specify network settings like gateway, network mask, DNS servers, IP ranges, etc.
|
* Specify network settings like gateway, network mask, DNS servers, IP ranges, etc.
|
||||||
*
|
*
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
@XmlRootElement(namespace = VCLOUD_1_5_NS, name = "IpScope")
|
@XmlRootElement(name = "IpScope")
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
|
||||||
public class IpScope {
|
public class IpScope {
|
||||||
|
|
||||||
public static Builder builder() {
|
public static Builder builder() {
|
||||||
return new Builder();
|
return new Builder();
|
||||||
}
|
}
|
||||||
|
@ -46,7 +42,7 @@ public class IpScope {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Builder {
|
public static class Builder {
|
||||||
|
|
||||||
private boolean isInherited;
|
private boolean isInherited;
|
||||||
private String gateway;
|
private String gateway;
|
||||||
private String netmask;
|
private String netmask;
|
||||||
|
@ -111,7 +107,7 @@ public class IpScope {
|
||||||
this.ipRanges = ipRanges;
|
this.ipRanges = ipRanges;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see IpScope#getAllocatedIpAddresses()
|
* @see IpScope#getAllocatedIpAddresses()
|
||||||
*/
|
*/
|
||||||
|
@ -121,15 +117,7 @@ public class IpScope {
|
||||||
}
|
}
|
||||||
|
|
||||||
public IpScope build() {
|
public IpScope build() {
|
||||||
IpScope ipScope = new IpScope(isInherited);
|
return new IpScope(isInherited, gateway, netmask, dns1, dns2, dnsSuffix, ipRanges, allocatedIpAddresses);
|
||||||
ipScope.setGateway(gateway);
|
|
||||||
ipScope.setNetmask(netmask);
|
|
||||||
ipScope.setDns1(dns1);
|
|
||||||
ipScope.setDns2(dns2);
|
|
||||||
ipScope.setDnsSuffix(dnsSuffix);
|
|
||||||
ipScope.setIpRanges(ipRanges);
|
|
||||||
ipScope.setAllocatedIpAddresses(allocatedIpAddresses);
|
|
||||||
return ipScope;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder fromIpScope(IpScope in) {
|
public Builder fromIpScope(IpScope in) {
|
||||||
|
@ -142,30 +130,39 @@ public class IpScope {
|
||||||
.allocatedIpAddresses(in.getAllocatedIpAddresses());
|
.allocatedIpAddresses(in.getAllocatedIpAddresses());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private IpScope() {
|
private IpScope() {
|
||||||
// For JAXB and builder use
|
// For JAXB and builder use
|
||||||
}
|
}
|
||||||
|
|
||||||
private IpScope(boolean isInherited) {
|
public IpScope(boolean inherited, String gateway, String netmask, String dns1, String dns2, String dnsSuffix,
|
||||||
this.isInherited = isInherited;
|
IpRanges ipRanges, IpAddresses allocatedIpAddresses) {
|
||||||
|
this.isInherited = inherited;
|
||||||
|
this.gateway = gateway;
|
||||||
|
this.netmask = netmask;
|
||||||
|
this.dns1 = dns1;
|
||||||
|
this.dns2 = dns2;
|
||||||
|
this.dnsSuffix = dnsSuffix;
|
||||||
|
this.ipRanges = ipRanges;
|
||||||
|
this.allocatedIpAddresses = allocatedIpAddresses;
|
||||||
}
|
}
|
||||||
|
|
||||||
@XmlElement(namespace = VCLOUD_1_5_NS, name = "IsInherited")
|
|
||||||
|
@XmlElement(name = "IsInherited")
|
||||||
private boolean isInherited;
|
private boolean isInherited;
|
||||||
@XmlElement(namespace = VCLOUD_1_5_NS, name = "Gateway")
|
@XmlElement(name = "Gateway")
|
||||||
private String gateway;
|
private String gateway;
|
||||||
@XmlElement(namespace = VCLOUD_1_5_NS, name = "Netmask")
|
@XmlElement(name = "Netmask")
|
||||||
private String netmask;
|
private String netmask;
|
||||||
@XmlElement(namespace = VCLOUD_1_5_NS, name = "Dns1")
|
@XmlElement(name = "Dns1")
|
||||||
private String dns1;
|
private String dns1;
|
||||||
@XmlElement(namespace = VCLOUD_1_5_NS, name = "Dns2")
|
@XmlElement(name = "Dns2")
|
||||||
private String dns2;
|
private String dns2;
|
||||||
@XmlElement(namespace = VCLOUD_1_5_NS, name = "DnsSuffix")
|
@XmlElement(name = "DnsSuffix")
|
||||||
private String dnsSuffix;
|
private String dnsSuffix;
|
||||||
@XmlElement(namespace = VCLOUD_1_5_NS, name = "IpRanges")
|
@XmlElement(name = "IpRanges")
|
||||||
private IpRanges ipRanges;
|
private IpRanges ipRanges;
|
||||||
@XmlElement(namespace = VCLOUD_1_5_NS, name = "AllocatedIpAddresses")
|
@XmlElement(name = "AllocatedIpAddresses")
|
||||||
private IpAddresses allocatedIpAddresses;
|
private IpAddresses allocatedIpAddresses;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -174,17 +171,13 @@ public class IpScope {
|
||||||
public boolean isInherited() {
|
public boolean isInherited() {
|
||||||
return isInherited;
|
return isInherited;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Gateway of the network..
|
* @return Gateway of the network..
|
||||||
*/
|
*/
|
||||||
public String getGateway() {
|
public String getGateway() {
|
||||||
return gateway;
|
return gateway;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setGateway(String gateway) {
|
|
||||||
this.gateway = gateway;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Network mask.
|
* @return Network mask.
|
||||||
|
@ -192,10 +185,6 @@ public class IpScope {
|
||||||
public String getNetmask() {
|
public String getNetmask() {
|
||||||
return netmask;
|
return netmask;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setNetmask(String netmask) {
|
|
||||||
this.netmask = netmask;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Primary DNS server.
|
* @return Primary DNS server.
|
||||||
|
@ -203,21 +192,13 @@ public class IpScope {
|
||||||
public String getDns1() {
|
public String getDns1() {
|
||||||
return dns1;
|
return dns1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDns1(String dns1) {
|
|
||||||
this.dns1 = dns1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Secondary DNS server.
|
* @return Secondary DNS server.
|
||||||
*/
|
*/
|
||||||
public String getDns2() {
|
public String getDns2() {
|
||||||
return dns2;
|
return dns2;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDns2(String dns2) {
|
|
||||||
this.dns2 = dns2;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return DNS suffix.
|
* @return DNS suffix.
|
||||||
|
@ -225,33 +206,21 @@ public class IpScope {
|
||||||
public String getDnsSuffix() {
|
public String getDnsSuffix() {
|
||||||
return dnsSuffix;
|
return dnsSuffix;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDnsSuffix(String dnsSuffix) {
|
|
||||||
this.dnsSuffix = dnsSuffix;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return IP ranges used for static pool allocation in the network.
|
* @return IP ranges used for static pool allocation in the network.
|
||||||
*/
|
*/
|
||||||
public IpRanges getIpRanges() {
|
public IpRanges getIpRanges() {
|
||||||
return ipRanges;
|
return ipRanges;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setIpRanges(IpRanges ipRanges) {
|
|
||||||
this.ipRanges = ipRanges;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Read-only list of allocated IP addresses in the network.
|
* @return Read-only list of allocated IP addresses in the network.
|
||||||
*/
|
*/
|
||||||
public IpAddresses getAllocatedIpAddresses() {
|
public IpAddresses getAllocatedIpAddresses() {
|
||||||
return allocatedIpAddresses;
|
return allocatedIpAddresses;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAllocatedIpAddresses(IpAddresses allocatedIpAddresses) {
|
|
||||||
this.allocatedIpAddresses = allocatedIpAddresses;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
|
@ -285,5 +254,5 @@ public class IpScope {
|
||||||
.add("ipRanges", ipRanges)
|
.add("ipRanges", ipRanges)
|
||||||
.add("allocatedIpAddresses", allocatedIpAddresses).toString();
|
.add("allocatedIpAddresses", allocatedIpAddresses).toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,14 +20,11 @@
|
||||||
package org.jclouds.vcloud.director.v1_5.domain;
|
package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_1_5_NS;
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.ArrayList;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.Set;
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlAnyElement;
|
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
@ -37,9 +34,9 @@ import javax.xml.datatype.XMLGregorianCalendar;
|
||||||
|
|
||||||
import org.jclouds.javax.annotation.Nullable;
|
import org.jclouds.javax.annotation.Nullable;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.ovf.SectionType;
|
import org.jclouds.vcloud.director.v1_5.domain.ovf.SectionType;
|
||||||
import org.w3c.dom.Element;
|
|
||||||
|
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
|
import com.google.common.collect.Sets;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -70,15 +67,13 @@ import com.google.common.base.Objects;
|
||||||
* </complexType>
|
* </complexType>
|
||||||
* </pre>
|
* </pre>
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
@XmlRootElement(name = "LeaseSettingsSection")
|
||||||
@XmlRootElement(name = "LeaseSettingsSection", namespace = VCLOUD_1_5_NS)
|
|
||||||
@XmlType(propOrder = {
|
@XmlType(propOrder = {
|
||||||
"link",
|
"links",
|
||||||
"deploymentLeaseInSeconds",
|
"deploymentLeaseInSeconds",
|
||||||
"storageLeaseInSeconds",
|
"storageLeaseInSeconds",
|
||||||
"deploymentLeaseExpiration",
|
"deploymentLeaseExpiration",
|
||||||
"storageLeaseExpiration",
|
"storageLeaseExpiration"
|
||||||
"any"
|
|
||||||
})
|
})
|
||||||
public class LeaseSettingsSection extends SectionType<LeaseSettingsSection> {
|
public class LeaseSettingsSection extends SectionType<LeaseSettingsSection> {
|
||||||
public static <T extends LeaseSettingsSection> Builder builder() {
|
public static <T extends LeaseSettingsSection> Builder builder() {
|
||||||
|
@ -90,20 +85,19 @@ public class LeaseSettingsSection extends SectionType<LeaseSettingsSection> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Builder extends SectionType.Builder<LeaseSettingsSection> {
|
public static class Builder extends SectionType.Builder<LeaseSettingsSection> {
|
||||||
private List<Link> links;
|
private Set<Link> links = Sets.newLinkedHashSet();
|
||||||
private Integer deploymentLeaseInSeconds;
|
private Integer deploymentLeaseInSeconds;
|
||||||
private Integer storageLeaseInSeconds;
|
private Integer storageLeaseInSeconds;
|
||||||
private XMLGregorianCalendar deploymentLeaseExpiration;
|
private XMLGregorianCalendar deploymentLeaseExpiration;
|
||||||
private XMLGregorianCalendar storageLeaseExpiration;
|
private XMLGregorianCalendar storageLeaseExpiration;
|
||||||
private List<Object> any;
|
|
||||||
private URI href;
|
private URI href;
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see LeaseSettingsSection#getLinks()
|
* @see LeaseSettingsSection#getLinks()
|
||||||
*/
|
*/
|
||||||
public Builder links(List<Link> links) {
|
public Builder links(Set<Link> links) {
|
||||||
this.links = links;
|
this.links = checkNotNull(links, "links");
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -139,14 +133,6 @@ public class LeaseSettingsSection extends SectionType<LeaseSettingsSection> {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @see LeaseSettingsSection#getAny()
|
|
||||||
*/
|
|
||||||
public Builder any(List<Object> any) {
|
|
||||||
this.any = any;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see LeaseSettingsSection#getHref()
|
* @see LeaseSettingsSection#getHref()
|
||||||
*/
|
*/
|
||||||
|
@ -165,14 +151,9 @@ public class LeaseSettingsSection extends SectionType<LeaseSettingsSection> {
|
||||||
|
|
||||||
|
|
||||||
public LeaseSettingsSection build() {
|
public LeaseSettingsSection build() {
|
||||||
LeaseSettingsSection leaseSettingsSection = new LeaseSettingsSection(info, links, any);
|
return new LeaseSettingsSection(info, required, links, deploymentLeaseInSeconds,
|
||||||
leaseSettingsSection.setDeploymentLeaseInSeconds(deploymentLeaseInSeconds);
|
storageLeaseInSeconds, deploymentLeaseExpiration,
|
||||||
leaseSettingsSection.setStorageLeaseInSeconds(storageLeaseInSeconds);
|
storageLeaseExpiration, href, type);
|
||||||
leaseSettingsSection.setDeploymentLeaseExpiration(deploymentLeaseExpiration);
|
|
||||||
leaseSettingsSection.setStorageLeaseExpiration(storageLeaseExpiration);
|
|
||||||
leaseSettingsSection.setHref(href);
|
|
||||||
leaseSettingsSection.setType(type);
|
|
||||||
return leaseSettingsSection;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder fromLeaseSettingsSection(LeaseSettingsSection in) {
|
public Builder fromLeaseSettingsSection(LeaseSettingsSection in) {
|
||||||
|
@ -182,7 +163,6 @@ public class LeaseSettingsSection extends SectionType<LeaseSettingsSection> {
|
||||||
.storageLeaseInSeconds(in.getStorageLeaseInSeconds())
|
.storageLeaseInSeconds(in.getStorageLeaseInSeconds())
|
||||||
.deploymentLeaseExpiration(in.getDeploymentLeaseExpiration())
|
.deploymentLeaseExpiration(in.getDeploymentLeaseExpiration())
|
||||||
.storageLeaseExpiration(in.getStorageLeaseExpiration())
|
.storageLeaseExpiration(in.getStorageLeaseExpiration())
|
||||||
.any(in.getAny())
|
|
||||||
.href(in.getHref())
|
.href(in.getHref())
|
||||||
.type(in.getType());
|
.type(in.getType());
|
||||||
}
|
}
|
||||||
|
@ -202,10 +182,18 @@ public class LeaseSettingsSection extends SectionType<LeaseSettingsSection> {
|
||||||
public Builder info(String info) {
|
public Builder info(String info) {
|
||||||
return Builder.class.cast(super.info(info));
|
return Builder.class.cast(super.info(info));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Builder required(Boolean required) {
|
||||||
|
return Builder.class.cast(super.required(required));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@XmlElement(name = "Link")
|
@XmlElement(name = "Link")
|
||||||
protected List<Link> link;
|
protected Set<Link> links;
|
||||||
@XmlElement(name = "DeploymentLeaseInSeconds")
|
@XmlElement(name = "DeploymentLeaseInSeconds")
|
||||||
protected Integer deploymentLeaseInSeconds;
|
protected Integer deploymentLeaseInSeconds;
|
||||||
@XmlElement(name = "StorageLeaseInSeconds")
|
@XmlElement(name = "StorageLeaseInSeconds")
|
||||||
|
@ -216,18 +204,23 @@ public class LeaseSettingsSection extends SectionType<LeaseSettingsSection> {
|
||||||
@XmlElement(name = "StorageLeaseExpiration")
|
@XmlElement(name = "StorageLeaseExpiration")
|
||||||
@XmlSchemaType(name = "dateTime")
|
@XmlSchemaType(name = "dateTime")
|
||||||
protected XMLGregorianCalendar storageLeaseExpiration;
|
protected XMLGregorianCalendar storageLeaseExpiration;
|
||||||
@XmlAnyElement(lax = true)
|
|
||||||
protected List<Object> any;
|
|
||||||
@XmlAttribute
|
@XmlAttribute
|
||||||
@XmlSchemaType(name = "anyURI")
|
@XmlSchemaType(name = "anyURI")
|
||||||
protected URI href;
|
protected URI href;
|
||||||
@XmlAttribute
|
@XmlAttribute
|
||||||
protected String type;
|
protected String type;
|
||||||
|
|
||||||
private LeaseSettingsSection(@Nullable String info, List<Link> link, List<Object> any) {
|
private LeaseSettingsSection(@Nullable String info, @Nullable Boolean required, Set<Link> links, Integer deploymentLeaseInSeconds,
|
||||||
super(info);
|
Integer storageLeaseInSeconds, XMLGregorianCalendar deploymentLeaseExpiration,
|
||||||
this.link = link;
|
XMLGregorianCalendar storageLeaseExpiration, URI href, String type) {
|
||||||
this.any = any;
|
super(info, required);
|
||||||
|
this.links = links;
|
||||||
|
this.deploymentLeaseInSeconds = deploymentLeaseInSeconds;
|
||||||
|
this.storageLeaseInSeconds = storageLeaseInSeconds;
|
||||||
|
this.deploymentLeaseExpiration = deploymentLeaseExpiration;
|
||||||
|
this.storageLeaseExpiration = storageLeaseExpiration;
|
||||||
|
this.href = href;
|
||||||
|
this.type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
private LeaseSettingsSection() {
|
private LeaseSettingsSection() {
|
||||||
|
@ -254,11 +247,8 @@ public class LeaseSettingsSection extends SectionType<LeaseSettingsSection> {
|
||||||
* Objects of the following type(s) are allowed in the list
|
* Objects of the following type(s) are allowed in the list
|
||||||
* {@link Link }
|
* {@link Link }
|
||||||
*/
|
*/
|
||||||
public List<Link> getLinks() {
|
public Set<Link> getLinks() {
|
||||||
if (link == null) {
|
return Collections.unmodifiableSet(this.links);
|
||||||
link = new ArrayList<Link>();
|
|
||||||
}
|
|
||||||
return this.link;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -271,16 +261,6 @@ public class LeaseSettingsSection extends SectionType<LeaseSettingsSection> {
|
||||||
return deploymentLeaseInSeconds;
|
return deploymentLeaseInSeconds;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the deploymentLeaseInSeconds property.
|
|
||||||
*
|
|
||||||
* @param value allowed object is
|
|
||||||
* {@link Integer }
|
|
||||||
*/
|
|
||||||
public void setDeploymentLeaseInSeconds(Integer value) {
|
|
||||||
this.deploymentLeaseInSeconds = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the storageLeaseInSeconds property.
|
* Gets the value of the storageLeaseInSeconds property.
|
||||||
*
|
*
|
||||||
|
@ -291,16 +271,6 @@ public class LeaseSettingsSection extends SectionType<LeaseSettingsSection> {
|
||||||
return storageLeaseInSeconds;
|
return storageLeaseInSeconds;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the storageLeaseInSeconds property.
|
|
||||||
*
|
|
||||||
* @param value allowed object is
|
|
||||||
* {@link Integer }
|
|
||||||
*/
|
|
||||||
public void setStorageLeaseInSeconds(Integer value) {
|
|
||||||
this.storageLeaseInSeconds = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the deploymentLeaseExpiration property.
|
* Gets the value of the deploymentLeaseExpiration property.
|
||||||
*
|
*
|
||||||
|
@ -311,16 +281,6 @@ public class LeaseSettingsSection extends SectionType<LeaseSettingsSection> {
|
||||||
return deploymentLeaseExpiration;
|
return deploymentLeaseExpiration;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the deploymentLeaseExpiration property.
|
|
||||||
*
|
|
||||||
* @param value allowed object is
|
|
||||||
* {@link XMLGregorianCalendar }
|
|
||||||
*/
|
|
||||||
public void setDeploymentLeaseExpiration(XMLGregorianCalendar value) {
|
|
||||||
this.deploymentLeaseExpiration = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the storageLeaseExpiration property.
|
* Gets the value of the storageLeaseExpiration property.
|
||||||
*
|
*
|
||||||
|
@ -331,44 +291,6 @@ public class LeaseSettingsSection extends SectionType<LeaseSettingsSection> {
|
||||||
return storageLeaseExpiration;
|
return storageLeaseExpiration;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the storageLeaseExpiration property.
|
|
||||||
*
|
|
||||||
* @param value allowed object is
|
|
||||||
* {@link XMLGregorianCalendar }
|
|
||||||
*/
|
|
||||||
public void setStorageLeaseExpiration(XMLGregorianCalendar value) {
|
|
||||||
this.storageLeaseExpiration = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the value of the any property.
|
|
||||||
* <p/>
|
|
||||||
* <p/>
|
|
||||||
* 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 <CODE>set</CODE> method for the any property.
|
|
||||||
* <p/>
|
|
||||||
* <p/>
|
|
||||||
* For example, to add a new item, do as follows:
|
|
||||||
* <pre>
|
|
||||||
* getAny().add(newItem);
|
|
||||||
* </pre>
|
|
||||||
* <p/>
|
|
||||||
* <p/>
|
|
||||||
* <p/>
|
|
||||||
* Objects of the following type(s) are allowed in the list
|
|
||||||
* {@link Object }
|
|
||||||
* {@link Element }
|
|
||||||
*/
|
|
||||||
public List<Object> getAny() {
|
|
||||||
if (any == null) {
|
|
||||||
any = new ArrayList<Object>();
|
|
||||||
}
|
|
||||||
return this.any;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the value of the href property.
|
* @return the value of the href property.
|
||||||
*/
|
*/
|
||||||
|
@ -376,15 +298,6 @@ public class LeaseSettingsSection extends SectionType<LeaseSettingsSection> {
|
||||||
return href;
|
return href;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the href property.
|
|
||||||
*
|
|
||||||
* @param value the value to set
|
|
||||||
*/
|
|
||||||
public void setHref(URI value) {
|
|
||||||
this.href = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the type property.
|
* Gets the value of the type property.
|
||||||
*
|
*
|
||||||
|
@ -395,16 +308,6 @@ public class LeaseSettingsSection extends SectionType<LeaseSettingsSection> {
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the type property.
|
|
||||||
*
|
|
||||||
* @param value allowed object is
|
|
||||||
* {@link String }
|
|
||||||
*/
|
|
||||||
public void setType(String value) {
|
|
||||||
this.type = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
|
@ -412,39 +315,38 @@ public class LeaseSettingsSection extends SectionType<LeaseSettingsSection> {
|
||||||
if (o == null || getClass() != o.getClass())
|
if (o == null || getClass() != o.getClass())
|
||||||
return false;
|
return false;
|
||||||
LeaseSettingsSection that = LeaseSettingsSection.class.cast(o);
|
LeaseSettingsSection that = LeaseSettingsSection.class.cast(o);
|
||||||
return equal(link, that.link) &&
|
return super.equals(that) &&
|
||||||
|
equal(links, that.links) &&
|
||||||
equal(deploymentLeaseInSeconds, that.deploymentLeaseInSeconds) &&
|
equal(deploymentLeaseInSeconds, that.deploymentLeaseInSeconds) &&
|
||||||
equal(storageLeaseInSeconds, that.storageLeaseInSeconds) &&
|
equal(storageLeaseInSeconds, that.storageLeaseInSeconds) &&
|
||||||
equal(deploymentLeaseExpiration, that.deploymentLeaseExpiration) &&
|
equal(deploymentLeaseExpiration, that.deploymentLeaseExpiration) &&
|
||||||
equal(storageLeaseExpiration, that.storageLeaseExpiration) &&
|
equal(storageLeaseExpiration, that.storageLeaseExpiration) &&
|
||||||
equal(any, that.any) &&
|
|
||||||
equal(href, that.href) &&
|
equal(href, that.href) &&
|
||||||
equal(type, that.type);
|
equal(type, that.type);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hashCode(link,
|
return Objects.hashCode(super.hashCode(),
|
||||||
|
links,
|
||||||
deploymentLeaseInSeconds,
|
deploymentLeaseInSeconds,
|
||||||
storageLeaseInSeconds,
|
storageLeaseInSeconds,
|
||||||
deploymentLeaseExpiration,
|
deploymentLeaseExpiration,
|
||||||
storageLeaseExpiration,
|
storageLeaseExpiration,
|
||||||
any,
|
|
||||||
href,
|
href,
|
||||||
type);
|
type);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public Objects.ToStringHelper string() {
|
||||||
return Objects.toStringHelper("")
|
return super.string()
|
||||||
.add("link", link)
|
.add("links", links)
|
||||||
.add("deploymentLeaseInSeconds", deploymentLeaseInSeconds)
|
.add("deploymentLeaseInSeconds", deploymentLeaseInSeconds)
|
||||||
.add("storageLeaseInSeconds", storageLeaseInSeconds)
|
.add("storageLeaseInSeconds", storageLeaseInSeconds)
|
||||||
.add("deploymentLeaseExpiration", deploymentLeaseExpiration)
|
.add("deploymentLeaseExpiration", deploymentLeaseExpiration)
|
||||||
.add("storageLeaseExpiration", storageLeaseExpiration)
|
.add("storageLeaseExpiration", storageLeaseExpiration)
|
||||||
.add("any", any)
|
|
||||||
.add("href", href)
|
.add("href", href)
|
||||||
.add("type", type).toString();
|
.add("type", type);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,21 +25,22 @@ import java.net.URI;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
import com.google.common.base.Objects.ToStringHelper;
|
import com.google.common.base.Objects.ToStringHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A link.
|
* A link.
|
||||||
*
|
* <p/>
|
||||||
* <pre>
|
* <pre>
|
||||||
* <xs:complexType name="LinkType">
|
* <xs:complexType name="LinkType">
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author Adrian Cole
|
* @author Adrian Cole
|
||||||
*/
|
*/
|
||||||
|
@XmlRootElement(name = "Link")
|
||||||
public class Link extends ReferenceType<Link> {
|
public class Link extends ReferenceType<Link> {
|
||||||
|
|
||||||
public static final class Rel {
|
public static final class Rel {
|
||||||
|
@ -58,16 +59,16 @@ public class Link extends ReferenceType<Link> {
|
||||||
public static final String FIRST_PAGE = "firstPage";
|
public static final String FIRST_PAGE = "firstPage";
|
||||||
public static final String CONTROL_ACCESS = "controlAccess";
|
public static final String CONTROL_ACCESS = "controlAccess";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* All acceptable {@link Link#getRel()} values.
|
* All acceptable {@link Link#getRel()} values.
|
||||||
*
|
* <p/>
|
||||||
* This list must be updated whenever a new relationship is added.
|
* This list must be updated whenever a new relationship is added.
|
||||||
*/
|
*/
|
||||||
public static final List<String> ALL = Arrays.asList(
|
public static final List<String> ALL = Arrays.asList(
|
||||||
UP, DOWN, EDIT, ADD, DELETE, REMOVE, CATALOG_ITEM, TASK_CANCEL,
|
UP, DOWN, EDIT, ADD, DELETE, REMOVE, CATALOG_ITEM, TASK_CANCEL,
|
||||||
ALTERNATE, NEXT_PAGE, PREVIOUS_PAGE, LAST_PAGE, FIRST_PAGE,
|
ALTERNATE, NEXT_PAGE, PREVIOUS_PAGE, LAST_PAGE, FIRST_PAGE,
|
||||||
CONTROL_ACCESS
|
CONTROL_ACCESS
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
|
@ -97,11 +98,7 @@ public class Link extends ReferenceType<Link> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Link build() {
|
public Link build() {
|
||||||
Link link = new Link(href, rel);
|
return new Link(href, id, name, type, rel);
|
||||||
link.setId(id);
|
|
||||||
link.setName(name);
|
|
||||||
link.setType(type);
|
|
||||||
return link;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -166,8 +163,8 @@ public class Link extends ReferenceType<Link> {
|
||||||
@XmlAttribute(required = true)
|
@XmlAttribute(required = true)
|
||||||
private String rel;
|
private String rel;
|
||||||
|
|
||||||
private Link(URI href, String rel) {
|
private Link(URI href, String id, String name, String type, String rel) {
|
||||||
super(href);
|
super(href, id, name, type);
|
||||||
this.rel = checkNotNull(rel, "rel");
|
this.rel = checkNotNull(rel, "rel");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -180,7 +177,7 @@ public class Link extends ReferenceType<Link> {
|
||||||
* name of an operation on the object, a reference to a contained or containing object, or a
|
* name of an operation on the object, a reference to a contained or containing object, or a
|
||||||
* reference to an alternate representation of the object. The relationship value implies the
|
* reference to an alternate representation of the object. The relationship value implies the
|
||||||
* HTTP verb to use when you use the link's href value as a request URL.
|
* HTTP verb to use when you use the link's href value as a request URL.
|
||||||
*
|
*
|
||||||
* @return relationship of the link to the object that contains it.
|
* @return relationship of the link to the object that contains it.
|
||||||
*/
|
*/
|
||||||
public String getRel() {
|
public String getRel() {
|
||||||
|
|
|
@ -19,13 +19,11 @@
|
||||||
package org.jclouds.vcloud.director.v1_5.domain;
|
package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_1_5_NS;
|
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
@ -35,12 +33,12 @@ import com.google.common.base.Objects.ToStringHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a media.
|
* Represents a media.
|
||||||
*
|
* <p/>
|
||||||
* <pre>
|
* <pre>
|
||||||
* <complexType name="Media" />
|
* <complexType name="Media" />
|
||||||
* </pre>
|
* </pre>
|
||||||
*/
|
*/
|
||||||
@XmlRootElement(namespace = VCLOUD_1_5_NS, name = "Media")
|
@XmlRootElement(name = "Media")
|
||||||
public class Media extends ResourceEntityType<Media> {
|
public class Media extends ResourceEntityType<Media> {
|
||||||
|
|
||||||
public static final class ImageType {
|
public static final class ImageType {
|
||||||
|
@ -92,18 +90,7 @@ public class Media extends ResourceEntityType<Media> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Media build() {
|
public Media build() {
|
||||||
Media media = new Media(href, name);
|
return new Media(href, type, links, description, tasksInProgress, id, name, files, status, owner, imageType, size);
|
||||||
media.setOwner(owner);
|
|
||||||
media.setImageType(imageType);
|
|
||||||
media.setSize(size);
|
|
||||||
media.setFiles(files);
|
|
||||||
media.setStatus(status);
|
|
||||||
media.setDescription(description);
|
|
||||||
media.setTasksInProgress(tasksInProgress);
|
|
||||||
media.setId(id);
|
|
||||||
media.setType(type);
|
|
||||||
media.setLinks(links);
|
|
||||||
return media;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -179,7 +166,7 @@ public class Media extends ResourceEntityType<Media> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ReferenceType#getLinks()
|
* @see EntityType#getLinks()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder links(Set<Link> links) {
|
public Builder links(Set<Link> links) {
|
||||||
|
@ -188,7 +175,7 @@ public class Media extends ResourceEntityType<Media> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ReferenceType#getLinks()
|
* @see EntityType#getLinks()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder link(Link link) {
|
public Builder link(Link link) {
|
||||||
|
@ -206,15 +193,20 @@ public class Media extends ResourceEntityType<Media> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Media() {
|
|
||||||
// for JAXB
|
public Media(URI href, String type, Set<Link> links, String description, TasksInProgress tasksInProgress, String id,
|
||||||
}
|
String name, FilesList files, Integer status, Owner owner, String imageType, long size) {
|
||||||
|
super(href, type, links, description, tasksInProgress, id, name, files, status);
|
||||||
protected Media(URI href, String name) {
|
this.owner = owner;
|
||||||
super(href, name);
|
this.imageType = imageType;
|
||||||
|
this.size = size;
|
||||||
}
|
}
|
||||||
|
|
||||||
@XmlElement(namespace = VCLOUD_1_5_NS, name = "Owner")
|
private Media() {
|
||||||
|
// for JAXB
|
||||||
|
}
|
||||||
|
|
||||||
|
@XmlElement(name = "Owner")
|
||||||
protected Owner owner;
|
protected Owner owner;
|
||||||
@XmlAttribute(required = true)
|
@XmlAttribute(required = true)
|
||||||
protected String imageType;
|
protected String imageType;
|
||||||
|
@ -228,10 +220,6 @@ public class Media extends ResourceEntityType<Media> {
|
||||||
return owner;
|
return owner;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setOwner(Owner value) {
|
|
||||||
this.owner = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the imageType property.
|
* Gets the value of the imageType property.
|
||||||
*/
|
*/
|
||||||
|
@ -239,10 +227,6 @@ public class Media extends ResourceEntityType<Media> {
|
||||||
return imageType;
|
return imageType;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setImageType(String value) {
|
|
||||||
this.imageType = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the size property.
|
* Gets the value of the size property.
|
||||||
*/
|
*/
|
||||||
|
@ -250,10 +234,6 @@ public class Media extends ResourceEntityType<Media> {
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSize(long value) {
|
|
||||||
this.size = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
|
|
|
@ -20,11 +20,9 @@ package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
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.net.URI;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@ -37,16 +35,16 @@ import com.google.common.collect.Sets;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a set of metadata
|
* Represents a set of metadata
|
||||||
*
|
* <p/>
|
||||||
* <pre>
|
* <pre>
|
||||||
* <xs:complexType name="Metadata">
|
* <xs:complexType name="Metadata">
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
@XmlRootElement(namespace = VCLOUD_1_5_NS, name = "Metadata")
|
@XmlRootElement(name = "Metadata")
|
||||||
public class Metadata extends ResourceType<Metadata> {
|
public class Metadata extends ResourceType<Metadata> {
|
||||||
|
|
||||||
public static final String MEDIA_TYPE = VCloudDirectorMediaType.METADATA;
|
public static final String MEDIA_TYPE = VCloudDirectorMediaType.METADATA;
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
|
@ -78,15 +76,12 @@ public class Metadata extends ResourceType<Metadata> {
|
||||||
metadataEntries.add(checkNotNull(metadataEntry, "metadataEntry"));
|
metadataEntries.add(checkNotNull(metadataEntry, "metadataEntry"));
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Metadata build() {
|
public Metadata build() {
|
||||||
Metadata metadata = new Metadata(href, metadataEntries);
|
return new Metadata(href, type, links, metadataEntries);
|
||||||
metadata.setType(type);
|
|
||||||
metadata.setLinks(links);
|
|
||||||
return metadata;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ResourceType#getHref()
|
* @see ResourceType#getHref()
|
||||||
*/
|
*/
|
||||||
|
@ -137,15 +132,16 @@ public class Metadata extends ResourceType<Metadata> {
|
||||||
}
|
}
|
||||||
|
|
||||||
private Metadata() {
|
private Metadata() {
|
||||||
// For JAXB and builder use
|
// For JAXB
|
||||||
}
|
}
|
||||||
|
|
||||||
private Metadata(URI href, Set<MetadataEntry> metadataEntries) {
|
private Metadata(URI href, String type, Set<Link> links, Set<MetadataEntry> metadataEntries) {
|
||||||
super(href);
|
super(href, type, links);
|
||||||
this.metadataEntries = ImmutableSet.copyOf(metadataEntries);
|
this.metadataEntries = ImmutableSet.copyOf(metadataEntries);
|
||||||
}
|
}
|
||||||
|
|
||||||
@XmlElement(namespace = VCLOUD_1_5_NS, name = "MetadataEntry")
|
|
||||||
|
@XmlElement(name = "MetadataEntry")
|
||||||
private Set<MetadataEntry> metadataEntries = Sets.newLinkedHashSet();
|
private Set<MetadataEntry> metadataEntries = Sets.newLinkedHashSet();
|
||||||
|
|
||||||
public Set<MetadataEntry> getMetadataEntries() {
|
public Set<MetadataEntry> getMetadataEntries() {
|
||||||
|
|
|
@ -20,11 +20,9 @@ package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
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.net.URI;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@ -36,16 +34,16 @@ import com.google.common.collect.Sets;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a metadata entry
|
* Represents a metadata entry
|
||||||
*
|
* <p/>
|
||||||
* <pre>
|
* <pre>
|
||||||
* <xs:complexType name="MetadataType">
|
* <xs:complexType name="MetadataType">
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
@XmlRootElement(namespace = VCLOUD_1_5_NS, name = "MetadataEntry")
|
@XmlRootElement(name = "MetadataEntry")
|
||||||
public class MetadataEntry extends ResourceType<MetadataEntry> {
|
public class MetadataEntry extends ResourceType<MetadataEntry> {
|
||||||
|
|
||||||
public static final String MEDIA_TYPE = VCloudDirectorMediaType.METADATA_ENTRY;
|
public static final String MEDIA_TYPE = VCloudDirectorMediaType.METADATA_ENTRY;
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
|
@ -53,7 +51,6 @@ public class MetadataEntry extends ResourceType<MetadataEntry> {
|
||||||
return new Builder();
|
return new Builder();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Builder toBuilder() {
|
public Builder toBuilder() {
|
||||||
return new Builder().fromMetadataEntry(this);
|
return new Builder().fromMetadataEntry(this);
|
||||||
}
|
}
|
||||||
|
@ -87,15 +84,12 @@ public class MetadataEntry extends ResourceType<MetadataEntry> {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MetadataEntry build() {
|
public MetadataEntry build() {
|
||||||
MetadataEntry metadataEntry = new MetadataEntry(href, key, value);
|
return new MetadataEntry(href, type, links, key, value);
|
||||||
metadataEntry.setType(type);
|
|
||||||
metadataEntry.setLinks(links);
|
|
||||||
return metadataEntry;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ResourceType#getHref()
|
* @see ResourceType#getHref()
|
||||||
*/
|
*/
|
||||||
|
@ -149,15 +143,15 @@ public class MetadataEntry extends ResourceType<MetadataEntry> {
|
||||||
// For JAXB and builder use
|
// For JAXB and builder use
|
||||||
}
|
}
|
||||||
|
|
||||||
private MetadataEntry(URI href, String key, String value) {
|
public MetadataEntry(URI href, String type, Set<Link> links, String key, String value) {
|
||||||
super(href);
|
super(href, type, links);
|
||||||
this.key = checkNotNull(key, "key");
|
this.key = checkNotNull(key, "key");
|
||||||
this.value = checkNotNull(value, "value");
|
this.value = checkNotNull(value, "value");
|
||||||
}
|
}
|
||||||
|
|
||||||
@XmlElement(namespace = VCLOUD_1_5_NS, name = "Key")
|
@XmlElement(name = "Key")
|
||||||
private String key;
|
private String key;
|
||||||
@XmlElement(namespace = VCLOUD_1_5_NS, name = "Value")
|
@XmlElement(name = "Value")
|
||||||
private String value;
|
private String value;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -173,7 +167,7 @@ public class MetadataEntry extends ResourceType<MetadataEntry> {
|
||||||
public String getValue() {
|
public String getValue() {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
|
|
|
@ -20,11 +20,9 @@ package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
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.net.URI;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@ -36,16 +34,16 @@ import com.google.common.collect.Sets;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a metadata entry
|
* Represents a metadata entry
|
||||||
*
|
* <p/>
|
||||||
* <pre>
|
* <pre>
|
||||||
* <xs:complexType name="MetadataType">
|
* <xs:complexType name="MetadataType">
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author grkvlt@apache.org
|
* @author grkvlt@apache.org
|
||||||
*/
|
*/
|
||||||
@XmlRootElement(namespace = VCLOUD_1_5_NS, name = "MetadataValue")
|
@XmlRootElement(name = "MetadataValue")
|
||||||
public class MetadataValue extends ResourceType<MetadataValue> {
|
public class MetadataValue extends ResourceType<MetadataValue> {
|
||||||
|
|
||||||
public static final String MEDIA_TYPE = VCloudDirectorMediaType.METADATA_ENTRY;
|
public static final String MEDIA_TYPE = VCloudDirectorMediaType.METADATA_ENTRY;
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
|
@ -68,15 +66,12 @@ public class MetadataValue extends ResourceType<MetadataValue> {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MetadataValue build() {
|
public MetadataValue build() {
|
||||||
MetadataValue metadataValue = new MetadataValue(href, value);
|
return new MetadataValue(href, type, links, value);
|
||||||
metadataValue.setType(type);
|
|
||||||
metadataValue.setLinks(links);
|
|
||||||
return metadataValue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ResourceType#getHref()
|
* @see ResourceType#getHref()
|
||||||
*/
|
*/
|
||||||
|
@ -127,15 +122,15 @@ public class MetadataValue extends ResourceType<MetadataValue> {
|
||||||
}
|
}
|
||||||
|
|
||||||
private MetadataValue() {
|
private MetadataValue() {
|
||||||
// For JAXB and builder use
|
// For JAXB
|
||||||
}
|
}
|
||||||
|
|
||||||
private MetadataValue(URI href, String value) {
|
private MetadataValue(URI href, String type, Set<Link> links, String value) {
|
||||||
super(href);
|
super(href, type, links);
|
||||||
this.value = checkNotNull(value, "value");
|
this.value = checkNotNull(value, "value");
|
||||||
}
|
}
|
||||||
|
|
||||||
@XmlElement(namespace = VCLOUD_1_5_NS, name = "Value", required = true)
|
@XmlElement(name = "Value", required = true)
|
||||||
private String value;
|
private String value;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -144,7 +139,7 @@ public class MetadataValue extends ResourceType<MetadataValue> {
|
||||||
public String getValue() {
|
public String getValue() {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
|
|
|
@ -21,8 +21,6 @@ package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import javax.xml.bind.annotation.XmlType;
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
|
||||||
|
@ -30,14 +28,13 @@ import com.google.common.base.Objects;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Represents mapping between a VM and vApp network.
|
||||||
* Represents mapping between a VM and vApp network.
|
* <p/>
|
||||||
*
|
* <p/>
|
||||||
*
|
|
||||||
* <p>Java class for NetworkAssignment complex type.
|
* <p>Java class for NetworkAssignment complex type.
|
||||||
*
|
* <p/>
|
||||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
*
|
* <p/>
|
||||||
* <pre>
|
* <pre>
|
||||||
* <complexType name="NetworkAssignment">
|
* <complexType name="NetworkAssignment">
|
||||||
* <complexContent>
|
* <complexContent>
|
||||||
|
@ -49,13 +46,10 @@ import com.google.common.base.Objects;
|
||||||
* </complexContent>
|
* </complexContent>
|
||||||
* </complexType>
|
* </complexType>
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
|
||||||
@XmlType(name = "NetworkAssignment")
|
@XmlType(name = "NetworkAssignment")
|
||||||
public class NetworkAssignment
|
public class NetworkAssignment
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
public static Builder builder() {
|
public static Builder builder() {
|
||||||
|
@ -67,7 +61,7 @@ public class NetworkAssignment
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Builder {
|
public static class Builder {
|
||||||
|
|
||||||
private String innerNetwork;
|
private String innerNetwork;
|
||||||
private String containerNetwork;
|
private String containerNetwork;
|
||||||
|
|
||||||
|
@ -87,95 +81,66 @@ public class NetworkAssignment
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public NetworkAssignment build() {
|
public NetworkAssignment build() {
|
||||||
NetworkAssignment networkAssignment = new NetworkAssignment();
|
return new NetworkAssignment(innerNetwork, containerNetwork);
|
||||||
networkAssignment.setInnerNetwork(innerNetwork);
|
|
||||||
networkAssignment.setContainerNetwork(containerNetwork);
|
|
||||||
return networkAssignment;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Builder fromNetworkAssignment(NetworkAssignment in) {
|
public Builder fromNetworkAssignment(NetworkAssignment in) {
|
||||||
return innerNetwork(in.getInnerNetwork())
|
return innerNetwork(in.getInnerNetwork())
|
||||||
.containerNetwork(in.getContainerNetwork());
|
.containerNetwork(in.getContainerNetwork());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private NetworkAssignment(String innerNetwork, String containerNetwork) {
|
||||||
|
this.innerNetwork = innerNetwork;
|
||||||
|
this.containerNetwork = containerNetwork;
|
||||||
|
}
|
||||||
|
|
||||||
private NetworkAssignment() {
|
private NetworkAssignment() {
|
||||||
// For JAXB and builder use
|
// For JAXB and builder use
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@XmlAttribute(required = true)
|
||||||
|
protected String innerNetwork;
|
||||||
|
@XmlAttribute(required = true)
|
||||||
|
protected String containerNetwork;
|
||||||
|
|
||||||
@XmlAttribute(required = true)
|
/**
|
||||||
protected String innerNetwork;
|
* Gets the value of the innerNetwork property.
|
||||||
@XmlAttribute(required = true)
|
*
|
||||||
protected String containerNetwork;
|
* @return possible object is
|
||||||
|
* {@link String }
|
||||||
|
*/
|
||||||
|
public String getInnerNetwork() {
|
||||||
|
return innerNetwork;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the innerNetwork property.
|
* Gets the value of the containerNetwork property.
|
||||||
*
|
*
|
||||||
* @return
|
* @return possible object is
|
||||||
* possible object is
|
* {@link String }
|
||||||
* {@link String }
|
*/
|
||||||
*
|
public String getContainerNetwork() {
|
||||||
*/
|
return containerNetwork;
|
||||||
public String getInnerNetwork() {
|
}
|
||||||
return innerNetwork;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the innerNetwork property.
|
|
||||||
*
|
|
||||||
* @param value
|
|
||||||
* allowed object is
|
|
||||||
* {@link String }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setInnerNetwork(String value) {
|
|
||||||
this.innerNetwork = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the value of the containerNetwork property.
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
* possible object is
|
|
||||||
* {@link String }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public String getContainerNetwork() {
|
|
||||||
return containerNetwork;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the containerNetwork property.
|
|
||||||
*
|
|
||||||
* @param value
|
|
||||||
* allowed object is
|
|
||||||
* {@link String }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setContainerNetwork(String value) {
|
|
||||||
this.containerNetwork = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
return true;
|
return true;
|
||||||
if (o == null || getClass() != o.getClass())
|
if (o == null || getClass() != o.getClass())
|
||||||
return false;
|
return false;
|
||||||
NetworkAssignment that = NetworkAssignment.class.cast(o);
|
NetworkAssignment that = NetworkAssignment.class.cast(o);
|
||||||
return equal(innerNetwork, that.innerNetwork) &&
|
return equal(innerNetwork, that.innerNetwork) &&
|
||||||
equal(containerNetwork, that.containerNetwork);
|
equal(containerNetwork, that.containerNetwork);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hashCode(innerNetwork,
|
return Objects.hashCode(innerNetwork,
|
||||||
containerNetwork);
|
containerNetwork);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -20,14 +20,11 @@
|
||||||
package org.jclouds.vcloud.director.v1_5.domain;
|
package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_1_5_NS;
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.ArrayList;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.Set;
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlAnyElement;
|
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
@ -36,9 +33,10 @@ import javax.xml.bind.annotation.XmlType;
|
||||||
|
|
||||||
import org.jclouds.javax.annotation.Nullable;
|
import org.jclouds.javax.annotation.Nullable;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.ovf.SectionType;
|
import org.jclouds.vcloud.director.v1_5.domain.ovf.SectionType;
|
||||||
import org.w3c.dom.Element;
|
|
||||||
|
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
|
import com.google.common.collect.ImmutableSet;
|
||||||
|
import com.google.common.collect.Sets;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -66,12 +64,10 @@ import com.google.common.base.Objects;
|
||||||
* </complexType>
|
* </complexType>
|
||||||
* </pre>
|
* </pre>
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
@XmlRootElement(name = "NetworkConfigSection")
|
||||||
@XmlRootElement(name="NetworkConfigSection", namespace = VCLOUD_1_5_NS)
|
@XmlType(propOrder = {
|
||||||
@XmlType( propOrder = {
|
"links",
|
||||||
"link",
|
"networkConfigs"
|
||||||
"networkConfig",
|
|
||||||
"any"
|
|
||||||
})
|
})
|
||||||
public class NetworkConfigSection extends SectionType<NetworkConfigSection> {
|
public class NetworkConfigSection extends SectionType<NetworkConfigSection> {
|
||||||
public static Builder builder() {
|
public static Builder builder() {
|
||||||
|
@ -84,33 +80,24 @@ public class NetworkConfigSection extends SectionType<NetworkConfigSection> {
|
||||||
|
|
||||||
public static class Builder extends SectionType.Builder<NetworkConfigSection> {
|
public static class Builder extends SectionType.Builder<NetworkConfigSection> {
|
||||||
|
|
||||||
private List<Link> link;
|
private Set<Link> links = Sets.newLinkedHashSet();
|
||||||
private List<VAppNetworkConfiguration<?>> networkConfig;
|
private Set<VAppNetworkConfiguration<?>> networkConfigs = Sets.newLinkedHashSet();
|
||||||
private List<Object> any;
|
|
||||||
private URI href;
|
private URI href;
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see NetworkConfigSection#getLink()
|
* @see NetworkConfigSection#getLinks()
|
||||||
*/
|
*/
|
||||||
public Builder link(List<Link> link) {
|
public Builder links(Set<Link> links) {
|
||||||
this.link = link;
|
this.links = checkNotNull(links, "links");
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see NetworkConfigSection#getNetworkConfig()
|
* @see NetworkConfigSection#getNetworkConfigs()
|
||||||
*/
|
*/
|
||||||
public Builder networkConfig(List<VAppNetworkConfiguration<?>> networkConfig) {
|
public Builder networkConfig(Set<VAppNetworkConfiguration<?>> networkConfigs) {
|
||||||
this.networkConfig = networkConfig;
|
this.networkConfigs = checkNotNull(networkConfigs, "networkConfigs");
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @see NetworkConfigSection#getAny()
|
|
||||||
*/
|
|
||||||
public Builder any(List<Object> any) {
|
|
||||||
this.any = any;
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,17 +119,13 @@ public class NetworkConfigSection extends SectionType<NetworkConfigSection> {
|
||||||
|
|
||||||
|
|
||||||
public NetworkConfigSection build() {
|
public NetworkConfigSection build() {
|
||||||
NetworkConfigSection networkConfigSection = new NetworkConfigSection(info, link, networkConfig, any);
|
return new NetworkConfigSection(info, required, links, networkConfigs, href, type);
|
||||||
networkConfigSection.setHref(href);
|
|
||||||
networkConfigSection.setType(type);
|
|
||||||
return networkConfigSection;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder fromNetworkConfigSection(NetworkConfigSection in) {
|
public Builder fromNetworkConfigSection(NetworkConfigSection in) {
|
||||||
return fromSection(in)
|
return fromSection(in)
|
||||||
.link(in.getLink())
|
.links(in.getLinks())
|
||||||
.networkConfig(in.getNetworkConfig())
|
.networkConfig(in.getNetworkConfigs())
|
||||||
.any(in.getAny())
|
|
||||||
.href(in.getHref())
|
.href(in.getHref())
|
||||||
.type(in.getType());
|
.type(in.getType());
|
||||||
}
|
}
|
||||||
|
@ -163,111 +146,51 @@ public class NetworkConfigSection extends SectionType<NetworkConfigSection> {
|
||||||
return Builder.class.cast(super.info(info));
|
return Builder.class.cast(super.info(info));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Builder required(Boolean required) {
|
||||||
|
return Builder.class.cast(super.required(required));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@XmlElement(name = "Link")
|
@XmlElement(name = "Link")
|
||||||
protected List<Link> link;
|
protected Set<Link> links;
|
||||||
@XmlElement(name = "NetworkConfig")
|
@XmlElement(name = "NetworkConfig")
|
||||||
protected List<VAppNetworkConfiguration<?>> networkConfig;
|
protected Set<VAppNetworkConfiguration<?>> networkConfigs;
|
||||||
@XmlAnyElement(lax = true)
|
|
||||||
protected List<Object> any;
|
|
||||||
@XmlAttribute
|
@XmlAttribute
|
||||||
@XmlSchemaType(name = "anyURI")
|
@XmlSchemaType(name = "anyURI")
|
||||||
protected URI href;
|
protected URI href;
|
||||||
@XmlAttribute
|
@XmlAttribute
|
||||||
protected String type;
|
protected String type;
|
||||||
|
|
||||||
private NetworkConfigSection(@Nullable String info, List<Link> link, List<VAppNetworkConfiguration<?>> networkConfig, List<Object> any) {
|
public NetworkConfigSection(@Nullable String info, @Nullable Boolean required, Set<Link> links, Set<VAppNetworkConfiguration<?>> networkConfigs,
|
||||||
super(info);
|
URI href, String type) {
|
||||||
this.link = link;
|
super(info, required);
|
||||||
this.networkConfig = networkConfig;
|
this.links = ImmutableSet.copyOf(links);
|
||||||
this.any = any;
|
this.networkConfigs = ImmutableSet.copyOf(networkConfigs);
|
||||||
|
this.href = href;
|
||||||
|
this.type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
private NetworkConfigSection() {
|
private NetworkConfigSection() {
|
||||||
// For JAXB
|
// For JAXB
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the link property.
|
* Gets the value of the link property.
|
||||||
* <p/>
|
|
||||||
* <p/>
|
|
||||||
* 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 <CODE>set</CODE> method for the link property.
|
|
||||||
* <p/>
|
|
||||||
* <p/>
|
|
||||||
* For example, to add a new item, do as follows:
|
|
||||||
* <pre>
|
|
||||||
* getLink().add(newItem);
|
|
||||||
* </pre>
|
|
||||||
* <p/>
|
|
||||||
* <p/>
|
|
||||||
* <p/>
|
|
||||||
* Objects of the following type(s) are allowed in the list
|
|
||||||
* {@link Link }
|
|
||||||
*/
|
*/
|
||||||
public List<Link> getLink() {
|
public Set<Link> getLinks() {
|
||||||
if (link == null) {
|
return Collections.unmodifiableSet(this.links);
|
||||||
link = new ArrayList<Link>();
|
|
||||||
}
|
|
||||||
return this.link;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the networkConfig property.
|
* Gets the value of the networkConfig property.
|
||||||
* <p/>
|
|
||||||
* <p/>
|
|
||||||
* 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 <CODE>set</CODE> method for the networkConfig property.
|
|
||||||
* <p/>
|
|
||||||
* <p/>
|
|
||||||
* For example, to add a new item, do as follows:
|
|
||||||
* <pre>
|
|
||||||
* getNetworkConfig().add(newItem);
|
|
||||||
* </pre>
|
|
||||||
* <p/>
|
|
||||||
* <p/>
|
|
||||||
* <p/>
|
|
||||||
* Objects of the following type(s) are allowed in the list
|
|
||||||
* {@link VAppNetworkConfiguration }
|
|
||||||
*/
|
*/
|
||||||
public List<VAppNetworkConfiguration<?>> getNetworkConfig() {
|
public Set<VAppNetworkConfiguration<?>> getNetworkConfigs() {
|
||||||
if (networkConfig == null) {
|
return Collections.unmodifiableSet(this.networkConfigs);
|
||||||
networkConfig = new ArrayList<VAppNetworkConfiguration<?>>();
|
|
||||||
}
|
|
||||||
return this.networkConfig;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the value of the any property.
|
|
||||||
* <p/>
|
|
||||||
* <p/>
|
|
||||||
* 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 <CODE>set</CODE> method for the any property.
|
|
||||||
* <p/>
|
|
||||||
* <p/>
|
|
||||||
* For example, to add a new item, do as follows:
|
|
||||||
* <pre>
|
|
||||||
* getAny().add(newItem);
|
|
||||||
* </pre>
|
|
||||||
* <p/>
|
|
||||||
* <p/>
|
|
||||||
* <p/>
|
|
||||||
* Objects of the following type(s) are allowed in the list
|
|
||||||
* {@link Object }
|
|
||||||
* {@link Element }
|
|
||||||
*/
|
|
||||||
public List<Object> getAny() {
|
|
||||||
if (any == null) {
|
|
||||||
any = new ArrayList<Object>();
|
|
||||||
}
|
|
||||||
return this.any;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -277,13 +200,6 @@ public class NetworkConfigSection extends SectionType<NetworkConfigSection> {
|
||||||
return href;
|
return href;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the href property.
|
|
||||||
*/
|
|
||||||
public void setHref(URI value) {
|
|
||||||
this.href = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the type property.
|
* Gets the value of the type property.
|
||||||
*
|
*
|
||||||
|
@ -294,16 +210,6 @@ public class NetworkConfigSection extends SectionType<NetworkConfigSection> {
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the type property.
|
|
||||||
*
|
|
||||||
* @param value allowed object is
|
|
||||||
* {@link String }
|
|
||||||
*/
|
|
||||||
public void setType(String value) {
|
|
||||||
this.type = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
|
@ -311,30 +217,29 @@ public class NetworkConfigSection extends SectionType<NetworkConfigSection> {
|
||||||
if (o == null || getClass() != o.getClass())
|
if (o == null || getClass() != o.getClass())
|
||||||
return false;
|
return false;
|
||||||
NetworkConfigSection that = NetworkConfigSection.class.cast(o);
|
NetworkConfigSection that = NetworkConfigSection.class.cast(o);
|
||||||
return equal(link, that.link) &&
|
return super.equals(that) &&
|
||||||
equal(networkConfig, that.networkConfig) &&
|
equal(links, that.links) &&
|
||||||
equal(any, that.any) &&
|
equal(networkConfigs, that.networkConfigs) &&
|
||||||
equal(href, that.href) &&
|
equal(href, that.href) &&
|
||||||
equal(type, that.type);
|
equal(type, that.type);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hashCode(link,
|
return Objects.hashCode(super.hashCode(),
|
||||||
networkConfig,
|
links,
|
||||||
any,
|
networkConfigs,
|
||||||
href,
|
href,
|
||||||
type);
|
type);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public Objects.ToStringHelper string() {
|
||||||
return Objects.toStringHelper("")
|
return super.string()
|
||||||
.add("link", link)
|
.add("links", links)
|
||||||
.add("networkConfig", networkConfig)
|
.add("networkConfigs", networkConfigs)
|
||||||
.add("any", any)
|
|
||||||
.add("href", href)
|
.add("href", href)
|
||||||
.add("type", type).toString();
|
.add("type", type);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,10 +19,8 @@
|
||||||
package org.jclouds.vcloud.director.v1_5.domain;
|
package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_1_5_NS;
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@ -30,12 +28,11 @@ import com.google.common.base.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a network configuration
|
* Returns a network configuration
|
||||||
*
|
*
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
@XmlRootElement(namespace = VCLOUD_1_5_NS, name = "NetworkConfiguration")
|
@XmlRootElement(name = "NetworkConfiguration")
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
public class NetworkConfiguration {
|
||||||
public class NetworkConfiguration{
|
|
||||||
|
|
||||||
public static Builder builder() {
|
public static Builder builder() {
|
||||||
return new Builder();
|
return new Builder();
|
||||||
|
@ -111,14 +108,7 @@ public class NetworkConfiguration{
|
||||||
}
|
}
|
||||||
|
|
||||||
public NetworkConfiguration build() {
|
public NetworkConfiguration build() {
|
||||||
NetworkConfiguration networkConfiguration = new NetworkConfiguration(fenceMode);
|
return new NetworkConfiguration(ipScope, parentNetwork, fenceMode, retainNetInfoAcrossDeployments, features, syslogServerSettings, routerInfo);
|
||||||
networkConfiguration.setIpScope(ipScope);
|
|
||||||
networkConfiguration.setParentNetwork(parentNetwork);
|
|
||||||
networkConfiguration.setRetainNetInfoAcrossDeployments(retainNetInfoAcrossDeployments);
|
|
||||||
networkConfiguration.setNetworkFeatures(features);
|
|
||||||
networkConfiguration.setSyslogServerSettings(syslogServerSettings);
|
|
||||||
networkConfiguration.setRouterInfo(routerInfo);
|
|
||||||
return networkConfiguration;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder fromConfiguration(NetworkConfiguration in) {
|
public Builder fromConfiguration(NetworkConfiguration in) {
|
||||||
|
@ -130,41 +120,44 @@ public class NetworkConfiguration{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public NetworkConfiguration(IpScope ipScope, ReferenceType<?> parentNetwork, String fenceMode, boolean retainNetInfoAcrossDeployments,
|
||||||
|
NetworkFeatures features, SyslogServerSettings syslogServerSettings, RouterInfo routerInfo) {
|
||||||
|
this.ipScope = ipScope;
|
||||||
|
this.parentNetwork = parentNetwork;
|
||||||
|
this.fenceMode = checkNotNull(fenceMode, "fenceMode");
|
||||||
|
this.retainNetInfoAcrossDeployments = retainNetInfoAcrossDeployments;
|
||||||
|
this.features = features;
|
||||||
|
this.syslogServerSettings = syslogServerSettings;
|
||||||
|
this.routerInfo = routerInfo;
|
||||||
|
}
|
||||||
|
|
||||||
private NetworkConfiguration() {
|
private NetworkConfiguration() {
|
||||||
// For JAXB and builder use
|
// For JAXB and builder use
|
||||||
}
|
}
|
||||||
|
|
||||||
private NetworkConfiguration(String fenceMode) {
|
@XmlElement(name = "IpScope")
|
||||||
this.fenceMode = fenceMode;
|
|
||||||
}
|
|
||||||
|
|
||||||
@XmlElement(namespace = VCLOUD_1_5_NS, name = "IpScope")
|
|
||||||
private IpScope ipScope;
|
private IpScope ipScope;
|
||||||
@XmlElement(namespace = VCLOUD_1_5_NS, name = "ParentNetwork")
|
@XmlElement(name = "ParentNetwork")
|
||||||
private ReferenceType<?> parentNetwork;
|
private ReferenceType<?> parentNetwork;
|
||||||
@XmlElement(namespace = VCLOUD_1_5_NS, name = "FenceMode")
|
@XmlElement(name = "FenceMode")
|
||||||
private String fenceMode;
|
private String fenceMode;
|
||||||
@XmlElement(namespace = VCLOUD_1_5_NS, name = "RetainNetInfoAcrossDeployments")
|
@XmlElement(name = "RetainNetInfoAcrossDeployments")
|
||||||
private boolean retainNetInfoAcrossDeployments = false;
|
private boolean retainNetInfoAcrossDeployments = false;
|
||||||
@XmlElement(namespace = VCLOUD_1_5_NS, name = "Features")
|
@XmlElement(name = "Features")
|
||||||
private NetworkFeatures features;
|
private NetworkFeatures features;
|
||||||
@XmlElement(namespace = VCLOUD_1_5_NS, name = "SyslogServerSettings")
|
@XmlElement(name = "SyslogServerSettings")
|
||||||
private SyslogServerSettings syslogServerSettings;
|
private SyslogServerSettings syslogServerSettings;
|
||||||
@XmlElement(namespace = VCLOUD_1_5_NS, name = "RouterInfo")
|
@XmlElement(name = "RouterInfo")
|
||||||
private RouterInfo routerInfo;
|
private RouterInfo routerInfo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return IP level configuration items such as gateway, dns, subnet,
|
* @return IP level configuration items such as gateway, dns, subnet,
|
||||||
* IP address pool to be used for allocation. Note that the pool of IP addresses
|
* IP address pool to be used for allocation. Note that the pool of IP addresses
|
||||||
* needs to fall within the subnet/mask of the IpScope.
|
* needs to fall within the subnet/mask of the IpScope.
|
||||||
*/
|
*/
|
||||||
public IpScope getIpScope() {
|
public IpScope getIpScope() {
|
||||||
return ipScope;
|
return ipScope;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setIpScope(IpScope ipScope) {
|
|
||||||
this.ipScope = ipScope;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return reference to parent network.
|
* @return reference to parent network.
|
||||||
|
@ -172,32 +165,24 @@ public class NetworkConfiguration{
|
||||||
public ReferenceType<?> getParentNetwork() {
|
public ReferenceType<?> getParentNetwork() {
|
||||||
return parentNetwork;
|
return parentNetwork;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setParentNetwork(ReferenceType<?> parentNetwork) {
|
|
||||||
this.parentNetwork = parentNetwork;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Isolation type of the network. If ParentNetwork is specified, this property
|
* @return Isolation type of the network. If ParentNetwork is specified, this property
|
||||||
* controls connectivity to the parent. One of: bridged (connected directly to the ParentNetwork),
|
* controls connectivity to the parent. One of: bridged (connected directly to the ParentNetwork),
|
||||||
* isolated (not connected to any other network), natRouted (connected to the ParentNetwork via a
|
* isolated (not connected to any other network), natRouted (connected to the ParentNetwork via a
|
||||||
* NAT service)
|
* NAT service)
|
||||||
*/
|
*/
|
||||||
public String getFenceMode() {
|
public String getFenceMode() {
|
||||||
return fenceMode;
|
return fenceMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return whether the network resources such as IP/MAC of router will be retained
|
* @return whether the network resources such as IP/MAC of router will be retained
|
||||||
* across deployments. Default is false.
|
* across deployments. Default is false.
|
||||||
*/
|
*/
|
||||||
public boolean getRetainNetInfoAcrossDeployments() {
|
public boolean getRetainNetInfoAcrossDeployments() {
|
||||||
return retainNetInfoAcrossDeployments;
|
return retainNetInfoAcrossDeployments;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRetainNetInfoAcrossDeployments(boolean retainNetInfoAcrossDeployments) {
|
|
||||||
this.retainNetInfoAcrossDeployments = retainNetInfoAcrossDeployments;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Network features like DHCP, firewall and NAT rules.
|
* @return Network features like DHCP, firewall and NAT rules.
|
||||||
|
@ -205,10 +190,6 @@ public class NetworkConfiguration{
|
||||||
public NetworkFeatures getNetworkFeatures() {
|
public NetworkFeatures getNetworkFeatures() {
|
||||||
return features;
|
return features;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setNetworkFeatures(NetworkFeatures features) {
|
|
||||||
this.features = features;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Syslog server settings for the network.
|
* @return Syslog server settings for the network.
|
||||||
|
@ -216,10 +197,6 @@ public class NetworkConfiguration{
|
||||||
public SyslogServerSettings getSyslogServerSettings() {
|
public SyslogServerSettings getSyslogServerSettings() {
|
||||||
return syslogServerSettings;
|
return syslogServerSettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSyslogServerSettings(SyslogServerSettings syslogServerSettings) {
|
|
||||||
this.syslogServerSettings = syslogServerSettings;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return router information
|
* @return router information
|
||||||
|
@ -227,10 +204,6 @@ public class NetworkConfiguration{
|
||||||
public RouterInfo getRouterInfo() {
|
public RouterInfo getRouterInfo() {
|
||||||
return routerInfo;
|
return routerInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRouterInfo(RouterInfo routerInfo) {
|
|
||||||
this.routerInfo = routerInfo;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
|
|
|
@ -21,8 +21,6 @@ package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlType;
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
@ -31,14 +29,13 @@ import com.google.common.base.Objects;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Represents a network connection.
|
||||||
* Represents a network connection.
|
* <p/>
|
||||||
*
|
* <p/>
|
||||||
*
|
|
||||||
* <p>Java class for NetworkConnection complex type.
|
* <p>Java class for NetworkConnection complex type.
|
||||||
*
|
* <p/>
|
||||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
*
|
* <p/>
|
||||||
* <pre>
|
* <pre>
|
||||||
* <complexType name="NetworkConnection">
|
* <complexType name="NetworkConnection">
|
||||||
* <complexContent>
|
* <complexContent>
|
||||||
|
@ -58,17 +55,14 @@ import com.google.common.base.Objects;
|
||||||
* </complexContent>
|
* </complexContent>
|
||||||
* </complexType>
|
* </complexType>
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
|
||||||
@XmlType(name = "NetworkConnection", propOrder = {
|
@XmlType(name = "NetworkConnection", propOrder = {
|
||||||
"networkConnectionIndex",
|
"networkConnectionIndex",
|
||||||
"ipAddress",
|
"ipAddress",
|
||||||
"externalIpAddress",
|
"externalIpAddress",
|
||||||
"isConnected",
|
"isConnected",
|
||||||
"macAddress",
|
"macAddress",
|
||||||
"ipAddressAllocationMode"
|
"ipAddressAllocationMode"
|
||||||
})
|
})
|
||||||
public class NetworkConnection {
|
public class NetworkConnection {
|
||||||
public static Builder builder() {
|
public static Builder builder() {
|
||||||
|
@ -80,7 +74,7 @@ public class NetworkConnection {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Builder {
|
public static class Builder {
|
||||||
|
|
||||||
private int networkConnectionIndex;
|
private int networkConnectionIndex;
|
||||||
private String ipAddress;
|
private String ipAddress;
|
||||||
private String externalIpAddress;
|
private String externalIpAddress;
|
||||||
|
@ -115,7 +109,7 @@ public class NetworkConnection {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see NetworkConnection#getIsConnected()
|
* @see NetworkConnection#isConnected()
|
||||||
*/
|
*/
|
||||||
public Builder isConnected(boolean isConnected) {
|
public Builder isConnected(boolean isConnected) {
|
||||||
this.isConnected = isConnected;
|
this.isConnected = isConnected;
|
||||||
|
@ -123,7 +117,7 @@ public class NetworkConnection {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see NetworkConnection#getMacAddress()
|
* @see NetworkConnection#getMACAddress()
|
||||||
*/
|
*/
|
||||||
public Builder macAddress(String macAddress) {
|
public Builder macAddress(String macAddress) {
|
||||||
this.macAddress = macAddress;
|
this.macAddress = macAddress;
|
||||||
|
@ -147,7 +141,7 @@ public class NetworkConnection {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see NetworkConnection#getNeedsCustomization()
|
* @see NetworkConnection#needsCustomization()
|
||||||
*/
|
*/
|
||||||
public Builder needsCustomization(Boolean needsCustomization) {
|
public Builder needsCustomization(Boolean needsCustomization) {
|
||||||
this.needsCustomization = needsCustomization;
|
this.needsCustomization = needsCustomization;
|
||||||
|
@ -156,259 +150,158 @@ public class NetworkConnection {
|
||||||
|
|
||||||
|
|
||||||
public NetworkConnection build() {
|
public NetworkConnection build() {
|
||||||
NetworkConnection networkConnection = new NetworkConnection(macAddress);
|
return new NetworkConnection(networkConnectionIndex, ipAddress, externalIpAddress, isConnected,
|
||||||
networkConnection.setNetworkConnectionIndex(networkConnectionIndex);
|
macAddress, ipAddressAllocationMode, network, needsCustomization);
|
||||||
networkConnection.setIpAddress(ipAddress);
|
|
||||||
networkConnection.setExternalIpAddress(externalIpAddress);
|
|
||||||
networkConnection.setIsConnected(isConnected);
|
|
||||||
networkConnection.setIpAddressAllocationMode(ipAddressAllocationMode);
|
|
||||||
networkConnection.setNetwork(network);
|
|
||||||
networkConnection.setNeedsCustomization(needsCustomization);
|
|
||||||
return networkConnection;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Builder fromNetworkConnection(NetworkConnection in) {
|
public Builder fromNetworkConnection(NetworkConnection in) {
|
||||||
return networkConnectionIndex(in.getNetworkConnectionIndex())
|
return networkConnectionIndex(in.getNetworkConnectionIndex())
|
||||||
.ipAddress(in.getIpAddress())
|
.ipAddress(in.getIpAddress())
|
||||||
.externalIpAddress(in.getExternalIpAddress())
|
.externalIpAddress(in.getExternalIpAddress())
|
||||||
.isConnected(in.isConnected())
|
.isConnected(in.isConnected())
|
||||||
.macAddress(in.getMACAddress())
|
.macAddress(in.getMACAddress())
|
||||||
.ipAddressAllocationMode(in.getIpAddressAllocationMode())
|
.ipAddressAllocationMode(in.getIpAddressAllocationMode())
|
||||||
.network(in.getNetwork())
|
.network(in.getNetwork())
|
||||||
.needsCustomization(in.needsCustomization());
|
.needsCustomization(in.needsCustomization());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public NetworkConnection(int networkConnectionIndex, String ipAddress, String externalIpAddress, boolean connected,
|
||||||
|
String macAddress, String ipAddressAllocationMode, String network, Boolean needsCustomization) {
|
||||||
|
this.networkConnectionIndex = networkConnectionIndex;
|
||||||
|
this.ipAddress = ipAddress;
|
||||||
|
this.externalIpAddress = externalIpAddress;
|
||||||
|
isConnected = connected;
|
||||||
|
this.macAddress = macAddress;
|
||||||
|
this.ipAddressAllocationMode = ipAddressAllocationMode;
|
||||||
|
this.network = network;
|
||||||
|
this.needsCustomization = needsCustomization;
|
||||||
|
}
|
||||||
|
|
||||||
private NetworkConnection() {
|
private NetworkConnection() {
|
||||||
// For JAXB and builder use
|
// For JAXB and builder use
|
||||||
}
|
}
|
||||||
|
|
||||||
private NetworkConnection(String macAddress) {
|
|
||||||
this.macAddress = macAddress;
|
@XmlElement(name = "NetworkConnectionIndex")
|
||||||
|
protected int networkConnectionIndex;
|
||||||
|
@XmlElement(name = "IpAddress")
|
||||||
|
protected String ipAddress;
|
||||||
|
@XmlElement(name = "ExternalIpAddress")
|
||||||
|
protected String externalIpAddress;
|
||||||
|
@XmlElement(name = "IsConnected")
|
||||||
|
protected boolean isConnected;
|
||||||
|
@XmlElement(name = "MACAddress")
|
||||||
|
protected String macAddress;
|
||||||
|
@XmlElement(name = "IpAddressAllocationMode", required = true)
|
||||||
|
protected String ipAddressAllocationMode;
|
||||||
|
@XmlAttribute(required = true)
|
||||||
|
protected String network;
|
||||||
|
@XmlAttribute
|
||||||
|
protected Boolean needsCustomization;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the networkConnectionIndex property.
|
||||||
|
*/
|
||||||
|
public int getNetworkConnectionIndex() {
|
||||||
|
return networkConnectionIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the ipAddress property.
|
||||||
|
*
|
||||||
|
* @return possible object is
|
||||||
|
* {@link String }
|
||||||
|
*/
|
||||||
|
public String getIpAddress() {
|
||||||
|
return ipAddress;
|
||||||
|
}
|
||||||
|
|
||||||
@XmlElement(name = "NetworkConnectionIndex")
|
/**
|
||||||
protected int networkConnectionIndex;
|
* Gets the value of the externalIpAddress property.
|
||||||
@XmlElement(name = "IpAddress")
|
*
|
||||||
protected String ipAddress;
|
* @return possible object is
|
||||||
@XmlElement(name = "ExternalIpAddress")
|
* {@link String }
|
||||||
protected String externalIpAddress;
|
*/
|
||||||
@XmlElement(name = "IsConnected")
|
public String getExternalIpAddress() {
|
||||||
protected boolean isConnected;
|
return externalIpAddress;
|
||||||
@XmlElement(name = "MACAddress")
|
}
|
||||||
protected String macAddress;
|
|
||||||
@XmlElement(name = "IpAddressAllocationMode", required = true)
|
|
||||||
protected String ipAddressAllocationMode;
|
|
||||||
@XmlAttribute(required = true)
|
|
||||||
protected String network;
|
|
||||||
@XmlAttribute
|
|
||||||
protected Boolean needsCustomization;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the networkConnectionIndex property.
|
* Gets the value of the isConnected property.
|
||||||
*
|
*/
|
||||||
*/
|
public boolean isConnected() {
|
||||||
public int getNetworkConnectionIndex() {
|
return isConnected;
|
||||||
return networkConnectionIndex;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the value of the networkConnectionIndex property.
|
* Gets the value of the macAddress property.
|
||||||
*
|
*
|
||||||
*/
|
* @return possible object is
|
||||||
public void setNetworkConnectionIndex(int value) {
|
* {@link String }
|
||||||
this.networkConnectionIndex = value;
|
*/
|
||||||
}
|
public String getMACAddress() {
|
||||||
|
return macAddress;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the ipAddress property.
|
* Gets the value of the ipAddressAllocationMode property.
|
||||||
*
|
*
|
||||||
* @return
|
* @return possible object is
|
||||||
* possible object is
|
* {@link String }
|
||||||
* {@link String }
|
*/
|
||||||
*
|
public String getIpAddressAllocationMode() {
|
||||||
*/
|
return ipAddressAllocationMode;
|
||||||
public String getIpAddress() {
|
}
|
||||||
return ipAddress;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the value of the ipAddress property.
|
* Gets the value of the network property.
|
||||||
*
|
*
|
||||||
* @param value
|
* @return possible object is
|
||||||
* allowed object is
|
* {@link String }
|
||||||
* {@link String }
|
*/
|
||||||
*
|
public String getNetwork() {
|
||||||
*/
|
return network;
|
||||||
public void setIpAddress(String value) {
|
}
|
||||||
this.ipAddress = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the externalIpAddress property.
|
* Gets the value of the needsCustomization property.
|
||||||
*
|
*
|
||||||
* @return
|
* @return possible object is
|
||||||
* possible object is
|
* {@link Boolean }
|
||||||
* {@link String }
|
*/
|
||||||
*
|
public Boolean needsCustomization() {
|
||||||
*/
|
return needsCustomization;
|
||||||
public String getExternalIpAddress() {
|
}
|
||||||
return externalIpAddress;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the externalIpAddress property.
|
|
||||||
*
|
|
||||||
* @param value
|
|
||||||
* allowed object is
|
|
||||||
* {@link String }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setExternalIpAddress(String value) {
|
|
||||||
this.externalIpAddress = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the value of the isConnected property.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public boolean isConnected() {
|
|
||||||
return isConnected;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the isConnected property.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setIsConnected(boolean value) {
|
|
||||||
this.isConnected = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the value of the macAddress property.
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
* possible object is
|
|
||||||
* {@link String }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public String getMACAddress() {
|
|
||||||
return macAddress;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the macAddress property.
|
|
||||||
*
|
|
||||||
* @param value
|
|
||||||
* allowed object is
|
|
||||||
* {@link String }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setMACAddress(String value) {
|
|
||||||
this.macAddress = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the value of the ipAddressAllocationMode property.
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
* possible object is
|
|
||||||
* {@link String }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public String getIpAddressAllocationMode() {
|
|
||||||
return ipAddressAllocationMode;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the ipAddressAllocationMode property.
|
|
||||||
*
|
|
||||||
* @param value
|
|
||||||
* allowed object is
|
|
||||||
* {@link String }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setIpAddressAllocationMode(String value) {
|
|
||||||
this.ipAddressAllocationMode = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the value of the network property.
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
* possible object is
|
|
||||||
* {@link String }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public String getNetwork() {
|
|
||||||
return network;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the network property.
|
|
||||||
*
|
|
||||||
* @param value
|
|
||||||
* allowed object is
|
|
||||||
* {@link String }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setNetwork(String value) {
|
|
||||||
this.network = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the value of the needsCustomization property.
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
* possible object is
|
|
||||||
* {@link Boolean }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public Boolean needsCustomization() {
|
|
||||||
return needsCustomization;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the needsCustomization property.
|
|
||||||
*
|
|
||||||
* @param value
|
|
||||||
* allowed object is
|
|
||||||
* {@link Boolean }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setNeedsCustomization(Boolean value) {
|
|
||||||
this.needsCustomization = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
return true;
|
return true;
|
||||||
if (o == null || getClass() != o.getClass())
|
if (o == null || getClass() != o.getClass())
|
||||||
return false;
|
return false;
|
||||||
NetworkConnection that = NetworkConnection.class.cast(o);
|
NetworkConnection that = NetworkConnection.class.cast(o);
|
||||||
return equal(networkConnectionIndex, that.networkConnectionIndex) &&
|
return equal(networkConnectionIndex, that.networkConnectionIndex) &&
|
||||||
equal(ipAddress, that.ipAddress) &&
|
equal(ipAddress, that.ipAddress) &&
|
||||||
equal(externalIpAddress, that.externalIpAddress) &&
|
equal(externalIpAddress, that.externalIpAddress) &&
|
||||||
equal(isConnected, that.isConnected) &&
|
equal(isConnected, that.isConnected) &&
|
||||||
equal(macAddress, that.macAddress) &&
|
equal(macAddress, that.macAddress) &&
|
||||||
equal(ipAddressAllocationMode, that.ipAddressAllocationMode) &&
|
equal(ipAddressAllocationMode, that.ipAddressAllocationMode) &&
|
||||||
equal(network, that.network) &&
|
equal(network, that.network) &&
|
||||||
equal(needsCustomization, that.needsCustomization);
|
equal(needsCustomization, that.needsCustomization);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hashCode(networkConnectionIndex,
|
return Objects.hashCode(networkConnectionIndex,
|
||||||
ipAddress,
|
ipAddress,
|
||||||
externalIpAddress,
|
externalIpAddress,
|
||||||
isConnected,
|
isConnected,
|
||||||
macAddress,
|
macAddress,
|
||||||
ipAddressAllocationMode,
|
ipAddressAllocationMode,
|
||||||
network,
|
network,
|
||||||
needsCustomization);
|
needsCustomization);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -20,15 +20,10 @@
|
||||||
package org.jclouds.vcloud.director.v1_5.domain;
|
package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_1_5_NS;
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.ArrayList;
|
import java.util.Set;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlAnyElement;
|
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
@ -37,9 +32,10 @@ import javax.xml.bind.annotation.XmlType;
|
||||||
|
|
||||||
import org.jclouds.javax.annotation.Nullable;
|
import org.jclouds.javax.annotation.Nullable;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.ovf.SectionType;
|
import org.jclouds.vcloud.director.v1_5.domain.ovf.SectionType;
|
||||||
import org.w3c.dom.Element;
|
|
||||||
|
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
|
import com.google.common.collect.ImmutableSet;
|
||||||
|
import com.google.common.collect.Sets;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -68,13 +64,11 @@ import com.google.common.base.Objects;
|
||||||
* </complexType>
|
* </complexType>
|
||||||
* </pre>
|
* </pre>
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
@XmlRootElement(name = "NetworkConnectionSection")
|
||||||
@XmlRootElement(name="NetworkConnectionSection", namespace = VCLOUD_1_5_NS)
|
|
||||||
@XmlType(propOrder = {
|
@XmlType(propOrder = {
|
||||||
"primaryNetworkConnectionIndex",
|
"primaryNetworkConnectionIndex",
|
||||||
"networkConnection",
|
"networkConnections",
|
||||||
"link",
|
"links"
|
||||||
"any"
|
|
||||||
})
|
})
|
||||||
public class NetworkConnectionSection extends SectionType<NetworkConnectionSection> {
|
public class NetworkConnectionSection extends SectionType<NetworkConnectionSection> {
|
||||||
|
|
||||||
|
@ -89,9 +83,8 @@ public class NetworkConnectionSection extends SectionType<NetworkConnectionSecti
|
||||||
public static class Builder extends SectionType.Builder<NetworkConnectionSection> {
|
public static class Builder extends SectionType.Builder<NetworkConnectionSection> {
|
||||||
|
|
||||||
private Integer primaryNetworkConnectionIndex;
|
private Integer primaryNetworkConnectionIndex;
|
||||||
private List<NetworkConnection> networkConnection;
|
private Set<NetworkConnection> networkConnection = Sets.newLinkedHashSet();
|
||||||
private List<Link> link;
|
private Set<Link> links = Sets.newLinkedHashSet();
|
||||||
private List<Object> any;
|
|
||||||
private URI href;
|
private URI href;
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
|
@ -104,26 +97,18 @@ public class NetworkConnectionSection extends SectionType<NetworkConnectionSecti
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see NetworkConnectionSection#getNetworkConnection()
|
* @see NetworkConnectionSection#getNetworkConnections()
|
||||||
*/
|
*/
|
||||||
public Builder networkConnection(List<NetworkConnection> networkConnection) {
|
public Builder networkConnection(Set<NetworkConnection> networkConnection) {
|
||||||
this.networkConnection = networkConnection;
|
this.networkConnection = checkNotNull(networkConnection, "networkConnection");
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see NetworkConnectionSection#getLink()
|
* @see NetworkConnectionSection#getLinks()
|
||||||
*/
|
*/
|
||||||
public Builder link(List<Link> link) {
|
public Builder links(Set<Link> links) {
|
||||||
this.link = link;
|
this.links = checkNotNull(links, "links");
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @see NetworkConnectionSection#getAny()
|
|
||||||
*/
|
|
||||||
public Builder any(List<Object> any) {
|
|
||||||
this.any = any;
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -145,19 +130,15 @@ public class NetworkConnectionSection extends SectionType<NetworkConnectionSecti
|
||||||
|
|
||||||
|
|
||||||
public NetworkConnectionSection build() {
|
public NetworkConnectionSection build() {
|
||||||
NetworkConnectionSection networkConnectionSection = new NetworkConnectionSection(info, networkConnection, link, any);
|
return new NetworkConnectionSection(info, required, primaryNetworkConnectionIndex, networkConnection, links, href, type);
|
||||||
networkConnectionSection.setPrimaryNetworkConnectionIndex(primaryNetworkConnectionIndex);
|
|
||||||
networkConnectionSection.setHref(href);
|
|
||||||
networkConnectionSection.setType(type);
|
|
||||||
return networkConnectionSection;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder fromNetworkConnectionSection(NetworkConnectionSection in) {
|
public Builder fromNetworkConnectionSection(NetworkConnectionSection in) {
|
||||||
return fromSection(in)
|
return fromSection(in)
|
||||||
.primaryNetworkConnectionIndex(in.getPrimaryNetworkConnectionIndex())
|
.primaryNetworkConnectionIndex(in.getPrimaryNetworkConnectionIndex())
|
||||||
.networkConnection(in.getNetworkConnection())
|
.networkConnection(in.getNetworkConnections())
|
||||||
.link(in.getLink())
|
.links(in.getLinks())
|
||||||
.any(in.getAny())
|
|
||||||
.href(in.getHref())
|
.href(in.getHref())
|
||||||
.type(in.getType());
|
.type(in.getType());
|
||||||
}
|
}
|
||||||
|
@ -177,13 +158,25 @@ public class NetworkConnectionSection extends SectionType<NetworkConnectionSecti
|
||||||
public Builder info(String info) {
|
public Builder info(String info) {
|
||||||
return Builder.class.cast(super.info(info));
|
return Builder.class.cast(super.info(info));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Builder required(Boolean required) {
|
||||||
|
return Builder.class.cast(super.required(required));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private NetworkConnectionSection(@Nullable String info, List<NetworkConnection> networkConnection, List<Link> link, List<Object> any) {
|
private NetworkConnectionSection(@Nullable String info, @Nullable Boolean required, Integer primaryNetworkConnectionIndex,
|
||||||
super(info);
|
Set<NetworkConnection> networkConnections, Set<Link> links, URI href, String type) {
|
||||||
this.networkConnection = networkConnection;
|
super(info, required);
|
||||||
this.link = link;
|
this.primaryNetworkConnectionIndex = primaryNetworkConnectionIndex;
|
||||||
this.any = any;
|
this.networkConnections = ImmutableSet.copyOf(networkConnections);
|
||||||
|
this.links = ImmutableSet.copyOf(links);
|
||||||
|
this.href = href;
|
||||||
|
this.type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
private NetworkConnectionSection() {
|
private NetworkConnectionSection() {
|
||||||
|
@ -193,11 +186,9 @@ public class NetworkConnectionSection extends SectionType<NetworkConnectionSecti
|
||||||
@XmlElement(name = "PrimaryNetworkConnectionIndex")
|
@XmlElement(name = "PrimaryNetworkConnectionIndex")
|
||||||
protected Integer primaryNetworkConnectionIndex;
|
protected Integer primaryNetworkConnectionIndex;
|
||||||
@XmlElement(name = "NetworkConnection")
|
@XmlElement(name = "NetworkConnection")
|
||||||
protected List<NetworkConnection> networkConnection;
|
protected Set<NetworkConnection> networkConnections = Sets.newLinkedHashSet();
|
||||||
@XmlElement(name = "Link")
|
@XmlElement(name = "Link")
|
||||||
protected List<Link> link;
|
protected Set<Link> links = Sets.newLinkedHashSet();
|
||||||
@XmlAnyElement(lax = true)
|
|
||||||
protected List<Object> any;
|
|
||||||
@XmlAttribute
|
@XmlAttribute
|
||||||
@XmlSchemaType(name = "anyURI")
|
@XmlSchemaType(name = "anyURI")
|
||||||
protected URI href;
|
protected URI href;
|
||||||
|
@ -214,96 +205,24 @@ public class NetworkConnectionSection extends SectionType<NetworkConnectionSecti
|
||||||
return primaryNetworkConnectionIndex;
|
return primaryNetworkConnectionIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the primaryNetworkConnectionIndex property.
|
|
||||||
*
|
|
||||||
* @param value allowed object is
|
|
||||||
* {@link Integer }
|
|
||||||
*/
|
|
||||||
public void setPrimaryNetworkConnectionIndex(Integer value) {
|
|
||||||
this.primaryNetworkConnectionIndex = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the networkConnection property.
|
* Gets the value of the networkConnection property.
|
||||||
* <p/>
|
* <p/>
|
||||||
* <p/>
|
|
||||||
* 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 <CODE>set</CODE> method for the networkConnection property.
|
|
||||||
* <p/>
|
|
||||||
* <p/>
|
|
||||||
* For example, to add a new item, do as follows:
|
|
||||||
* <pre>
|
|
||||||
* getNetworkConnection().add(newItem);
|
|
||||||
* </pre>
|
|
||||||
* <p/>
|
|
||||||
* <p/>
|
|
||||||
* <p/>
|
|
||||||
* Objects of the following type(s) are allowed in the list
|
* Objects of the following type(s) are allowed in the list
|
||||||
* {@link NetworkConnection }
|
* {@link NetworkConnection }
|
||||||
*/
|
*/
|
||||||
public List<NetworkConnection> getNetworkConnection() {
|
public Set<NetworkConnection> getNetworkConnections() {
|
||||||
if (networkConnection == null) {
|
return this.networkConnections;
|
||||||
networkConnection = new ArrayList<NetworkConnection>();
|
|
||||||
}
|
|
||||||
return this.networkConnection;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the link property.
|
* Gets the value of the link property.
|
||||||
* <p/>
|
* <p/>
|
||||||
* <p/>
|
|
||||||
* 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 <CODE>set</CODE> method for the link property.
|
|
||||||
* <p/>
|
|
||||||
* <p/>
|
|
||||||
* For example, to add a new item, do as follows:
|
|
||||||
* <pre>
|
|
||||||
* getLink().add(newItem);
|
|
||||||
* </pre>
|
|
||||||
* <p/>
|
|
||||||
* <p/>
|
|
||||||
* <p/>
|
|
||||||
* Objects of the following type(s) are allowed in the list
|
* Objects of the following type(s) are allowed in the list
|
||||||
* {@link Link }
|
* {@link Link }
|
||||||
*/
|
*/
|
||||||
public List<Link> getLink() {
|
public Set<Link> getLinks() {
|
||||||
if (link == null) {
|
return this.links;
|
||||||
link = new ArrayList<Link>();
|
|
||||||
}
|
|
||||||
return this.link;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the value of the any property.
|
|
||||||
* <p/>
|
|
||||||
* <p/>
|
|
||||||
* 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 <CODE>set</CODE> method for the any property.
|
|
||||||
* <p/>
|
|
||||||
* <p/>
|
|
||||||
* For example, to add a new item, do as follows:
|
|
||||||
* <pre>
|
|
||||||
* getAny().add(newItem);
|
|
||||||
* </pre>
|
|
||||||
* <p/>
|
|
||||||
* <p/>
|
|
||||||
* <p/>
|
|
||||||
* Objects of the following type(s) are allowed in the list
|
|
||||||
* {@link Object }
|
|
||||||
* {@link Element }
|
|
||||||
*/
|
|
||||||
public List<Object> getAny() {
|
|
||||||
if (any == null) {
|
|
||||||
any = new ArrayList<Object>();
|
|
||||||
}
|
|
||||||
return this.any;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -313,15 +232,6 @@ public class NetworkConnectionSection extends SectionType<NetworkConnectionSecti
|
||||||
return href;
|
return href;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the href property.
|
|
||||||
*
|
|
||||||
* @param value the value to set
|
|
||||||
*/
|
|
||||||
public void setHref(URI value) {
|
|
||||||
this.href = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the type property.
|
* Gets the value of the type property.
|
||||||
*
|
*
|
||||||
|
@ -332,16 +242,6 @@ public class NetworkConnectionSection extends SectionType<NetworkConnectionSecti
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the type property.
|
|
||||||
*
|
|
||||||
* @param value allowed object is
|
|
||||||
* {@link String }
|
|
||||||
*/
|
|
||||||
public void setType(String value) {
|
|
||||||
this.type = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
|
@ -349,10 +249,10 @@ public class NetworkConnectionSection extends SectionType<NetworkConnectionSecti
|
||||||
if (o == null || getClass() != o.getClass())
|
if (o == null || getClass() != o.getClass())
|
||||||
return false;
|
return false;
|
||||||
NetworkConnectionSection that = NetworkConnectionSection.class.cast(o);
|
NetworkConnectionSection that = NetworkConnectionSection.class.cast(o);
|
||||||
return equal(primaryNetworkConnectionIndex, that.primaryNetworkConnectionIndex) &&
|
return super.equals(that) &&
|
||||||
equal(networkConnection, that.networkConnection) &&
|
equal(primaryNetworkConnectionIndex, that.primaryNetworkConnectionIndex) &&
|
||||||
equal(link, that.link) &&
|
equal(networkConnections, that.networkConnections) &&
|
||||||
equal(any, that.any) &&
|
equal(links, that.links) &&
|
||||||
equal(href, that.href) &&
|
equal(href, that.href) &&
|
||||||
equal(type, that.type);
|
equal(type, that.type);
|
||||||
}
|
}
|
||||||
|
@ -360,22 +260,20 @@ public class NetworkConnectionSection extends SectionType<NetworkConnectionSecti
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hashCode(primaryNetworkConnectionIndex,
|
return Objects.hashCode(primaryNetworkConnectionIndex,
|
||||||
networkConnection,
|
networkConnections,
|
||||||
link,
|
links,
|
||||||
any,
|
|
||||||
href,
|
href,
|
||||||
type);
|
type);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public Objects.ToStringHelper string() {
|
||||||
return Objects.toStringHelper("")
|
return super.string()
|
||||||
.add("primaryNetworkConnectionIndex", primaryNetworkConnectionIndex)
|
.add("primaryNetworkConnectionIndex", primaryNetworkConnectionIndex)
|
||||||
.add("networkConnection", networkConnection)
|
.add("networkConnection", networkConnections)
|
||||||
.add("link", link)
|
.add("links", links)
|
||||||
.add("any", any)
|
|
||||||
.add("href", href)
|
.add("href", href)
|
||||||
.add("type", type).toString();
|
.add("type", type);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,10 +20,8 @@ package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_1_5_NS;
|
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@ -33,10 +31,10 @@ import com.google.common.collect.Sets;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents features of a network.
|
* Represents features of a network.
|
||||||
*
|
*
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
@XmlRootElement(namespace = VCLOUD_1_5_NS, name = "Features")
|
@XmlRootElement(name = "Features")
|
||||||
public class NetworkFeatures {
|
public class NetworkFeatures {
|
||||||
|
|
||||||
public static Builder builder() {
|
public static Builder builder() {
|
||||||
|
@ -68,9 +66,7 @@ public class NetworkFeatures {
|
||||||
}
|
}
|
||||||
|
|
||||||
public NetworkFeatures build() {
|
public NetworkFeatures build() {
|
||||||
NetworkFeatures networkFeatures = new NetworkFeatures();
|
return new NetworkFeatures(services);
|
||||||
networkFeatures.setNetworkServices(services);
|
|
||||||
return networkFeatures;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder fromNetworkFeatures(NetworkFeatures in) {
|
public Builder fromNetworkFeatures(NetworkFeatures in) {
|
||||||
|
@ -82,20 +78,20 @@ public class NetworkFeatures {
|
||||||
// For JAXB and builder use
|
// For JAXB and builder use
|
||||||
}
|
}
|
||||||
|
|
||||||
@XmlElement(namespace = VCLOUD_1_5_NS, name = "NetworkService")
|
public NetworkFeatures(Set<NetworkService> services) {
|
||||||
|
this.services = services;
|
||||||
|
}
|
||||||
|
|
||||||
|
@XmlElement(name = "NetworkService")
|
||||||
private Set<NetworkService> services = Sets.newLinkedHashSet();
|
private Set<NetworkService> services = Sets.newLinkedHashSet();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return a Network service. May be any of DhcpService, NatService, IpsecVpnService,
|
* @return a Network service. May be any of DhcpService, NatService, IpsecVpnService,
|
||||||
* DhcpService, or StaticRoutingService.
|
* DhcpService, or StaticRoutingService.
|
||||||
*/
|
*/
|
||||||
public Set<NetworkService> getNetworkServices() {
|
public Set<NetworkService> getNetworkServices() {
|
||||||
return ImmutableSet.copyOf(services);
|
return ImmutableSet.copyOf(services);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setNetworkServices(Set<NetworkService> services) {
|
|
||||||
this.services = Sets.newLinkedHashSet(checkNotNull(services, "services"));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
package org.jclouds.vcloud.director.v1_5.domain;
|
package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_1_5_NS;
|
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
@ -28,10 +27,10 @@ import com.google.common.base.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a network service
|
* Represents a network service
|
||||||
*
|
*
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
@XmlRootElement(namespace = VCLOUD_1_5_NS, name = "NetworkService")
|
@XmlRootElement(name = "NetworkService")
|
||||||
public class NetworkService {
|
public class NetworkService {
|
||||||
|
|
||||||
public static Builder builder() {
|
public static Builder builder() {
|
||||||
|
@ -55,9 +54,7 @@ public class NetworkService {
|
||||||
}
|
}
|
||||||
|
|
||||||
public NetworkService build() {
|
public NetworkService build() {
|
||||||
NetworkService networkService = new NetworkService();
|
return new NetworkService(isEnabled);
|
||||||
networkService.setEnabled(isEnabled);
|
|
||||||
return networkService;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder fromNetworkService(NetworkService in) {
|
public Builder fromNetworkService(NetworkService in) {
|
||||||
|
@ -65,11 +62,15 @@ public class NetworkService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private NetworkService(boolean enabled) {
|
||||||
|
isEnabled = enabled;
|
||||||
|
}
|
||||||
|
|
||||||
private NetworkService() {
|
private NetworkService() {
|
||||||
// For JAXB and builder use
|
// For JAXB and builder use
|
||||||
}
|
}
|
||||||
|
|
||||||
@XmlElement(namespace = VCLOUD_1_5_NS, name = "IsEnabled")
|
@XmlElement(name = "IsEnabled")
|
||||||
private boolean isEnabled;
|
private boolean isEnabled;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -78,10 +79,6 @@ public class NetworkService {
|
||||||
public boolean isEnabled() {
|
public boolean isEnabled() {
|
||||||
return isEnabled;
|
return isEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setEnabled(boolean isEnabled) {
|
|
||||||
this.isEnabled = isEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
|
|
|
@ -20,11 +20,9 @@ package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
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.net.URI;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@ -32,9 +30,9 @@ import com.google.common.base.Objects;
|
||||||
import com.google.common.base.Objects.ToStringHelper;
|
import com.google.common.base.Objects.ToStringHelper;
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
|
|
||||||
@XmlRootElement(namespace = VCLOUD_1_5_NS, name = "NetworkType")
|
@XmlRootElement(name = "NetworkType")
|
||||||
public class NetworkType<T extends NetworkType<T>> extends EntityType<T> {
|
public class NetworkType<T extends NetworkType<T>> extends EntityType<T> {
|
||||||
|
|
||||||
public static <T extends NetworkType<T>> Builder<T> builder() {
|
public static <T extends NetworkType<T>> Builder<T> builder() {
|
||||||
return new Builder<T>();
|
return new Builder<T>();
|
||||||
}
|
}
|
||||||
|
@ -47,7 +45,7 @@ public class NetworkType<T extends NetworkType<T>> extends EntityType<T> {
|
||||||
public static class Builder<T extends NetworkType<T>> extends EntityType.Builder<T> {
|
public static class Builder<T extends NetworkType<T>> extends EntityType.Builder<T> {
|
||||||
|
|
||||||
protected NetworkConfiguration networkConfiguration;
|
protected NetworkConfiguration networkConfiguration;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see NetworkType#getConfiguration()
|
* @see NetworkType#getConfiguration()
|
||||||
*/
|
*/
|
||||||
|
@ -55,17 +53,10 @@ public class NetworkType<T extends NetworkType<T>> extends EntityType<T> {
|
||||||
this.networkConfiguration = networkConfiguration;
|
this.networkConfiguration = networkConfiguration;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public NetworkType<T> build() {
|
public NetworkType<T> build() {
|
||||||
NetworkType<T> network = new NetworkType<T>(href, name);
|
return new NetworkType<T>(href, type, links, description, tasksInProgress, id, name, networkConfiguration);
|
||||||
network.setConfiguration(networkConfiguration);
|
|
||||||
network.setDescription(description);
|
|
||||||
network.setId(id);
|
|
||||||
network.setType(type);
|
|
||||||
network.setLinks(links);
|
|
||||||
network.setTasksInProgress(tasksInProgress);
|
|
||||||
return network;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -123,7 +114,7 @@ public class NetworkType<T extends NetworkType<T>> extends EntityType<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ReferenceType#getLinks()
|
* @see EntityType#getLinks()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder<T> links(Set<Link> links) {
|
public Builder<T> links(Set<Link> links) {
|
||||||
|
@ -132,7 +123,7 @@ public class NetworkType<T extends NetworkType<T>> extends EntityType<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ReferenceType#getLinks()
|
* @see EntityType#getLinks()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder<T> link(Link link) {
|
public Builder<T> link(Link link) {
|
||||||
|
@ -154,15 +145,17 @@ public class NetworkType<T extends NetworkType<T>> extends EntityType<T> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public NetworkType(URI href, String type, Set<Link> links, String description, TasksInProgress tasksInProgress,
|
||||||
|
String id, String name, NetworkConfiguration networkConfiguration) {
|
||||||
|
super(href, type, links, description, tasksInProgress, id, name);
|
||||||
|
this.networkConfiguration = networkConfiguration;
|
||||||
|
}
|
||||||
|
|
||||||
protected NetworkType() {
|
protected NetworkType() {
|
||||||
// For JAXB and builder use
|
// For JAXB and builder use
|
||||||
}
|
}
|
||||||
|
|
||||||
protected NetworkType(URI href, String name) {
|
|
||||||
super(href, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
@XmlElement(namespace = VCLOUD_1_5_NS, name = "Configuration")
|
@XmlElement(name = "Configuration")
|
||||||
private NetworkConfiguration networkConfiguration;
|
private NetworkConfiguration networkConfiguration;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -171,11 +164,7 @@ public class NetworkType<T extends NetworkType<T>> extends EntityType<T> {
|
||||||
public NetworkConfiguration getConfiguration() {
|
public NetworkConfiguration getConfiguration() {
|
||||||
return networkConfiguration;
|
return networkConfiguration;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setConfiguration(NetworkConfiguration networkConfiguration) {
|
|
||||||
this.networkConfiguration = networkConfiguration;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (!super.equals(o))
|
if (!super.equals(o))
|
||||||
|
|
|
@ -20,11 +20,9 @@ package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
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.net.URI;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@ -36,18 +34,18 @@ import com.google.common.collect.Sets;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* iRepresents an organization.
|
* iRepresents an organization.
|
||||||
*
|
* <p/>
|
||||||
* Unit of multi-tenancy and a top-level container. Contain vDCs, TasksList, Catalogs and Shared Network entities.
|
* Unit of multi-tenancy and a top-level container. Contain vDCs, TasksList, Catalogs and Shared Network entities.
|
||||||
*
|
* <p/>
|
||||||
* <pre>
|
* <pre>
|
||||||
* <xs:complexType name="OrgType">
|
* <xs:complexType name="OrgType">
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author Adrian Cole
|
* @author Adrian Cole
|
||||||
*/
|
*/
|
||||||
@XmlRootElement(namespace = VCLOUD_1_5_NS, name = "Org")
|
@XmlRootElement(name = "Org")
|
||||||
public class Org extends EntityType<Org> {
|
public class Org extends EntityType<Org> {
|
||||||
|
|
||||||
public static final String MEDIA_TYPE = VCloudDirectorMediaType.ORG;
|
public static final String MEDIA_TYPE = VCloudDirectorMediaType.ORG;
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
|
@ -99,14 +97,7 @@ public class Org extends EntityType<Org> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Org build() {
|
public Org build() {
|
||||||
Org org = new Org(href, name, fullName);
|
return new Org(href, type, links, description, tasksInProgress, id, name, fullName, isEnabled);
|
||||||
org.setDescription(description);
|
|
||||||
org.setId(id);
|
|
||||||
org.setType(type);
|
|
||||||
org.setLinks(links);
|
|
||||||
org.setTasksInProgress(tasksInProgress);
|
|
||||||
org.setIsEnabled(isEnabled);
|
|
||||||
return org;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -164,7 +155,7 @@ public class Org extends EntityType<Org> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ReferenceType#getLinks()
|
* @see EntityType#getLinks()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder links(Set<Link> links) {
|
public Builder links(Set<Link> links) {
|
||||||
|
@ -173,7 +164,7 @@ public class Org extends EntityType<Org> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ReferenceType#getLinks()
|
* @see EntityType#getLinks()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder link(Link link) {
|
public Builder link(Link link) {
|
||||||
|
@ -195,14 +186,15 @@ public class Org extends EntityType<Org> {
|
||||||
// For JAXB and builder use
|
// For JAXB and builder use
|
||||||
}
|
}
|
||||||
|
|
||||||
private Org(URI href, String name, String fullName) {
|
public Org(URI href, String type, Set<Link> links, String description, TasksInProgress tasksInProgress, String id, String name, String fullName, Boolean enabled) {
|
||||||
super(href, name);
|
super(href, type, links, description, tasksInProgress, id, name);
|
||||||
this.fullName = fullName;
|
this.fullName = fullName;
|
||||||
|
isEnabled = enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
@XmlElement(namespace = VCLOUD_1_5_NS, name = "FullName", required = true)
|
@XmlElement(name = "FullName", required = true)
|
||||||
private String fullName;
|
private String fullName;
|
||||||
@XmlElement(namespace = VCLOUD_1_5_NS, name = "IsEnabled")
|
@XmlElement(name = "IsEnabled")
|
||||||
private Boolean isEnabled;
|
private Boolean isEnabled;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -219,10 +211,6 @@ public class Org extends EntityType<Org> {
|
||||||
return isEnabled;
|
return isEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setIsEnabled(Boolean isEnabled) {
|
|
||||||
this.isEnabled = isEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
|
|
|
@ -20,10 +20,8 @@ package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_1_5_NS;
|
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@ -35,12 +33,12 @@ import com.google.common.collect.Sets;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A list of organizations.
|
* A list of organizations.
|
||||||
*
|
*
|
||||||
* @author Adrian Cole
|
* @author Adrian Cole
|
||||||
*/
|
*/
|
||||||
@XmlRootElement(namespace = VCLOUD_1_5_NS, name = "OrgList")
|
@XmlRootElement(name = "OrgList")
|
||||||
public class OrgList {
|
public class OrgList {
|
||||||
|
|
||||||
public static final String MEDIA_TYPE = VCloudDirectorMediaType.ORG_LIST;
|
public static final String MEDIA_TYPE = VCloudDirectorMediaType.ORG_LIST;
|
||||||
|
|
||||||
public static Builder builder() {
|
public static Builder builder() {
|
||||||
|
@ -88,7 +86,7 @@ public class OrgList {
|
||||||
this.orgs = ImmutableSet.copyOf(orgs);
|
this.orgs = ImmutableSet.copyOf(orgs);
|
||||||
}
|
}
|
||||||
|
|
||||||
@XmlElement(namespace = VCLOUD_1_5_NS, name = "Org")
|
@XmlElement(name = "Org")
|
||||||
private Set<Reference> orgs = Sets.newLinkedHashSet();
|
private Set<Reference> orgs = Sets.newLinkedHashSet();
|
||||||
|
|
||||||
public Set<Reference> getOrgs() {
|
public Set<Reference> getOrgs() {
|
||||||
|
|
|
@ -20,11 +20,9 @@ package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
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.net.URI;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@ -32,9 +30,9 @@ import com.google.common.base.Objects;
|
||||||
import com.google.common.base.Objects.ToStringHelper;
|
import com.google.common.base.Objects.ToStringHelper;
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
|
|
||||||
@XmlRootElement(namespace = VCLOUD_1_5_NS, name = "OrgNetwork")
|
@XmlRootElement(name = "OrgNetwork")
|
||||||
public class OrgNetwork extends NetworkType<OrgNetwork> {
|
public class OrgNetwork extends NetworkType<OrgNetwork> {
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public static Builder builder() {
|
public static Builder builder() {
|
||||||
return new Builder();
|
return new Builder();
|
||||||
|
@ -49,7 +47,7 @@ public class OrgNetwork extends NetworkType<OrgNetwork> {
|
||||||
|
|
||||||
private ReferenceType<?> networkPool;
|
private ReferenceType<?> networkPool;
|
||||||
private IpAddresses allowedExternalIpAddresses;
|
private IpAddresses allowedExternalIpAddresses;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see OrgNetwork#getNetworkPool()
|
* @see OrgNetwork#getNetworkPool()
|
||||||
*/
|
*/
|
||||||
|
@ -65,21 +63,13 @@ public class OrgNetwork extends NetworkType<OrgNetwork> {
|
||||||
this.allowedExternalIpAddresses = allowedExternalIpAddresses;
|
this.allowedExternalIpAddresses = allowedExternalIpAddresses;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public OrgNetwork build() {
|
public OrgNetwork build() {
|
||||||
OrgNetwork network = new OrgNetwork(href, name);
|
return new OrgNetwork(href, type, links, description, tasksInProgress, id, name, networkConfiguration,
|
||||||
network.setConfiguration(networkConfiguration);
|
networkPool, allowedExternalIpAddresses);
|
||||||
network.setNetworkPool(networkPool);
|
|
||||||
network.setAllowedExternalIpAddresses(allowedExternalIpAddresses);
|
|
||||||
network.setDescription(description);
|
|
||||||
network.setId(id);
|
|
||||||
network.setType(type);
|
|
||||||
network.setLinks(links);
|
|
||||||
network.setTasksInProgress(tasksInProgress);
|
|
||||||
return network;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see NetworkType#getConfiguration()
|
* @see NetworkType#getConfiguration()
|
||||||
*/
|
*/
|
||||||
|
@ -143,7 +133,7 @@ public class OrgNetwork extends NetworkType<OrgNetwork> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ReferenceType#getLinks()
|
* @see EntityType#getLinks()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder links(Set<Link> links) {
|
public Builder links(Set<Link> links) {
|
||||||
|
@ -152,7 +142,7 @@ public class OrgNetwork extends NetworkType<OrgNetwork> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ReferenceType#getLinks()
|
* @see EntityType#getLinks()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder link(Link link) {
|
public Builder link(Link link) {
|
||||||
|
@ -173,16 +163,19 @@ public class OrgNetwork extends NetworkType<OrgNetwork> {
|
||||||
}
|
}
|
||||||
|
|
||||||
private OrgNetwork() {
|
private OrgNetwork() {
|
||||||
// For JAXB and builder use
|
// For JAXB
|
||||||
}
|
|
||||||
|
|
||||||
private OrgNetwork(URI href, String name) {
|
|
||||||
super(href, name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@XmlElement(namespace = VCLOUD_1_5_NS, name = "NetworkPool")
|
private OrgNetwork(URI href, String type, Set<Link> links, String description, TasksInProgress tasksInProgress,
|
||||||
|
String id, String name, NetworkConfiguration networkConfiguration, ReferenceType<?> networkPool, IpAddresses allowedExternalIpAddresses) {
|
||||||
|
super(href, type, links, description, tasksInProgress, id, name, networkConfiguration);
|
||||||
|
this.networkPool = networkPool;
|
||||||
|
this.allowedExternalIpAddresses = allowedExternalIpAddresses;
|
||||||
|
}
|
||||||
|
|
||||||
|
@XmlElement(name = "NetworkPool")
|
||||||
private ReferenceType<?> networkPool;
|
private ReferenceType<?> networkPool;
|
||||||
@XmlElement(namespace = VCLOUD_1_5_NS, name = "AllowedExternalIpAddresses")
|
@XmlElement(name = "AllowedExternalIpAddresses")
|
||||||
private IpAddresses allowedExternalIpAddresses;
|
private IpAddresses allowedExternalIpAddresses;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -191,28 +184,20 @@ public class OrgNetwork extends NetworkType<OrgNetwork> {
|
||||||
public ReferenceType<?> getNetworkPool() {
|
public ReferenceType<?> getNetworkPool() {
|
||||||
return networkPool;
|
return networkPool;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setNetworkPool(ReferenceType<?> networkPool) {
|
|
||||||
this.networkPool = networkPool;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return optional network pool
|
* @return optional network pool
|
||||||
*/
|
*/
|
||||||
public IpAddresses getAllowedExternalIpAddresses() {
|
public IpAddresses getAllowedExternalIpAddresses() {
|
||||||
return allowedExternalIpAddresses;
|
return allowedExternalIpAddresses;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAllowedExternalIpAddresses(IpAddresses allowedExternalIpAddresses) {
|
|
||||||
this.allowedExternalIpAddresses = allowedExternalIpAddresses;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (!super.equals(o))
|
if (!super.equals(o))
|
||||||
return false;
|
return false;
|
||||||
OrgNetwork that = OrgNetwork.class.cast(o);
|
OrgNetwork that = OrgNetwork.class.cast(o);
|
||||||
return super.equals(that) && equal(networkPool, that.networkPool) &&
|
return super.equals(that) && equal(networkPool, that.networkPool) &&
|
||||||
equal(allowedExternalIpAddresses, that.allowedExternalIpAddresses);
|
equal(allowedExternalIpAddresses, that.allowedExternalIpAddresses);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,9 +24,6 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
import javax.xml.bind.annotation.XmlType;
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
@ -36,14 +33,13 @@ import com.google.common.collect.Sets;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Represents the owner of this entity.
|
||||||
* Represents the owner of this entity.
|
* <p/>
|
||||||
*
|
* <p/>
|
||||||
*
|
|
||||||
* <p>Java class for Owner complex type.
|
* <p>Java class for Owner complex type.
|
||||||
*
|
* <p/>
|
||||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
*
|
* <p/>
|
||||||
* <pre>
|
* <pre>
|
||||||
* <complexType name="Owner">
|
* <complexType name="Owner">
|
||||||
* <complexContent>
|
* <complexContent>
|
||||||
|
@ -56,14 +52,11 @@ import com.google.common.collect.Sets;
|
||||||
* </complexContent>
|
* </complexContent>
|
||||||
* </complexType>
|
* </complexType>
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
|
||||||
@XmlRootElement(name = "Owner")
|
@XmlRootElement(name = "Owner")
|
||||||
@XmlType(propOrder = {"user"})
|
@XmlType(propOrder = {"user"})
|
||||||
public class Owner
|
public class Owner
|
||||||
extends ResourceType<Owner>
|
extends ResourceType<Owner>
|
||||||
|
|
||||||
{
|
{
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
|
@ -71,12 +64,13 @@ public class Owner
|
||||||
return new Builder();
|
return new Builder();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Builder toBuilder() {
|
public Builder toBuilder() {
|
||||||
return new Builder().fromOwner(this);
|
return new Builder().fromOwner(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Builder extends ResourceType.Builder<Owner> {
|
public static class Builder extends ResourceType.Builder<Owner> {
|
||||||
|
|
||||||
private Reference user;
|
private Reference user;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -89,14 +83,9 @@ public class Owner
|
||||||
|
|
||||||
|
|
||||||
public Owner build() {
|
public Owner build() {
|
||||||
Owner owner = new Owner(href);
|
return new Owner(href, type, links, user);
|
||||||
owner.setUser(user);
|
|
||||||
owner.setType(type);
|
|
||||||
owner.setLinks(links);
|
|
||||||
return owner;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ResourceType#getHref()
|
* @see ResourceType#getHref()
|
||||||
*/
|
*/
|
||||||
|
@ -136,55 +125,41 @@ public class Owner
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Builder fromResourceType(ResourceType<Owner> in) {
|
public Builder fromResourceType(ResourceType<Owner> in) {
|
||||||
return Builder.class.cast(super.fromResourceType(in));
|
return Builder.class.cast(super.fromResourceType(in));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder fromOwner(Owner in) {
|
public Builder fromOwner(Owner in) {
|
||||||
return fromResourceType(in)
|
return fromResourceType(in)
|
||||||
.user(in.getUser());
|
.user(in.getUser());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Owner() {
|
private Owner() {
|
||||||
// For JAXB and builder use
|
// For JAXB and builder use
|
||||||
}
|
}
|
||||||
|
|
||||||
private Owner(URI href) {
|
public Owner(URI href, String type, Set<Link> links, Reference user) {
|
||||||
super(href);
|
super(href, type, links);
|
||||||
|
this.user = user;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@XmlElement(name = "User", required = true)
|
||||||
|
protected Reference user;
|
||||||
|
|
||||||
|
/**
|
||||||
@XmlElement(name = "User", required = true)
|
* Gets the value of the user property.
|
||||||
protected Reference user;
|
*
|
||||||
|
* @return possible object is
|
||||||
/**
|
* {@link Reference }
|
||||||
* Gets the value of the user property.
|
*/
|
||||||
*
|
public Reference getUser() {
|
||||||
* @return
|
return user;
|
||||||
* possible object is
|
}
|
||||||
* {@link Reference }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public Reference getUser() {
|
|
||||||
return user;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the user property.
|
|
||||||
*
|
|
||||||
* @param value
|
|
||||||
* allowed object is
|
|
||||||
* {@link Reference }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setUser(Reference value) {
|
|
||||||
this.user = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
return true;
|
return true;
|
||||||
if (o == null || getClass() != o.getClass())
|
if (o == null || getClass() != o.getClass())
|
||||||
return false;
|
return false;
|
||||||
Owner that = Owner.class.cast(o);
|
Owner that = Owner.class.cast(o);
|
||||||
|
|
|
@ -21,8 +21,6 @@ package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlSeeAlso;
|
import javax.xml.bind.annotation.XmlSeeAlso;
|
||||||
|
@ -32,14 +30,13 @@ import com.google.common.base.Objects;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* A basic type used to specify parameters for operations.
|
||||||
* A basic type used to specify parameters for operations.
|
* <p/>
|
||||||
*
|
* <p/>
|
||||||
*
|
|
||||||
* <p>Java class for Params complex type.
|
* <p>Java class for Params complex type.
|
||||||
*
|
* <p/>
|
||||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
*
|
* <p/>
|
||||||
* <pre>
|
* <pre>
|
||||||
* <complexType name="Params">
|
* <complexType name="Params">
|
||||||
* <complexContent>
|
* <complexContent>
|
||||||
|
@ -53,19 +50,16 @@ import com.google.common.base.Objects;
|
||||||
* </complexContent>
|
* </complexContent>
|
||||||
* </complexType>
|
* </complexType>
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
|
||||||
@XmlType(name = "Params", propOrder = {
|
@XmlType(name = "Params", propOrder = {
|
||||||
"description"
|
"description"
|
||||||
})
|
})
|
||||||
@XmlSeeAlso({
|
@XmlSeeAlso({
|
||||||
// CaptureVAppParams.class,
|
CaptureVAppParams.class,
|
||||||
// CloneVAppTemplateParams.class,
|
CloneVAppTemplateParams.class,
|
||||||
// CloneMediaParams.class,
|
CloneMediaParams.class,
|
||||||
// UploadVAppTemplateParams.class,
|
UploadVAppTemplateParams.class
|
||||||
// ImportVmAsVAppTemplateParams.class,
|
//, ImportVmAsVAppTemplateParams.class,
|
||||||
// ImportMediaParams.class,
|
// ImportMediaParams.class,
|
||||||
// UpdateResourcePoolSetParams.class,
|
// UpdateResourcePoolSetParams.class,
|
||||||
// VAppCreationParams.class
|
// VAppCreationParams.class
|
||||||
|
@ -79,8 +73,8 @@ public class ParamsType<T extends ParamsType<T>> {
|
||||||
return new Builder<T>().fromParamsType(this);
|
return new Builder<T>().fromParamsType(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Builder<T extends ParamsType<T>>{
|
public static class Builder<T extends ParamsType<T>> {
|
||||||
|
|
||||||
protected String description;
|
protected String description;
|
||||||
protected String name;
|
protected String name;
|
||||||
|
|
||||||
|
@ -102,93 +96,65 @@ public class ParamsType<T extends ParamsType<T>> {
|
||||||
|
|
||||||
|
|
||||||
public ParamsType<T> build() {
|
public ParamsType<T> build() {
|
||||||
ParamsType<T> params = new ParamsType<T>();
|
return new ParamsType<T>(description, name);
|
||||||
params.setDescription(description);
|
|
||||||
params.setName(name);
|
|
||||||
return params;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Builder<T> fromParamsType(ParamsType<T> in) {
|
public Builder<T> fromParamsType(ParamsType<T> in) {
|
||||||
return description(in.getDescription())
|
return description(in.getDescription())
|
||||||
.name(in.getName());
|
.name(in.getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected ParamsType(String description, String name) {
|
||||||
|
this.description = description;
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
protected ParamsType() {
|
protected ParamsType() {
|
||||||
// For JAXB and builder use
|
// For JAXB and builder use
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@XmlElement(name = "Description")
|
||||||
|
protected String description;
|
||||||
|
@XmlAttribute
|
||||||
|
protected String name;
|
||||||
|
|
||||||
@XmlElement(name = "Description")
|
/**
|
||||||
protected String description;
|
* Gets the value of the description property.
|
||||||
@XmlAttribute
|
*
|
||||||
protected String name;
|
* @return possible object is
|
||||||
|
* {@link String }
|
||||||
|
*/
|
||||||
|
public String getDescription() {
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the description property.
|
* Gets the value of the name property.
|
||||||
*
|
*
|
||||||
* @return
|
* @return possible object is
|
||||||
* possible object is
|
* {@link String }
|
||||||
* {@link String }
|
*/
|
||||||
*
|
public String getName() {
|
||||||
*/
|
return name;
|
||||||
public String getDescription() {
|
}
|
||||||
return description;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the description property.
|
|
||||||
*
|
|
||||||
* @param value
|
|
||||||
* allowed object is
|
|
||||||
* {@link String }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setDescription(String value) {
|
|
||||||
this.description = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the value of the name property.
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
* possible object is
|
|
||||||
* {@link String }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the name property.
|
|
||||||
*
|
|
||||||
* @param value
|
|
||||||
* allowed object is
|
|
||||||
* {@link String }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setName(String value) {
|
|
||||||
this.name = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
return true;
|
return true;
|
||||||
if (o == null || getClass() != o.getClass())
|
if (o == null || getClass() != o.getClass())
|
||||||
return false;
|
return false;
|
||||||
ParamsType<?> that = ParamsType.class.cast(o);
|
ParamsType<?> that = ParamsType.class.cast(o);
|
||||||
return equal(description, that.description) &&
|
return equal(description, that.description) &&
|
||||||
equal(name, that.name);
|
equal(name, that.name);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hashCode(description,
|
return Objects.hashCode(description,
|
||||||
name);
|
name);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -23,29 +23,24 @@ import static com.google.common.base.Objects.equal;
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlType;
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.ovf.ProductSection;
|
import org.jclouds.vcloud.director.v1_5.domain.ovf.ProductSection;
|
||||||
|
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
|
import com.google.common.collect.ImmutableSet;
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* Essentially a container with a list of product sections.
|
* Essentially a container with a list of product sections.
|
||||||
*
|
* <p/>
|
||||||
* <p>Java class for ProductSectionList complex type.
|
* <p>Java class for ProductSectionList complex type.
|
||||||
*
|
* <p/>
|
||||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
*
|
* <p/>
|
||||||
* <pre>
|
* <pre>
|
||||||
* <complexType name="ProductSectionList">
|
* <complexType name="ProductSectionList">
|
||||||
* <complexContent>
|
* <complexContent>
|
||||||
|
@ -58,15 +53,12 @@ import com.google.common.collect.Sets;
|
||||||
* </complexContent>
|
* </complexContent>
|
||||||
* </complexType>
|
* </complexType>
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
|
||||||
@XmlType(name = "ProductSectionList", propOrder = {
|
@XmlType(name = "ProductSectionList", propOrder = {
|
||||||
"productSection"
|
"productSection"
|
||||||
})
|
})
|
||||||
public class ProductSectionList
|
public class ProductSectionList
|
||||||
extends ResourceType<ProductSectionList>
|
extends ResourceType<ProductSectionList>
|
||||||
|
|
||||||
{
|
{
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
|
@ -74,29 +66,30 @@ public class ProductSectionList
|
||||||
return new Builder();
|
return new Builder();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Builder toBuilder() {
|
public Builder toBuilder() {
|
||||||
return new Builder().fromProductSectionList(this);
|
return new Builder().fromProductSectionList(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Builder extends ResourceType.Builder<ProductSectionList> {
|
public static class Builder extends ResourceType.Builder<ProductSectionList> {
|
||||||
|
|
||||||
private List<ProductSection> productSection;
|
private Set<ProductSection> productSections = Sets.newLinkedHashSet();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ProductSectionList#getProductSection()
|
* @see ProductSectionList#getProductSection()
|
||||||
*/
|
*/
|
||||||
public Builder productSection(List<ProductSection> productSection) {
|
public Builder productSection(Set<ProductSection> productSections) {
|
||||||
this.productSection = productSection;
|
this.productSections = checkNotNull(productSections, "productSection");
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public ProductSectionList build() {
|
public ProductSectionList build() {
|
||||||
ProductSectionList productSectionList = new ProductSectionList(productSection);
|
ProductSectionList productSectionList = new ProductSectionList(productSections);
|
||||||
return productSectionList;
|
return productSectionList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ResourceType#getHref()
|
* @see ResourceType#getHref()
|
||||||
*/
|
*/
|
||||||
|
@ -136,11 +129,12 @@ public class ProductSectionList
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Builder fromResourceType(ResourceType<ProductSectionList> in) {
|
public Builder fromResourceType(ResourceType<ProductSectionList> in) {
|
||||||
return Builder.class.cast(super.fromResourceType(in));
|
return Builder.class.cast(super.fromResourceType(in));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder fromProductSectionList(ProductSectionList in) {
|
public Builder fromProductSectionList(ProductSectionList in) {
|
||||||
return fromResourceType(in)
|
return fromResourceType(in)
|
||||||
.productSection(in.getProductSection());
|
.productSection(in.getProductSection());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -148,45 +142,25 @@ public class ProductSectionList
|
||||||
// For JAXB and builder use
|
// For JAXB and builder use
|
||||||
}
|
}
|
||||||
|
|
||||||
private ProductSectionList(List<ProductSection> productSection) {
|
private ProductSectionList(Set<ProductSection> productSection) {
|
||||||
this.productSection = productSection;
|
this.productSection = ImmutableSet.copyOf(productSection);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@XmlElement(name = "ProductSection", namespace = "http://schemas.dmtf.org/ovf/envelope/1")
|
@XmlElement(name = "ProductSection", namespace = "http://schemas.dmtf.org/ovf/envelope/1")
|
||||||
protected List<ProductSection> productSection;
|
protected Set<ProductSection> productSection = Sets.newLinkedHashSet();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the productSection property.
|
* Gets the value of the productSection property.
|
||||||
*
|
*/
|
||||||
* <p>
|
public Set<ProductSection> getProductSection() {
|
||||||
* This accessor method returns a reference to the live list,
|
return this.productSection;
|
||||||
* 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 <CODE>set</CODE> method for the productSection property.
|
|
||||||
*
|
|
||||||
* <p>
|
|
||||||
* For example, to add a new item, do as follows:
|
|
||||||
* <pre>
|
|
||||||
* getProductSection().add(newItem);
|
|
||||||
* </pre>
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* <p>
|
|
||||||
* Objects of the following type(s) are allowed in the list
|
|
||||||
* {@link ProductSection }
|
|
||||||
*/
|
|
||||||
public List<ProductSection> getProductSection() {
|
|
||||||
if (productSection == null) {
|
|
||||||
productSection = new ArrayList<ProductSection>();
|
|
||||||
}
|
|
||||||
return this.productSection;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
return true;
|
return true;
|
||||||
if (o == null || getClass() != o.getClass())
|
if (o == null || getClass() != o.getClass())
|
||||||
return false;
|
return false;
|
||||||
ProductSectionList that = ProductSectionList.class.cast(o);
|
ProductSectionList that = ProductSectionList.class.cast(o);
|
||||||
|
|
|
@ -18,10 +18,6 @@
|
||||||
*/
|
*/
|
||||||
package org.jclouds.vcloud.director.v1_5.domain;
|
package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_1_5_NS;
|
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
import javax.xml.bind.annotation.XmlValue;
|
import javax.xml.bind.annotation.XmlValue;
|
||||||
|
@ -30,15 +26,14 @@ import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Contains key/value pair as property.
|
* Contains key/value pair as property.
|
||||||
*
|
* <p/>
|
||||||
* <pre>
|
* <pre>
|
||||||
* <complexType name="PropertyType" />
|
* <complexType name="PropertyType" />
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author grkvlt@apache.org
|
* @author grkvlt@apache.org
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
@XmlRootElement(name = "Property")
|
||||||
@XmlRootElement(namespace = VCLOUD_1_5_NS, name = "Property")
|
|
||||||
public class Property {
|
public class Property {
|
||||||
|
|
||||||
public static final String MEDIA_TYPE = VCloudDirectorMediaType.PROPERTY;
|
public static final String MEDIA_TYPE = VCloudDirectorMediaType.PROPERTY;
|
||||||
|
@ -83,9 +78,7 @@ public class Property {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Property build() {
|
public Property build() {
|
||||||
Property property = new Property(key);
|
return new Property(key, value);
|
||||||
property.setValue(value);
|
|
||||||
return property;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder fromProperty(Property in) {
|
public Builder fromProperty(Property in) {
|
||||||
|
@ -94,10 +87,11 @@ public class Property {
|
||||||
}
|
}
|
||||||
|
|
||||||
private Property() {
|
private Property() {
|
||||||
// For JAXB and builder use
|
// For JAXB
|
||||||
}
|
}
|
||||||
|
|
||||||
private Property(String key) {
|
private Property(String key, String value) {
|
||||||
|
this.value = value;
|
||||||
this.key = key;
|
this.key = key;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,10 +107,6 @@ public class Property {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setValue(String value) {
|
|
||||||
this.value = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the key property.
|
* Gets the value of the key property.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -22,7 +22,7 @@ import java.net.URI;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A reference to a resource.
|
* A reference to a resource.
|
||||||
*
|
*
|
||||||
* @author grkvlt@apache.org
|
* @author grkvlt@apache.org
|
||||||
*/
|
*/
|
||||||
public class Reference extends ReferenceType<Reference> {
|
public class Reference extends ReferenceType<Reference> {
|
||||||
|
@ -41,11 +41,7 @@ public class Reference extends ReferenceType<Reference> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Reference build() {
|
public Reference build() {
|
||||||
Reference reference = new Reference(href);
|
return new Reference(href, id, name, type);
|
||||||
reference.setId(id);
|
|
||||||
reference.setName(name);
|
|
||||||
reference.setType(type);
|
|
||||||
return reference;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -94,8 +90,8 @@ public class Reference extends ReferenceType<Reference> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Reference(URI href) {
|
public Reference(URI href, String id, String name, String type) {
|
||||||
super(href);
|
super(href, id, name, type);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Reference() {
|
protected Reference() {
|
||||||
|
|
|
@ -22,9 +22,6 @@ import static com.google.common.base.Objects.equal;
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
|
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
|
@ -32,16 +29,15 @@ import com.google.common.base.Objects.ToStringHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A reference to a resource.
|
* A reference to a resource.
|
||||||
*
|
* <p/>
|
||||||
* Contains an href attribute and optional name and type attributes.
|
* Contains an href attribute and optional name and type attributes.
|
||||||
*
|
* <p/>
|
||||||
* <pre>
|
* <pre>
|
||||||
* <xs:complexType name="ReferenceType">
|
* <xs:complexType name="ReferenceType">
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author grkvlt@apache.org
|
* @author grkvlt@apache.org
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
|
||||||
public class ReferenceType<T extends ReferenceType<T>> implements URISupplier {
|
public class ReferenceType<T extends ReferenceType<T>> implements URISupplier {
|
||||||
|
|
||||||
public static <T extends ReferenceType<T>> Builder<T> builder() {
|
public static <T extends ReferenceType<T>> Builder<T> builder() {
|
||||||
|
@ -92,11 +88,7 @@ public class ReferenceType<T extends ReferenceType<T>> implements URISupplier {
|
||||||
}
|
}
|
||||||
|
|
||||||
public ReferenceType<T> build() {
|
public ReferenceType<T> build() {
|
||||||
ReferenceType<T> reference = new ReferenceType<T>(href);
|
return new ReferenceType<T>(href, id, name, type);
|
||||||
reference.setId(id);
|
|
||||||
reference.setName(name);
|
|
||||||
reference.setType(type);
|
|
||||||
return reference;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Builder<T> fromReferenceType(ReferenceType<T> in) {
|
protected Builder<T> fromReferenceType(ReferenceType<T> in) {
|
||||||
|
@ -117,8 +109,11 @@ public class ReferenceType<T extends ReferenceType<T>> implements URISupplier {
|
||||||
@XmlAttribute
|
@XmlAttribute
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
protected ReferenceType(URI href) {
|
protected ReferenceType(URI href, String id, String name, String type) {
|
||||||
this.href = href;
|
this.href = href;
|
||||||
|
this.id = id;
|
||||||
|
this.name = name;
|
||||||
|
this.type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected ReferenceType() {
|
protected ReferenceType() {
|
||||||
|
@ -127,7 +122,7 @@ public class ReferenceType<T extends ReferenceType<T>> implements URISupplier {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Contains the URI to the entity.
|
* Contains the URI to the entity.
|
||||||
*
|
* <p/>
|
||||||
* An object reference, expressed in URL format. Because this URL includes the object identifier
|
* An object reference, expressed in URL format. Because this URL includes the object identifier
|
||||||
* portion of the id attribute value, it uniquely identifies the object, persists for the life of
|
* portion of the id attribute value, it uniquely identifies the object, persists for the life of
|
||||||
* the object, and is never reused. The value of the href attribute is a reference to a view of
|
* the object, and is never reused. The value of the href attribute is a reference to a view of
|
||||||
|
@ -135,7 +130,7 @@ public class ReferenceType<T extends ReferenceType<T>> implements URISupplier {
|
||||||
* particular context. Although URLs have a well-known syntax and a well-understood
|
* particular context. Although URLs have a well-known syntax and a well-understood
|
||||||
* interpretation, a client should treat each href as an opaque string. The rules that govern how
|
* interpretation, a client should treat each href as an opaque string. The rules that govern how
|
||||||
* the server constructs href strings might change in future releases.
|
* the server constructs href strings might change in future releases.
|
||||||
*
|
*
|
||||||
* @return an opaque reference and should never be parsed
|
* @return an opaque reference and should never be parsed
|
||||||
*/
|
*/
|
||||||
public URI getHref() {
|
public URI getHref() {
|
||||||
|
@ -144,7 +139,7 @@ public class ReferenceType<T extends ReferenceType<T>> implements URISupplier {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The resource identifier, expressed in URN format.
|
* The resource identifier, expressed in URN format.
|
||||||
*
|
* <p/>
|
||||||
* The value of this attribute uniquely identifies the resource, persists for the life of the
|
* The value of this attribute uniquely identifies the resource, persists for the life of the
|
||||||
* resource, and is never reused.
|
* resource, and is never reused.
|
||||||
*/
|
*/
|
||||||
|
@ -152,42 +147,30 @@ public class ReferenceType<T extends ReferenceType<T>> implements URISupplier {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setId(String id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Contains the name of the the entity.
|
* Contains the name of the the entity.
|
||||||
*
|
* <p/>
|
||||||
* The object type, specified as a MIME content type, of the object that the link references.
|
* The object type, specified as a MIME content type, of the object that the link references.
|
||||||
* This attribute is present only for links to objects. It is not present for links to actions.
|
* This attribute is present only for links to objects. It is not present for links to actions.
|
||||||
*
|
*
|
||||||
* @return type definition, type, expressed as an HTTP Content-Type
|
* @return type definition, type, expressed as an HTTP Content-Type
|
||||||
*/
|
*/
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setName(String name) {
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Contains the type of the the entity.
|
* Contains the type of the the entity.
|
||||||
*
|
* <p/>
|
||||||
* The object type, specified as a MIME content type, of the object that the link references.
|
* The object type, specified as a MIME content type, of the object that the link references.
|
||||||
* This attribute is present only for links to objects. It is not present for links to actions.
|
* This attribute is present only for links to objects. It is not present for links to actions.
|
||||||
*
|
*
|
||||||
* @return type definition, type, expressed as an HTTP Content-Type
|
* @return type definition, type, expressed as an HTTP Content-Type
|
||||||
*/
|
*/
|
||||||
public String getType() {
|
public String getType() {
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setType(String type) {
|
|
||||||
this.type = type;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see URISupplier#getURI()
|
* @see URISupplier#getURI()
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -19,21 +19,18 @@
|
||||||
|
|
||||||
package org.jclouds.vcloud.director.v1_5.domain;
|
package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlType;
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Parameters to be used for vm relocation.
|
||||||
* Parameters to be used for vm relocation.
|
* <p/>
|
||||||
*
|
* <p/>
|
||||||
*
|
|
||||||
* <p>Java class for RelocateParams complex type.
|
* <p>Java class for RelocateParams complex type.
|
||||||
*
|
* <p/>
|
||||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
*
|
* <p/>
|
||||||
* <pre>
|
* <pre>
|
||||||
* <complexType name="RelocateParams">
|
* <complexType name="RelocateParams">
|
||||||
* <complexContent>
|
* <complexContent>
|
||||||
|
@ -45,40 +42,22 @@ import javax.xml.bind.annotation.XmlType;
|
||||||
* </complexContent>
|
* </complexContent>
|
||||||
* </complexType>
|
* </complexType>
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
|
||||||
@XmlType(name = "RelocateParams", propOrder = {
|
@XmlType(name = "RelocateParams", propOrder = {
|
||||||
"datastore"
|
"datastore"
|
||||||
})
|
})
|
||||||
public class RelocateParams {
|
public class RelocateParams {
|
||||||
|
|
||||||
@XmlElement(name = "Datastore", required = true)
|
@XmlElement(name = "Datastore", required = true)
|
||||||
protected ReferenceType<?> datastore;
|
protected ReferenceType<?> datastore;
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the value of the datastore property.
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
* possible object is
|
|
||||||
* {@link ReferenceType }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public ReferenceType<?> getDatastore() {
|
|
||||||
return datastore;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the datastore property.
|
|
||||||
*
|
|
||||||
* @param value
|
|
||||||
* allowed object is
|
|
||||||
* {@link ReferenceType }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setDatastore(ReferenceType<?> value) {
|
|
||||||
this.datastore = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the datastore property.
|
||||||
|
*
|
||||||
|
* @return possible object is
|
||||||
|
* {@link ReferenceType }
|
||||||
|
*/
|
||||||
|
public ReferenceType<?> getDatastore() {
|
||||||
|
return datastore;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,12 +27,11 @@ import com.google.common.collect.Sets;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A resource.
|
* A resource.
|
||||||
*
|
*
|
||||||
* @author grkvlt@apache.org
|
* @author grkvlt@apache.org
|
||||||
*/
|
*/
|
||||||
public class Resource extends ResourceType<Resource> {
|
public class Resource extends ResourceType<Resource> {
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public static Builder builder() {
|
public static Builder builder() {
|
||||||
return new Builder();
|
return new Builder();
|
||||||
}
|
}
|
||||||
|
@ -46,10 +45,7 @@ public class Resource extends ResourceType<Resource> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Resource build() {
|
public Resource build() {
|
||||||
Resource reference = new Resource(href);
|
return new Resource(href, type, links);
|
||||||
reference.setType(type);
|
|
||||||
reference.setLinks(links);
|
|
||||||
return reference;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -98,11 +94,11 @@ public class Resource extends ResourceType<Resource> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Resource(URI href) {
|
private Resource(URI href, String type, Set<Link> links) {
|
||||||
super(href);
|
super(href, type, links);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Resource() {
|
private Resource() {
|
||||||
// For JAXB
|
// For JAXB
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,26 +22,23 @@ package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlType;
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.ImmutableSet;
|
||||||
|
import com.google.common.collect.Sets;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Represents a list of references to resource entities.
|
||||||
* Represents a list of references to resource entities.
|
* <p/>
|
||||||
*
|
* <p/>
|
||||||
*
|
|
||||||
* <p>Java class for ResourceEntities complex type.
|
* <p>Java class for ResourceEntities complex type.
|
||||||
*
|
* <p/>
|
||||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
*
|
* <p/>
|
||||||
* <pre>
|
* <pre>
|
||||||
* <complexType name="ResourceEntities">
|
* <complexType name="ResourceEntities">
|
||||||
* <complexContent>
|
* <complexContent>
|
||||||
|
@ -54,12 +51,9 @@ import com.google.common.collect.Lists;
|
||||||
* </complexContent>
|
* </complexContent>
|
||||||
* </complexType>
|
* </complexType>
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
|
||||||
@XmlType(name = "ResourceEntities", propOrder = {
|
@XmlType(name = "ResourceEntities", propOrder = {
|
||||||
"resourceEntities"
|
"resourceEntities"
|
||||||
})
|
})
|
||||||
public class ResourceEntities {
|
public class ResourceEntities {
|
||||||
public static Builder builder() {
|
public static Builder builder() {
|
||||||
|
@ -71,14 +65,14 @@ public class ResourceEntities {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Builder {
|
public static class Builder {
|
||||||
|
|
||||||
private List<Reference> resourceEntities = Lists.newArrayList();
|
private Set<Reference> resourceEntities = Sets.newLinkedHashSet();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ResourceEntities#getResourceEntities()
|
* @see ResourceEntities#getResourceEntities()
|
||||||
*/
|
*/
|
||||||
public Builder resourceEntities(List<Reference> resourceEntities) {
|
public Builder resourceEntities(Set<Reference> resourceEntities) {
|
||||||
this.resourceEntities = Lists.newArrayList(checkNotNull(resourceEntities, "resourceEntities"));
|
this.resourceEntities = checkNotNull(resourceEntities, "resourceEntities");
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -91,8 +85,7 @@ public class ResourceEntities {
|
||||||
}
|
}
|
||||||
|
|
||||||
public ResourceEntities build() {
|
public ResourceEntities build() {
|
||||||
ResourceEntities resourceEntities = new ResourceEntities(this.resourceEntities);
|
return new ResourceEntities(this.resourceEntities);
|
||||||
return resourceEntities;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -105,47 +98,25 @@ public class ResourceEntities {
|
||||||
// For JAXB and builder use
|
// For JAXB and builder use
|
||||||
}
|
}
|
||||||
|
|
||||||
private ResourceEntities(List<Reference> resourceEntity) {
|
private ResourceEntities(Set<Reference> resourceEntity) {
|
||||||
this.resourceEntities = resourceEntity;
|
this.resourceEntities = ImmutableSet.copyOf(resourceEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@XmlElement(name = "ResourceEntity")
|
@XmlElement(name = "ResourceEntity")
|
||||||
protected List<Reference> resourceEntities;
|
private Set<Reference> resourceEntities = Sets.newLinkedHashSet();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the resourceEntity property.
|
* Gets the value of the resourceEntity property.
|
||||||
*
|
*/
|
||||||
* <p>
|
public Set<Reference> getResourceEntities() {
|
||||||
* This accessor method returns a reference to the live list,
|
return this.resourceEntities;
|
||||||
* 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 <CODE>set</CODE> method for the resourceEntity property.
|
|
||||||
*
|
|
||||||
* <p>
|
|
||||||
* For example, to add a new item, do as follows:
|
|
||||||
* <pre>
|
|
||||||
* getResourceEntity().add(newItem);
|
|
||||||
* </pre>
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* <p>
|
|
||||||
* Objects of the following type(s) are allowed in the list
|
|
||||||
* {@link ReferenceType }
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public List<Reference> getResourceEntities() {
|
|
||||||
if (resourceEntities == null) {
|
|
||||||
resourceEntities = Lists.newArrayList();
|
|
||||||
}
|
|
||||||
return this.resourceEntities;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
return true;
|
return true;
|
||||||
if (o == null || getClass() != o.getClass())
|
if (o == null || getClass() != o.getClass())
|
||||||
return false;
|
return false;
|
||||||
ResourceEntities that = ResourceEntities.class.cast(o);
|
ResourceEntities that = ResourceEntities.class.cast(o);
|
||||||
|
|
|
@ -24,7 +24,6 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
|
|
||||||
|
@ -34,26 +33,17 @@ import com.google.common.collect.Sets;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base type that represents a resource entity such as a vApp template or virtual media.
|
* Base type that represents a resource entity such as a vApp template or virtual media.
|
||||||
*
|
* <p/>
|
||||||
* <pre>
|
* <pre>
|
||||||
* <complexType name="ResourceEntity" >
|
* <complexType name="ResourceEntity" >
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author danikov
|
* @author danikov
|
||||||
|
* @author Adam Lowe
|
||||||
*/
|
*/
|
||||||
public class ResourceEntityType<T extends ResourceEntityType<T>> extends EntityType<T> {
|
public abstract class ResourceEntityType<T extends ResourceEntityType<T>> extends EntityType<T> {
|
||||||
|
|
||||||
public static <T extends ResourceEntityType<T>> Builder<T> builder() {
|
|
||||||
return new Builder<T>();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Builder<T> toBuilder() {
|
|
||||||
return new Builder<T>().fromResourceEntityType(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class Builder<T extends ResourceEntityType<T>> extends EntityType.Builder<T> {
|
|
||||||
|
|
||||||
|
public static abstract class Builder<T extends ResourceEntityType<T>> extends EntityType.Builder<T> {
|
||||||
protected FilesList files;
|
protected FilesList files;
|
||||||
protected Integer status;
|
protected Integer status;
|
||||||
|
|
||||||
|
@ -73,19 +63,6 @@ public class ResourceEntityType<T extends ResourceEntityType<T>> extends EntityT
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public ResourceEntityType<T> build() {
|
|
||||||
ResourceEntityType<T> resourceEntity = new ResourceEntityType<T>(href, name);
|
|
||||||
resourceEntity.setFiles(files);
|
|
||||||
resourceEntity.setStatus(status);
|
|
||||||
resourceEntity.setDescription(description);
|
|
||||||
resourceEntity.setTasksInProgress(tasksInProgress);
|
|
||||||
resourceEntity.setId(id);
|
|
||||||
resourceEntity.setType(type);
|
|
||||||
resourceEntity.setLinks(links);
|
|
||||||
return resourceEntity;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see EntityType#getId()
|
* @see EntityType#getId()
|
||||||
*/
|
*/
|
||||||
|
@ -123,7 +100,7 @@ public class ResourceEntityType<T extends ResourceEntityType<T>> extends EntityT
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ReferenceType#getLinks()
|
* @see EntityType#getLinks()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder<T> links(Set<Link> links) {
|
public Builder<T> links(Set<Link> links) {
|
||||||
|
@ -132,7 +109,7 @@ public class ResourceEntityType<T extends ResourceEntityType<T>> extends EntityT
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ReferenceType#getLinks()
|
* @see EntityType#getLinks()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder<T> link(Link link) {
|
public Builder<T> link(Link link) {
|
||||||
|
@ -151,19 +128,22 @@ public class ResourceEntityType<T extends ResourceEntityType<T>> extends EntityT
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected ResourceEntityType() {
|
|
||||||
// for JAXB
|
|
||||||
}
|
|
||||||
|
|
||||||
protected ResourceEntityType(URI href, String name) {
|
|
||||||
super(href, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
@XmlElement(name = "Files")
|
@XmlElement(name = "Files")
|
||||||
protected FilesList files;
|
protected FilesList files;
|
||||||
@XmlAttribute
|
@XmlAttribute
|
||||||
protected Integer status;
|
protected Integer status;
|
||||||
|
|
||||||
|
public ResourceEntityType(URI href, String type, Set<Link> links, String description, TasksInProgress tasksInProgress, String id, String name, FilesList files, Integer status) {
|
||||||
|
super(href, type, links, description, tasksInProgress, id, name);
|
||||||
|
this.files = files;
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected ResourceEntityType() {
|
||||||
|
// for JAXB
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the files property.
|
* Gets the value of the files property.
|
||||||
*/
|
*/
|
||||||
|
@ -171,10 +151,6 @@ public class ResourceEntityType<T extends ResourceEntityType<T>> extends EntityT
|
||||||
return files;
|
return files;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFiles(FilesList value) {
|
|
||||||
this.files = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the status property.
|
* Gets the value of the status property.
|
||||||
*/
|
*/
|
||||||
|
@ -182,10 +158,6 @@ public class ResourceEntityType<T extends ResourceEntityType<T>> extends EntityT
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setStatus(Integer value) {
|
|
||||||
this.status = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
|
|
|
@ -20,13 +20,9 @@ package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
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.net.URI;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
|
|
||||||
|
@ -36,27 +32,20 @@ import com.google.common.collect.Sets;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The base type for all objects in the vCloud model.
|
* The base type for all objects in the vCloud model.
|
||||||
*
|
* <p/>
|
||||||
* Has an optional list of links and href and type attributes.
|
* Has an optional list of links and href and type attributes.
|
||||||
*
|
* <p/>
|
||||||
* <pre>
|
* <pre>
|
||||||
* <xs:complexType name="ResourceType">
|
* <xs:complexType name="ResourceType">
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author Adrian Cole
|
* @author Adrian Cole
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
public abstract class ResourceType<T extends ResourceType<T>> implements URISupplier {
|
||||||
public class ResourceType<T extends ResourceType<T>> implements URISupplier {
|
|
||||||
|
|
||||||
public static <T extends ResourceType<T>> Builder<T> builder() {
|
public abstract Builder<T> toBuilder();
|
||||||
return new Builder<T>();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Builder<T> toBuilder() {
|
public static abstract class Builder<T extends ResourceType<T>> {
|
||||||
return new Builder<T>().fromResourceType(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class Builder<T extends ResourceType<T>> {
|
|
||||||
|
|
||||||
protected URI href;
|
protected URI href;
|
||||||
protected String type;
|
protected String type;
|
||||||
|
@ -94,12 +83,7 @@ public class ResourceType<T extends ResourceType<T>> implements URISupplier {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ResourceType<T> build() {
|
public abstract ResourceType<T> build();
|
||||||
ResourceType<T> reference = new ResourceType<T>(href);
|
|
||||||
reference.setType(type);
|
|
||||||
reference.setLinks(links);
|
|
||||||
return reference;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected Builder<T> fromResourceType(ResourceType<T> in) {
|
protected Builder<T> fromResourceType(ResourceType<T> in) {
|
||||||
return href(in.getHref()).type(in.getType()).links(in.getLinks());
|
return href(in.getHref()).type(in.getType()).links(in.getLinks());
|
||||||
|
@ -110,11 +94,13 @@ public class ResourceType<T extends ResourceType<T>> implements URISupplier {
|
||||||
private URI href;
|
private URI href;
|
||||||
@XmlAttribute
|
@XmlAttribute
|
||||||
private String type;
|
private String type;
|
||||||
@XmlElement(namespace = VCLOUD_1_5_NS, name = "Link")
|
@XmlElement(name = "Link")
|
||||||
private Set<Link> links = Sets.newLinkedHashSet();
|
private Set<Link> links = Sets.newLinkedHashSet();
|
||||||
|
|
||||||
protected ResourceType(URI href) {
|
protected ResourceType(URI href, String type, Set<Link> links) {
|
||||||
this.href = href;
|
this.href = href;
|
||||||
|
this.type = type;
|
||||||
|
this.links = links;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected ResourceType() {
|
protected ResourceType() {
|
||||||
|
@ -123,7 +109,7 @@ public class ResourceType<T extends ResourceType<T>> implements URISupplier {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Contains the URI to the entity.
|
* Contains the URI to the entity.
|
||||||
*
|
* <p/>
|
||||||
* An object reference, expressed in URL format. Because this URL includes the object identifier
|
* An object reference, expressed in URL format. Because this URL includes the object identifier
|
||||||
* portion of the id attribute value, it uniquely identifies the object, persists for the life of
|
* portion of the id attribute value, it uniquely identifies the object, persists for the life of
|
||||||
* the object, and is never reused. The value of the href attribute is a reference to a view of
|
* the object, and is never reused. The value of the href attribute is a reference to a view of
|
||||||
|
@ -131,7 +117,7 @@ public class ResourceType<T extends ResourceType<T>> implements URISupplier {
|
||||||
* particular context. Although URLs have a well-known syntax and a well-understood
|
* particular context. Although URLs have a well-known syntax and a well-understood
|
||||||
* interpretation, a client should treat each href as an opaque string. The rules that govern how
|
* interpretation, a client should treat each href as an opaque string. The rules that govern how
|
||||||
* the server constructs href strings might change in future releases.
|
* the server constructs href strings might change in future releases.
|
||||||
*
|
*
|
||||||
* @return an opaque reference and should never be parsed
|
* @return an opaque reference and should never be parsed
|
||||||
*/
|
*/
|
||||||
public URI getHref() {
|
public URI getHref() {
|
||||||
|
@ -148,20 +134,16 @@ public class ResourceType<T extends ResourceType<T>> implements URISupplier {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Contains the type of the the entity.
|
* Contains the type of the the entity.
|
||||||
*
|
* <p/>
|
||||||
* The object type, specified as a MIME content type, of the object that the link references.
|
* The object type, specified as a MIME content type, of the object that the link references.
|
||||||
* This attribute is present only for links to objects. It is not present for links to actions.
|
* This attribute is present only for links to objects. It is not present for links to actions.
|
||||||
*
|
*
|
||||||
* @return type definition, type, expressed as an HTTP Content-Type
|
* @return type definition, type, expressed as an HTTP Content-Type
|
||||||
*/
|
*/
|
||||||
public String getType() {
|
public String getType() {
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setType(String type) {
|
|
||||||
this.type = type;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set of optional links to an entity or operation associated with this object.
|
* Set of optional links to an entity or operation associated with this object.
|
||||||
*/
|
*/
|
||||||
|
@ -169,14 +151,6 @@ public class ResourceType<T extends ResourceType<T>> implements URISupplier {
|
||||||
return links;
|
return links;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLinks(Set<Link> links) {
|
|
||||||
this.links = Sets.newLinkedHashSet(checkNotNull(links, "links"));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addLink(Link link) {
|
|
||||||
this.links.add(checkNotNull(link, "link"));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
package org.jclouds.vcloud.director.v1_5.domain;
|
package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_1_5_NS;
|
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
@ -28,10 +27,10 @@ import com.google.common.base.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specifies router information.
|
* Specifies router information.
|
||||||
*
|
*
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
@XmlRootElement(namespace = VCLOUD_1_5_NS, name = "RouterInfo")
|
@XmlRootElement(name = "RouterInfo")
|
||||||
public class RouterInfo {
|
public class RouterInfo {
|
||||||
public static Builder builder() {
|
public static Builder builder() {
|
||||||
return new Builder();
|
return new Builder();
|
||||||
|
@ -42,7 +41,7 @@ public class RouterInfo {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Builder {
|
public static class Builder {
|
||||||
|
|
||||||
private String externalIp;
|
private String externalIp;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -61,7 +60,7 @@ public class RouterInfo {
|
||||||
return externalIp(in.getExternalIp());
|
return externalIp(in.getExternalIp());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private RouterInfo() {
|
private RouterInfo() {
|
||||||
// For JAXB and builder use
|
// For JAXB and builder use
|
||||||
}
|
}
|
||||||
|
@ -69,18 +68,18 @@ public class RouterInfo {
|
||||||
private RouterInfo(String externalIp) {
|
private RouterInfo(String externalIp) {
|
||||||
this.externalIp = externalIp;
|
this.externalIp = externalIp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@XmlElement(namespace = VCLOUD_1_5_NS, name = "ExternalIp")
|
@XmlElement(name = "ExternalIp")
|
||||||
private String externalIp;
|
private String externalIp;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the external IP of the router. Applicable for NAT Routed / Fenced networks only.
|
* @return the external IP of the router. Applicable for NAT Routed / Fenced networks only.
|
||||||
*/
|
*/
|
||||||
public String getExternalIp() {
|
public String getExternalIp() {
|
||||||
return externalIp;
|
return externalIp;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
|
|
|
@ -20,13 +20,9 @@ package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
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.net.URI;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
@ -41,13 +37,12 @@ import com.google.common.collect.Sets;
|
||||||
* Returns a representation of the current session that can serve as a single entry point to the
|
* Returns a representation of the current session that can serve as a single entry point to the
|
||||||
* system, as it provides user, admin, and extension (sysadmin) entry links depending on the
|
* system, as it provides user, admin, and extension (sysadmin) entry links depending on the
|
||||||
* privileges of the current user.
|
* privileges of the current user.
|
||||||
*
|
*
|
||||||
* @author Adrian Cole
|
* @author Adrian Cole
|
||||||
*/
|
*/
|
||||||
@XmlRootElement(namespace = VCLOUD_1_5_NS, name = "Session")
|
@XmlRootElement(name = "Session")
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
|
||||||
public class Session {
|
public class Session {
|
||||||
|
|
||||||
public static final String MEDIA_TYPE = VCloudDirectorMediaType.SESSION;
|
public static final String MEDIA_TYPE = VCloudDirectorMediaType.SESSION;
|
||||||
|
|
||||||
public static Builder builder() {
|
public static Builder builder() {
|
||||||
|
@ -124,7 +119,7 @@ public class Session {
|
||||||
this.links = ImmutableSet.copyOf(links);
|
this.links = ImmutableSet.copyOf(links);
|
||||||
}
|
}
|
||||||
|
|
||||||
@XmlElement(namespace = VCLOUD_1_5_NS, name = "Link")
|
@XmlElement(name = "Link")
|
||||||
private Set<Link> links = Sets.newLinkedHashSet();
|
private Set<Link> links = Sets.newLinkedHashSet();
|
||||||
@XmlAttribute
|
@XmlAttribute
|
||||||
private String user;
|
private String user;
|
||||||
|
@ -138,7 +133,6 @@ public class Session {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @return the user's login name.
|
* @return the user's login name.
|
||||||
*/
|
*/
|
||||||
public String getUser() {
|
public String getUser() {
|
||||||
|
@ -146,7 +140,6 @@ public class Session {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @return is the name of an organization of which the user is a member
|
* @return is the name of an organization of which the user is a member
|
||||||
*/
|
*/
|
||||||
public String getOrg() {
|
public String getOrg() {
|
||||||
|
@ -154,7 +147,6 @@ public class Session {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @return a reference to the current session
|
* @return a reference to the current session
|
||||||
*/
|
*/
|
||||||
public URI getHref() {
|
public URI getHref() {
|
||||||
|
@ -179,6 +171,6 @@ public class Session {
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return Objects.toStringHelper("").add("user", user).add("org", org).add("href", href).add("links", links)
|
return Objects.toStringHelper("").add("user", user).add("org", org).add("href", href).add("links", links)
|
||||||
.toString();
|
.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@ import com.google.common.base.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Session and its corresponding token
|
* Session and its corresponding token
|
||||||
*
|
*
|
||||||
* @author Adrian Cole
|
* @author Adrian Cole
|
||||||
*/
|
*/
|
||||||
public class SessionWithToken {
|
public class SessionWithToken {
|
||||||
|
@ -95,7 +95,7 @@ public class SessionWithToken {
|
||||||
* particular context. Although URLs have a well-known syntax and a well-understood
|
* particular context. Although URLs have a well-known syntax and a well-understood
|
||||||
* interpretation, a client should treat each token as an opaque string. The rules that govern
|
* interpretation, a client should treat each token as an opaque string. The rules that govern
|
||||||
* how the server constructs token strings might change in future releases.
|
* how the server constructs token strings might change in future releases.
|
||||||
*
|
*
|
||||||
* @return an opaque reference and should never be parsed
|
* @return an opaque reference and should never be parsed
|
||||||
*/
|
*/
|
||||||
public String getToken() {
|
public String getToken() {
|
||||||
|
|
|
@ -21,27 +21,24 @@ package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.Set;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlType;
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
|
import com.google.common.collect.ImmutableSet;
|
||||||
|
import com.google.common.collect.Sets;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Represents a composition item.
|
||||||
* Represents a composition item.
|
* <p/>
|
||||||
*
|
* <p/>
|
||||||
*
|
|
||||||
* <p>Java class for SourcedCompositionItemParam complex type.
|
* <p>Java class for SourcedCompositionItemParam complex type.
|
||||||
*
|
* <p/>
|
||||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
*
|
* <p/>
|
||||||
* <pre>
|
* <pre>
|
||||||
* <complexType name="SourcedCompositionItemParam">
|
* <complexType name="SourcedCompositionItemParam">
|
||||||
* <complexContent>
|
* <complexContent>
|
||||||
|
@ -58,15 +55,12 @@ import com.google.common.base.Objects;
|
||||||
* </complexContent>
|
* </complexContent>
|
||||||
* </complexType>
|
* </complexType>
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
|
||||||
@XmlType(name = "SourcedCompositionItemParam", propOrder = {
|
@XmlType(name = "SourcedCompositionItemParam", propOrder = {
|
||||||
"source",
|
"source",
|
||||||
"vAppScopedLocalId",
|
"vAppScopedLocalId",
|
||||||
"instantiationParams",
|
"instantiationParams",
|
||||||
"networkAssignment"
|
"networkAssignment"
|
||||||
})
|
})
|
||||||
public class SourcedCompositionItemParam {
|
public class SourcedCompositionItemParam {
|
||||||
public static Builder builder() {
|
public static Builder builder() {
|
||||||
|
@ -78,11 +72,11 @@ public class SourcedCompositionItemParam {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Builder {
|
public static class Builder {
|
||||||
|
|
||||||
private Reference source;
|
private Reference source;
|
||||||
private String vAppScopedLocalId;
|
private String vAppScopedLocalId;
|
||||||
private InstantiationParams instantiationParams;
|
private InstantiationParams instantiationParams;
|
||||||
private List<NetworkAssignment> networkAssignment;
|
private Set<NetworkAssignment> networkAssignments = Sets.newLinkedHashSet();
|
||||||
private Boolean sourceDelete;
|
private Boolean sourceDelete;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -110,207 +104,144 @@ public class SourcedCompositionItemParam {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see SourcedCompositionItemParam#getNetworkAssignment()
|
* @see SourcedCompositionItemParam#getNetworkAssignments()
|
||||||
*/
|
*/
|
||||||
public Builder networkAssignment(List<NetworkAssignment> networkAssignment) {
|
public Builder networkAssignments(Set<NetworkAssignment> networkAssignments) {
|
||||||
this.networkAssignment = networkAssignment;
|
this.networkAssignments = networkAssignments;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see SourcedCompositionItemParam#getSourceDelete()
|
* @see SourcedCompositionItemParam#isSourceDelete()
|
||||||
*/
|
*/
|
||||||
public Builder sourceDelete(Boolean sourceDelete) {
|
public Builder sourceDelete(Boolean sourceDelete) {
|
||||||
this.sourceDelete = sourceDelete;
|
this.sourceDelete = sourceDelete;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public SourcedCompositionItemParam build() {
|
public SourcedCompositionItemParam build() {
|
||||||
SourcedCompositionItemParam sourcedCompositionItemParam = new SourcedCompositionItemParam(networkAssignment);
|
return new SourcedCompositionItemParam(source, vAppScopedLocalId, instantiationParams, networkAssignments, sourceDelete);
|
||||||
sourcedCompositionItemParam.setSource(source);
|
|
||||||
sourcedCompositionItemParam.setVAppScopedLocalId(vAppScopedLocalId);
|
|
||||||
sourcedCompositionItemParam.setInstantiationParams(instantiationParams);
|
|
||||||
sourcedCompositionItemParam.setSourceDelete(sourceDelete);
|
|
||||||
return sourcedCompositionItemParam;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Builder fromSourcedCompositionItemParam(SourcedCompositionItemParam in) {
|
public Builder fromSourcedCompositionItemParam(SourcedCompositionItemParam in) {
|
||||||
return source(in.getSource())
|
return source(in.getSource())
|
||||||
.vAppScopedLocalId(in.getVAppScopedLocalId())
|
.vAppScopedLocalId(in.getVAppScopedLocalId())
|
||||||
.instantiationParams(in.getInstantiationParams())
|
.instantiationParams(in.getInstantiationParams())
|
||||||
.networkAssignment(in.getNetworkAssignment())
|
.networkAssignments(in.getNetworkAssignments())
|
||||||
.sourceDelete(in.isSourceDelete());
|
.sourceDelete(in.isSourceDelete());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public SourcedCompositionItemParam(Reference source, String vAppScopedLocalId, InstantiationParams instantiationParams,
|
||||||
|
Set<NetworkAssignment> networkAssignments, Boolean sourceDelete) {
|
||||||
|
this.source = source;
|
||||||
|
this.vAppScopedLocalId = vAppScopedLocalId;
|
||||||
|
this.instantiationParams = instantiationParams;
|
||||||
|
this.networkAssignments = ImmutableSet.copyOf(networkAssignments);
|
||||||
|
this.sourceDelete = sourceDelete;
|
||||||
|
}
|
||||||
|
|
||||||
private SourcedCompositionItemParam() {
|
private SourcedCompositionItemParam() {
|
||||||
// For JAXB and builder use
|
// For JAXB and builder use
|
||||||
}
|
}
|
||||||
|
|
||||||
private SourcedCompositionItemParam(List<NetworkAssignment> networkAssignment) {
|
@XmlElement(name = "Source", required = true)
|
||||||
this.networkAssignment = networkAssignment;
|
protected Reference source;
|
||||||
|
@XmlElement(name = "VAppScopedLocalId")
|
||||||
|
protected String vAppScopedLocalId;
|
||||||
|
@XmlElement(name = "InstantiationParams")
|
||||||
|
protected InstantiationParams instantiationParams;
|
||||||
|
@XmlElement(name = "NetworkAssignment")
|
||||||
|
protected Set<NetworkAssignment> networkAssignments = Sets.newLinkedHashSet();
|
||||||
|
@XmlAttribute
|
||||||
|
protected Boolean sourceDelete;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the source property.
|
||||||
|
*
|
||||||
|
* @return possible object is
|
||||||
|
* {@link Reference }
|
||||||
|
*/
|
||||||
|
public Reference getSource() {
|
||||||
|
return source;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@XmlElement(name = "Source", required = true)
|
/**
|
||||||
protected Reference source;
|
* Gets the value of the vAppScopedLocalId property.
|
||||||
@XmlElement(name = "VAppScopedLocalId")
|
*
|
||||||
protected String vAppScopedLocalId;
|
* @return possible object is
|
||||||
@XmlElement(name = "InstantiationParams")
|
* {@link String }
|
||||||
protected InstantiationParams instantiationParams;
|
*/
|
||||||
@XmlElement(name = "NetworkAssignment")
|
public String getVAppScopedLocalId() {
|
||||||
protected List<NetworkAssignment> networkAssignment;
|
return vAppScopedLocalId;
|
||||||
@XmlAttribute
|
}
|
||||||
protected Boolean sourceDelete;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the source property.
|
* Gets the value of the instantiationParams property.
|
||||||
*
|
*
|
||||||
* @return
|
* @return possible object is
|
||||||
* possible object is
|
* {@link InstantiationParams }
|
||||||
* {@link Reference }
|
*/
|
||||||
*
|
public InstantiationParams getInstantiationParams() {
|
||||||
*/
|
return instantiationParams;
|
||||||
public Reference getSource() {
|
}
|
||||||
return source;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the value of the source property.
|
* Gets the value of the networkAssignment property.
|
||||||
*
|
* <p/>
|
||||||
* @param value
|
* <p/>
|
||||||
* allowed object is
|
* This accessor method returns a reference to the live list,
|
||||||
* {@link Reference }
|
* 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 <CODE>set</CODE> method for the networkAssignment property.
|
||||||
public void setSource(Reference value) {
|
* <p/>
|
||||||
this.source = value;
|
* <p/>
|
||||||
}
|
* For example, to add a new item, do as follows:
|
||||||
|
* <pre>
|
||||||
|
* getNetworkAssignment().add(newItem);
|
||||||
|
* </pre>
|
||||||
|
* <p/>
|
||||||
|
* <p/>
|
||||||
|
* <p/>
|
||||||
|
* Objects of the following type(s) are allowed in the list
|
||||||
|
* {@link NetworkAssignment }
|
||||||
|
*/
|
||||||
|
public Set<NetworkAssignment> getNetworkAssignments() {
|
||||||
|
return this.networkAssignments;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the vAppScopedLocalId property.
|
* Gets the value of the sourceDelete property.
|
||||||
*
|
*
|
||||||
* @return
|
* @return possible object is
|
||||||
* possible object is
|
* {@link Boolean }
|
||||||
* {@link String }
|
*/
|
||||||
*
|
public Boolean isSourceDelete() {
|
||||||
*/
|
return sourceDelete;
|
||||||
public String getVAppScopedLocalId() {
|
}
|
||||||
return vAppScopedLocalId;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the vAppScopedLocalId property.
|
|
||||||
*
|
|
||||||
* @param value
|
|
||||||
* allowed object is
|
|
||||||
* {@link String }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setVAppScopedLocalId(String value) {
|
|
||||||
this.vAppScopedLocalId = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the value of the instantiationParams property.
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
* possible object is
|
|
||||||
* {@link InstantiationParams }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public InstantiationParams getInstantiationParams() {
|
|
||||||
return instantiationParams;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the instantiationParams property.
|
|
||||||
*
|
|
||||||
* @param value
|
|
||||||
* allowed object is
|
|
||||||
* {@link InstantiationParams }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setInstantiationParams(InstantiationParams value) {
|
|
||||||
this.instantiationParams = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the value of the networkAssignment property.
|
|
||||||
*
|
|
||||||
* <p>
|
|
||||||
* 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 <CODE>set</CODE> method for the networkAssignment property.
|
|
||||||
*
|
|
||||||
* <p>
|
|
||||||
* For example, to add a new item, do as follows:
|
|
||||||
* <pre>
|
|
||||||
* getNetworkAssignment().add(newItem);
|
|
||||||
* </pre>
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* <p>
|
|
||||||
* Objects of the following type(s) are allowed in the list
|
|
||||||
* {@link NetworkAssignmentType }
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public List<NetworkAssignment> getNetworkAssignment() {
|
|
||||||
if (networkAssignment == null) {
|
|
||||||
networkAssignment = new ArrayList<NetworkAssignment>();
|
|
||||||
}
|
|
||||||
return this.networkAssignment;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the value of the sourceDelete property.
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
* possible object is
|
|
||||||
* {@link Boolean }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public Boolean isSourceDelete() {
|
|
||||||
return sourceDelete;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the sourceDelete property.
|
|
||||||
*
|
|
||||||
* @param value
|
|
||||||
* allowed object is
|
|
||||||
* {@link Boolean }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setSourceDelete(Boolean value) {
|
|
||||||
this.sourceDelete = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
return true;
|
return true;
|
||||||
if (o == null || getClass() != o.getClass())
|
if (o == null || getClass() != o.getClass())
|
||||||
return false;
|
return false;
|
||||||
SourcedCompositionItemParam that = SourcedCompositionItemParam.class.cast(o);
|
SourcedCompositionItemParam that = SourcedCompositionItemParam.class.cast(o);
|
||||||
return equal(source, that.source) &&
|
return equal(source, that.source) &&
|
||||||
equal(vAppScopedLocalId, that.vAppScopedLocalId) &&
|
equal(vAppScopedLocalId, that.vAppScopedLocalId) &&
|
||||||
equal(instantiationParams, that.instantiationParams) &&
|
equal(instantiationParams, that.instantiationParams) &&
|
||||||
equal(networkAssignment, that.networkAssignment) &&
|
equal(networkAssignments, that.networkAssignments) &&
|
||||||
equal(sourceDelete, that.sourceDelete);
|
equal(sourceDelete, that.sourceDelete);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hashCode(source,
|
return Objects.hashCode(source,
|
||||||
vAppScopedLocalId,
|
vAppScopedLocalId,
|
||||||
instantiationParams,
|
instantiationParams,
|
||||||
networkAssignment,
|
networkAssignments,
|
||||||
sourceDelete);
|
sourceDelete);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -319,7 +250,7 @@ public class SourcedCompositionItemParam {
|
||||||
.add("source", source)
|
.add("source", source)
|
||||||
.add("vAppScopedLocalId", vAppScopedLocalId)
|
.add("vAppScopedLocalId", vAppScopedLocalId)
|
||||||
.add("instantiationParams", instantiationParams)
|
.add("instantiationParams", instantiationParams)
|
||||||
.add("networkAssignment", networkAssignment)
|
.add("networkAssignments", networkAssignments)
|
||||||
.add("sourceDelete", sourceDelete).toString();
|
.add("sourceDelete", sourceDelete).toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,26 +22,23 @@ package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.Collections;
|
||||||
|
import java.util.Set;
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlType;
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Sets;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Represents a list of supported VM hardware versions.
|
||||||
* Represents a list of supported VM hardware versions.
|
* <p/>
|
||||||
*
|
* <p/>
|
||||||
*
|
|
||||||
* <p>Java class for SupportedHardwareVersions complex type.
|
* <p>Java class for SupportedHardwareVersions complex type.
|
||||||
*
|
* <p/>
|
||||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
*
|
* <p/>
|
||||||
* <pre>
|
* <pre>
|
||||||
* <complexType name="SupportedHardwareVersions">
|
* <complexType name="SupportedHardwareVersions">
|
||||||
* <complexContent>
|
* <complexContent>
|
||||||
|
@ -54,12 +51,9 @@ import com.google.common.collect.Lists;
|
||||||
* </complexContent>
|
* </complexContent>
|
||||||
* </complexType>
|
* </complexType>
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
|
||||||
@XmlType(name = "SupportedHardwareVersions", propOrder = {
|
@XmlType(name = "SupportedHardwareVersions", propOrder = {
|
||||||
"supportedHardwareVersions"
|
"supportedHardwareVersions"
|
||||||
})
|
})
|
||||||
public class SupportedHardwareVersions {
|
public class SupportedHardwareVersions {
|
||||||
public static Builder builder() {
|
public static Builder builder() {
|
||||||
|
@ -71,17 +65,17 @@ public class SupportedHardwareVersions {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Builder {
|
public static class Builder {
|
||||||
|
|
||||||
private List<String> supportedHardwareVersions = Lists.newArrayList();
|
private Set<String> supportedHardwareVersions = Sets.newLinkedHashSet();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see SupportedHardwareVersions#getSupportedHardwareVersions()
|
* @see SupportedHardwareVersions#getSupportedHardwareVersions()
|
||||||
*/
|
*/
|
||||||
public Builder supportedHardwareVersions(List<String> supportedHardwareVersions) {
|
public Builder supportedHardwareVersions(Set<String> supportedHardwareVersions) {
|
||||||
this.supportedHardwareVersions = Lists.newArrayList(checkNotNull(supportedHardwareVersions, "supportedHardwareVersions"));
|
this.supportedHardwareVersions = Sets.newLinkedHashSet(checkNotNull(supportedHardwareVersions, "supportedHardwareVersions"));
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see SupportedHardwareVersions#getSupportedHardwareVersions()
|
* @see SupportedHardwareVersions#getSupportedHardwareVersions()
|
||||||
*/
|
*/
|
||||||
|
@ -105,47 +99,25 @@ public class SupportedHardwareVersions {
|
||||||
// For JAXB and builder use
|
// For JAXB and builder use
|
||||||
}
|
}
|
||||||
|
|
||||||
private SupportedHardwareVersions(List<String> supportedHardwareVersions) {
|
private SupportedHardwareVersions(Set<String> supportedHardwareVersions) {
|
||||||
this.supportedHardwareVersions = supportedHardwareVersions;
|
this.supportedHardwareVersions = supportedHardwareVersions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@XmlElement(name = "SupportedHardwareVersion")
|
@XmlElement(name = "SupportedHardwareVersion")
|
||||||
protected List<String> supportedHardwareVersions;
|
protected Set<String> supportedHardwareVersions = Sets.newLinkedHashSet();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the supportedHardwareVersion property.
|
* Gets the value of the supportedHardwareVersion property.
|
||||||
*
|
*/
|
||||||
* <p>
|
public Set<String> getSupportedHardwareVersions() {
|
||||||
* This accessor method returns a reference to the live list,
|
return Collections.unmodifiableSet(supportedHardwareVersions);
|
||||||
* 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 <CODE>set</CODE> method for the supportedHardwareVersion property.
|
|
||||||
*
|
|
||||||
* <p>
|
|
||||||
* For example, to add a new item, do as follows:
|
|
||||||
* <pre>
|
|
||||||
* getSupportedHardwareVersion().add(newItem);
|
|
||||||
* </pre>
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* <p>
|
|
||||||
* Objects of the following type(s) are allowed in the list
|
|
||||||
* {@link String }
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public List<String> getSupportedHardwareVersions() {
|
|
||||||
if (supportedHardwareVersions == null) {
|
|
||||||
supportedHardwareVersions = Lists.newArrayList();
|
|
||||||
}
|
|
||||||
return this.supportedHardwareVersions;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
return true;
|
return true;
|
||||||
if (o == null || getClass() != o.getClass())
|
if (o == null || getClass() != o.getClass())
|
||||||
return false;
|
return false;
|
||||||
SupportedHardwareVersions that = SupportedHardwareVersions.class.cast(o);
|
SupportedHardwareVersions that = SupportedHardwareVersions.class.cast(o);
|
||||||
|
|
|
@ -19,23 +19,19 @@
|
||||||
package org.jclouds.vcloud.director.v1_5.domain;
|
package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_1_5_NS;
|
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Syslog server settings. If logging is configured for firewall rules, the logs
|
* Syslog server settings. If logging is configured for firewall rules, the logs
|
||||||
* will be directed to these syslog servers.
|
* will be directed to these syslog servers.
|
||||||
*
|
*
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
@XmlRootElement(namespace = VCLOUD_1_5_NS, name = "SyslogServerSettings")
|
@XmlRootElement(name = "SyslogServerSettings")
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
|
||||||
public class SyslogServerSettings {
|
public class SyslogServerSettings {
|
||||||
|
|
||||||
public static Builder builder() {
|
public static Builder builder() {
|
||||||
|
@ -47,7 +43,7 @@ public class SyslogServerSettings {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Builder {
|
public static class Builder {
|
||||||
|
|
||||||
private String syslogServerIp1;
|
private String syslogServerIp1;
|
||||||
private String syslogServerIp2;
|
private String syslogServerIp2;
|
||||||
|
|
||||||
|
@ -78,38 +74,30 @@ public class SyslogServerSettings {
|
||||||
return syslogServerIp1(in.getSyslogServerIp1()).syslogServerIp2(in.getSyslogServerIp2());
|
return syslogServerIp1(in.getSyslogServerIp1()).syslogServerIp2(in.getSyslogServerIp2());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private SyslogServerSettings() {
|
private SyslogServerSettings() {
|
||||||
// For JAXB and builder use
|
// For JAXB and builder use
|
||||||
}
|
}
|
||||||
|
|
||||||
@XmlElement(namespace = VCLOUD_1_5_NS, name = "SyslogServerIp1")
|
@XmlElement(name = "SyslogServerIp1")
|
||||||
private String syslogServerIp1;
|
private String syslogServerIp1;
|
||||||
@XmlElement(namespace = VCLOUD_1_5_NS, name = "SyslogServerIp2")
|
@XmlElement(name = "SyslogServerIp2")
|
||||||
private String syslogServerIp2;
|
private String syslogServerIp2;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Primary syslog server.
|
* @return Primary syslog server.
|
||||||
*/
|
*/
|
||||||
public String getSyslogServerIp1() {
|
public String getSyslogServerIp1() {
|
||||||
return syslogServerIp1;
|
return syslogServerIp1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSyslogServerIp1(String syslogServerIp1) {
|
|
||||||
this.syslogServerIp1 = syslogServerIp1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Secondary syslog server.
|
* @return Secondary syslog server.
|
||||||
*/
|
*/
|
||||||
public String getSyslogServerIp2() {
|
public String getSyslogServerIp2() {
|
||||||
return syslogServerIp2;
|
return syslogServerIp2;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSyslogServerIp2(String syslogServerIp2) {
|
|
||||||
this.syslogServerIp2 = syslogServerIp2;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
|
|
|
@ -20,14 +20,12 @@ package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
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.net.URI;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
@ -40,34 +38,33 @@ import com.google.common.collect.Sets;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents an asynchronous or long-running task in the vCloud environment.
|
* Represents an asynchronous or long-running task in the vCloud environment.
|
||||||
*
|
* <p/>
|
||||||
* <pre>
|
* <pre>
|
||||||
* <xs:complexType name="TaskType">
|
* <xs:complexType name="TaskType">
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author grkvlt@apache.org
|
* @author grkvlt@apache.org
|
||||||
*/
|
*/
|
||||||
@XmlRootElement(namespace = VCLOUD_1_5_NS, name = "Task")
|
@XmlRootElement(name = "Task")
|
||||||
public class Task extends EntityType<Task> {
|
public class Task extends EntityType<Task> {
|
||||||
|
|
||||||
public static final String MEDIA_TYPE = VCloudDirectorMediaType.TASK;
|
|
||||||
|
|
||||||
public static class Status {
|
|
||||||
public static final String QUEUED = "queued";
|
|
||||||
public static final String PRE_RUNNING = "preRunning";
|
|
||||||
public static final String RUNNING = "running";
|
|
||||||
public static final String SUCCESS = "success";
|
|
||||||
public static final String ERROR = "error";
|
|
||||||
public static final String CANCELED = "canceled";
|
|
||||||
public static final String ABORTED = "aborted";
|
|
||||||
|
|
||||||
public static final List<String> ALL = Arrays.asList(
|
public static final String MEDIA_TYPE = VCloudDirectorMediaType.TASK;
|
||||||
QUEUED, PRE_RUNNING, RUNNING, SUCCESS,
|
|
||||||
ERROR, CANCELED, ABORTED
|
public static class Status {
|
||||||
);
|
public static final String QUEUED = "queued";
|
||||||
|
public static final String PRE_RUNNING = "preRunning";
|
||||||
|
public static final String RUNNING = "running";
|
||||||
|
public static final String SUCCESS = "success";
|
||||||
|
public static final String ERROR = "error";
|
||||||
|
public static final String CANCELED = "canceled";
|
||||||
|
public static final String ABORTED = "aborted";
|
||||||
|
|
||||||
|
public static final List<String> ALL = Arrays.asList(
|
||||||
|
QUEUED, PRE_RUNNING, RUNNING, SUCCESS,
|
||||||
|
ERROR, CANCELED, ABORTED
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public static Builder builder() {
|
public static Builder builder() {
|
||||||
return new Builder();
|
return new Builder();
|
||||||
}
|
}
|
||||||
|
@ -190,25 +187,8 @@ public class Task extends EntityType<Task> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Task build() {
|
public Task build() {
|
||||||
Task task = new Task(href, name);
|
return new Task(href, type, links, description, tasksInProgress, id, name,
|
||||||
task.setDescription(description);
|
error, org, progress, owner, user, params, status, operation, operationName, startTime, endTime, expiryTime);
|
||||||
task.setTasksInProgress(tasksInProgress);
|
|
||||||
task.setId(id);
|
|
||||||
task.setType(type);
|
|
||||||
task.setLinks(links);
|
|
||||||
task.setError(error);
|
|
||||||
task.setOrg(org);
|
|
||||||
task.setOwner(owner);
|
|
||||||
task.setUser(user);
|
|
||||||
task.setParams(params);
|
|
||||||
task.setProgress(progress);
|
|
||||||
task.setStatus(status);
|
|
||||||
task.setOperation(operation);
|
|
||||||
task.setOperationName(operationName);
|
|
||||||
task.setStartTime(startTime);
|
|
||||||
task.setEndTime(endTime);
|
|
||||||
task.setExpiryTime(expiryTime);
|
|
||||||
return task;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -266,7 +246,7 @@ public class Task extends EntityType<Task> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ReferenceType#getLinks()
|
* @see EntityType#getLinks()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder links(Set<Link> links) {
|
public Builder links(Set<Link> links) {
|
||||||
|
@ -275,7 +255,7 @@ public class Task extends EntityType<Task> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ReferenceType#getLinks()
|
* @see EntityType#getLinks()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder link(Link link) {
|
public Builder link(Link link) {
|
||||||
|
@ -290,30 +270,46 @@ public class Task extends EntityType<Task> {
|
||||||
|
|
||||||
public Builder fromTask(Task in) {
|
public Builder fromTask(Task in) {
|
||||||
return fromEntityType(in)
|
return fromEntityType(in)
|
||||||
.error(in.getError()).org(in.getOrg()).progress(in.getProgress()).status(in.getStatus())
|
.error(in.getError()).org(in.getOrg()).progress(in.getProgress()).status(in.getStatus())
|
||||||
.operation(in.getOperation()).operationName(in.getOperationName());
|
.operation(in.getOperation()).operationName(in.getOperationName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Task(URI href, String type, Set<Link> links, String description, TasksInProgress tasksInProgress,
|
||||||
|
String id, String name, Error error, Reference org, Integer progress, Reference owner,
|
||||||
|
Reference user, Object params, String status, String operation, String operationName,
|
||||||
|
Date startTime, Date endTime, Date expiryTime) {
|
||||||
|
super(href, type, links, description, tasksInProgress, id, name);
|
||||||
|
this.error = error;
|
||||||
|
this.org = org;
|
||||||
|
this.progress = progress;
|
||||||
|
this.owner = owner;
|
||||||
|
this.user = user;
|
||||||
|
this.params = params;
|
||||||
|
this.status = status;
|
||||||
|
this.operation = operation;
|
||||||
|
this.operationName = operationName;
|
||||||
|
this.startTime = startTime;
|
||||||
|
this.endTime = endTime;
|
||||||
|
this.expiryTime = expiryTime;
|
||||||
|
}
|
||||||
|
|
||||||
private Task() {
|
private Task() {
|
||||||
// For JAXB and builder use
|
// For JAXB and builder use
|
||||||
}
|
}
|
||||||
|
|
||||||
private Task(URI href, String name) {
|
|
||||||
super(href, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
@XmlElement(namespace = VCLOUD_1_5_NS, name = "Error")
|
@XmlElement(name = "Error")
|
||||||
private Error error;
|
private Error error;
|
||||||
@XmlElement(namespace = VCLOUD_1_5_NS, name = "Organization")
|
@XmlElement(name = "Organization")
|
||||||
private Reference org;
|
private Reference org;
|
||||||
@XmlElement(namespace = VCLOUD_1_5_NS, name = "Progress")
|
@XmlElement(name = "Progress")
|
||||||
private Integer progress;
|
private Integer progress;
|
||||||
@XmlElement(namespace = VCLOUD_1_5_NS, name = "Owner")
|
@XmlElement(name = "Owner")
|
||||||
private Reference owner;
|
private Reference owner;
|
||||||
@XmlElement(namespace = VCLOUD_1_5_NS, name = "User")
|
@XmlElement(name = "User")
|
||||||
private Reference user;
|
private Reference user;
|
||||||
@XmlElement(namespace = VCLOUD_1_5_NS, name = "Params")
|
@XmlElement(name = "Params")
|
||||||
private Object params;
|
private Object params;
|
||||||
@XmlAttribute
|
@XmlAttribute
|
||||||
private String status;
|
private String status;
|
||||||
|
@ -327,7 +323,7 @@ public class Task extends EntityType<Task> {
|
||||||
private Date endTime;
|
private Date endTime;
|
||||||
@XmlAttribute
|
@XmlAttribute
|
||||||
private Date expiryTime;
|
private Date expiryTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents an error information if the task failed.
|
* Represents an error information if the task failed.
|
||||||
*/
|
*/
|
||||||
|
@ -335,10 +331,6 @@ public class Task extends EntityType<Task> {
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setError(Error error) {
|
|
||||||
this.error = error;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The organization that started the task.
|
* The organization that started the task.
|
||||||
*/
|
*/
|
||||||
|
@ -346,10 +338,6 @@ public class Task extends EntityType<Task> {
|
||||||
return org;
|
return org;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setOrg(Reference org) {
|
|
||||||
this.org = org;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reference to the owner of the task.
|
* Reference to the owner of the task.
|
||||||
*/
|
*/
|
||||||
|
@ -357,10 +345,6 @@ public class Task extends EntityType<Task> {
|
||||||
return owner;
|
return owner;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setOwner(Reference owner) {
|
|
||||||
this.owner = owner;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The user who started the task.
|
* The user who started the task.
|
||||||
*/
|
*/
|
||||||
|
@ -368,10 +352,6 @@ public class Task extends EntityType<Task> {
|
||||||
return user;
|
return user;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUser(Reference user) {
|
|
||||||
this.user = user;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The parameters with which this task has been run.
|
* The parameters with which this task has been run.
|
||||||
*/
|
*/
|
||||||
|
@ -379,13 +359,9 @@ public class Task extends EntityType<Task> {
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setParams(Object params) {
|
|
||||||
this.params = params;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The progress of a long running asynchronous task.
|
* The progress of a long running asynchronous task.
|
||||||
*
|
* <p/>
|
||||||
* The value is between 0 - 100. Not all tasks have progress, the value is not
|
* The value is between 0 - 100. Not all tasks have progress, the value is not
|
||||||
* present for task which progress is not available.
|
* present for task which progress is not available.
|
||||||
*/
|
*/
|
||||||
|
@ -393,13 +369,9 @@ public class Task extends EntityType<Task> {
|
||||||
return progress;
|
return progress;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setProgress(Integer progress) {
|
|
||||||
this.progress = progress;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The execution status of the task.
|
* The execution status of the task.
|
||||||
*
|
* <p/>
|
||||||
* One of:
|
* One of:
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>queued - The task has been queued for execution.
|
* <li>queued - The task has been queued for execution.
|
||||||
|
@ -414,10 +386,6 @@ public class Task extends EntityType<Task> {
|
||||||
public String getStatus() {
|
public String getStatus() {
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setStatus(String status) {
|
|
||||||
this.status = status;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The display name of the operation that is tracked by this task.
|
* The display name of the operation that is tracked by this task.
|
||||||
|
@ -426,10 +394,6 @@ public class Task extends EntityType<Task> {
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setOperation(String operation) {
|
|
||||||
this.operation = operation;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The name of the operation that is tracked by this task.
|
* The name of the operation that is tracked by this task.
|
||||||
*/
|
*/
|
||||||
|
@ -437,49 +401,33 @@ public class Task extends EntityType<Task> {
|
||||||
return operationName;
|
return operationName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setOperationName(String operationName) {
|
|
||||||
this.operationName = operationName;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The date and time the system started executing the task.
|
* The date and time the system started executing the task.
|
||||||
*
|
* <p/>
|
||||||
* May not be present if the task hasn't been executed yet.
|
* May not be present if the task hasn't been executed yet.
|
||||||
*/
|
*/
|
||||||
public Date getStartTime() {
|
public Date getStartTime() {
|
||||||
return startTime;
|
return startTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setStartTime(Date startTime) {
|
|
||||||
this.startTime = startTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The date and time that processing of the task was completed.
|
* The date and time that processing of the task was completed.
|
||||||
*
|
* <p/>
|
||||||
* May not be present if the task is still being executed.
|
* May not be present if the task is still being executed.
|
||||||
*/
|
*/
|
||||||
public Date getEndTime() {
|
public Date getEndTime() {
|
||||||
return endTime;
|
return endTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setEndTime(Date endTime) {
|
|
||||||
this.endTime = endTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The date and time at which the task resource will be destroyed and no longer available for retrieval.
|
* The date and time at which the task resource will be destroyed and no longer available for retrieval.
|
||||||
*
|
* <p/>
|
||||||
* May not be present if the task has not been executed or is still being executed.
|
* May not be present if the task has not been executed or is still being executed.
|
||||||
*/
|
*/
|
||||||
public Date getExpiryTime() {
|
public Date getExpiryTime() {
|
||||||
return expiryTime;
|
return expiryTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setExpiryTime(Date expiryTime) {
|
|
||||||
this.expiryTime = expiryTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
|
|
|
@ -20,13 +20,9 @@ package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_1_5_NS;
|
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@ -37,8 +33,7 @@ import com.google.common.collect.Sets;
|
||||||
/**
|
/**
|
||||||
* @author grkvlt@apache.org
|
* @author grkvlt@apache.org
|
||||||
*/
|
*/
|
||||||
@XmlRootElement(namespace = VCLOUD_1_5_NS, name = "TasksInProgress")
|
@XmlRootElement(name = "TasksInProgress")
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
|
||||||
public class TasksInProgress {
|
public class TasksInProgress {
|
||||||
|
|
||||||
public static Builder builder() {
|
public static Builder builder() {
|
||||||
|
@ -86,7 +81,7 @@ public class TasksInProgress {
|
||||||
this.tasks = ImmutableSet.copyOf(tasks);
|
this.tasks = ImmutableSet.copyOf(tasks);
|
||||||
}
|
}
|
||||||
|
|
||||||
@XmlElement(namespace = VCLOUD_1_5_NS, name = "Task")
|
@XmlElement(name = "Task")
|
||||||
private Set<Task> tasks = Sets.newLinkedHashSet();
|
private Set<Task> tasks = Sets.newLinkedHashSet();
|
||||||
|
|
||||||
public Set<Task> getTasks() {
|
public Set<Task> getTasks() {
|
||||||
|
|
|
@ -20,11 +20,9 @@ package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
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.net.URI;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@ -37,15 +35,14 @@ import com.google.common.collect.Sets;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A list of tasks.
|
* A list of tasks.
|
||||||
*
|
*
|
||||||
* @author Adrian Cole
|
* @author Adrian Cole
|
||||||
*/
|
*/
|
||||||
@XmlRootElement(namespace = VCLOUD_1_5_NS, name = "TasksList")
|
@XmlRootElement(name = "TasksList")
|
||||||
public class TasksList extends EntityType<TasksList> {
|
public class TasksList extends EntityType<TasksList> {
|
||||||
|
|
||||||
public static final String MEDIA_TYPE = VCloudDirectorMediaType.TASKS_LIST;
|
public static final String MEDIA_TYPE = VCloudDirectorMediaType.TASKS_LIST;
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public static Builder builder() {
|
public static Builder builder() {
|
||||||
return new Builder();
|
return new Builder();
|
||||||
}
|
}
|
||||||
|
@ -77,13 +74,7 @@ public class TasksList extends EntityType<TasksList> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TasksList build() {
|
public TasksList build() {
|
||||||
TasksList taskslist = new TasksList(href, name, tasks);
|
return new TasksList(href, type, links, description, tasksInProgress, id, name, tasks);
|
||||||
taskslist.setDescription(description);
|
|
||||||
taskslist.setTasksInProgress(tasksInProgress);
|
|
||||||
taskslist.setId(id);
|
|
||||||
taskslist.setType(type);
|
|
||||||
taskslist.setLinks(links);
|
|
||||||
return taskslist;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -141,7 +132,7 @@ public class TasksList extends EntityType<TasksList> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ReferenceType#getLinks()
|
* @see EntityType#getLinks()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder links(Set<Link> links) {
|
public Builder links(Set<Link> links) {
|
||||||
|
@ -150,7 +141,7 @@ public class TasksList extends EntityType<TasksList> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ReferenceType#getLinks()
|
* @see EntityType#getLinks()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder link(Link link) {
|
public Builder link(Link link) {
|
||||||
|
@ -172,12 +163,12 @@ public class TasksList extends EntityType<TasksList> {
|
||||||
// For JAXB and builder use
|
// For JAXB and builder use
|
||||||
}
|
}
|
||||||
|
|
||||||
protected TasksList(URI href, String name, Set<Task> tasks) {
|
public TasksList(URI href, String type, Set<Link> links, String description, TasksInProgress tasksInProgress, String id, String name, Set<Task> tasks) {
|
||||||
super(href, name);
|
super(href, type, links, description, tasksInProgress, id, name);
|
||||||
this.tasks = ImmutableSet.copyOf(tasks);
|
this.tasks = ImmutableSet.copyOf(tasks);
|
||||||
}
|
}
|
||||||
|
|
||||||
@XmlElement(namespace = VCLOUD_1_5_NS, name = "Task")
|
@XmlElement(name = "Task")
|
||||||
private Set<Task> tasks = Sets.newLinkedHashSet();
|
private Set<Task> tasks = Sets.newLinkedHashSet();
|
||||||
|
|
||||||
public Set<Task> getTasks() {
|
public Set<Task> getTasks() {
|
||||||
|
|
|
@ -21,8 +21,6 @@ package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import javax.xml.bind.annotation.XmlType;
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
|
||||||
|
@ -30,14 +28,13 @@ import com.google.common.base.Objects;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Represents vApp Template upload parameters.
|
||||||
* Represents vApp Template upload parameters.
|
* <p/>
|
||||||
*
|
* <p/>
|
||||||
*
|
|
||||||
* <p>Java class for UploadVAppTemplateParams complex type.
|
* <p>Java class for UploadVAppTemplateParams complex type.
|
||||||
*
|
* <p/>
|
||||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
*
|
* <p/>
|
||||||
* <pre>
|
* <pre>
|
||||||
* <complexType name="UploadVAppTemplateParams">
|
* <complexType name="UploadVAppTemplateParams">
|
||||||
* <complexContent>
|
* <complexContent>
|
||||||
|
@ -49,13 +46,10 @@ import com.google.common.base.Objects;
|
||||||
* </complexContent>
|
* </complexContent>
|
||||||
* </complexType>
|
* </complexType>
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
|
||||||
@XmlType(name = "UploadVAppTemplateParams")
|
@XmlType(name = "UploadVAppTemplateParams")
|
||||||
public class UploadVAppTemplateParams
|
public class UploadVAppTemplateParams
|
||||||
extends ParamsType<UploadVAppTemplateParams>
|
extends ParamsType<UploadVAppTemplateParams>
|
||||||
|
|
||||||
{
|
{
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
|
@ -68,7 +62,7 @@ public class UploadVAppTemplateParams
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Builder extends ParamsType.Builder<UploadVAppTemplateParams> {
|
public static class Builder extends ParamsType.Builder<UploadVAppTemplateParams> {
|
||||||
|
|
||||||
private String transferFormat;
|
private String transferFormat;
|
||||||
private Boolean manifestRequired;
|
private Boolean manifestRequired;
|
||||||
|
|
||||||
|
@ -81,7 +75,7 @@ public class UploadVAppTemplateParams
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see UploadVAppTemplateParams#getManifestRequired()
|
* @see UploadVAppTemplateParams#isManifestRequired()
|
||||||
*/
|
*/
|
||||||
public Builder manifestRequired(Boolean manifestRequired) {
|
public Builder manifestRequired(Boolean manifestRequired) {
|
||||||
this.manifestRequired = manifestRequired;
|
this.manifestRequired = manifestRequired;
|
||||||
|
@ -90,98 +84,73 @@ public class UploadVAppTemplateParams
|
||||||
|
|
||||||
|
|
||||||
public UploadVAppTemplateParams build() {
|
public UploadVAppTemplateParams build() {
|
||||||
UploadVAppTemplateParams uploadVAppTemplateParams = new UploadVAppTemplateParams();
|
return new UploadVAppTemplateParams(description, name, transferFormat, manifestRequired);
|
||||||
uploadVAppTemplateParams.setTransferFormat(transferFormat);
|
|
||||||
uploadVAppTemplateParams.setManifestRequired(manifestRequired);
|
|
||||||
return uploadVAppTemplateParams;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Builder fromParamsType(ParamsType<UploadVAppTemplateParams> in) {
|
public Builder fromParamsType(ParamsType<UploadVAppTemplateParams> in) {
|
||||||
return Builder.class.cast(super.fromParamsType(in));
|
return Builder.class.cast(super.fromParamsType(in));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder fromUploadVAppTemplateParams(UploadVAppTemplateParams in) {
|
public Builder fromUploadVAppTemplateParams(UploadVAppTemplateParams in) {
|
||||||
return fromParamsType(in)
|
return fromParamsType(in)
|
||||||
.transferFormat(in.getTransferFormat())
|
.transferFormat(in.getTransferFormat())
|
||||||
.manifestRequired(in.isManifestRequired());
|
.manifestRequired(in.isManifestRequired());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public UploadVAppTemplateParams(String description, String name, String transferFormat, Boolean manifestRequired) {
|
||||||
|
super(description, name);
|
||||||
|
this.transferFormat = transferFormat;
|
||||||
|
this.manifestRequired = manifestRequired;
|
||||||
|
}
|
||||||
|
|
||||||
private UploadVAppTemplateParams() {
|
private UploadVAppTemplateParams() {
|
||||||
// For JAXB and builder use
|
// For JAXB
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@XmlAttribute
|
||||||
|
protected String transferFormat;
|
||||||
|
@XmlAttribute
|
||||||
|
protected Boolean manifestRequired;
|
||||||
|
|
||||||
@XmlAttribute
|
/**
|
||||||
protected String transferFormat;
|
* Gets the value of the transferFormat property.
|
||||||
@XmlAttribute
|
*
|
||||||
protected Boolean manifestRequired;
|
* @return possible object is
|
||||||
|
* {@link String }
|
||||||
|
*/
|
||||||
|
public String getTransferFormat() {
|
||||||
|
return transferFormat;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the transferFormat property.
|
* Gets the value of the manifestRequired property.
|
||||||
*
|
*
|
||||||
* @return
|
* @return possible object is
|
||||||
* possible object is
|
* {@link Boolean }
|
||||||
* {@link String }
|
*/
|
||||||
*
|
public Boolean isManifestRequired() {
|
||||||
*/
|
return manifestRequired;
|
||||||
public String getTransferFormat() {
|
}
|
||||||
return transferFormat;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the transferFormat property.
|
|
||||||
*
|
|
||||||
* @param value
|
|
||||||
* allowed object is
|
|
||||||
* {@link String }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setTransferFormat(String value) {
|
|
||||||
this.transferFormat = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the value of the manifestRequired property.
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
* possible object is
|
|
||||||
* {@link Boolean }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public Boolean isManifestRequired() {
|
|
||||||
return manifestRequired;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the manifestRequired property.
|
|
||||||
*
|
|
||||||
* @param value
|
|
||||||
* allowed object is
|
|
||||||
* {@link Boolean }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setManifestRequired(Boolean value) {
|
|
||||||
this.manifestRequired = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
return true;
|
return true;
|
||||||
if (o == null || getClass() != o.getClass())
|
if (o == null || getClass() != o.getClass())
|
||||||
return false;
|
return false;
|
||||||
UploadVAppTemplateParams that = UploadVAppTemplateParams.class.cast(o);
|
UploadVAppTemplateParams that = UploadVAppTemplateParams.class.cast(o);
|
||||||
return equal(transferFormat, that.transferFormat) &&
|
return equal(transferFormat, that.transferFormat) &&
|
||||||
equal(manifestRequired, that.manifestRequired);
|
equal(manifestRequired, that.manifestRequired);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hashCode(transferFormat,
|
return Objects.hashCode(transferFormat,
|
||||||
manifestRequired);
|
manifestRequired);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,5 +1,5 @@
|
||||||
package org.jclouds.vcloud.director.v1_5.domain;
|
package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
public class VApp {
|
public class VApp {
|
||||||
// Placeholder for merge
|
// Placeholder for merge
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,8 +21,6 @@ package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlSeeAlso;
|
import javax.xml.bind.annotation.XmlSeeAlso;
|
||||||
|
@ -32,14 +30,13 @@ import com.google.common.base.Objects;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Represents vApp creation parameters.
|
||||||
* Represents vApp creation parameters.
|
* <p/>
|
||||||
*
|
* <p/>
|
||||||
*
|
|
||||||
* <p>Java class for VAppCreationParams complex type.
|
* <p>Java class for VAppCreationParams complex type.
|
||||||
*
|
* <p/>
|
||||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
*
|
* <p/>
|
||||||
* <pre>
|
* <pre>
|
||||||
* <complexType name="VAppCreationParams">
|
* <complexType name="VAppCreationParams">
|
||||||
* <complexContent>
|
* <complexContent>
|
||||||
|
@ -55,13 +52,10 @@ import com.google.common.base.Objects;
|
||||||
* </complexContent>
|
* </complexContent>
|
||||||
* </complexType>
|
* </complexType>
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
|
||||||
@XmlType(name = "VAppCreationParams", propOrder = {
|
@XmlType(name = "VAppCreationParams", propOrder = {
|
||||||
"vAppParent",
|
"vAppParent",
|
||||||
"instantiationParams"
|
"instantiationParams"
|
||||||
})
|
})
|
||||||
@XmlSeeAlso({
|
@XmlSeeAlso({
|
||||||
// InstantiateOvfParamsType.class,
|
// InstantiateOvfParamsType.class,
|
||||||
|
@ -70,7 +64,7 @@ import com.google.common.base.Objects;
|
||||||
// ImportVmAsVAppParamsType.class
|
// ImportVmAsVAppParamsType.class
|
||||||
})
|
})
|
||||||
public class VAppCreationParamsType<T extends VAppCreationParamsType<T>>
|
public class VAppCreationParamsType<T extends VAppCreationParamsType<T>>
|
||||||
extends ParamsType<T>
|
extends ParamsType<T>
|
||||||
|
|
||||||
{
|
{
|
||||||
public static <T extends VAppCreationParamsType<T>> Builder<T> builder() {
|
public static <T extends VAppCreationParamsType<T>> Builder<T> builder() {
|
||||||
|
@ -82,7 +76,7 @@ public class VAppCreationParamsType<T extends VAppCreationParamsType<T>>
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Builder<T extends VAppCreationParamsType<T>> extends ParamsType.Builder<T> {
|
public static class Builder<T extends VAppCreationParamsType<T>> extends ParamsType.Builder<T> {
|
||||||
|
|
||||||
protected Reference vAppParent;
|
protected Reference vAppParent;
|
||||||
protected InstantiationParams instantiationParams;
|
protected InstantiationParams instantiationParams;
|
||||||
protected Boolean deploy;
|
protected Boolean deploy;
|
||||||
|
@ -105,7 +99,7 @@ public class VAppCreationParamsType<T extends VAppCreationParamsType<T>>
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppCreationParamsType#getDeploy()
|
* @see VAppCreationParamsType#isDeploy()
|
||||||
*/
|
*/
|
||||||
public Builder<T> deploy(Boolean deploy) {
|
public Builder<T> deploy(Boolean deploy) {
|
||||||
this.deploy = deploy;
|
this.deploy = deploy;
|
||||||
|
@ -113,7 +107,7 @@ public class VAppCreationParamsType<T extends VAppCreationParamsType<T>>
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppCreationParamsType#getPowerOn()
|
* @see VAppCreationParamsType#isPowerOn()
|
||||||
*/
|
*/
|
||||||
public Builder<T> powerOn(Boolean powerOn) {
|
public Builder<T> powerOn(Boolean powerOn) {
|
||||||
this.powerOn = powerOn;
|
this.powerOn = powerOn;
|
||||||
|
@ -122,16 +116,9 @@ public class VAppCreationParamsType<T extends VAppCreationParamsType<T>>
|
||||||
|
|
||||||
|
|
||||||
public VAppCreationParamsType<T> build() {
|
public VAppCreationParamsType<T> build() {
|
||||||
VAppCreationParamsType<T> vAppCreationParams = new VAppCreationParamsType<T>();
|
return new VAppCreationParamsType<T>(description, name, vAppParent, instantiationParams,deploy, powerOn);
|
||||||
vAppCreationParams.setVAppParent(vAppParent);
|
|
||||||
vAppCreationParams.setInstantiationParams(instantiationParams);
|
|
||||||
vAppCreationParams.setDeploy(deploy);
|
|
||||||
vAppCreationParams.setPowerOn(powerOn);
|
|
||||||
vAppCreationParams.setDescription(description);
|
|
||||||
vAppCreationParams.setName(name);
|
|
||||||
return vAppCreationParams;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ParamsType#getDescription()
|
* @see ParamsType#getDescription()
|
||||||
*/
|
*/
|
||||||
|
@ -154,145 +141,99 @@ public class VAppCreationParamsType<T extends VAppCreationParamsType<T>>
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
public Builder<T> fromParamsType(ParamsType<T> in) {
|
public Builder<T> fromParamsType(ParamsType<T> in) {
|
||||||
return Builder.class.cast(super.fromParamsType(in));
|
return Builder.class.cast(super.fromParamsType(in));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder<T> fromVAppCreationParamsType(VAppCreationParamsType<T> in) {
|
public Builder<T> fromVAppCreationParamsType(VAppCreationParamsType<T> in) {
|
||||||
return fromParamsType(in)
|
return fromParamsType(in)
|
||||||
.vAppParent(in.getVAppParent())
|
.vAppParent(in.getVAppParent())
|
||||||
.instantiationParams(in.getInstantiationParams())
|
.instantiationParams(in.getInstantiationParams())
|
||||||
.deploy(in.isDeploy())
|
.deploy(in.isDeploy())
|
||||||
.powerOn(in.isPowerOn());
|
.powerOn(in.isPowerOn());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@XmlElement(name = "VAppParent")
|
||||||
|
protected Reference vAppParent;
|
||||||
|
@XmlElement(name = "InstantiationParams")
|
||||||
|
protected InstantiationParams instantiationParams;
|
||||||
|
@XmlAttribute
|
||||||
|
protected Boolean deploy;
|
||||||
|
@XmlAttribute
|
||||||
|
protected Boolean powerOn;
|
||||||
|
|
||||||
|
public VAppCreationParamsType(String description, String name, Reference vAppParent,
|
||||||
|
InstantiationParams instantiationParams, Boolean deploy, Boolean powerOn) {
|
||||||
|
super(description, name);
|
||||||
|
this.vAppParent = vAppParent;
|
||||||
|
this.instantiationParams = instantiationParams;
|
||||||
|
this.deploy = deploy;
|
||||||
|
this.powerOn = powerOn;
|
||||||
|
}
|
||||||
|
|
||||||
protected VAppCreationParamsType() {
|
protected VAppCreationParamsType() {
|
||||||
// For JAXB and builder use
|
// For JAXB and builder use
|
||||||
}
|
}
|
||||||
|
|
||||||
@XmlElement(name = "VAppParent")
|
/**
|
||||||
protected Reference vAppParent;
|
* Gets the value of the vAppParent property.
|
||||||
@XmlElement(name = "InstantiationParams")
|
*
|
||||||
protected InstantiationParams instantiationParams;
|
* @return possible object is
|
||||||
@XmlAttribute
|
* {@link Reference }
|
||||||
protected Boolean deploy;
|
*/
|
||||||
@XmlAttribute
|
public Reference getVAppParent() {
|
||||||
protected Boolean powerOn;
|
return vAppParent;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the vAppParent property.
|
* Gets the value of the instantiationParams property.
|
||||||
*
|
*
|
||||||
* @return
|
* @return possible object is
|
||||||
* possible object is
|
* {@link InstantiationParams }
|
||||||
* {@link Reference }
|
*/
|
||||||
*
|
public InstantiationParams getInstantiationParams() {
|
||||||
*/
|
return instantiationParams;
|
||||||
public Reference getVAppParent() {
|
}
|
||||||
return vAppParent;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the value of the vAppParent property.
|
* Gets the value of the deploy property.
|
||||||
*
|
*
|
||||||
* @param value
|
* @return possible object is
|
||||||
* allowed object is
|
* {@link Boolean }
|
||||||
* {@link Reference }
|
*/
|
||||||
*
|
public Boolean isDeploy() {
|
||||||
*/
|
return deploy;
|
||||||
public void setVAppParent(Reference value) {
|
}
|
||||||
this.vAppParent = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the instantiationParams property.
|
* Gets the value of the powerOn property.
|
||||||
*
|
*
|
||||||
* @return
|
* @return possible object is
|
||||||
* possible object is
|
* {@link Boolean }
|
||||||
* {@link InstantiationParams }
|
*/
|
||||||
*
|
public Boolean isPowerOn() {
|
||||||
*/
|
return powerOn;
|
||||||
public InstantiationParams getInstantiationParams() {
|
}
|
||||||
return instantiationParams;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the instantiationParams property.
|
|
||||||
*
|
|
||||||
* @param value
|
|
||||||
* allowed object is
|
|
||||||
* {@link InstantiationParams }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setInstantiationParams(InstantiationParams value) {
|
|
||||||
this.instantiationParams = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the value of the deploy property.
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
* possible object is
|
|
||||||
* {@link Boolean }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public Boolean isDeploy() {
|
|
||||||
return deploy;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the deploy property.
|
|
||||||
*
|
|
||||||
* @param value
|
|
||||||
* allowed object is
|
|
||||||
* {@link Boolean }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setDeploy(Boolean value) {
|
|
||||||
this.deploy = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the value of the powerOn property.
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
* possible object is
|
|
||||||
* {@link Boolean }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public Boolean isPowerOn() {
|
|
||||||
return powerOn;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the powerOn property.
|
|
||||||
*
|
|
||||||
* @param value
|
|
||||||
* allowed object is
|
|
||||||
* {@link Boolean }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setPowerOn(Boolean value) {
|
|
||||||
this.powerOn = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
return true;
|
return true;
|
||||||
if (o == null || getClass() != o.getClass())
|
if (o == null || getClass() != o.getClass())
|
||||||
return false;
|
return false;
|
||||||
VAppCreationParamsType<?> that = VAppCreationParamsType.class.cast(o);
|
VAppCreationParamsType<?> that = VAppCreationParamsType.class.cast(o);
|
||||||
return equal(vAppParent, that.vAppParent) &&
|
return equal(vAppParent, that.vAppParent) &&
|
||||||
equal(instantiationParams, that.instantiationParams) &&
|
equal(instantiationParams, that.instantiationParams) &&
|
||||||
equal(deploy, that.deploy) &&
|
equal(deploy, that.deploy) &&
|
||||||
equal(powerOn, that.powerOn);
|
equal(powerOn, that.powerOn);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hashCode(vAppParent,
|
return Objects.hashCode(vAppParent,
|
||||||
instantiationParams,
|
instantiationParams,
|
||||||
deploy,
|
deploy,
|
||||||
powerOn);
|
powerOn);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -24,9 +24,6 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlType;
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
@ -36,14 +33,13 @@ import com.google.common.collect.Sets;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Represents a VApp network configuration.
|
||||||
* Represents a VApp network configuration.
|
* <p/>
|
||||||
*
|
* <p/>
|
||||||
*
|
|
||||||
* <p>Java class for VAppNetworkConfiguration complex type.
|
* <p>Java class for VAppNetworkConfiguration complex type.
|
||||||
*
|
* <p/>
|
||||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
*
|
* <p/>
|
||||||
* <pre>
|
* <pre>
|
||||||
* <complexType name="VAppNetworkConfiguration">
|
* <complexType name="VAppNetworkConfiguration">
|
||||||
* <complexContent>
|
* <complexContent>
|
||||||
|
@ -59,29 +55,24 @@ import com.google.common.collect.Sets;
|
||||||
* </complexContent>
|
* </complexContent>
|
||||||
* </complexType>
|
* </complexType>
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
|
||||||
@XmlType(name = "VAppNetworkConfiguration", propOrder = {
|
@XmlType(name = "VAppNetworkConfiguration", propOrder = {
|
||||||
"description",
|
"description",
|
||||||
"configuration",
|
"configuration",
|
||||||
"isDeployed"
|
"isDeployed"
|
||||||
})
|
})
|
||||||
public class VAppNetworkConfiguration<T extends VAppNetworkConfiguration<T>>
|
public class VAppNetworkConfiguration<T extends VAppNetworkConfiguration<T>> extends ResourceType<T> {
|
||||||
extends ResourceType<T>
|
|
||||||
|
|
||||||
{
|
|
||||||
public static <T extends VAppNetworkConfiguration<T>> Builder<T> builder() {
|
public static <T extends VAppNetworkConfiguration<T>> Builder<T> builder() {
|
||||||
return new Builder<T>();
|
return new Builder<T>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Builder<T> toBuilder() {
|
public Builder<T> toBuilder() {
|
||||||
return new Builder<T>().fromVAppNetworkConfiguration(this);
|
return new Builder<T>().fromVAppNetworkConfiguration(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Builder<T extends VAppNetworkConfiguration<T>> extends ResourceType.Builder<T> {
|
public static class Builder<T extends VAppNetworkConfiguration<T>> extends ResourceType.Builder<T> {
|
||||||
|
|
||||||
private String description;
|
private String description;
|
||||||
private NetworkConfiguration configuration;
|
private NetworkConfiguration configuration;
|
||||||
private Boolean isDeployed;
|
private Boolean isDeployed;
|
||||||
|
@ -104,7 +95,7 @@ public class VAppNetworkConfiguration<T extends VAppNetworkConfiguration<T>>
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppNetworkConfiguration#getIsDeployed()
|
* @see VAppNetworkConfiguration#isDeployed()
|
||||||
*/
|
*/
|
||||||
public Builder<T> isDeployed(Boolean isDeployed) {
|
public Builder<T> isDeployed(Boolean isDeployed) {
|
||||||
this.isDeployed = isDeployed;
|
this.isDeployed = isDeployed;
|
||||||
|
@ -121,15 +112,11 @@ public class VAppNetworkConfiguration<T extends VAppNetworkConfiguration<T>>
|
||||||
|
|
||||||
|
|
||||||
public VAppNetworkConfiguration<T> build() {
|
public VAppNetworkConfiguration<T> build() {
|
||||||
VAppNetworkConfiguration<T> vAppNetworkConfiguration = new VAppNetworkConfiguration<T>();
|
return new VAppNetworkConfiguration<T>(href, type, links,
|
||||||
vAppNetworkConfiguration.setDescription(description);
|
description, configuration, isDeployed, networkName);
|
||||||
vAppNetworkConfiguration.setConfiguration(configuration);
|
|
||||||
vAppNetworkConfiguration.setIsDeployed(isDeployed);
|
|
||||||
vAppNetworkConfiguration.setNetworkName(networkName);
|
|
||||||
return vAppNetworkConfiguration;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ResourceType#getHref()
|
* @see ResourceType#getHref()
|
||||||
*/
|
*/
|
||||||
|
@ -171,147 +158,99 @@ public class VAppNetworkConfiguration<T extends VAppNetworkConfiguration<T>>
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public Builder<T> fromResourceType(ResourceType<T> in) {
|
public Builder<T> fromResourceType(ResourceType<T> in) {
|
||||||
return Builder.class.cast(super.fromResourceType(in));
|
return Builder.class.cast(super.fromResourceType(in));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder<T> fromVAppNetworkConfiguration(VAppNetworkConfiguration<T> in) {
|
public Builder<T> fromVAppNetworkConfiguration(VAppNetworkConfiguration<T> in) {
|
||||||
return fromResourceType(in)
|
return fromResourceType(in)
|
||||||
.description(in.getDescription())
|
.description(in.getDescription())
|
||||||
.configuration(in.getConfiguration())
|
.configuration(in.getConfiguration())
|
||||||
.isDeployed(in.isDeployed())
|
.isDeployed(in.isDeployed())
|
||||||
.networkName(in.getNetworkName());
|
.networkName(in.getNetworkName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@XmlElement(name = "Description")
|
||||||
|
protected String description;
|
||||||
|
@XmlElement(name = "Configuration", required = true)
|
||||||
|
protected NetworkConfiguration configuration;
|
||||||
|
@XmlElement(name = "IsDeployed")
|
||||||
|
protected Boolean isDeployed;
|
||||||
|
@XmlAttribute(required = true)
|
||||||
|
protected String networkName;
|
||||||
|
|
||||||
|
public VAppNetworkConfiguration(URI href, String type, Set<Link> links, String description,
|
||||||
|
NetworkConfiguration configuration, Boolean deployed, String networkName) {
|
||||||
|
super(href, type, links);
|
||||||
|
this.description = description;
|
||||||
|
this.configuration = configuration;
|
||||||
|
isDeployed = deployed;
|
||||||
|
this.networkName = networkName;
|
||||||
|
}
|
||||||
|
|
||||||
private VAppNetworkConfiguration() {
|
private VAppNetworkConfiguration() {
|
||||||
// For JAXB and builder use
|
// For JAXB
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the description property.
|
||||||
|
*
|
||||||
|
* @return possible object is
|
||||||
|
* {@link String }
|
||||||
|
*/
|
||||||
|
public String getDescription() {
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the configuration property.
|
||||||
|
*
|
||||||
|
* @return possible object is
|
||||||
|
* {@link NetworkConfiguration }
|
||||||
|
*/
|
||||||
|
public NetworkConfiguration getConfiguration() {
|
||||||
|
return configuration;
|
||||||
|
}
|
||||||
|
|
||||||
@XmlElement(name = "Description")
|
/**
|
||||||
protected String description;
|
* Gets the value of the isDeployed property.
|
||||||
@XmlElement(name = "Configuration", required = true)
|
*
|
||||||
protected NetworkConfiguration configuration;
|
* @return possible object is
|
||||||
@XmlElement(name = "IsDeployed")
|
* {@link Boolean }
|
||||||
protected Boolean isDeployed;
|
*/
|
||||||
@XmlAttribute(required = true)
|
public Boolean isDeployed() {
|
||||||
protected String networkName;
|
return isDeployed;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the description property.
|
* Gets the value of the networkName property.
|
||||||
*
|
*
|
||||||
* @return
|
* @return possible object is
|
||||||
* possible object is
|
* {@link String }
|
||||||
* {@link String }
|
*/
|
||||||
*
|
public String getNetworkName() {
|
||||||
*/
|
return networkName;
|
||||||
public String getDescription() {
|
}
|
||||||
return description;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the description property.
|
|
||||||
*
|
|
||||||
* @param value
|
|
||||||
* allowed object is
|
|
||||||
* {@link String }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setDescription(String value) {
|
|
||||||
this.description = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the value of the configuration property.
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
* possible object is
|
|
||||||
* {@link NetworkConfiguration }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public NetworkConfiguration getConfiguration() {
|
|
||||||
return configuration;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the configuration property.
|
|
||||||
*
|
|
||||||
* @param value
|
|
||||||
* allowed object is
|
|
||||||
* {@link NetworkConfiguration }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setConfiguration(NetworkConfiguration value) {
|
|
||||||
this.configuration = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the value of the isDeployed property.
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
* possible object is
|
|
||||||
* {@link Boolean }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public Boolean isDeployed() {
|
|
||||||
return isDeployed;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the isDeployed property.
|
|
||||||
*
|
|
||||||
* @param value
|
|
||||||
* allowed object is
|
|
||||||
* {@link Boolean }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setIsDeployed(Boolean value) {
|
|
||||||
this.isDeployed = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the value of the networkName property.
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
* possible object is
|
|
||||||
* {@link String }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public String getNetworkName() {
|
|
||||||
return networkName;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the networkName property.
|
|
||||||
*
|
|
||||||
* @param value
|
|
||||||
* allowed object is
|
|
||||||
* {@link String }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setNetworkName(String value) {
|
|
||||||
this.networkName = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
return true;
|
return true;
|
||||||
if (o == null || getClass() != o.getClass())
|
if (o == null || getClass() != o.getClass())
|
||||||
return false;
|
return false;
|
||||||
VAppNetworkConfiguration<?> that = VAppNetworkConfiguration.class.cast(o);
|
VAppNetworkConfiguration<?> that = VAppNetworkConfiguration.class.cast(o);
|
||||||
return equal(description, that.description) &&
|
return equal(description, that.description) &&
|
||||||
equal(configuration, that.configuration) &&
|
equal(configuration, that.configuration) &&
|
||||||
equal(isDeployed, that.isDeployed) &&
|
equal(isDeployed, that.isDeployed) &&
|
||||||
equal(networkName, that.networkName);
|
equal(networkName, that.networkName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hashCode(description,
|
return Objects.hashCode(description,
|
||||||
configuration,
|
configuration,
|
||||||
isDeployed,
|
isDeployed,
|
||||||
networkName);
|
networkName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -20,20 +20,16 @@
|
||||||
package org.jclouds.vcloud.director.v1_5.domain;
|
package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlElementRef;
|
import javax.xml.bind.annotation.XmlElementRef;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
import javax.xml.bind.annotation.XmlType;
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
|
||||||
import org.jclouds.javax.annotation.Nullable;
|
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.ovf.DeploymentOptionSection;
|
import org.jclouds.vcloud.director.v1_5.domain.ovf.DeploymentOptionSection;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.ovf.DiskSection;
|
import org.jclouds.vcloud.director.v1_5.domain.ovf.DiskSection;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.ovf.NetworkSection;
|
import org.jclouds.vcloud.director.v1_5.domain.ovf.NetworkSection;
|
||||||
|
@ -42,6 +38,8 @@ import org.jclouds.vcloud.director.v1_5.domain.ovf.SectionType;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.ovf.VirtualHardwareSection;
|
import org.jclouds.vcloud.director.v1_5.domain.ovf.VirtualHardwareSection;
|
||||||
|
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
|
import com.google.common.collect.ImmutableSet;
|
||||||
|
import com.google.common.collect.Sets;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -70,7 +68,6 @@ import com.google.common.base.Objects;
|
||||||
* </complexType>
|
* </complexType>
|
||||||
* </pre>
|
* </pre>
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
|
||||||
@XmlRootElement(name = "VAppTemplate")
|
@XmlRootElement(name = "VAppTemplate")
|
||||||
@XmlType(propOrder = {
|
@XmlType(propOrder = {
|
||||||
"owner",
|
"owner",
|
||||||
|
@ -78,23 +75,20 @@ import com.google.common.base.Objects;
|
||||||
"sections",
|
"sections",
|
||||||
"vAppScopedLocalId"
|
"vAppScopedLocalId"
|
||||||
})
|
})
|
||||||
public class VAppTemplate
|
public class VAppTemplate extends ResourceEntityType<VAppTemplate> {
|
||||||
extends ResourceEntityType<VAppTemplate>
|
|
||||||
|
|
||||||
{
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public static Builder builder() {
|
public static Builder builder() {
|
||||||
return new Builder();
|
return new Builder();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Builder toBuilder() {
|
public Builder toBuilder() {
|
||||||
return new Builder().fromVAppTemplate(this);
|
return new Builder().fromVAppTemplate(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Builder extends ResourceEntityType.Builder<VAppTemplate> {
|
public static class Builder extends ResourceEntityType.Builder<VAppTemplate> {
|
||||||
private Owner owner;
|
private Owner owner;
|
||||||
private VAppTemplateChildren children;
|
private Set<VAppTemplate> children = Sets.newLinkedHashSet();
|
||||||
private List<SectionType> sections;
|
private Set<SectionType> sections = Sets.newLinkedHashSet();
|
||||||
private String vAppScopedLocalId;
|
private String vAppScopedLocalId;
|
||||||
private Boolean ovfDescriptorUploaded;
|
private Boolean ovfDescriptorUploaded;
|
||||||
private Boolean goldMaster;
|
private Boolean goldMaster;
|
||||||
|
@ -110,15 +104,15 @@ public class VAppTemplate
|
||||||
/**
|
/**
|
||||||
* @see VAppTemplate#getChildren()
|
* @see VAppTemplate#getChildren()
|
||||||
*/
|
*/
|
||||||
public Builder children(VAppTemplateChildren children) {
|
public Builder children(Set<VAppTemplate> children) {
|
||||||
this.children = children;
|
this.children = checkNotNull(children, "children");
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppTemplate#getSections()
|
* @see VAppTemplate#getSections()
|
||||||
*/
|
*/
|
||||||
public Builder sections(List<SectionType> sections) {
|
public Builder sections(Set<SectionType> sections) {
|
||||||
this.sections = sections;
|
this.sections = sections;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
@ -149,18 +143,9 @@ public class VAppTemplate
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public VAppTemplate build() {
|
public VAppTemplate build() {
|
||||||
VAppTemplate result = new VAppTemplate(href, name, owner, children, sections, vAppScopedLocalId, ovfDescriptorUploaded, goldMaster);
|
return new VAppTemplate(href, type, links, description, tasksInProgress, id, name, files, status, owner, children, sections, vAppScopedLocalId, ovfDescriptorUploaded, goldMaster);
|
||||||
result.setFiles(files);
|
|
||||||
result.setStatus(status);
|
|
||||||
result.setDescription(description);
|
|
||||||
result.setTasksInProgress(tasksInProgress);
|
|
||||||
result.setId(id);
|
|
||||||
result.setType(type);
|
|
||||||
result.setLinks(links);
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Builder fromResourceEntityType(ResourceEntityType<VAppTemplate> in) {
|
public Builder fromResourceEntityType(ResourceEntityType<VAppTemplate> in) {
|
||||||
return Builder.class.cast(super.fromResourceEntityType(in));
|
return Builder.class.cast(super.fromResourceEntityType(in));
|
||||||
|
@ -270,10 +255,10 @@ public class VAppTemplate
|
||||||
|
|
||||||
@XmlElementRef
|
@XmlElementRef
|
||||||
protected Owner owner;
|
protected Owner owner;
|
||||||
@XmlElement(name = "Children")
|
|
||||||
protected VAppTemplateChildren children;
|
|
||||||
@XmlElementRef
|
@XmlElementRef
|
||||||
protected List<SectionType> sections;
|
protected VAppTemplateChildren children = VAppTemplateChildren.builder().build();
|
||||||
|
@XmlElementRef
|
||||||
|
protected Set<SectionType> sections = Sets.newLinkedHashSet();
|
||||||
@XmlElement(name = "VAppScopedLocalId")
|
@XmlElement(name = "VAppScopedLocalId")
|
||||||
protected String vAppScopedLocalId;
|
protected String vAppScopedLocalId;
|
||||||
@XmlAttribute
|
@XmlAttribute
|
||||||
|
@ -281,20 +266,19 @@ public class VAppTemplate
|
||||||
@XmlAttribute
|
@XmlAttribute
|
||||||
protected Boolean goldMaster;
|
protected Boolean goldMaster;
|
||||||
|
|
||||||
private VAppTemplate(URI href, String name, @Nullable Owner owner, @Nullable VAppTemplateChildren children,
|
private VAppTemplate(URI href, String type, Set<Link> links, String description, TasksInProgress tasksInProgress,
|
||||||
List<SectionType> sections, @Nullable String vAppScopedLocalId,
|
String id, String name, FilesList files, Integer status, Owner owner, Set<VAppTemplate> children, Set<SectionType> sections, String vAppScopedLocalId, Boolean ovfDescriptorUploaded, Boolean goldMaster) {
|
||||||
@Nullable Boolean ovfDescriptorUploaded, @Nullable Boolean goldMaster) {
|
super(href, type, links, description, tasksInProgress, id, name, files, status);
|
||||||
super(href, name);
|
|
||||||
this.sections = sections;
|
|
||||||
this.owner = owner;
|
this.owner = owner;
|
||||||
this.children = children;
|
this.children = VAppTemplateChildren.builder().vms(children).build();
|
||||||
|
this.sections = ImmutableSet.copyOf(sections);
|
||||||
this.vAppScopedLocalId = vAppScopedLocalId;
|
this.vAppScopedLocalId = vAppScopedLocalId;
|
||||||
this.ovfDescriptorUploaded = ovfDescriptorUploaded;
|
this.ovfDescriptorUploaded = ovfDescriptorUploaded;
|
||||||
this.goldMaster = goldMaster;
|
this.goldMaster = goldMaster;
|
||||||
}
|
}
|
||||||
|
|
||||||
private VAppTemplate() {
|
private VAppTemplate() {
|
||||||
// For JAXB and builder use
|
// For JAXB
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -307,34 +291,14 @@ public class VAppTemplate
|
||||||
return owner;
|
return owner;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the owner property.
|
|
||||||
*
|
|
||||||
* @param value allowed object is
|
|
||||||
* {@link Owner }
|
|
||||||
*/
|
|
||||||
public void setOwner(Owner value) {
|
|
||||||
this.owner = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the children property.
|
* Gets the value of the children property.
|
||||||
*
|
*
|
||||||
* @return possible object is
|
* @return possible object is
|
||||||
* {@link VAppTemplateChildren }
|
* {@link VAppTemplateChildren }
|
||||||
*/
|
*/
|
||||||
public VAppTemplateChildren getChildren() {
|
public Set<VAppTemplate> getChildren() {
|
||||||
return children;
|
return children.getVms();
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the children property.
|
|
||||||
*
|
|
||||||
* @param value allowed object is
|
|
||||||
* {@link VAppTemplateChildren }
|
|
||||||
*/
|
|
||||||
public void setChildren(VAppTemplateChildren value) {
|
|
||||||
this.children = value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -375,10 +339,7 @@ public class VAppTemplate
|
||||||
* {@link JAXBElement }{@code <}{@link DiskSection }{@code >}
|
* {@link JAXBElement }{@code <}{@link DiskSection }{@code >}
|
||||||
* {@link JAXBElement }{@code <}{@link InstallSection }{@code >}
|
* {@link JAXBElement }{@code <}{@link InstallSection }{@code >}
|
||||||
*/
|
*/
|
||||||
public List<SectionType> getSections() {
|
public Set<SectionType> getSections() {
|
||||||
if (sections == null) {
|
|
||||||
sections = new ArrayList<SectionType>();
|
|
||||||
}
|
|
||||||
return this.sections;
|
return this.sections;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -392,16 +353,6 @@ public class VAppTemplate
|
||||||
return vAppScopedLocalId;
|
return vAppScopedLocalId;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the vAppScopedLocalId property.
|
|
||||||
*
|
|
||||||
* @param value allowed object is
|
|
||||||
* {@link String }
|
|
||||||
*/
|
|
||||||
public void setVAppScopedLocalId(String value) {
|
|
||||||
this.vAppScopedLocalId = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the ovfDescriptorUploaded property.
|
* Gets the value of the ovfDescriptorUploaded property.
|
||||||
*
|
*
|
||||||
|
@ -412,16 +363,6 @@ public class VAppTemplate
|
||||||
return ovfDescriptorUploaded;
|
return ovfDescriptorUploaded;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the ovfDescriptorUploaded property.
|
|
||||||
*
|
|
||||||
* @param value allowed object is
|
|
||||||
* {@link Boolean }
|
|
||||||
*/
|
|
||||||
public void setOvfDescriptorUploaded(Boolean value) {
|
|
||||||
this.ovfDescriptorUploaded = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the goldMaster property.
|
* Gets the value of the goldMaster property.
|
||||||
*
|
*
|
||||||
|
@ -436,16 +377,6 @@ public class VAppTemplate
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the goldMaster property.
|
|
||||||
*
|
|
||||||
* @param value allowed object is
|
|
||||||
* {@link Boolean }
|
|
||||||
*/
|
|
||||||
public void setGoldMaster(Boolean value) {
|
|
||||||
this.goldMaster = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
|
@ -453,7 +384,7 @@ public class VAppTemplate
|
||||||
if (o == null || getClass() != o.getClass())
|
if (o == null || getClass() != o.getClass())
|
||||||
return false;
|
return false;
|
||||||
VAppTemplate that = VAppTemplate.class.cast(o);
|
VAppTemplate that = VAppTemplate.class.cast(o);
|
||||||
return super.equals(that) &&
|
return super.equals(that) &&
|
||||||
equal(owner, that.owner) &&
|
equal(owner, that.owner) &&
|
||||||
equal(children, that.children) &&
|
equal(children, that.children) &&
|
||||||
equal(sections, that.sections) &&
|
equal(sections, that.sections) &&
|
||||||
|
|
|
@ -20,27 +20,26 @@
|
||||||
package org.jclouds.vcloud.director.v1_5.domain;
|
package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.Set;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
import javax.xml.bind.annotation.XmlType;
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
|
import com.google.common.collect.ImmutableSet;
|
||||||
|
import com.google.common.collect.Sets;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Represents vApp template children.
|
||||||
* Represents vApp template children.
|
* <p/>
|
||||||
*
|
* <p/>
|
||||||
*
|
|
||||||
* <p>Java class for VAppTemplateChildren complex type.
|
* <p>Java class for VAppTemplateChildren complex type.
|
||||||
*
|
* <p/>
|
||||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
*
|
* <p/>
|
||||||
* <pre>
|
* <pre>
|
||||||
* <complexType name="VAppTemplateChildren">
|
* <complexType name="VAppTemplateChildren">
|
||||||
* <complexContent>
|
* <complexContent>
|
||||||
|
@ -53,12 +52,10 @@ import com.google.common.base.Objects;
|
||||||
* </complexContent>
|
* </complexContent>
|
||||||
* </complexType>
|
* </complexType>
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
@XmlRootElement(name = "Children")
|
||||||
@XmlType(name = "VAppTemplateChildren", propOrder = {
|
@XmlType(propOrder = {
|
||||||
"vm"
|
"vms"
|
||||||
})
|
})
|
||||||
public class VAppTemplateChildren {
|
public class VAppTemplateChildren {
|
||||||
public static Builder builder() {
|
public static Builder builder() {
|
||||||
|
@ -70,89 +67,64 @@ public class VAppTemplateChildren {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Builder {
|
public static class Builder {
|
||||||
|
private Set<VAppTemplate> vms = Sets.newLinkedHashSet();
|
||||||
private List<VAppTemplate> vm;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppTemplateChildren#getVm()
|
* @see VAppTemplateChildren#getVms()
|
||||||
*/
|
*/
|
||||||
public Builder vm(List<VAppTemplate> vm) {
|
public Builder vms(Set<VAppTemplate> vms) {
|
||||||
this.vm = vm;
|
this.vms = checkNotNull(vms, "vms");
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public VAppTemplateChildren build() {
|
public VAppTemplateChildren build() {
|
||||||
VAppTemplateChildren vAppTemplateChildren = new VAppTemplateChildren(vm);
|
return new VAppTemplateChildren(vms);
|
||||||
return vAppTemplateChildren;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Builder fromVAppTemplateChildren(VAppTemplateChildren in) {
|
public Builder fromVAppTemplateChildren(VAppTemplateChildren in) {
|
||||||
return vm(in.getVm());
|
return vms(in.getVms());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private VAppTemplateChildren(Set<VAppTemplate> vm) {
|
||||||
|
this.vms = ImmutableSet.copyOf(vm);
|
||||||
|
}
|
||||||
|
|
||||||
private VAppTemplateChildren() {
|
private VAppTemplateChildren() {
|
||||||
// For JAXB and builder use
|
// For JAXB
|
||||||
}
|
}
|
||||||
|
|
||||||
private VAppTemplateChildren(List<VAppTemplate> vm) {
|
@XmlElement(name = "Vm")
|
||||||
this.vm = vm;
|
protected Set<VAppTemplate> vms = Sets.newLinkedHashSet();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the vm property.
|
||||||
|
*/
|
||||||
|
public Set<VAppTemplate> getVms() {
|
||||||
|
return this.vms;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@XmlElement(name = "Vm")
|
|
||||||
protected List<VAppTemplate> vm;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the value of the vm property.
|
|
||||||
*
|
|
||||||
* <p>
|
|
||||||
* 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 <CODE>set</CODE> method for the vm property.
|
|
||||||
*
|
|
||||||
* <p>
|
|
||||||
* For example, to add a new item, do as follows:
|
|
||||||
* <pre>
|
|
||||||
* getVm().add(newItem);
|
|
||||||
* </pre>
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* <p>
|
|
||||||
* Objects of the following type(s) are allowed in the list
|
|
||||||
* {@link VAppTemplate }
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public List<VAppTemplate> getVm() {
|
|
||||||
if (vm == null) {
|
|
||||||
vm = new ArrayList<VAppTemplate>();
|
|
||||||
}
|
|
||||||
return this.vm;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
return true;
|
return true;
|
||||||
if (o == null || getClass() != o.getClass())
|
if (o == null || getClass() != o.getClass())
|
||||||
return false;
|
return false;
|
||||||
VAppTemplateChildren that = VAppTemplateChildren.class.cast(o);
|
VAppTemplateChildren that = VAppTemplateChildren.class.cast(o);
|
||||||
return equal(vm, that.vm);
|
return equal(vms, that.vms);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hashCode(vm);
|
return Objects.hashCode(vms);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return Objects.toStringHelper("")
|
return Objects.toStringHelper("")
|
||||||
.add("vm", vm).toString();
|
.add("vms", vms).toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,9 +24,6 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
@ -38,14 +35,13 @@ import com.google.common.collect.Sets;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Represents a virtual data center (vDC).
|
||||||
* Represents a virtual data center (vDC).
|
* <p/>
|
||||||
*
|
* <p/>
|
||||||
*
|
|
||||||
* <p>Java class for Vdc complex type.
|
* <p>Java class for Vdc complex type.
|
||||||
*
|
* <p/>
|
||||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
*
|
* <p/>
|
||||||
* <pre>
|
* <pre>
|
||||||
* <complexType name="Vdc">
|
* <complexType name="Vdc">
|
||||||
* <complexContent>
|
* <complexContent>
|
||||||
|
@ -68,41 +64,38 @@ import com.google.common.collect.Sets;
|
||||||
* </complexContent>
|
* </complexContent>
|
||||||
* </complexType>
|
* </complexType>
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
|
||||||
@XmlRootElement(name = "Vdc")
|
@XmlRootElement(name = "Vdc")
|
||||||
@XmlType(propOrder = {
|
@XmlType(propOrder = {
|
||||||
"allocationModel",
|
"allocationModel",
|
||||||
"storageCapacity",
|
"storageCapacity",
|
||||||
"computeCapacity",
|
"computeCapacity",
|
||||||
"resourceEntities",
|
"resourceEntities",
|
||||||
"availableNetworks",
|
"availableNetworks",
|
||||||
"capabilities",
|
"capabilities",
|
||||||
"nicQuota",
|
"nicQuota",
|
||||||
"networkQuota",
|
"networkQuota",
|
||||||
"vmQuota",
|
"vmQuota",
|
||||||
"isEnabled"
|
"isEnabled"
|
||||||
})
|
})
|
||||||
@XmlSeeAlso({
|
@XmlSeeAlso({
|
||||||
// AdminVdc.class
|
// AdminVdc.class
|
||||||
})
|
})
|
||||||
public class Vdc
|
public class Vdc
|
||||||
extends EntityType<Vdc>
|
extends EntityType<Vdc>
|
||||||
|
|
||||||
{
|
{
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public static Builder builder() {
|
public static Builder builder() {
|
||||||
return new Builder();
|
return new Builder();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Builder toBuilder() {
|
public Builder toBuilder() {
|
||||||
return new Builder().fromVdc(this);
|
return new Builder().fromVdc(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Builder extends EntityType.Builder<Vdc> {
|
public static class Builder extends EntityType.Builder<Vdc> {
|
||||||
|
|
||||||
private String allocationModel;
|
private String allocationModel;
|
||||||
private CapacityWithUsage storageCapacity;
|
private CapacityWithUsage storageCapacity;
|
||||||
private ComputeCapacity computeCapacity;
|
private ComputeCapacity computeCapacity;
|
||||||
|
@ -203,23 +196,13 @@ public class Vdc
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Vdc build() {
|
public Vdc build() {
|
||||||
Vdc vdc = new Vdc();
|
return new Vdc(
|
||||||
vdc.setAllocationModel(allocationModel);
|
href, type, links, description, tasksInProgress, id, name, allocationModel, storageCapacity,
|
||||||
vdc.setStorageCapacity(storageCapacity);
|
computeCapacity, resourceEntities, availableNetworks, capabilities, nicQuota, networkQuota,
|
||||||
vdc.setComputeCapacity(computeCapacity);
|
vmQuota, isEnabled, status);
|
||||||
vdc.setResourceEntities(resourceEntities);
|
|
||||||
vdc.setAvailableNetworks(availableNetworks);
|
|
||||||
vdc.setCapabilities(capabilities);
|
|
||||||
vdc.setNicQuota(nicQuota);
|
|
||||||
vdc.setNetworkQuota(networkQuota);
|
|
||||||
vdc.setVmQuota(vmQuota);
|
|
||||||
vdc.setIsEnabled(isEnabled);
|
|
||||||
vdc.setStatus(status);
|
|
||||||
return vdc;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see EntityType#getName()
|
* @see EntityType#getName()
|
||||||
*/
|
*/
|
||||||
|
@ -293,333 +276,205 @@ public class Vdc
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Builder fromEntityType(EntityType<Vdc> in) {
|
public Builder fromEntityType(EntityType<Vdc> in) {
|
||||||
return Builder.class.cast(super.fromEntityType(in));
|
return Builder.class.cast(super.fromEntityType(in));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder fromVdc(Vdc in) {
|
public Builder fromVdc(Vdc in) {
|
||||||
return fromEntityType(in)
|
return fromEntityType(in)
|
||||||
.allocationModel(in.getAllocationModel())
|
.allocationModel(in.getAllocationModel())
|
||||||
.storageCapacity(in.getStorageCapacity())
|
.storageCapacity(in.getStorageCapacity())
|
||||||
.computeCapacity(in.getComputeCapacity())
|
.computeCapacity(in.getComputeCapacity())
|
||||||
.resourceEntities(in.getResourceEntities())
|
.resourceEntities(in.getResourceEntities())
|
||||||
.availableNetworks(in.getAvailableNetworks())
|
.availableNetworks(in.getAvailableNetworks())
|
||||||
.capabilities(in.getCapabilities())
|
.capabilities(in.getCapabilities())
|
||||||
.nicQuota(in.getNicQuota())
|
.nicQuota(in.getNicQuota())
|
||||||
.networkQuota(in.getNetworkQuota())
|
.networkQuota(in.getNetworkQuota())
|
||||||
.vmQuota(in.getVmQuota())
|
.vmQuota(in.getVmQuota())
|
||||||
.isEnabled(in.isEnabled())
|
.isEnabled(in.isEnabled())
|
||||||
.status(in.getStatus());
|
.status(in.getStatus());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Vdc(URI href, String type, Set<Link> links, String description, TasksInProgress tasksInProgress, String id, String name, String allocationModel, CapacityWithUsage storageCapacity, ComputeCapacity computeCapacity, ResourceEntities resourceEntities, AvailableNetworks availableNetworks, Capabilities capabilities, int nicQuota, int networkQuota, Integer vmQuota, Boolean enabled, Integer status) {
|
||||||
|
super(href, type, links, description, tasksInProgress, id, name);
|
||||||
|
this.allocationModel = allocationModel;
|
||||||
|
this.storageCapacity = storageCapacity;
|
||||||
|
this.computeCapacity = computeCapacity;
|
||||||
|
this.resourceEntities = resourceEntities;
|
||||||
|
this.availableNetworks = availableNetworks;
|
||||||
|
this.capabilities = capabilities;
|
||||||
|
this.nicQuota = nicQuota;
|
||||||
|
this.networkQuota = networkQuota;
|
||||||
|
this.vmQuota = vmQuota;
|
||||||
|
isEnabled = enabled;
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
private Vdc() {
|
private Vdc() {
|
||||||
// For JAXB and builder use
|
// For JAXB
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@XmlElement(name = "AllocationModel", required = true)
|
@XmlElement(name = "AllocationModel", required = true)
|
||||||
protected String allocationModel;
|
protected String allocationModel;
|
||||||
@XmlElement(name = "StorageCapacity", required = true)
|
@XmlElement(name = "StorageCapacity", required = true)
|
||||||
protected CapacityWithUsage storageCapacity;
|
protected CapacityWithUsage storageCapacity;
|
||||||
@XmlElement(name = "ComputeCapacity", required = true)
|
@XmlElement(name = "ComputeCapacity", required = true)
|
||||||
protected ComputeCapacity computeCapacity;
|
protected ComputeCapacity computeCapacity;
|
||||||
@XmlElement(name = "ResourceEntities")
|
@XmlElement(name = "ResourceEntities")
|
||||||
protected ResourceEntities resourceEntities;
|
protected ResourceEntities resourceEntities;
|
||||||
@XmlElement(name = "AvailableNetworks")
|
@XmlElement(name = "AvailableNetworks")
|
||||||
protected AvailableNetworks availableNetworks;
|
protected AvailableNetworks availableNetworks;
|
||||||
@XmlElement(name = "Capabilities")
|
@XmlElement(name = "Capabilities")
|
||||||
protected Capabilities capabilities;
|
protected Capabilities capabilities;
|
||||||
@XmlElement(name = "NicQuota")
|
@XmlElement(name = "NicQuota")
|
||||||
protected int nicQuota;
|
protected int nicQuota;
|
||||||
@XmlElement(name = "NetworkQuota")
|
@XmlElement(name = "NetworkQuota")
|
||||||
protected int networkQuota;
|
protected int networkQuota;
|
||||||
@XmlElement(name = "VmQuota")
|
@XmlElement(name = "VmQuota")
|
||||||
protected Integer vmQuota;
|
protected Integer vmQuota;
|
||||||
@XmlElement(name = "IsEnabled")
|
@XmlElement(name = "IsEnabled")
|
||||||
protected Boolean isEnabled;
|
protected Boolean isEnabled;
|
||||||
@XmlAttribute
|
@XmlAttribute
|
||||||
protected Integer status;
|
protected Integer status;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the allocationModel property.
|
* Gets the value of the allocationModel property.
|
||||||
*
|
*
|
||||||
* @return
|
* @return possible object is
|
||||||
* possible object is
|
* {@link String }
|
||||||
* {@link String }
|
*/
|
||||||
*
|
public String getAllocationModel() {
|
||||||
*/
|
return allocationModel;
|
||||||
public String getAllocationModel() {
|
}
|
||||||
return allocationModel;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the value of the allocationModel property.
|
* Gets the value of the storageCapacity property.
|
||||||
*
|
*
|
||||||
* @param value
|
* @return possible object is
|
||||||
* allowed object is
|
* {@link CapacityWithUsage }
|
||||||
* {@link String }
|
*/
|
||||||
*
|
public CapacityWithUsage getStorageCapacity() {
|
||||||
*/
|
return storageCapacity;
|
||||||
public void setAllocationModel(String value) {
|
}
|
||||||
this.allocationModel = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the storageCapacity property.
|
* Gets the value of the computeCapacity property.
|
||||||
*
|
*
|
||||||
* @return
|
* @return possible object is
|
||||||
* possible object is
|
* {@link ComputeCapacity }
|
||||||
* {@link CapacityWithUsage }
|
*/
|
||||||
*
|
public ComputeCapacity getComputeCapacity() {
|
||||||
*/
|
return computeCapacity;
|
||||||
public CapacityWithUsage getStorageCapacity() {
|
}
|
||||||
return storageCapacity;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the value of the storageCapacity property.
|
* Gets the value of the resourceEntities property.
|
||||||
*
|
*
|
||||||
* @param value
|
* @return possible object is
|
||||||
* allowed object is
|
* {@link ResourceEntities }
|
||||||
* {@link CapacityWithUsage }
|
*/
|
||||||
*
|
public ResourceEntities getResourceEntities() {
|
||||||
*/
|
return resourceEntities;
|
||||||
public void setStorageCapacity(CapacityWithUsage value) {
|
}
|
||||||
this.storageCapacity = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the computeCapacity property.
|
* Gets the value of the availableNetworks property.
|
||||||
*
|
*
|
||||||
* @return
|
* @return possible object is
|
||||||
* possible object is
|
* {@link AvailableNetworks }
|
||||||
* {@link ComputeCapacity }
|
*/
|
||||||
*
|
public AvailableNetworks getAvailableNetworks() {
|
||||||
*/
|
return availableNetworks;
|
||||||
public ComputeCapacity getComputeCapacity() {
|
}
|
||||||
return computeCapacity;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the value of the computeCapacity property.
|
* Gets the value of the capabilities property.
|
||||||
*
|
*
|
||||||
* @param value
|
* @return possible object is
|
||||||
* allowed object is
|
* {@link Capabilities }
|
||||||
* {@link ComputeCapacity }
|
*/
|
||||||
*
|
public Capabilities getCapabilities() {
|
||||||
*/
|
return capabilities;
|
||||||
public void setComputeCapacity(ComputeCapacity value) {
|
}
|
||||||
this.computeCapacity = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the resourceEntities property.
|
* Gets the value of the nicQuota property.
|
||||||
*
|
*/
|
||||||
* @return
|
public int getNicQuota() {
|
||||||
* possible object is
|
return nicQuota;
|
||||||
* {@link ResourceEntities }
|
}
|
||||||
*
|
|
||||||
*/
|
|
||||||
public ResourceEntities getResourceEntities() {
|
|
||||||
return resourceEntities;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the value of the resourceEntities property.
|
* Gets the value of the networkQuota property.
|
||||||
*
|
*/
|
||||||
* @param value
|
public int getNetworkQuota() {
|
||||||
* allowed object is
|
return networkQuota;
|
||||||
* {@link ResourceEntities }
|
}
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setResourceEntities(ResourceEntities value) {
|
|
||||||
this.resourceEntities = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the availableNetworks property.
|
* Gets the value of the vmQuota property.
|
||||||
*
|
*
|
||||||
* @return
|
* @return possible object is
|
||||||
* possible object is
|
* {@link Integer }
|
||||||
* {@link AvailableNetworks }
|
*/
|
||||||
*
|
public Integer getVmQuota() {
|
||||||
*/
|
return vmQuota;
|
||||||
public AvailableNetworks getAvailableNetworks() {
|
}
|
||||||
return availableNetworks;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the value of the availableNetworks property.
|
* Gets the value of the isEnabled property.
|
||||||
*
|
*
|
||||||
* @param value
|
* @return possible object is
|
||||||
* allowed object is
|
* {@link Boolean }
|
||||||
* {@link AvailableNetworks }
|
*/
|
||||||
*
|
public Boolean isEnabled() {
|
||||||
*/
|
return isEnabled;
|
||||||
public void setAvailableNetworks(AvailableNetworks value) {
|
}
|
||||||
this.availableNetworks = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the capabilities property.
|
* Gets the value of the status property.
|
||||||
*
|
*
|
||||||
* @return
|
* @return possible object is
|
||||||
* possible object is
|
* {@link Integer }
|
||||||
* {@link Capabilities }
|
*/
|
||||||
*
|
public Integer getStatus() {
|
||||||
*/
|
return status;
|
||||||
public Capabilities getCapabilities() {
|
}
|
||||||
return capabilities;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the capabilities property.
|
|
||||||
*
|
|
||||||
* @param value
|
|
||||||
* allowed object is
|
|
||||||
* {@link Capabilities }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setCapabilities(Capabilities value) {
|
|
||||||
this.capabilities = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the value of the nicQuota property.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public int getNicQuota() {
|
|
||||||
return nicQuota;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the nicQuota property.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setNicQuota(int value) {
|
|
||||||
this.nicQuota = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the value of the networkQuota property.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public int getNetworkQuota() {
|
|
||||||
return networkQuota;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the networkQuota property.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setNetworkQuota(int value) {
|
|
||||||
this.networkQuota = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the value of the vmQuota property.
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
* possible object is
|
|
||||||
* {@link Integer }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public Integer getVmQuota() {
|
|
||||||
return vmQuota;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the vmQuota property.
|
|
||||||
*
|
|
||||||
* @param value
|
|
||||||
* allowed object is
|
|
||||||
* {@link Integer }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setVmQuota(Integer value) {
|
|
||||||
this.vmQuota = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the value of the isEnabled property.
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
* possible object is
|
|
||||||
* {@link Boolean }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public Boolean isEnabled() {
|
|
||||||
return isEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the isEnabled property.
|
|
||||||
*
|
|
||||||
* @param value
|
|
||||||
* allowed object is
|
|
||||||
* {@link Boolean }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setIsEnabled(Boolean value) {
|
|
||||||
this.isEnabled = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the value of the status property.
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
* possible object is
|
|
||||||
* {@link Integer }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public Integer getStatus() {
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the status property.
|
|
||||||
*
|
|
||||||
* @param value
|
|
||||||
* allowed object is
|
|
||||||
* {@link Integer }
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setStatus(Integer value) {
|
|
||||||
this.status = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
return true;
|
return true;
|
||||||
if (o == null || getClass() != o.getClass())
|
if (o == null || getClass() != o.getClass())
|
||||||
return false;
|
return false;
|
||||||
Vdc that = Vdc.class.cast(o);
|
Vdc that = Vdc.class.cast(o);
|
||||||
return equal(allocationModel, that.allocationModel) &&
|
return equal(allocationModel, that.allocationModel) &&
|
||||||
equal(storageCapacity, that.storageCapacity) &&
|
equal(storageCapacity, that.storageCapacity) &&
|
||||||
equal(computeCapacity, that.computeCapacity) &&
|
equal(computeCapacity, that.computeCapacity) &&
|
||||||
equal(resourceEntities, that.resourceEntities) &&
|
equal(resourceEntities, that.resourceEntities) &&
|
||||||
equal(availableNetworks, that.availableNetworks) &&
|
equal(availableNetworks, that.availableNetworks) &&
|
||||||
equal(capabilities, that.capabilities) &&
|
equal(capabilities, that.capabilities) &&
|
||||||
equal(nicQuota, that.nicQuota) &&
|
equal(nicQuota, that.nicQuota) &&
|
||||||
equal(networkQuota, that.networkQuota) &&
|
equal(networkQuota, that.networkQuota) &&
|
||||||
equal(vmQuota, that.vmQuota) &&
|
equal(vmQuota, that.vmQuota) &&
|
||||||
equal(isEnabled, that.isEnabled) &&
|
equal(isEnabled, that.isEnabled) &&
|
||||||
equal(status, that.status);
|
equal(status, that.status);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hashCode(allocationModel,
|
return Objects.hashCode(allocationModel,
|
||||||
storageCapacity,
|
storageCapacity,
|
||||||
computeCapacity,
|
computeCapacity,
|
||||||
resourceEntities,
|
resourceEntities,
|
||||||
availableNetworks,
|
availableNetworks,
|
||||||
capabilities,
|
capabilities,
|
||||||
nicQuota,
|
nicQuota,
|
||||||
networkQuota,
|
networkQuota,
|
||||||
vmQuota,
|
vmQuota,
|
||||||
isEnabled,
|
isEnabled,
|
||||||
status);
|
status);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -20,11 +20,8 @@ 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_OVF_NS;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
|
||||||
import javax.xml.bind.annotation.XmlType;
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
|
@ -33,7 +30,6 @@ import com.google.common.base.Objects;
|
||||||
* @author Adrian Cole
|
* @author Adrian Cole
|
||||||
* @author Adam Lowe
|
* @author Adam Lowe
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
|
||||||
@XmlType(name = "Configuration", namespace = VCLOUD_OVF_NS, propOrder = {
|
@XmlType(name = "Configuration", namespace = VCLOUD_OVF_NS, propOrder = {
|
||||||
"label", "description"
|
"label", "description"
|
||||||
})
|
})
|
||||||
|
|
|
@ -19,14 +19,14 @@
|
||||||
package org.jclouds.vcloud.director.v1_5.domain.ovf;
|
package org.jclouds.vcloud.director.v1_5.domain.ovf;
|
||||||
|
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_OVF_NS;
|
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
import org.jclouds.javax.annotation.Nullable;
|
||||||
|
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
|
@ -41,8 +41,7 @@ import com.google.common.collect.Sets;
|
||||||
* @author Adrian Cole
|
* @author Adrian Cole
|
||||||
* @author Adam Lowe
|
* @author Adam Lowe
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
@XmlRootElement(name = "DeploymentOptionSection")
|
||||||
@XmlRootElement(name = "DeploymentOptionSection", namespace = VCLOUD_OVF_NS)
|
|
||||||
public class DeploymentOptionSection extends SectionType<DeploymentOptionSection> {
|
public class DeploymentOptionSection extends SectionType<DeploymentOptionSection> {
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
|
@ -82,7 +81,7 @@ public class DeploymentOptionSection extends SectionType<DeploymentOptionSection
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public DeploymentOptionSection build() {
|
public DeploymentOptionSection build() {
|
||||||
return new DeploymentOptionSection(info, configurations);
|
return new DeploymentOptionSection(info, required, configurations);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder fromDeploymentOptionSection(DeploymentOptionSection in) {
|
public Builder fromDeploymentOptionSection(DeploymentOptionSection in) {
|
||||||
|
@ -105,21 +104,32 @@ public class DeploymentOptionSection extends SectionType<DeploymentOptionSection
|
||||||
return Builder.class.cast(super.info(info));
|
return Builder.class.cast(super.info(info));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Builder required(Boolean required) {
|
||||||
|
return Builder.class.cast(super.required(required));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@XmlElement(name = "Configuration")
|
@XmlElement(name = "Configuration")
|
||||||
protected Set<Configuration> configurations;
|
protected Set<Configuration> configurations;
|
||||||
|
|
||||||
private DeploymentOptionSection(String info, Iterable<Configuration> configurations) {
|
private DeploymentOptionSection(@Nullable String info, @Nullable Boolean required, Iterable<Configuration> configurations) {
|
||||||
super(info);
|
super(info, required);
|
||||||
this.configurations = ImmutableSet.<Configuration>copyOf(checkNotNull(configurations, "configurations"));
|
this.configurations = ImmutableSet.copyOf(configurations);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private DeploymentOptionSection() {
|
private DeploymentOptionSection() {
|
||||||
// For JAXB
|
// For JAXB
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Set<Configuration> getConfigurations() {
|
||||||
|
return Collections.unmodifiableSet(configurations);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hashCode(super.hashCode(), configurations);
|
return Objects.hashCode(super.hashCode(), configurations);
|
||||||
|
@ -139,9 +149,4 @@ public class DeploymentOptionSection extends SectionType<DeploymentOptionSection
|
||||||
protected Objects.ToStringHelper string() {
|
protected Objects.ToStringHelper string() {
|
||||||
return super.string().add("configurations", configurations);
|
return super.string().add("configurations", configurations);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Set<Configuration> getConfigurations() {
|
|
||||||
return configurations;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -18,19 +18,15 @@
|
||||||
*/
|
*/
|
||||||
package org.jclouds.vcloud.director.v1_5.domain.ovf;
|
package org.jclouds.vcloud.director.v1_5.domain.ovf;
|
||||||
|
|
||||||
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_OVF_NS;
|
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlType;
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Adrian Cole
|
* @author Adrian Cole
|
||||||
* @author Adam Lowe
|
* @author Adam Lowe
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
@XmlRootElement(name = "Disk")
|
||||||
@XmlType(name = "Disk", namespace = VCLOUD_OVF_NS)
|
|
||||||
public class Disk implements Comparable<Disk>{
|
public class Disk implements Comparable<Disk>{
|
||||||
public static Builder builder() {
|
public static Builder builder() {
|
||||||
return new Builder();
|
return new Builder();
|
||||||
|
|
|
@ -22,12 +22,12 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_OVF_NS;
|
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_OVF_NS;
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
import javax.xml.bind.annotation.XmlElementRef;
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
import javax.xml.bind.annotation.XmlType;
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
|
||||||
|
import org.jclouds.javax.annotation.Nullable;
|
||||||
|
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
|
@ -40,7 +40,6 @@ import com.google.common.collect.Sets;
|
||||||
* @author Adrian Cole
|
* @author Adrian Cole
|
||||||
* @author Adam Lowe
|
* @author Adam Lowe
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
|
||||||
@XmlRootElement(name = "DiskSection", namespace = VCLOUD_OVF_NS)
|
@XmlRootElement(name = "DiskSection", namespace = VCLOUD_OVF_NS)
|
||||||
@XmlType(propOrder = {
|
@XmlType(propOrder = {
|
||||||
"disks"
|
"disks"
|
||||||
|
@ -84,7 +83,7 @@ public class DiskSection extends SectionType<DiskSection> {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public DiskSection build() {
|
public DiskSection build() {
|
||||||
return new DiskSection(info, disks);
|
return new DiskSection(info, required, disks);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder fromDiskSection(DiskSection in) {
|
public Builder fromDiskSection(DiskSection in) {
|
||||||
|
@ -107,12 +106,21 @@ public class DiskSection extends SectionType<DiskSection> {
|
||||||
return Builder.class.cast(super.info(info));
|
return Builder.class.cast(super.info(info));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Builder required(Boolean required) {
|
||||||
|
return Builder.class.cast(super.required(required));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@XmlElementRef
|
||||||
private Set<Disk> disks;
|
private Set<Disk> disks;
|
||||||
|
|
||||||
private DiskSection(String info, Iterable<Disk> disks) {
|
private DiskSection(@Nullable String info, @Nullable Boolean required, Iterable<Disk> disks) {
|
||||||
super(info);
|
super(info, required);
|
||||||
this.disks = ImmutableSet.<Disk>copyOf(checkNotNull(disks, "disks"));
|
this.disks = ImmutableSet.<Disk>copyOf(checkNotNull(disks, "disks"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,12 +20,9 @@ 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_OVF_NS;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.ovf.internal.BaseEnvelope;
|
import org.jclouds.vcloud.director.v1_5.domain.ovf.internal.BaseEnvelope;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.ovf.VirtualSystem;
|
|
||||||
|
|
||||||
import com.google.common.collect.Multimap;
|
import com.google.common.collect.Multimap;
|
||||||
|
|
||||||
|
@ -33,7 +30,6 @@ import com.google.common.collect.Multimap;
|
||||||
* @author Adrian Cole
|
* @author Adrian Cole
|
||||||
* @author Adam Lowe
|
* @author Adam Lowe
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
|
||||||
@XmlRootElement(name = "Envelope", namespace = VCLOUD_OVF_NS)
|
@XmlRootElement(name = "Envelope", namespace = VCLOUD_OVF_NS)
|
||||||
public class Envelope extends BaseEnvelope<VirtualSystem, Envelope> {
|
public class Envelope extends BaseEnvelope<VirtualSystem, Envelope> {
|
||||||
|
|
||||||
|
|
|
@ -19,18 +19,13 @@
|
||||||
package org.jclouds.vcloud.director.v1_5.domain.ovf;
|
package org.jclouds.vcloud.director.v1_5.domain.ovf;
|
||||||
|
|
||||||
|
|
||||||
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_OVF_NS;
|
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Adrian Cole
|
* @author Adrian Cole
|
||||||
* @author Adam Lowe
|
* @author Adam Lowe
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
@XmlRootElement(name = "Network")
|
||||||
@XmlRootElement(name = "Network", namespace = VCLOUD_OVF_NS)
|
|
||||||
public class Network {
|
public class Network {
|
||||||
public static Builder builder() {
|
public static Builder builder() {
|
||||||
return new Builder();
|
return new Builder();
|
||||||
|
|
|
@ -19,14 +19,12 @@
|
||||||
package org.jclouds.vcloud.director.v1_5.domain.ovf;
|
package org.jclouds.vcloud.director.v1_5.domain.ovf;
|
||||||
|
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_OVF_NS;
|
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
import org.jclouds.javax.annotation.Nullable;
|
||||||
|
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
|
@ -37,8 +35,7 @@ import com.google.common.collect.Sets;
|
||||||
* @author Adrian Cole
|
* @author Adrian Cole
|
||||||
* @author Adam Lowe
|
* @author Adam Lowe
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
@XmlRootElement(name = "NetworkSection")
|
||||||
@XmlRootElement(name = "NetworkSection", namespace = VCLOUD_OVF_NS)
|
|
||||||
public class NetworkSection extends SectionType<NetworkSection> {
|
public class NetworkSection extends SectionType<NetworkSection> {
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
|
@ -78,7 +75,7 @@ public class NetworkSection extends SectionType<NetworkSection> {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public NetworkSection build() {
|
public NetworkSection build() {
|
||||||
return new NetworkSection(info, networks);
|
return new NetworkSection(info, required, networks);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder fromNetworkSection(NetworkSection in) {
|
public Builder fromNetworkSection(NetworkSection in) {
|
||||||
|
@ -101,12 +98,20 @@ public class NetworkSection extends SectionType<NetworkSection> {
|
||||||
return Builder.class.cast(super.info(info));
|
return Builder.class.cast(super.info(info));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Builder required(Boolean required) {
|
||||||
|
return Builder.class.cast(super.required(required));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Set<Network> networks;
|
private Set<Network> networks;
|
||||||
|
|
||||||
private NetworkSection(String info, Iterable<Network> networks) {
|
private NetworkSection(@Nullable String info, @Nullable Boolean required, Iterable<Network> networks) {
|
||||||
super(info);
|
super(info, required);
|
||||||
this.networks = ImmutableSet.<Network> copyOf(checkNotNull(networks, "networks"));
|
this.networks = ImmutableSet.<Network> copyOf(checkNotNull(networks, "networks"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,14 +18,11 @@
|
||||||
*/
|
*/
|
||||||
package org.jclouds.vcloud.director.v1_5.domain.ovf;
|
package org.jclouds.vcloud.director.v1_5.domain.ovf;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
import org.jclouds.javax.annotation.Nullable;
|
import org.jclouds.javax.annotation.Nullable;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.ovf.SectionType;
|
|
||||||
|
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
|
|
||||||
|
@ -35,7 +32,6 @@ import com.google.common.base.Objects;
|
||||||
* @author Adrian Cole
|
* @author Adrian Cole
|
||||||
* @author Adam Lowe
|
* @author Adam Lowe
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
|
||||||
@XmlRootElement(name = "VirtualHardwareSection")
|
@XmlRootElement(name = "VirtualHardwareSection")
|
||||||
public class OperatingSystemSection extends SectionType<OperatingSystemSection> {
|
public class OperatingSystemSection extends SectionType<OperatingSystemSection> {
|
||||||
|
|
||||||
|
@ -86,7 +82,7 @@ public class OperatingSystemSection extends SectionType<OperatingSystemSection>
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public OperatingSystemSection build() {
|
public OperatingSystemSection build() {
|
||||||
return new OperatingSystemSection(info, id, version, description);
|
return new OperatingSystemSection(info, required, id, version, description);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder fromOperatingSystemSection(OperatingSystemSection in) {
|
public Builder fromOperatingSystemSection(OperatingSystemSection in) {
|
||||||
|
@ -109,6 +105,13 @@ public class OperatingSystemSection extends SectionType<OperatingSystemSection>
|
||||||
return Builder.class.cast(super.info(info));
|
return Builder.class.cast(super.info(info));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Builder required(Boolean required) {
|
||||||
|
return Builder.class.cast(super.required(required));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@XmlAttribute
|
@XmlAttribute
|
||||||
|
@ -118,8 +121,8 @@ public class OperatingSystemSection extends SectionType<OperatingSystemSection>
|
||||||
@XmlElement
|
@XmlElement
|
||||||
protected String description;
|
protected String description;
|
||||||
|
|
||||||
public OperatingSystemSection(@Nullable String info, @Nullable Integer id, @Nullable String version, @Nullable String description) {
|
public OperatingSystemSection(@Nullable String info, @Nullable Boolean required, @Nullable Integer id, @Nullable String version, @Nullable String description) {
|
||||||
super(info);
|
super(info, required);
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.description = description;
|
this.description = description;
|
||||||
this.version = version;
|
this.version = version;
|
||||||
|
|
|
@ -22,10 +22,10 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_OVF_NS;
|
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_OVF_NS;
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
import org.jclouds.javax.annotation.Nullable;
|
||||||
|
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
|
@ -34,10 +34,11 @@ import com.google.common.collect.Sets;
|
||||||
* The ProductSection element specifies product-information for an appliance, such as product name,
|
* The ProductSection element specifies product-information for an appliance, such as product name,
|
||||||
* version, and vendor.
|
* version, and vendor.
|
||||||
*
|
*
|
||||||
|
* TODO this should contain a multitude of other elements!
|
||||||
|
*
|
||||||
* @author Adrian Cole
|
* @author Adrian Cole
|
||||||
* @author Adam Lowe
|
* @author Adam Lowe
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
|
||||||
@XmlRootElement(name = "ProductSection", namespace = VCLOUD_OVF_NS)
|
@XmlRootElement(name = "ProductSection", namespace = VCLOUD_OVF_NS)
|
||||||
public class ProductSection extends SectionType<ProductSection> {
|
public class ProductSection extends SectionType<ProductSection> {
|
||||||
|
|
||||||
|
@ -78,7 +79,7 @@ public class ProductSection extends SectionType<ProductSection> {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public ProductSection build() {
|
public ProductSection build() {
|
||||||
return new ProductSection(info, properties);
|
return new ProductSection(info, required, properties);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder fromDeploymentOptionSection(ProductSection in) {
|
public Builder fromDeploymentOptionSection(ProductSection in) {
|
||||||
|
@ -100,13 +101,22 @@ public class ProductSection extends SectionType<ProductSection> {
|
||||||
public Builder info(String info) {
|
public Builder info(String info) {
|
||||||
return Builder.class.cast(super.info(info));
|
return Builder.class.cast(super.info(info));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Builder required(Boolean required) {
|
||||||
|
return Builder.class.cast(super.required(required));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Set<org.jclouds.vcloud.director.v1_5.domain.ovf.Property> properties;
|
|
||||||
|
private Set<org.jclouds.vcloud.director.v1_5.domain.ovf.Property> properties;
|
||||||
|
|
||||||
private ProductSection(String info, Iterable<org.jclouds.vcloud.director.v1_5.domain.ovf.Property> properties) {
|
private ProductSection(@Nullable String info, @Nullable Boolean required, Set<Property> properties) {
|
||||||
super(info);
|
super(info, required);
|
||||||
this.properties = ImmutableSet.<org.jclouds.vcloud.director.v1_5.domain.ovf.Property> copyOf(checkNotNull(properties, "properties"));
|
this.properties = ImmutableSet.copyOf(checkNotNull(properties, "properties"));
|
||||||
}
|
}
|
||||||
|
|
||||||
private ProductSection() {
|
private ProductSection() {
|
||||||
|
|
|
@ -20,16 +20,12 @@ 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_OVF_NS;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
|
||||||
import javax.xml.bind.annotation.XmlType;
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Adrian Cole
|
* @author Adrian Cole
|
||||||
* @author Adam Lowe
|
* @author Adam Lowe
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
|
||||||
@XmlType(name = "Property", namespace = VCLOUD_OVF_NS)
|
@XmlType(name = "Property", namespace = VCLOUD_OVF_NS)
|
||||||
public class Property {
|
public class Property {
|
||||||
public static Builder builder() {
|
public static Builder builder() {
|
||||||
|
|
|
@ -20,6 +20,7 @@ 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_OVF_NS;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlSeeAlso;
|
import javax.xml.bind.annotation.XmlSeeAlso;
|
||||||
|
|
||||||
|
@ -44,48 +45,59 @@ import com.google.common.base.Objects;
|
||||||
|
|
||||||
// TODO why do I have to declare these?
|
// TODO why do I have to declare these?
|
||||||
@XmlSeeAlso(
|
@XmlSeeAlso(
|
||||||
{CustomizationSection.class,
|
{CustomizationSection.class,
|
||||||
DeploymentOptionSection.class,
|
DeploymentOptionSection.class,
|
||||||
DiskSection.class,
|
DiskSection.class,
|
||||||
LeaseSettingsSection.class,
|
LeaseSettingsSection.class,
|
||||||
GuestCustomizationSection.class,
|
GuestCustomizationSection.class,
|
||||||
NetworkSection.class,
|
NetworkSection.class,
|
||||||
NetworkConfigSection.class,
|
NetworkConfigSection.class,
|
||||||
NetworkConnectionSection.class,
|
NetworkConnectionSection.class,
|
||||||
ProductSection.class,
|
ProductSection.class,
|
||||||
VirtualHardwareSection.class,
|
VirtualHardwareSection.class,
|
||||||
VirtualSystem.class })
|
VirtualSystem.class})
|
||||||
public abstract class SectionType<T extends SectionType<T>> {
|
public abstract class SectionType<T extends SectionType<T>> {
|
||||||
|
|
||||||
public abstract Builder<T> toBuilder();
|
public abstract Builder<T> toBuilder();
|
||||||
|
|
||||||
public static abstract class Builder<T extends SectionType<T>> {
|
public static abstract class Builder<T extends SectionType<T>> {
|
||||||
protected String info;
|
protected String info;
|
||||||
|
protected Boolean required;
|
||||||
|
|
||||||
public abstract SectionType<T> build();
|
public abstract SectionType<T> build();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see SectionType#getInfo
|
* @see SectionType#getInfo()
|
||||||
*/
|
*/
|
||||||
public Builder<T> info(String info) {
|
public Builder<T> info(String info) {
|
||||||
this.info = info;
|
this.info = info;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* @see SectionType#isRequired()
|
||||||
|
*/
|
||||||
|
public Builder<T> required(Boolean required) {
|
||||||
|
this.required = required;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public Builder<T> fromSection(SectionType<T> in) {
|
public Builder<T> fromSection(SectionType<T> in) {
|
||||||
return info(in.getInfo());
|
return info(in.getInfo()).required(in.isRequired());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@XmlElement(name = "Info", namespace = VCLOUD_OVF_NS)
|
@XmlElement(name = "Info")
|
||||||
protected String info;
|
private String info;
|
||||||
|
@XmlAttribute(namespace = VCLOUD_OVF_NS)
|
||||||
|
private boolean required;
|
||||||
|
|
||||||
public SectionType(@Nullable String info) {
|
protected SectionType(@Nullable String info, @Nullable Boolean required) {
|
||||||
this.info = info;
|
this.info = info;
|
||||||
|
this.required = required;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected SectionType() {
|
protected SectionType() {
|
||||||
// For Builders and JAXB
|
// For JAXB
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -98,9 +110,13 @@ public abstract class SectionType<T extends SectionType<T>> {
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Boolean isRequired() {
|
||||||
|
return required;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hashCode(info);
|
return Objects.hashCode(info, required);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -112,7 +128,7 @@ public abstract class SectionType<T extends SectionType<T>> {
|
||||||
if (getClass() != obj.getClass())
|
if (getClass() != obj.getClass())
|
||||||
return false;
|
return false;
|
||||||
SectionType<?> other = (SectionType<?>) obj;
|
SectionType<?> other = (SectionType<?>) obj;
|
||||||
return Objects.equal(info, other.info);
|
return Objects.equal(info, other.info) && Objects.equal(required, other.required);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -121,7 +137,7 @@ public abstract class SectionType<T extends SectionType<T>> {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Objects.ToStringHelper string() {
|
protected Objects.ToStringHelper string() {
|
||||||
return Objects.toStringHelper("").add("info", info);
|
return Objects.toStringHelper("").add("info", info).add("required", required);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -22,10 +22,9 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_OVF_NS;
|
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_OVF_NS;
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
import org.jclouds.javax.annotation.Nullable;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.cim.ResourceAllocationSettingData;
|
import org.jclouds.vcloud.director.v1_5.domain.cim.ResourceAllocationSettingData;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.cim.VirtualSystemSettingData;
|
import org.jclouds.vcloud.director.v1_5.domain.cim.VirtualSystemSettingData;
|
||||||
|
|
||||||
|
@ -43,7 +42,6 @@ import com.google.common.collect.Sets;
|
||||||
* @author Adrian Cole
|
* @author Adrian Cole
|
||||||
* @author Adam Lowe
|
* @author Adam Lowe
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
|
||||||
@XmlRootElement(name = "VirtualHardwareSection", namespace = VCLOUD_OVF_NS)
|
@XmlRootElement(name = "VirtualHardwareSection", namespace = VCLOUD_OVF_NS)
|
||||||
public class VirtualHardwareSection extends SectionType<VirtualHardwareSection> {
|
public class VirtualHardwareSection extends SectionType<VirtualHardwareSection> {
|
||||||
|
|
||||||
|
@ -111,7 +109,7 @@ public class VirtualHardwareSection extends SectionType<VirtualHardwareSection>
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public VirtualHardwareSection build() {
|
public VirtualHardwareSection build() {
|
||||||
return new VirtualHardwareSection(info, transports, virtualSystem, items);
|
return new VirtualHardwareSection(info, required, transports, virtualSystem, items);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder fromVirtualHardwareSection(VirtualHardwareSection in) {
|
public Builder fromVirtualHardwareSection(VirtualHardwareSection in) {
|
||||||
|
@ -135,15 +133,22 @@ public class VirtualHardwareSection extends SectionType<VirtualHardwareSection>
|
||||||
return Builder.class.cast(super.info(info));
|
return Builder.class.cast(super.info(info));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Builder required(Boolean required) {
|
||||||
|
return Builder.class.cast(super.required(required));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private VirtualSystemSettingData virtualSystem;
|
private VirtualSystemSettingData virtualSystem;
|
||||||
private Set<String> transports;
|
private Set<String> transports;
|
||||||
private Set<ResourceAllocationSettingData> items;
|
private Set<ResourceAllocationSettingData> items;
|
||||||
|
|
||||||
private VirtualHardwareSection(String info, Iterable<String> transports, VirtualSystemSettingData virtualSystem,
|
private VirtualHardwareSection(@Nullable String info, @Nullable Boolean required, Iterable<String> transports, VirtualSystemSettingData virtualSystem,
|
||||||
Iterable<? extends ResourceAllocationSettingData> items) {
|
Iterable<? extends ResourceAllocationSettingData> items) {
|
||||||
super(info);
|
super(info, required);
|
||||||
this.virtualSystem = virtualSystem;
|
this.virtualSystem = virtualSystem;
|
||||||
this.transports = ImmutableSet.<String>copyOf(checkNotNull(transports, "transports"));
|
this.transports = ImmutableSet.<String>copyOf(checkNotNull(transports, "transports"));
|
||||||
this.items = ImmutableSet.<ResourceAllocationSettingData>copyOf(checkNotNull(items, "items"));
|
this.items = ImmutableSet.<ResourceAllocationSettingData>copyOf(checkNotNull(items, "items"));
|
||||||
|
|
|
@ -22,7 +22,7 @@ import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_OV
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.ovf.OperatingSystemSection;
|
import org.jclouds.javax.annotation.Nullable;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.ovf.internal.BaseVirtualSystem;
|
import org.jclouds.vcloud.director.v1_5.domain.ovf.internal.BaseVirtualSystem;
|
||||||
|
|
||||||
import com.google.common.collect.Multimap;
|
import com.google.common.collect.Multimap;
|
||||||
|
@ -50,7 +50,7 @@ public class VirtualSystem extends BaseVirtualSystem<VirtualSystem> {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public VirtualSystem build() {
|
public VirtualSystem build() {
|
||||||
return new VirtualSystem(id, info, name, operatingSystem, virtualHardwareSections, productSections,
|
return new VirtualSystem(id, info, required, name, operatingSystem, virtualHardwareSections, productSections,
|
||||||
additionalSections);
|
additionalSections);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,6 +120,14 @@ public class VirtualSystem extends BaseVirtualSystem<VirtualSystem> {
|
||||||
return Builder.class.cast(super.info(info));
|
return Builder.class.cast(super.info(info));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Builder required(Boolean required) {
|
||||||
|
return Builder.class.cast(super.required(required));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@ -154,11 +162,10 @@ public class VirtualSystem extends BaseVirtualSystem<VirtualSystem> {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
private VirtualSystem(String id, String info, @Nullable Boolean required, String name, OperatingSystemSection operatingSystem,
|
||||||
private VirtualSystem(String id, String info, String name, OperatingSystemSection operatingSystem,
|
|
||||||
Iterable<? extends VirtualHardwareSection> virtualHardwareSections,
|
Iterable<? extends VirtualHardwareSection> virtualHardwareSections,
|
||||||
Iterable<? extends ProductSection> productSections, Multimap<String, SectionType> additionalSections) {
|
Iterable<? extends ProductSection> productSections, Multimap<String, SectionType> additionalSections) {
|
||||||
super(id, info, name, operatingSystem, virtualHardwareSections, productSections, additionalSections);
|
super(id, info, required, name, operatingSystem, virtualHardwareSections, productSections, additionalSections);
|
||||||
}
|
}
|
||||||
|
|
||||||
private VirtualSystem() {
|
private VirtualSystem() {
|
||||||
|
|
|
@ -22,6 +22,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import org.jclouds.javax.annotation.Nullable;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.ovf.OperatingSystemSection;
|
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.ProductSection;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.ovf.SectionType;
|
import org.jclouds.vcloud.director.v1_5.domain.ovf.SectionType;
|
||||||
|
@ -164,10 +165,10 @@ public abstract class BaseVirtualSystem<T extends BaseVirtualSystem<T>> extends
|
||||||
private Multimap<String, SectionType> additionalSections;
|
private Multimap<String, SectionType> additionalSections;
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
protected BaseVirtualSystem(String id, String info, String name, OperatingSystemSection operatingSystem,
|
protected BaseVirtualSystem(String id, String info, @Nullable Boolean required, String name, OperatingSystemSection operatingSystem,
|
||||||
Iterable<? extends VirtualHardwareSection> virtualHardwareSections,
|
Iterable<? extends VirtualHardwareSection> virtualHardwareSections,
|
||||||
Iterable<? extends ProductSection> productSections, Multimap<String, SectionType> additionalSections) {
|
Iterable<? extends ProductSection> productSections, Multimap<String, SectionType> additionalSections) {
|
||||||
super(info);
|
super(info, required);
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.operatingSystem = checkNotNull(operatingSystem, "operatingSystem");
|
this.operatingSystem = checkNotNull(operatingSystem, "operatingSystem");
|
||||||
|
@ -216,7 +217,7 @@ public abstract class BaseVirtualSystem<T extends BaseVirtualSystem<T>> extends
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hashCode(id, name, info, operatingSystem, virtualHardwareSections, productSections, additionalSections);
|
return Objects.hashCode(super.hashCode(), id, name, operatingSystem, virtualHardwareSections, productSections, additionalSections);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -226,22 +227,17 @@ public abstract class BaseVirtualSystem<T extends BaseVirtualSystem<T>> extends
|
||||||
if (getClass() != obj.getClass()) return false;
|
if (getClass() != obj.getClass()) return false;
|
||||||
|
|
||||||
BaseVirtualSystem<?> other = (BaseVirtualSystem<?>) obj;
|
BaseVirtualSystem<?> other = (BaseVirtualSystem<?>) obj;
|
||||||
return Objects.equal(id, other.id)
|
return super.equals(other)
|
||||||
|
&& Objects.equal(id, other.id)
|
||||||
&& Objects.equal(name, other.name)
|
&& Objects.equal(name, other.name)
|
||||||
&& Objects.equal(info, other.info)
|
|
||||||
&& Objects.equal(operatingSystem, other.operatingSystem)
|
&& Objects.equal(operatingSystem, other.operatingSystem)
|
||||||
&& Objects.equal(virtualHardwareSections, other.virtualHardwareSections)
|
&& Objects.equal(virtualHardwareSections, other.virtualHardwareSections)
|
||||||
&& Objects.equal(productSections, other.productSections)
|
&& Objects.equal(productSections, other.productSections)
|
||||||
&& Objects.equal(additionalSections, other.additionalSections);
|
&& Objects.equal(additionalSections, other.additionalSections);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return string().toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected Objects.ToStringHelper string() {
|
protected Objects.ToStringHelper string() {
|
||||||
return Objects.toStringHelper("").add("id", id).add("name", name).add("info", info)
|
return super.string().add("id", id).add("name", name)
|
||||||
.add("operatingSystem", operatingSystem).add("virtualHardwareSections", virtualHardwareSections)
|
.add("operatingSystem", operatingSystem).add("virtualHardwareSections", virtualHardwareSections)
|
||||||
.add("productSections", productSections).add("additionalSections", additionalSections)
|
.add("productSections", productSections).add("additionalSections", additionalSections)
|
||||||
.add("additionalSections", additionalSections);
|
.add("additionalSections", additionalSections);
|
||||||
|
|
|
@ -20,12 +20,9 @@
|
||||||
package org.jclouds.vcloud.director.v1_5.domain.query;
|
package org.jclouds.vcloud.director.v1_5.domain.query;
|
||||||
|
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
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.net.URI;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.CatalogReference;
|
import org.jclouds.vcloud.director.v1_5.domain.CatalogReference;
|
||||||
|
@ -35,17 +32,16 @@ import com.google.common.collect.Sets;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents the results from a vCloud query as references.
|
* Represents the results from a vCloud query as references.
|
||||||
*
|
* <p/>
|
||||||
* <pre>
|
* <pre>
|
||||||
* <complexType name="QueryResultReferences" />
|
* <complexType name="QueryResultReferences" />
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author grkvlt@apache.org
|
* @author grkvlt@apache.org
|
||||||
*/
|
*/
|
||||||
@XmlRootElement(namespace = VCLOUD_1_5_NS, name = "CatalogReferences")
|
@XmlRootElement(name = "CatalogReferences")
|
||||||
public class CatalogReferences extends QueryResultReferences<CatalogReference> {
|
public class CatalogReferences extends QueryResultReferences<CatalogReference> {
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public static Builder builder() {
|
public static Builder builder() {
|
||||||
return new Builder();
|
return new Builder();
|
||||||
}
|
}
|
||||||
|
@ -59,22 +55,14 @@ public class CatalogReferences extends QueryResultReferences<CatalogReference> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CatalogReferences build() {
|
public CatalogReferences build() {
|
||||||
CatalogReferences queryResultReferences = new CatalogReferences(href);
|
return new CatalogReferences(href, type, links, name, page, pageSize, total, references);
|
||||||
queryResultReferences.setReferences(references);
|
|
||||||
queryResultReferences.setName(name);
|
|
||||||
queryResultReferences.setPage(page);
|
|
||||||
queryResultReferences.setPageSize(pageSize);
|
|
||||||
queryResultReferences.setTotal(total);
|
|
||||||
queryResultReferences.setType(type);
|
|
||||||
queryResultReferences.setLinks(links);
|
|
||||||
return queryResultReferences;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see QueryResultReferences#getReferences()
|
* @see QueryResultReferences#getReferences()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder references(List<CatalogReference> references) {
|
public Builder references(Set<CatalogReference> references) {
|
||||||
this.references = references;
|
this.references = references;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
@ -89,7 +77,7 @@ public class CatalogReferences extends QueryResultReferences<CatalogReference> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see Container#getName()
|
* @see CatalogReference#getName()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder name(String name) {
|
public Builder name(String name) {
|
||||||
|
@ -98,7 +86,7 @@ public class CatalogReferences extends QueryResultReferences<CatalogReference> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see Container#getPage()
|
* @see CatalogReference#getPage()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder page(Integer page) {
|
public Builder page(Integer page) {
|
||||||
|
@ -107,7 +95,7 @@ public class CatalogReferences extends QueryResultReferences<CatalogReference> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see Container#getPageSize()
|
* @see CatalogReference#getPageSize()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder pageSize(Integer pageSize) {
|
public Builder pageSize(Integer pageSize) {
|
||||||
|
@ -116,7 +104,7 @@ public class CatalogReferences extends QueryResultReferences<CatalogReference> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see Container#getTotal()
|
* @see CatalogReference#getTotal()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder total(Long total) {
|
public Builder total(Long total) {
|
||||||
|
@ -125,7 +113,7 @@ public class CatalogReferences extends QueryResultReferences<CatalogReference> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ResourceType#getHref()
|
* @see CatalogReference#getHref()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder href(URI href) {
|
public Builder href(URI href) {
|
||||||
|
@ -134,7 +122,7 @@ public class CatalogReferences extends QueryResultReferences<CatalogReference> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ResourceType#getType()
|
* @see CatalogReference#getType()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder type(String type) {
|
public Builder type(String type) {
|
||||||
|
@ -143,7 +131,7 @@ public class CatalogReferences extends QueryResultReferences<CatalogReference> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ResourceType#getLinks()
|
* @see CatalogReference#getLinks()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder links(Set<Link> links) {
|
public Builder links(Set<Link> links) {
|
||||||
|
@ -152,7 +140,7 @@ public class CatalogReferences extends QueryResultReferences<CatalogReference> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ResourceType#getLinks()
|
* @see CatalogReference#getLinks()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder link(Link link) {
|
public Builder link(Link link) {
|
||||||
|
@ -170,11 +158,11 @@ public class CatalogReferences extends QueryResultReferences<CatalogReference> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public CatalogReferences(URI href, String type, Set<Link> links, String name, Integer page, Integer pageSize, Long total, Set<CatalogReference> references) {
|
||||||
|
super(href, type, links, name, page, pageSize, total, references);
|
||||||
|
}
|
||||||
|
|
||||||
protected CatalogReferences() {
|
protected CatalogReferences() {
|
||||||
// For JAXB and builder use
|
// For JAXB and builder use
|
||||||
}
|
}
|
||||||
|
|
||||||
protected CatalogReferences(URI href) {
|
|
||||||
super(href);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,6 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
|
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Link;
|
import org.jclouds.vcloud.director.v1_5.domain.Link;
|
||||||
|
@ -36,7 +35,7 @@ import com.google.common.collect.Sets;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Container for query result sets.
|
* Container for query result sets.
|
||||||
*
|
* <p/>
|
||||||
* <pre>
|
* <pre>
|
||||||
* <complexType name="Container" />
|
* <complexType name="Container" />
|
||||||
* </pre>
|
* </pre>
|
||||||
|
@ -62,7 +61,7 @@ public class ContainerType<T extends ContainerType<T>> extends ResourceType<T> {
|
||||||
protected Long total;
|
protected Long total;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see Container#getName()
|
* @see ContainerType#getName()
|
||||||
*/
|
*/
|
||||||
public Builder<T> name(String name) {
|
public Builder<T> name(String name) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
|
@ -70,7 +69,7 @@ public class ContainerType<T extends ContainerType<T>> extends ResourceType<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see Container#getPage()
|
* @see ContainerType#getPage()
|
||||||
*/
|
*/
|
||||||
public Builder<T> page(Integer page) {
|
public Builder<T> page(Integer page) {
|
||||||
this.page = page;
|
this.page = page;
|
||||||
|
@ -78,7 +77,7 @@ public class ContainerType<T extends ContainerType<T>> extends ResourceType<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see Container#getPageSize()
|
* @see ContainerType#getPageSize()
|
||||||
*/
|
*/
|
||||||
public Builder<T> pageSize(Integer pageSize) {
|
public Builder<T> pageSize(Integer pageSize) {
|
||||||
this.pageSize = pageSize;
|
this.pageSize = pageSize;
|
||||||
|
@ -86,7 +85,7 @@ public class ContainerType<T extends ContainerType<T>> extends ResourceType<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see Container#getTotal()
|
* @see ContainerType#getTotal()
|
||||||
*/
|
*/
|
||||||
public Builder<T> total(Long total) {
|
public Builder<T> total(Long total) {
|
||||||
this.total = total;
|
this.total = total;
|
||||||
|
@ -95,14 +94,7 @@ public class ContainerType<T extends ContainerType<T>> extends ResourceType<T> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ContainerType<T> build() {
|
public ContainerType<T> build() {
|
||||||
ContainerType<T> container = new ContainerType<T>(href);
|
return new ContainerType<T>(href, type, links, name, page, pageSize, total);
|
||||||
container.setName(name);
|
|
||||||
container.setPage(page);
|
|
||||||
container.setPageSize(pageSize);
|
|
||||||
container.setTotal(total);
|
|
||||||
container.setType(type);
|
|
||||||
container.setLinks(links);
|
|
||||||
return container;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -151,15 +143,6 @@ public class ContainerType<T extends ContainerType<T>> extends ResourceType<T> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected ContainerType() {
|
|
||||||
// For JAXB and builder use
|
|
||||||
}
|
|
||||||
|
|
||||||
protected ContainerType(URI href) {
|
|
||||||
super(href);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@XmlAttribute
|
@XmlAttribute
|
||||||
protected String name;
|
protected String name;
|
||||||
@XmlAttribute
|
@XmlAttribute
|
||||||
|
@ -169,6 +152,18 @@ public class ContainerType<T extends ContainerType<T>> extends ResourceType<T> {
|
||||||
@XmlAttribute
|
@XmlAttribute
|
||||||
protected Long total;
|
protected Long total;
|
||||||
|
|
||||||
|
public ContainerType(URI href, String type, Set<Link> links, String name, Integer page, Integer pageSize, Long total) {
|
||||||
|
super(href, type, links);
|
||||||
|
this.name = name;
|
||||||
|
this.page = page;
|
||||||
|
this.pageSize = pageSize;
|
||||||
|
this.total = total;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected ContainerType() {
|
||||||
|
// For JAXB and builder use
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Query name that generated this result set.
|
* Query name that generated this result set.
|
||||||
*/
|
*/
|
||||||
|
@ -176,10 +171,6 @@ public class ContainerType<T extends ContainerType<T>> extends ResourceType<T> {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setName(String value) {
|
|
||||||
this.name = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Page of the result set that this container holds. The first page is page number 1.
|
* Page of the result set that this container holds. The first page is page number 1.
|
||||||
*/
|
*/
|
||||||
|
@ -187,10 +178,6 @@ public class ContainerType<T extends ContainerType<T>> extends ResourceType<T> {
|
||||||
return page;
|
return page;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPage(Integer value) {
|
|
||||||
this.page = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Page size, as a number of records or references.
|
* Page size, as a number of records or references.
|
||||||
*/
|
*/
|
||||||
|
@ -198,10 +185,6 @@ public class ContainerType<T extends ContainerType<T>> extends ResourceType<T> {
|
||||||
return pageSize;
|
return pageSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPageSize(Integer value) {
|
|
||||||
this.pageSize = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Total number of records or references in the container.
|
* Total number of records or references in the container.
|
||||||
*/
|
*/
|
||||||
|
@ -209,10 +192,6 @@ public class ContainerType<T extends ContainerType<T>> extends ResourceType<T> {
|
||||||
return total;
|
return total;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTotal(Long value) {
|
|
||||||
this.total = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
|
|
|
@ -23,15 +23,14 @@ import javax.xml.bind.annotation.XmlType;
|
||||||
import com.google.common.base.Objects.ToStringHelper;
|
import com.google.common.base.Objects.ToStringHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Container for the list of typed queries available to the
|
||||||
* Container for the list of typed queries available to the
|
* requesting user.
|
||||||
* requesting user.
|
* <p/>
|
||||||
*
|
* <p/>
|
||||||
*
|
|
||||||
* <p>Java class for QueryList complex type.
|
* <p>Java class for QueryList complex type.
|
||||||
*
|
* <p/>
|
||||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
*
|
* <p/>
|
||||||
* <pre>
|
* <pre>
|
||||||
* <complexType name="QueryList">
|
* <complexType name="QueryList">
|
||||||
* <complexContent>
|
* <complexContent>
|
||||||
|
@ -41,16 +40,15 @@ import com.google.common.base.Objects.ToStringHelper;
|
||||||
* </complexContent>
|
* </complexContent>
|
||||||
* </complexType>
|
* </complexType>
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@XmlType(name = "QueryList")
|
@XmlType(name = "QueryList")
|
||||||
public class QueryList extends ContainerType<QueryList> {
|
public class QueryList extends ContainerType<QueryList> {
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public static Builder builder() {
|
public static Builder builder() {
|
||||||
return new Builder();
|
return new Builder();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Builder toBuilder() {
|
public Builder toBuilder() {
|
||||||
return new Builder().fromQueryList(this);
|
return new Builder().fromQueryList(this);
|
||||||
}
|
}
|
||||||
|
@ -64,8 +62,9 @@ public class QueryList extends ContainerType<QueryList> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Builder fromContainerType(ContainerType<QueryList> in) {
|
public Builder fromContainerType(ContainerType<QueryList> in) {
|
||||||
return Builder.class.cast(super.fromContainerType(in));
|
return Builder.class.cast(super.fromContainerType(in));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder fromQueryList(QueryList in) {
|
public Builder fromQueryList(QueryList in) {
|
||||||
return fromContainerType(in);
|
return fromContainerType(in);
|
||||||
}
|
}
|
||||||
|
@ -78,11 +77,11 @@ public class QueryList extends ContainerType<QueryList> {
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
return true;
|
return true;
|
||||||
if (o == null || getClass() != o.getClass())
|
if (o == null || getClass() != o.getClass())
|
||||||
return false;
|
return false;
|
||||||
QueryList that = QueryList.class.cast(o);
|
QueryList that = QueryList.class.cast(o);
|
||||||
return super.equals(that) ;
|
return super.equals(that);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -21,12 +21,10 @@ package org.jclouds.vcloud.director.v1_5.domain.query;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
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.net.URI;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
import javax.xml.bind.annotation.XmlSchemaType;
|
import javax.xml.bind.annotation.XmlSchemaType;
|
||||||
|
@ -39,14 +37,14 @@ import com.google.common.collect.Sets;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents the results from a Catalog vCloud query as a record.
|
* Represents the results from a Catalog vCloud query as a record.
|
||||||
*
|
* <p/>
|
||||||
* <pre>
|
* <pre>
|
||||||
* <complexType name="QueryResultCatalogRecord" />
|
* <complexType name="QueryResultCatalogRecord" />
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author grkvlt@apache.org
|
* @author grkvlt@apache.org
|
||||||
*/
|
*/
|
||||||
@XmlRootElement(name = "CatalogRecord", namespace = VCLOUD_1_5_NS)
|
@XmlRootElement(name = "CatalogRecord")
|
||||||
public class QueryResultCatalogRecord extends QueryResultRecordType<QueryResultCatalogRecord> {
|
public class QueryResultCatalogRecord extends QueryResultRecordType<QueryResultCatalogRecord> {
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
|
@ -80,7 +78,7 @@ public class QueryResultCatalogRecord extends QueryResultRecordType<QueryResultC
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see QueryResultCatalogRecord#getIsPublished()
|
* @see QueryResultCatalogRecord#isPublished()
|
||||||
*/
|
*/
|
||||||
public Builder isPublished(Boolean isPublished) {
|
public Builder isPublished(Boolean isPublished) {
|
||||||
this.isPublished = isPublished;
|
this.isPublished = isPublished;
|
||||||
|
@ -88,7 +86,7 @@ public class QueryResultCatalogRecord extends QueryResultRecordType<QueryResultC
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see QueryResultCatalogRecord#getIsPublished()
|
* @see QueryResultCatalogRecord#isPublished()
|
||||||
*/
|
*/
|
||||||
public Builder published() {
|
public Builder published() {
|
||||||
this.isPublished = Boolean.TRUE;
|
this.isPublished = Boolean.TRUE;
|
||||||
|
@ -96,7 +94,7 @@ public class QueryResultCatalogRecord extends QueryResultRecordType<QueryResultC
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see QueryResultCatalogRecord#getIsPublished()
|
* @see QueryResultCatalogRecord#isPublished()
|
||||||
*/
|
*/
|
||||||
public Builder notPublished() {
|
public Builder notPublished() {
|
||||||
this.isPublished = Boolean.FALSE;
|
this.isPublished = Boolean.FALSE;
|
||||||
|
@ -104,7 +102,7 @@ public class QueryResultCatalogRecord extends QueryResultRecordType<QueryResultC
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see QueryResultCatalogRecord#getIsShared()
|
* @see QueryResultCatalogRecord#isShared()
|
||||||
*/
|
*/
|
||||||
public Builder isShared(Boolean isShared) {
|
public Builder isShared(Boolean isShared) {
|
||||||
this.isShared = isShared;
|
this.isShared = isShared;
|
||||||
|
@ -112,7 +110,7 @@ public class QueryResultCatalogRecord extends QueryResultRecordType<QueryResultC
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see QueryResultCatalogRecord#getIsShared()
|
* @see QueryResultCatalogRecord#isShared()
|
||||||
*/
|
*/
|
||||||
public Builder shared() {
|
public Builder shared() {
|
||||||
this.isShared = Boolean.TRUE;
|
this.isShared = Boolean.TRUE;
|
||||||
|
@ -120,7 +118,7 @@ public class QueryResultCatalogRecord extends QueryResultRecordType<QueryResultC
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see QueryResultCatalogRecord#getIsShared()
|
* @see QueryResultCatalogRecord#isShared()
|
||||||
*/
|
*/
|
||||||
public Builder notShared() {
|
public Builder notShared() {
|
||||||
this.isShared = Boolean.FALSE;
|
this.isShared = Boolean.FALSE;
|
||||||
|
@ -177,20 +175,8 @@ public class QueryResultCatalogRecord extends QueryResultRecordType<QueryResultC
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryResultCatalogRecord build() {
|
public QueryResultCatalogRecord build() {
|
||||||
QueryResultCatalogRecord queryResultCatalogRecord = new QueryResultCatalogRecord(href);
|
return new QueryResultCatalogRecord(links, href, id, type,name, isPublished, isShared, creationDate, orgName,
|
||||||
queryResultCatalogRecord.setName(name);
|
ownerName, numberOfVAppTemplates, numberOfMedia, owner);
|
||||||
queryResultCatalogRecord.setIsPublished(isPublished);
|
|
||||||
queryResultCatalogRecord.setIsShared(isShared);
|
|
||||||
queryResultCatalogRecord.setCreationDate(creationDate);
|
|
||||||
queryResultCatalogRecord.setOrgName(orgName);
|
|
||||||
queryResultCatalogRecord.setOwnerName(ownerName);
|
|
||||||
queryResultCatalogRecord.setNumberOfVAppTemplates(numberOfVAppTemplates);
|
|
||||||
queryResultCatalogRecord.setNumberOfMedia(numberOfMedia);
|
|
||||||
queryResultCatalogRecord.setOwner(owner);
|
|
||||||
queryResultCatalogRecord.setId(id);
|
|
||||||
queryResultCatalogRecord.setType(type);
|
|
||||||
queryResultCatalogRecord.setLinks(links);
|
|
||||||
return queryResultCatalogRecord;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -249,13 +235,26 @@ public class QueryResultCatalogRecord extends QueryResultRecordType<QueryResultC
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private QueryResultCatalogRecord(Set<Link> links, URI href, String id, String type, String name,
|
||||||
|
Boolean published, Boolean shared, Date creationDate, String orgName,
|
||||||
|
String ownerName, Integer numberOfVAppTemplates, Integer numberOfMedia,
|
||||||
|
URI owner) {
|
||||||
|
super(links, href, id, type);
|
||||||
|
this.name = name;
|
||||||
|
isPublished = published;
|
||||||
|
isShared = shared;
|
||||||
|
this.creationDate = creationDate;
|
||||||
|
this.orgName = orgName;
|
||||||
|
this.ownerName = ownerName;
|
||||||
|
this.numberOfVAppTemplates = numberOfVAppTemplates;
|
||||||
|
this.numberOfMedia = numberOfMedia;
|
||||||
|
this.owner = owner;
|
||||||
|
}
|
||||||
|
|
||||||
private QueryResultCatalogRecord() {
|
private QueryResultCatalogRecord() {
|
||||||
// For JAXB and builder use
|
// For JAXB and builder use
|
||||||
}
|
}
|
||||||
|
|
||||||
private QueryResultCatalogRecord(URI href) {
|
|
||||||
super(href);
|
|
||||||
}
|
|
||||||
|
|
||||||
@XmlAttribute
|
@XmlAttribute
|
||||||
protected String name;
|
protected String name;
|
||||||
|
@ -284,32 +283,21 @@ public class QueryResultCatalogRecord extends QueryResultRecordType<QueryResultC
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setName(String value) {
|
|
||||||
this.name = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the isPublished property.
|
||||||
|
*/
|
||||||
public Boolean isPublished() {
|
public Boolean isPublished() {
|
||||||
return isPublished;
|
return isPublished;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the value of the isPublished property.
|
* Gets the value of the isShared property.
|
||||||
*/
|
*/
|
||||||
public void setIsPublished(Boolean value) {
|
|
||||||
this.isPublished = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Boolean isShared() {
|
public Boolean isShared() {
|
||||||
return isShared;
|
return isShared;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the value of the isShared property.
|
|
||||||
*/
|
|
||||||
public void setIsShared(Boolean value) {
|
|
||||||
this.isShared = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the creationDate property.
|
* Gets the value of the creationDate property.
|
||||||
*/
|
*/
|
||||||
|
@ -317,10 +305,6 @@ public class QueryResultCatalogRecord extends QueryResultRecordType<QueryResultC
|
||||||
return creationDate;
|
return creationDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCreationDate(Date value) {
|
|
||||||
this.creationDate = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the orgName property.
|
* Gets the value of the orgName property.
|
||||||
*/
|
*/
|
||||||
|
@ -328,10 +312,6 @@ public class QueryResultCatalogRecord extends QueryResultRecordType<QueryResultC
|
||||||
return orgName;
|
return orgName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setOrgName(String value) {
|
|
||||||
this.orgName = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the ownerName property.
|
* Gets the value of the ownerName property.
|
||||||
*/
|
*/
|
||||||
|
@ -339,10 +319,6 @@ public class QueryResultCatalogRecord extends QueryResultRecordType<QueryResultC
|
||||||
return ownerName;
|
return ownerName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setOwnerName(String value) {
|
|
||||||
this.ownerName = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the numberOfVAppTemplates property.
|
* Gets the value of the numberOfVAppTemplates property.
|
||||||
*/
|
*/
|
||||||
|
@ -350,10 +326,6 @@ public class QueryResultCatalogRecord extends QueryResultRecordType<QueryResultC
|
||||||
return numberOfVAppTemplates;
|
return numberOfVAppTemplates;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setNumberOfVAppTemplates(Integer value) {
|
|
||||||
this.numberOfVAppTemplates = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the numberOfMedia property.
|
* Gets the value of the numberOfMedia property.
|
||||||
*/
|
*/
|
||||||
|
@ -361,10 +333,6 @@ public class QueryResultCatalogRecord extends QueryResultRecordType<QueryResultC
|
||||||
return numberOfMedia;
|
return numberOfMedia;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setNumberOfMedia(Integer value) {
|
|
||||||
this.numberOfMedia = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the owner property.
|
* Gets the value of the owner property.
|
||||||
*/
|
*/
|
||||||
|
@ -372,10 +340,6 @@ public class QueryResultCatalogRecord extends QueryResultRecordType<QueryResultC
|
||||||
return owner;
|
return owner;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setOwner(URI value) {
|
|
||||||
this.owner = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
|
|
|
@ -24,7 +24,6 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
|
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Link;
|
import org.jclouds.vcloud.director.v1_5.domain.Link;
|
||||||
|
@ -35,11 +34,11 @@ import com.google.common.collect.Sets;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents the results from a Network vCloud query as a record.
|
* Represents the results from a Network vCloud query as a record.
|
||||||
*
|
* <p/>
|
||||||
* <pre>
|
* <pre>
|
||||||
* <complexType name="QueryResultNetworkRecord" />
|
* <complexType name="QueryResultNetworkRecord" />
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author grkvlt@apache.org
|
* @author grkvlt@apache.org
|
||||||
*/
|
*/
|
||||||
public class QueryResultNetworkRecord extends QueryResultRecordType<QueryResultNetworkRecord> {
|
public class QueryResultNetworkRecord extends QueryResultRecordType<QueryResultNetworkRecord> {
|
||||||
|
@ -146,19 +145,8 @@ public class QueryResultNetworkRecord extends QueryResultRecordType<QueryResultN
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryResultNetworkRecord build() {
|
public QueryResultNetworkRecord build() {
|
||||||
QueryResultNetworkRecord queryResultNetworkRecord = new QueryResultNetworkRecord(href);
|
return new QueryResultNetworkRecord(links, href, id, type,
|
||||||
queryResultNetworkRecord.setName(name);
|
name, ipScopeId, gateway, netmask, dns1, dns2, dnsSuffix, isBusy);
|
||||||
queryResultNetworkRecord.setIpScopeId(ipScopeId);
|
|
||||||
queryResultNetworkRecord.setGateway(gateway);
|
|
||||||
queryResultNetworkRecord.setNetmask(netmask);
|
|
||||||
queryResultNetworkRecord.setDns1(dns1);
|
|
||||||
queryResultNetworkRecord.setDns2(dns2);
|
|
||||||
queryResultNetworkRecord.setDnsSuffix(dnsSuffix);
|
|
||||||
queryResultNetworkRecord.setIsBusy(isBusy);
|
|
||||||
queryResultNetworkRecord.setId(id);
|
|
||||||
queryResultNetworkRecord.setType(type);
|
|
||||||
queryResultNetworkRecord.setLinks(links);
|
|
||||||
return queryResultNetworkRecord;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -219,12 +207,21 @@ public class QueryResultNetworkRecord extends QueryResultRecordType<QueryResultN
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private QueryResultNetworkRecord() {
|
public QueryResultNetworkRecord(Set<Link> links, URI href, String id, String type, String name, String ipScopeId,
|
||||||
// For JAXB and builder use
|
String gateway, String netmask, String dns1, String dns2, String dnsSuffix, Boolean busy) {
|
||||||
|
super(links, href, id, type);
|
||||||
|
this.name = name;
|
||||||
|
this.ipScopeId = ipScopeId;
|
||||||
|
this.gateway = gateway;
|
||||||
|
this.netmask = netmask;
|
||||||
|
this.dns1 = dns1;
|
||||||
|
this.dns2 = dns2;
|
||||||
|
this.dnsSuffix = dnsSuffix;
|
||||||
|
isBusy = busy;
|
||||||
}
|
}
|
||||||
|
|
||||||
private QueryResultNetworkRecord(URI href) {
|
private QueryResultNetworkRecord() {
|
||||||
super(href);
|
// For JAXB and builder use
|
||||||
}
|
}
|
||||||
|
|
||||||
@XmlAttribute
|
@XmlAttribute
|
||||||
|
@ -251,10 +248,6 @@ public class QueryResultNetworkRecord extends QueryResultRecordType<QueryResultN
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setName(String value) {
|
|
||||||
this.name = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* IP scope object of this network.
|
* IP scope object of this network.
|
||||||
*/
|
*/
|
||||||
|
@ -262,9 +255,6 @@ public class QueryResultNetworkRecord extends QueryResultRecordType<QueryResultN
|
||||||
return ipScopeId;
|
return ipScopeId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setIpScopeId(String value) {
|
|
||||||
this.ipScopeId = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gateway for the network.
|
* Gateway for the network.
|
||||||
|
@ -273,10 +263,6 @@ public class QueryResultNetworkRecord extends QueryResultRecordType<QueryResultN
|
||||||
return gateway;
|
return gateway;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setGateway(String value) {
|
|
||||||
this.gateway = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Netmask for the network.
|
* Netmask for the network.
|
||||||
*/
|
*/
|
||||||
|
@ -284,10 +270,6 @@ public class QueryResultNetworkRecord extends QueryResultRecordType<QueryResultN
|
||||||
return netmask;
|
return netmask;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setNetmask(String value) {
|
|
||||||
this.netmask = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Primary DNS for the network.
|
* Primary DNS for the network.
|
||||||
*/
|
*/
|
||||||
|
@ -295,10 +277,6 @@ public class QueryResultNetworkRecord extends QueryResultRecordType<QueryResultN
|
||||||
return dns1;
|
return dns1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDns1(String value) {
|
|
||||||
this.dns1 = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Secondary DNS for the network.
|
* Secondary DNS for the network.
|
||||||
*/
|
*/
|
||||||
|
@ -306,10 +284,6 @@ public class QueryResultNetworkRecord extends QueryResultRecordType<QueryResultN
|
||||||
return dns2;
|
return dns2;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDns2(String value) {
|
|
||||||
this.dns2 = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DNS suffix for the network.
|
* DNS suffix for the network.
|
||||||
*/
|
*/
|
||||||
|
@ -317,10 +291,6 @@ public class QueryResultNetworkRecord extends QueryResultRecordType<QueryResultN
|
||||||
return dnsSuffix;
|
return dnsSuffix;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDnsSuffix(String value) {
|
|
||||||
this.dnsSuffix = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shows whether it is busy.
|
* Shows whether it is busy.
|
||||||
*/
|
*/
|
||||||
|
@ -328,10 +298,6 @@ public class QueryResultNetworkRecord extends QueryResultRecordType<QueryResultN
|
||||||
return isBusy;
|
return isBusy;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setIsBusy(Boolean value) {
|
|
||||||
this.isBusy = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
|
|
|
@ -20,21 +20,13 @@ package org.jclouds.vcloud.director.v1_5.domain.query;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
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.net.URI;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlAnyAttribute;
|
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlSchemaType;
|
import javax.xml.bind.annotation.XmlSchemaType;
|
||||||
import javax.xml.bind.annotation.XmlSeeAlso;
|
import javax.xml.bind.annotation.XmlSeeAlso;
|
||||||
import javax.xml.namespace.QName;
|
|
||||||
|
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Link;
|
import org.jclouds.vcloud.director.v1_5.domain.Link;
|
||||||
|
|
||||||
|
@ -44,15 +36,14 @@ import com.google.common.collect.Sets;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base type for query result Records. Subtypes define more specific elements.
|
* Base type for query result Records. Subtypes define more specific elements.
|
||||||
*
|
* <p/>
|
||||||
* <pre>
|
* <pre>
|
||||||
* <complexType name="QueryResultRecordType" />
|
* <complexType name="QueryResultRecordType" />
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author grkvlt@apache.org
|
* @author grkvlt@apache.org
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
@XmlSeeAlso({QueryResultCatalogRecord.class, QueryResultNetworkRecord.class})
|
||||||
@XmlSeeAlso({ QueryResultCatalogRecord.class, QueryResultNetworkRecord.class })
|
|
||||||
public class QueryResultRecordType<T extends QueryResultRecordType<T>> {
|
public class QueryResultRecordType<T extends QueryResultRecordType<T>> {
|
||||||
|
|
||||||
public static <T extends QueryResultRecordType<T>> Builder<T> builder() {
|
public static <T extends QueryResultRecordType<T>> Builder<T> builder() {
|
||||||
|
@ -111,11 +102,7 @@ public class QueryResultRecordType<T extends QueryResultRecordType<T>> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public QueryResultRecordType<T> build() {
|
public QueryResultRecordType<T> build() {
|
||||||
QueryResultRecordType<T> record = new QueryResultRecordType<T>(href);
|
return new QueryResultRecordType<T>(links, href, id, type);
|
||||||
record.setId(id);
|
|
||||||
record.setType(type);
|
|
||||||
record.setLinks(links);
|
|
||||||
return record;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder<T> fromQueryResultRecordType(QueryResultRecordType<T> in) {
|
public Builder<T> fromQueryResultRecordType(QueryResultRecordType<T> in) {
|
||||||
|
@ -123,7 +110,7 @@ public class QueryResultRecordType<T extends QueryResultRecordType<T>> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@XmlElement(namespace = VCLOUD_1_5_NS, name = "Link")
|
@XmlElement(name = "Link")
|
||||||
private Set<Link> links = Sets.newLinkedHashSet();
|
private Set<Link> links = Sets.newLinkedHashSet();
|
||||||
@XmlAttribute
|
@XmlAttribute
|
||||||
@XmlSchemaType(name = "anyURI")
|
@XmlSchemaType(name = "anyURI")
|
||||||
|
@ -132,9 +119,13 @@ public class QueryResultRecordType<T extends QueryResultRecordType<T>> {
|
||||||
private String id;
|
private String id;
|
||||||
@XmlAttribute
|
@XmlAttribute
|
||||||
private String type;
|
private String type;
|
||||||
@XmlAnyAttribute
|
|
||||||
// XXX not sure about this
|
public QueryResultRecordType(Set<Link> links, URI href, String id, String type) {
|
||||||
private Map<QName, String> otherAttributes = new HashMap<QName, String>();
|
this.links = links;
|
||||||
|
this.href = href;
|
||||||
|
this.id = id;
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
public QueryResultRecordType(URI href) {
|
public QueryResultRecordType(URI href) {
|
||||||
this.href = href;
|
this.href = href;
|
||||||
|
@ -151,14 +142,6 @@ public class QueryResultRecordType<T extends QueryResultRecordType<T>> {
|
||||||
return links;
|
return links;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLinks(Set<Link> links) {
|
|
||||||
this.links = Sets.newLinkedHashSet(checkNotNull(links, "links"));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addLink(Link link) {
|
|
||||||
this.links.add(checkNotNull(link, "link"));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Contains the URI to the entity. An object reference, expressed in URL format. Because this URL includes the object identifier
|
* Contains the URI to the entity. An object reference, expressed in URL format. Because this URL includes the object identifier
|
||||||
* portion of the id attribute value, it uniquely identifies the object, persists for the life of the object, and is never
|
* portion of the id attribute value, it uniquely identifies the object, persists for the life of the object, and is never
|
||||||
|
@ -166,17 +149,13 @@ public class QueryResultRecordType<T extends QueryResultRecordType<T>> {
|
||||||
* the object that is valid in a particular context. Although URLs have a well-known syntax and a well-understood interpretation,
|
* the object that is valid in a particular context. Although URLs have a well-known syntax and a well-understood interpretation,
|
||||||
* a client should treat each href as an opaque string. The rules that govern how the server constructs href strings might change
|
* a client should treat each href as an opaque string. The rules that govern how the server constructs href strings might change
|
||||||
* in future releases.
|
* in future releases.
|
||||||
*
|
*
|
||||||
* @return an opaque reference and should never be parsed
|
* @return an opaque reference and should never be parsed
|
||||||
*/
|
*/
|
||||||
public URI getHref() {
|
public URI getHref() {
|
||||||
return href;
|
return href;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setHref(URI href) {
|
|
||||||
this.href = href;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The resource identifier, expressed in URN format. The value of this attribute uniquely identifies the resource, persists for
|
* The resource identifier, expressed in URN format. The value of this attribute uniquely identifies the resource, persists for
|
||||||
* the life of the resource, and is never reused.
|
* the life of the resource, and is never reused.
|
||||||
|
@ -184,34 +163,16 @@ public class QueryResultRecordType<T extends QueryResultRecordType<T>> {
|
||||||
public String getId() {
|
public String getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setId(String id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Contains the type of the the entity. The object type, specified as a MIME content type, of the object that the link
|
* Contains the type of the the entity. The object type, specified as a MIME content type, of the object that the link
|
||||||
* references. This attribute is present only for links to objects. It is not present for links to actions.
|
* references. This attribute is present only for links to objects. It is not present for links to actions.
|
||||||
*
|
*
|
||||||
* @return type definition, type, expressed as an HTTP Content-Type
|
* @return type definition, type, expressed as an HTTP Content-Type
|
||||||
*/
|
*/
|
||||||
public String getType() {
|
public String getType() {
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setType(String type) {
|
|
||||||
this.type = type;
|
|
||||||
}
|
|
||||||
|
|
||||||
// XXX not sure about this
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets a map that contains attributes that aren't bound to any typed property on this class.
|
|
||||||
*/
|
|
||||||
public Map<QName, String> getOtherAttributes() {
|
|
||||||
return otherAttributes;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
|
@ -234,7 +195,7 @@ public class QueryResultRecordType<T extends QueryResultRecordType<T>> {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected ToStringHelper string() {
|
protected ToStringHelper string() {
|
||||||
return Objects.toStringHelper("").add("href", href).add("id", id)
|
return Objects.toStringHelper("").add("href", href).add("id", id)
|
||||||
.add("type", type).add("links", links);
|
.add("type", type).add("links", links);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,33 +21,31 @@ package org.jclouds.vcloud.director.v1_5.domain.query;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
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.net.URI;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlElementRef;
|
import javax.xml.bind.annotation.XmlElementRef;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
|
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.domain.EntityType;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Link;
|
import org.jclouds.vcloud.director.v1_5.domain.Link;
|
||||||
|
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
import com.google.common.base.Objects.ToStringHelper;
|
import com.google.common.base.Objects.ToStringHelper;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.ImmutableSet;
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents the results from a vCloud query as records.
|
* Represents the results from a vCloud query as records.
|
||||||
*
|
* <p/>
|
||||||
* <pre>
|
* <pre>
|
||||||
* <complexType name="QueryResultRecords" />
|
* <complexType name="QueryResultRecords" />
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author grkvlt@apache.org
|
* @author grkvlt@apache.org
|
||||||
*/
|
*/
|
||||||
@XmlRootElement(namespace = VCLOUD_1_5_NS, name = "QueryResultRecords")
|
@XmlRootElement(name = "QueryResultRecords")
|
||||||
public class QueryResultRecords<T extends QueryResultRecordType<T>> extends ContainerType<QueryResultRecords<T>> {
|
public class QueryResultRecords<T extends QueryResultRecordType<T>> extends ContainerType<QueryResultRecords<T>> {
|
||||||
|
|
||||||
public static final String MEDIA_TYPE = VCloudDirectorMediaType.QUERY_RESULT_RECORDS;
|
public static final String MEDIA_TYPE = VCloudDirectorMediaType.QUERY_RESULT_RECORDS;
|
||||||
|
@ -63,13 +61,13 @@ public class QueryResultRecords<T extends QueryResultRecordType<T>> extends Cont
|
||||||
|
|
||||||
public static class Builder<T extends QueryResultRecordType<T>> extends ContainerType.Builder<QueryResultRecords<T>> {
|
public static class Builder<T extends QueryResultRecordType<T>> extends ContainerType.Builder<QueryResultRecords<T>> {
|
||||||
|
|
||||||
private List<T> records = Lists.newArrayList();
|
private Set<T> records = Sets.newLinkedHashSet();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see QueryResultRecords#getRecords()
|
* @see QueryResultRecords#getRecords()
|
||||||
*/
|
*/
|
||||||
public Builder<T> records(List<T> records) {
|
public Builder<T> records(Set<T> records) {
|
||||||
this.records = records;
|
this.records = checkNotNull(records, "records");
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,15 +81,7 @@ public class QueryResultRecords<T extends QueryResultRecordType<T>> extends Cont
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryResultRecords<T> build() {
|
public QueryResultRecords<T> build() {
|
||||||
QueryResultRecords<T> queryResultRecords = new QueryResultRecords<T>(href);
|
return new QueryResultRecords<T>(href, type, links, name, page, pageSize, total, records);
|
||||||
queryResultRecords.setRecords(records);
|
|
||||||
queryResultRecords.setName(name);
|
|
||||||
queryResultRecords.setPage(page);
|
|
||||||
queryResultRecords.setPageSize(pageSize);
|
|
||||||
queryResultRecords.setTotal(total);
|
|
||||||
queryResultRecords.setType(type);
|
|
||||||
queryResultRecords.setLinks(links);
|
|
||||||
return queryResultRecords;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -131,7 +121,7 @@ public class QueryResultRecords<T extends QueryResultRecordType<T>> extends Cont
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ResourceType#getHref()
|
* @see EntityType#getHref()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder<T> href(URI href) {
|
public Builder<T> href(URI href) {
|
||||||
|
@ -140,7 +130,7 @@ public class QueryResultRecords<T extends QueryResultRecordType<T>> extends Cont
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ResourceType#getType()
|
* @see EntityType#getType()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder<T> type(String type) {
|
public Builder<T> type(String type) {
|
||||||
|
@ -149,7 +139,7 @@ public class QueryResultRecords<T extends QueryResultRecordType<T>> extends Cont
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ResourceType#getLinks()
|
* @see EntityType#getLinks()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder<T> links(Set<Link> links) {
|
public Builder<T> links(Set<Link> links) {
|
||||||
|
@ -158,7 +148,7 @@ public class QueryResultRecords<T extends QueryResultRecordType<T>> extends Cont
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ResourceType#getLinks()
|
* @see EntityType#getLinks()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder<T> link(Link link) {
|
public Builder<T> link(Link link) {
|
||||||
|
@ -176,32 +166,25 @@ public class QueryResultRecords<T extends QueryResultRecordType<T>> extends Cont
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected QueryResultRecords() {
|
protected QueryResultRecords(URI href, String type, Set<Link> links, String name, Integer page, Integer pageSize, Long total, Set<T> records) {
|
||||||
// For JAXB and builder use
|
super(href, type, links, name, page, pageSize, total);
|
||||||
|
this.records = ImmutableSet.copyOf(records);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected QueryResultRecords(URI href) {
|
protected QueryResultRecords() {
|
||||||
super(href);
|
// For JAXB
|
||||||
}
|
}
|
||||||
|
|
||||||
@XmlElementRef
|
@XmlElementRef
|
||||||
protected List<T> records;
|
private Set<T> records = Sets.newLinkedHashSet();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set of records representing query results.
|
* Set of records representing query results.
|
||||||
*/
|
*/
|
||||||
public List<T> getRecords() {
|
public Set<T> getRecords() {
|
||||||
return records;
|
return records;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRecords(List<T> records) {
|
|
||||||
this.records = Lists.newArrayList(checkNotNull(records, "records"));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addRecords(T record) {
|
|
||||||
this.records.add(checkNotNull(record, "record"));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
|
|
|
@ -23,9 +23,7 @@ import static com.google.common.base.Objects.equal;
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlElementRef;
|
import javax.xml.bind.annotation.XmlElementRef;
|
||||||
import javax.xml.bind.annotation.XmlElementRefs;
|
import javax.xml.bind.annotation.XmlElementRefs;
|
||||||
|
|
||||||
|
@ -36,16 +34,16 @@ import org.jclouds.vcloud.director.v1_5.domain.ReferenceType;
|
||||||
|
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
import com.google.common.base.Objects.ToStringHelper;
|
import com.google.common.base.Objects.ToStringHelper;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.ImmutableSet;
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents the results from a vCloud query as references.
|
* Represents the results from a vCloud query as references.
|
||||||
*
|
* <p/>
|
||||||
* <pre>
|
* <pre>
|
||||||
* <complexType name="QueryResultReferences" />
|
* <complexType name="QueryResultReferences" />
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author grkvlt@apache.org
|
* @author grkvlt@apache.org
|
||||||
*/
|
*/
|
||||||
public class QueryResultReferences<T extends ReferenceType<T>> extends ContainerType<QueryResultReferences<T>> {
|
public class QueryResultReferences<T extends ReferenceType<T>> extends ContainerType<QueryResultReferences<T>> {
|
||||||
|
@ -63,13 +61,13 @@ public class QueryResultReferences<T extends ReferenceType<T>> extends Container
|
||||||
|
|
||||||
public static class Builder<T extends ReferenceType<T>> extends ContainerType.Builder<QueryResultReferences<T>> {
|
public static class Builder<T extends ReferenceType<T>> extends ContainerType.Builder<QueryResultReferences<T>> {
|
||||||
|
|
||||||
protected List<T> references = Lists.newArrayList();
|
protected Set<T> references = Sets.newLinkedHashSet();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see QueryResultReferences#getReferences()
|
* @see QueryResultReferences#getReferences()
|
||||||
*/
|
*/
|
||||||
public Builder<T> references(List<T> references) {
|
public Builder<T> references(Set<T> references) {
|
||||||
this.references = references;
|
this.references = checkNotNull(references, "references");
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,19 +81,11 @@ public class QueryResultReferences<T extends ReferenceType<T>> extends Container
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryResultReferences<T> build() {
|
public QueryResultReferences<T> build() {
|
||||||
QueryResultReferences<T> queryResultReferences = new QueryResultReferences<T>(href);
|
return new QueryResultReferences<T>(href, type, links, name, page, pageSize, total, references);
|
||||||
queryResultReferences.setReferences(references);
|
|
||||||
queryResultReferences.setName(name);
|
|
||||||
queryResultReferences.setPage(page);
|
|
||||||
queryResultReferences.setPageSize(pageSize);
|
|
||||||
queryResultReferences.setTotal(total);
|
|
||||||
queryResultReferences.setType(type);
|
|
||||||
queryResultReferences.setLinks(links);
|
|
||||||
return queryResultReferences;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see Container#getName()
|
* @see ContainerType#getName()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder<T> name(String name) {
|
public Builder<T> name(String name) {
|
||||||
|
@ -104,7 +94,7 @@ public class QueryResultReferences<T extends ReferenceType<T>> extends Container
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see Container#getPage()
|
* @see ContainerType#getPage()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder<T> page(Integer page) {
|
public Builder<T> page(Integer page) {
|
||||||
|
@ -113,7 +103,7 @@ public class QueryResultReferences<T extends ReferenceType<T>> extends Container
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see Container#getPageSize()
|
* @see ContainerType#getPageSize()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder<T> pageSize(Integer pageSize) {
|
public Builder<T> pageSize(Integer pageSize) {
|
||||||
|
@ -122,7 +112,7 @@ public class QueryResultReferences<T extends ReferenceType<T>> extends Container
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see Container#getTotal()
|
* @see ContainerType#getTotal()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder<T> total(Long total) {
|
public Builder<T> total(Long total) {
|
||||||
|
@ -131,7 +121,7 @@ public class QueryResultReferences<T extends ReferenceType<T>> extends Container
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ResourceType#getHref()
|
* @see ContainerType#getHref()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder<T> href(URI href) {
|
public Builder<T> href(URI href) {
|
||||||
|
@ -140,7 +130,7 @@ public class QueryResultReferences<T extends ReferenceType<T>> extends Container
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ResourceType#getType()
|
* @see ContainerType#getType()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder<T> type(String type) {
|
public Builder<T> type(String type) {
|
||||||
|
@ -149,7 +139,7 @@ public class QueryResultReferences<T extends ReferenceType<T>> extends Container
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ResourceType#getLinks()
|
* @see ContainerType#getLinks()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder<T> links(Set<Link> links) {
|
public Builder<T> links(Set<Link> links) {
|
||||||
|
@ -158,7 +148,7 @@ public class QueryResultReferences<T extends ReferenceType<T>> extends Container
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ResourceType#getLinks()
|
* @see ContainerType#getLinks()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder<T> link(Link link) {
|
public Builder<T> link(Link link) {
|
||||||
|
@ -176,35 +166,28 @@ public class QueryResultReferences<T extends ReferenceType<T>> extends Container
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected QueryResultReferences(URI href, String type, Set<Link> links, String name, Integer page, Integer pageSize, Long total, Set<T> references) {
|
||||||
|
super(href, type, links, name, page, pageSize, total);
|
||||||
|
this.references = ImmutableSet.copyOf(references);
|
||||||
|
}
|
||||||
|
|
||||||
protected QueryResultReferences() {
|
protected QueryResultReferences() {
|
||||||
// For JAXB and builder use
|
// For JAXB and builder use
|
||||||
}
|
}
|
||||||
|
|
||||||
protected QueryResultReferences(URI href) {
|
|
||||||
super(href);
|
|
||||||
}
|
|
||||||
|
|
||||||
// NOTE add other types as they are used. probably not the best way to do this.
|
// NOTE add other types as they are used. probably not the best way to do this.
|
||||||
@XmlElementRefs({
|
@XmlElementRefs({
|
||||||
@XmlElementRef(type = CatalogReference.class)
|
@XmlElementRef(type = CatalogReference.class)
|
||||||
})
|
})
|
||||||
protected List<T> references = Lists.newArrayList();
|
private Set<T> references = Sets.newLinkedHashSet();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set of references representing query results.
|
* Set of references representing query results.
|
||||||
*/
|
*/
|
||||||
public List<T> getReferences() {
|
public Set<T> getReferences() {
|
||||||
return references;
|
return references;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setReferences(List<T> references) {
|
|
||||||
this.references = Lists.newArrayList(checkNotNull(references, "references"));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addReference(T reference) {
|
|
||||||
this.references.add(checkNotNull(reference, "reference"));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
|
|
|
@ -23,15 +23,16 @@ import org.jclouds.vcloud.director.v1_5.domain.ResourceEntityType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a base type for VAppType and VmType.
|
* Represents a base type for VAppType and VmType.
|
||||||
*
|
* <p/>
|
||||||
* <pre>
|
* <pre>
|
||||||
* <complexType name="AbstractVAppType" >
|
* <complexType name="AbstractVAppType" >
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author grkvlt@apache.org
|
* @author grkvlt@apache.org
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractVAppType extends ResourceEntityType<AbstractVAppType> {
|
public abstract class AbstractVAppType<T extends AbstractVAppType<T>> extends ResourceEntityType<T> {
|
||||||
|
|
||||||
|
public static abstract class Builder<T extends AbstractVAppType<T>> extends ResourceEntityType.Builder<T> {}
|
||||||
// @XmlElement(name = "VAppParent")
|
// @XmlElement(name = "VAppParent")
|
||||||
// protected ReferenceType vAppParent;
|
// protected ReferenceType vAppParent;
|
||||||
// @XmlElementRef(name = "Section", namespace = "http://schemas.dmtf.org/ovf/envelope/1", type = JAXBElement.class)
|
// @XmlElementRef(name = "Section", namespace = "http://schemas.dmtf.org/ovf/envelope/1", type = JAXBElement.class)
|
||||||
|
|
|
@ -20,26 +20,28 @@ package org.jclouds.vcloud.director.v1_5.domain.vapp;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a vApp.
|
* Represents a vApp.
|
||||||
*
|
* <p/>
|
||||||
* <pre>
|
* <pre>
|
||||||
* <complexType name="VApp" />
|
* <complexType name="VApp" />
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author grkvlt@apache.org
|
* @author grkvlt@apache.org
|
||||||
*/
|
*/
|
||||||
public class VApp extends AbstractVAppType {
|
public class VApp extends AbstractVAppType<VApp> {
|
||||||
//
|
//
|
||||||
// @SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
// public static Builder builder() {
|
public static Builder builder() {
|
||||||
// return new Builder();
|
return new Builder();
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// public Builder toBuilder() {
|
//
|
||||||
// return new Builder().fromVApp(this);
|
@Override
|
||||||
// }
|
public Builder toBuilder() {
|
||||||
//
|
return new Builder().fromVApp(this);
|
||||||
// public static class Builder extends AbstractVAppType.Builder<VApp> {
|
}
|
||||||
//
|
|
||||||
|
public static class Builder extends AbstractVAppType.Builder<VApp> {
|
||||||
|
//
|
||||||
// private Owner owner;
|
// private Owner owner;
|
||||||
// private Boolean inMaintenanceMode;
|
// private Boolean inMaintenanceMode;
|
||||||
// private VAppChildren children;
|
// private VAppChildren children;
|
||||||
|
@ -78,8 +80,11 @@ public class VApp extends AbstractVAppType {
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
// public VApp build() {
|
public VApp build() {
|
||||||
// VApp vApp = new VApp();
|
return new VApp();
|
||||||
|
}
|
||||||
|
|
||||||
|
// VApp vApp = new VApp();
|
||||||
// vApp.setOwner(owner);
|
// vApp.setOwner(owner);
|
||||||
// vApp.setInMaintenanceMode(inMaintenanceMode);
|
// vApp.setInMaintenanceMode(inMaintenanceMode);
|
||||||
// vApp.setChildren(children);
|
// vApp.setChildren(children);
|
||||||
|
@ -92,18 +97,20 @@ public class VApp extends AbstractVAppType {
|
||||||
// public Builder fromAbstractVAppType(AbstractVAppType<VApp> in) {
|
// public Builder fromAbstractVAppType(AbstractVAppType<VApp> in) {
|
||||||
// return Builder.class.cast(super.fromAbstractVAppType(in));
|
// return Builder.class.cast(super.fromAbstractVAppType(in));
|
||||||
// }
|
// }
|
||||||
// public Builder fromVApp(VApp in) {
|
public Builder fromVApp(VApp in) {
|
||||||
|
return new Builder();
|
||||||
|
}
|
||||||
// return fromAbstractVAppType(in)
|
// return fromAbstractVAppType(in)
|
||||||
// .owner(in.getOwner())
|
// .owner(in.getOwner())
|
||||||
// .inMaintenanceMode(in.getInMaintenanceMode())
|
// .inMaintenanceMode(in.getInMaintenanceMode())
|
||||||
// .children(in.getChildren())
|
// .children(in.getChildren())
|
||||||
// .ovfDescriptorUploaded(in.getOvfDescriptorUploaded());
|
// .ovfDescriptorUploaded(in.getOvfDescriptorUploaded());
|
||||||
// }
|
// }
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// private VApp() {
|
private VApp() {
|
||||||
// // For JAXB and builder use
|
// For JAXB and builder use
|
||||||
// }
|
}
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in New Issue