mirror of https://github.com/apache/jclouds.git
domain objects
This commit is contained in:
parent
5dd8f60a9f
commit
9b4e9e24c7
|
@ -0,0 +1,350 @@
|
|||
/**
|
||||
* Licensed to jclouds, Inc. (jclouds) under one or more
|
||||
* contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. jclouds licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.jclouds.vcloud.director.v1_5.domain;
|
||||
|
||||
import static com.google.common.base.Objects.equal;
|
||||
|
||||
import java.util.ArrayList;
|
||||
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.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlSchemaType;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
import org.jclouds.ovf.Section;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
import com.google.common.base.Objects;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Represents a vApp template customization settings section.
|
||||
*
|
||||
*
|
||||
* <p>Java class for CustomizationSection complex type.
|
||||
*
|
||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||
*
|
||||
* <pre>
|
||||
* <complexType name="CustomizationSection">
|
||||
* <complexContent>
|
||||
* <extension base="{http://schemas.dmtf.org/ovf/envelope/1}Section_Type">
|
||||
* <sequence>
|
||||
* <element name="CustomizeOnInstantiate" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
|
||||
* <element name="Link" type="{http://www.vmware.com/vcloud/v1.5}LinkType" maxOccurs="unbounded" minOccurs="0"/>
|
||||
* <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
|
||||
* </sequence>
|
||||
* <attribute name="href" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
|
||||
* <attribute name="type" type="{http://www.w3.org/2001/XMLSchema}string" />
|
||||
* <anyAttribute processContents='lax'/>
|
||||
* </extension>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "CustomizationSection", propOrder = {
|
||||
"customizeOnInstantiate",
|
||||
"link",
|
||||
"any"
|
||||
})
|
||||
public class CustomizationSectionType<T extends CustomizationSectionType<T>>
|
||||
extends Section<T>
|
||||
|
||||
{
|
||||
public static <T extends CustomizationSectionType<T>> Builder<T> builder() {
|
||||
return new Builder<T>();
|
||||
}
|
||||
|
||||
public Builder<T> toBuilder() {
|
||||
return new Builder<T>().fromCustomizationSectionType(this);
|
||||
}
|
||||
|
||||
public static class Builder<T extends CustomizationSectionType<T>> extends Section.Builder<T> {
|
||||
|
||||
private boolean customizeOnInstantiate;
|
||||
private List<Link> link;
|
||||
private List<Object> any;
|
||||
private String href;
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* @see CustomizationSectionType#getCustomizeOnInstantiate()
|
||||
*/
|
||||
public Builder<T> customizeOnInstantiate(boolean customizeOnInstantiate) {
|
||||
this.customizeOnInstantiate = customizeOnInstantiate;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see CustomizationSectionType#getLink()
|
||||
*/
|
||||
public Builder<T> link(List<Link> link) {
|
||||
this.link = link;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see CustomizationSectionType#getAny()
|
||||
*/
|
||||
public Builder<T> any(List<Object> any) {
|
||||
this.any = any;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see CustomizationSectionType#getHref()
|
||||
*/
|
||||
public Builder<T> href(String href) {
|
||||
this.href = href;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see CustomizationSectionType#getType()
|
||||
*/
|
||||
public Builder<T> type(String type) {
|
||||
this.type = type;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public CustomizationSectionType<T> build() {
|
||||
CustomizationSectionType<T> customizationSection = new CustomizationSectionType<T>(info, link, any);
|
||||
customizationSection.setCustomizeOnInstantiate(customizeOnInstantiate);
|
||||
customizationSection.setHref(href);
|
||||
customizationSection.setType(type);
|
||||
return customizationSection;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see Section#getInfo
|
||||
*/
|
||||
public Builder<T> info(String info) {
|
||||
this.info = info;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public Builder<T> fromSection(Section<T> in) {
|
||||
return Builder.class.cast(super.fromSection(in));
|
||||
}
|
||||
|
||||
public Builder<T> fromCustomizationSectionType(CustomizationSectionType<T> in) {
|
||||
return fromSection(in)
|
||||
.customizeOnInstantiate(in.isCustomizeOnInstantiate())
|
||||
.link(in.getLink())
|
||||
.any(in.getAny())
|
||||
.href(in.getHref())
|
||||
.type(in.getType());
|
||||
}
|
||||
}
|
||||
|
||||
private CustomizationSectionType() {
|
||||
// For JAXB and builder use
|
||||
}
|
||||
|
||||
private CustomizationSectionType(String info, List<Link> link, List<Object> any) {
|
||||
super(info);
|
||||
this.link = link;
|
||||
this.any = any;
|
||||
}
|
||||
|
||||
|
||||
@XmlElement(name = "CustomizeOnInstantiate")
|
||||
protected boolean customizeOnInstantiate;
|
||||
@XmlElement(name = "Link")
|
||||
protected List<Link> link;
|
||||
@XmlAnyElement(lax = true)
|
||||
protected List<Object> any;
|
||||
@XmlAttribute
|
||||
@XmlSchemaType(name = "anyURI")
|
||||
protected String href;
|
||||
@XmlAttribute
|
||||
protected String type;
|
||||
|
||||
/**
|
||||
* Gets the value of the customizeOnInstantiate property.
|
||||
*
|
||||
*/
|
||||
public boolean isCustomizeOnInstantiate() {
|
||||
return customizeOnInstantiate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the customizeOnInstantiate property.
|
||||
*
|
||||
*/
|
||||
public void setCustomizeOnInstantiate(boolean value) {
|
||||
this.customizeOnInstantiate = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the link 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 link property.
|
||||
*
|
||||
* <p>
|
||||
* For example, to add a new item, do as follows:
|
||||
* <pre>
|
||||
* getLink().add(newItem);
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* Objects of the following type(s) are allowed in the list
|
||||
* {@link LinkType }
|
||||
*
|
||||
*
|
||||
*/
|
||||
public List<Link> getLink() {
|
||||
if (link == null) {
|
||||
link = new ArrayList<Link>();
|
||||
}
|
||||
return this.link;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the any 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 any property.
|
||||
*
|
||||
* <p>
|
||||
* For example, to add a new item, do as follows:
|
||||
* <pre>
|
||||
* getAny().add(newItem);
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* <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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the href property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getHref() {
|
||||
return href;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the href property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setHref(String value) {
|
||||
this.href = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the type property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getType() {
|
||||
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
|
||||
public boolean equals(Object o) {
|
||||
if (this == o)
|
||||
return true;
|
||||
if (o == null || getClass() != o.getClass())
|
||||
return false;
|
||||
CustomizationSectionType<?> that = CustomizationSectionType.class.cast(o);
|
||||
return equal(customizeOnInstantiate, that.customizeOnInstantiate) &&
|
||||
equal(link, that.link) &&
|
||||
equal(any, that.any) &&
|
||||
equal(href, that.href) &&
|
||||
equal(type, that.type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hashCode(customizeOnInstantiate,
|
||||
link,
|
||||
any,
|
||||
href,
|
||||
type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Objects.toStringHelper("")
|
||||
.add("customizeOnInstantiate", customizeOnInstantiate)
|
||||
.add("link", link)
|
||||
.add("any", any)
|
||||
.add("href", href)
|
||||
.add("type", type).toString();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,477 @@
|
|||
/**
|
||||
* Licensed to jclouds, Inc. (jclouds) under one or more
|
||||
* contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. jclouds licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.jclouds.vcloud.director.v1_5.domain;
|
||||
|
||||
import static com.google.common.base.Objects.equal;
|
||||
|
||||
import java.util.ArrayList;
|
||||
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.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlSchemaType;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
import javax.xml.datatype.XMLGregorianCalendar;
|
||||
|
||||
import org.jclouds.ovf.Section;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
import com.google.common.base.Objects;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Represents the lease settings section for a vApp.
|
||||
*
|
||||
*
|
||||
* <p>Java class for LeaseSettingsSection complex type.
|
||||
*
|
||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||
*
|
||||
* <pre>
|
||||
* <complexType name="LeaseSettingsSection">
|
||||
* <complexContent>
|
||||
* <extension base="{http://schemas.dmtf.org/ovf/envelope/1}Section_Type">
|
||||
* <sequence>
|
||||
* <element name="Link" type="{http://www.vmware.com/vcloud/v1.5}LinkType" maxOccurs="unbounded" minOccurs="0"/>
|
||||
* <element name="DeploymentLeaseInSeconds" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
|
||||
* <element name="StorageLeaseInSeconds" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
|
||||
* <element name="DeploymentLeaseExpiration" type="{http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0"/>
|
||||
* <element name="StorageLeaseExpiration" type="{http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0"/>
|
||||
* <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
|
||||
* </sequence>
|
||||
* <attribute name="href" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
|
||||
* <attribute name="type" type="{http://www.w3.org/2001/XMLSchema}string" />
|
||||
* <anyAttribute processContents='lax'/>
|
||||
* </extension>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "LeaseSettingsSection", propOrder = {
|
||||
"link",
|
||||
"deploymentLeaseInSeconds",
|
||||
"storageLeaseInSeconds",
|
||||
"deploymentLeaseExpiration",
|
||||
"storageLeaseExpiration",
|
||||
"any"
|
||||
})
|
||||
public class LeaseSettingsSection<T extends LeaseSettingsSection<T>>
|
||||
extends Section<T>
|
||||
|
||||
{
|
||||
public static <T extends LeaseSettingsSection<T>> Builder<T> builder() {
|
||||
return new Builder<T>();
|
||||
}
|
||||
|
||||
public Builder<T> toBuilder() {
|
||||
return new Builder<T>().fromLeaseSettingsSection(this);
|
||||
}
|
||||
|
||||
public static class Builder<T extends LeaseSettingsSection<T>> extends Section.Builder<T> {
|
||||
|
||||
private List<Link> link;
|
||||
private Integer deploymentLeaseInSeconds;
|
||||
private Integer storageLeaseInSeconds;
|
||||
private XMLGregorianCalendar deploymentLeaseExpiration;
|
||||
private XMLGregorianCalendar storageLeaseExpiration;
|
||||
private List<Object> any;
|
||||
private String href;
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* @see LeaseSettingsSection#getLink()
|
||||
*/
|
||||
public Builder<T> link(List<Link> link) {
|
||||
this.link = link;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see LeaseSettingsSection#getDeploymentLeaseInSeconds()
|
||||
*/
|
||||
public Builder<T> deploymentLeaseInSeconds(Integer deploymentLeaseInSeconds) {
|
||||
this.deploymentLeaseInSeconds = deploymentLeaseInSeconds;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see LeaseSettingsSection#getStorageLeaseInSeconds()
|
||||
*/
|
||||
public Builder<T> storageLeaseInSeconds(Integer storageLeaseInSeconds) {
|
||||
this.storageLeaseInSeconds = storageLeaseInSeconds;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see LeaseSettingsSection#getDeploymentLeaseExpiration()
|
||||
*/
|
||||
public Builder<T> deploymentLeaseExpiration(XMLGregorianCalendar deploymentLeaseExpiration) {
|
||||
this.deploymentLeaseExpiration = deploymentLeaseExpiration;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see LeaseSettingsSection#getStorageLeaseExpiration()
|
||||
*/
|
||||
public Builder<T> storageLeaseExpiration(XMLGregorianCalendar storageLeaseExpiration) {
|
||||
this.storageLeaseExpiration = storageLeaseExpiration;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see LeaseSettingsSection#getAny()
|
||||
*/
|
||||
public Builder<T> any(List<Object> any) {
|
||||
this.any = any;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see LeaseSettingsSection#getHref()
|
||||
*/
|
||||
public Builder<T> href(String href) {
|
||||
this.href = href;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see LeaseSettingsSection#getType()
|
||||
*/
|
||||
public Builder<T> type(String type) {
|
||||
this.type = type;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public LeaseSettingsSection<T> build() {
|
||||
LeaseSettingsSection<T> leaseSettingsSection = new LeaseSettingsSection<T>(link, any);
|
||||
leaseSettingsSection.setDeploymentLeaseInSeconds(deploymentLeaseInSeconds);
|
||||
leaseSettingsSection.setStorageLeaseInSeconds(storageLeaseInSeconds);
|
||||
leaseSettingsSection.setDeploymentLeaseExpiration(deploymentLeaseExpiration);
|
||||
leaseSettingsSection.setStorageLeaseExpiration(storageLeaseExpiration);
|
||||
leaseSettingsSection.setHref(href);
|
||||
leaseSettingsSection.setType(type);
|
||||
return leaseSettingsSection;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public Builder<T> fromSection(Section<T> in) {
|
||||
return Builder.class.cast(super.fromSection(in));
|
||||
}
|
||||
public Builder<T> fromLeaseSettingsSection(LeaseSettingsSection<T> in) {
|
||||
return fromSection(in)
|
||||
.link(in.getLink())
|
||||
.deploymentLeaseInSeconds(in.getDeploymentLeaseInSeconds())
|
||||
.storageLeaseInSeconds(in.getStorageLeaseInSeconds())
|
||||
.deploymentLeaseExpiration(in.getDeploymentLeaseExpiration())
|
||||
.storageLeaseExpiration(in.getStorageLeaseExpiration())
|
||||
.any(in.getAny())
|
||||
.href(in.getHref())
|
||||
.type(in.getType());
|
||||
}
|
||||
}
|
||||
|
||||
private LeaseSettingsSection() {
|
||||
// For JAXB and builder use
|
||||
}
|
||||
|
||||
private LeaseSettingsSection(List<Link> link, List<Object> any) {
|
||||
this.link = link;
|
||||
this.any = any;
|
||||
}
|
||||
|
||||
|
||||
@XmlElement(name = "Link")
|
||||
protected List<Link> link;
|
||||
@XmlElement(name = "DeploymentLeaseInSeconds")
|
||||
protected Integer deploymentLeaseInSeconds;
|
||||
@XmlElement(name = "StorageLeaseInSeconds")
|
||||
protected Integer storageLeaseInSeconds;
|
||||
@XmlElement(name = "DeploymentLeaseExpiration")
|
||||
@XmlSchemaType(name = "dateTime")
|
||||
protected XMLGregorianCalendar deploymentLeaseExpiration;
|
||||
@XmlElement(name = "StorageLeaseExpiration")
|
||||
@XmlSchemaType(name = "dateTime")
|
||||
protected XMLGregorianCalendar storageLeaseExpiration;
|
||||
@XmlAnyElement(lax = true)
|
||||
protected List<Object> any;
|
||||
@XmlAttribute
|
||||
@XmlSchemaType(name = "anyURI")
|
||||
protected String href;
|
||||
@XmlAttribute
|
||||
protected String type;
|
||||
|
||||
/**
|
||||
* Gets the value of the link 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 link property.
|
||||
*
|
||||
* <p>
|
||||
* For example, to add a new item, do as follows:
|
||||
* <pre>
|
||||
* getLink().add(newItem);
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* Objects of the following type(s) are allowed in the list
|
||||
* {@link LinkType }
|
||||
*
|
||||
*
|
||||
*/
|
||||
public List<Link> getLink() {
|
||||
if (link == null) {
|
||||
link = new ArrayList<Link>();
|
||||
}
|
||||
return this.link;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the deploymentLeaseInSeconds property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link Integer }
|
||||
*
|
||||
*/
|
||||
public Integer getDeploymentLeaseInSeconds() {
|
||||
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.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link Integer }
|
||||
*
|
||||
*/
|
||||
public Integer getStorageLeaseInSeconds() {
|
||||
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.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link XMLGregorianCalendar }
|
||||
*
|
||||
*/
|
||||
public XMLGregorianCalendar getDeploymentLeaseExpiration() {
|
||||
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.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link XMLGregorianCalendar }
|
||||
*
|
||||
*/
|
||||
public XMLGregorianCalendar getStorageLeaseExpiration() {
|
||||
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>
|
||||
* 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>
|
||||
* For example, to add a new item, do as follows:
|
||||
* <pre>
|
||||
* getAny().add(newItem);
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* <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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the href property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getHref() {
|
||||
return href;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the href property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setHref(String value) {
|
||||
this.href = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the type property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getType() {
|
||||
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
|
||||
public boolean equals(Object o) {
|
||||
if (this == o)
|
||||
return true;
|
||||
if (o == null || getClass() != o.getClass())
|
||||
return false;
|
||||
LeaseSettingsSection<?> that = LeaseSettingsSection.class.cast(o);
|
||||
return equal(link, that.link) &&
|
||||
equal(deploymentLeaseInSeconds, that.deploymentLeaseInSeconds) &&
|
||||
equal(storageLeaseInSeconds, that.storageLeaseInSeconds) &&
|
||||
equal(deploymentLeaseExpiration, that.deploymentLeaseExpiration) &&
|
||||
equal(storageLeaseExpiration, that.storageLeaseExpiration) &&
|
||||
equal(any, that.any) &&
|
||||
equal(href, that.href) &&
|
||||
equal(type, that.type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hashCode(link,
|
||||
deploymentLeaseInSeconds,
|
||||
storageLeaseInSeconds,
|
||||
deploymentLeaseExpiration,
|
||||
storageLeaseExpiration,
|
||||
any,
|
||||
href,
|
||||
type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Objects.toStringHelper("")
|
||||
.add("link", link)
|
||||
.add("deploymentLeaseInSeconds", deploymentLeaseInSeconds)
|
||||
.add("storageLeaseInSeconds", storageLeaseInSeconds)
|
||||
.add("deploymentLeaseExpiration", deploymentLeaseExpiration)
|
||||
.add("storageLeaseExpiration", storageLeaseExpiration)
|
||||
.add("any", any)
|
||||
.add("href", href)
|
||||
.add("type", type).toString();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,352 @@
|
|||
/**
|
||||
* Licensed to jclouds, Inc. (jclouds) under one or more
|
||||
* contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. jclouds licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.jclouds.vcloud.director.v1_5.domain;
|
||||
|
||||
import static com.google.common.base.Objects.equal;
|
||||
|
||||
import java.util.ArrayList;
|
||||
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.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlSchemaType;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
import org.jclouds.ovf.Section;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
import com.google.common.base.Objects;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Represents the network config section of a vApp.
|
||||
*
|
||||
*
|
||||
* <p>Java class for NetworkConfigSection complex type.
|
||||
*
|
||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||
*
|
||||
* <pre>
|
||||
* <complexType name="NetworkConfigSection">
|
||||
* <complexContent>
|
||||
* <extension base="{http://schemas.dmtf.org/ovf/envelope/1}Section_Type">
|
||||
* <sequence>
|
||||
* <element name="Link" type="{http://www.vmware.com/vcloud/v1.5}LinkType" maxOccurs="unbounded" minOccurs="0"/>
|
||||
* <element name="NetworkConfig" type="{http://www.vmware.com/vcloud/v1.5}VAppNetworkConfigurationType" maxOccurs="unbounded" minOccurs="0"/>
|
||||
* <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
|
||||
* </sequence>
|
||||
* <attribute name="href" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
|
||||
* <attribute name="type" type="{http://www.w3.org/2001/XMLSchema}string" />
|
||||
* <anyAttribute processContents='lax'/>
|
||||
* </extension>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "NetworkConfigSection", propOrder = {
|
||||
"link",
|
||||
"networkConfig",
|
||||
"any"
|
||||
})
|
||||
public class NetworkConfigSection<T extends NetworkConfigSection<T>>
|
||||
extends Section<T>
|
||||
|
||||
{
|
||||
public static <T extends NetworkConfigSection<T>> Builder<T> builder() {
|
||||
return new Builder<T>();
|
||||
}
|
||||
|
||||
public Builder<T> toBuilder() {
|
||||
return new Builder<T>().fromNetworkConfigSection(this);
|
||||
}
|
||||
|
||||
public static class Builder<T extends NetworkConfigSection<T>> extends Section.Builder<T> {
|
||||
|
||||
private List<Link> link;
|
||||
private List<VAppNetworkConfiguration<?>> networkConfig;
|
||||
private List<Object> any;
|
||||
private String href;
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* @see NetworkConfigSection#getLink()
|
||||
*/
|
||||
public Builder<T> link(List<Link> link) {
|
||||
this.link = link;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see NetworkConfigSection#getNetworkConfig()
|
||||
*/
|
||||
public Builder<T> networkConfig(List<VAppNetworkConfiguration<?>> networkConfig) {
|
||||
this.networkConfig = networkConfig;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see NetworkConfigSection#getAny()
|
||||
*/
|
||||
public Builder<T> any(List<Object> any) {
|
||||
this.any = any;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see NetworkConfigSection#getHref()
|
||||
*/
|
||||
public Builder<T> href(String href) {
|
||||
this.href = href;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see NetworkConfigSection#getType()
|
||||
*/
|
||||
public Builder<T> type(String type) {
|
||||
this.type = type;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public NetworkConfigSection<T> build() {
|
||||
NetworkConfigSection<T> networkConfigSection = new NetworkConfigSection<T>(link, networkConfig, any);
|
||||
networkConfigSection.setHref(href);
|
||||
networkConfigSection.setType(type);
|
||||
return networkConfigSection;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public Builder<T> fromSection(Section<T> in) {
|
||||
return Builder.class.cast(super.fromSection(in));
|
||||
}
|
||||
public Builder<T> fromNetworkConfigSection(NetworkConfigSection<T> in) {
|
||||
return fromSection(in)
|
||||
.link(in.getLink())
|
||||
.networkConfig(in.getNetworkConfig())
|
||||
.any(in.getAny())
|
||||
.href(in.getHref())
|
||||
.type(in.getType());
|
||||
}
|
||||
}
|
||||
|
||||
private NetworkConfigSection() {
|
||||
// For JAXB and builder use
|
||||
}
|
||||
|
||||
private NetworkConfigSection(List<Link> link, List<VAppNetworkConfiguration<?>> networkConfig, List<Object> any) {
|
||||
this.link = link;
|
||||
this.networkConfig = networkConfig;
|
||||
this.any = any;
|
||||
}
|
||||
|
||||
|
||||
@XmlElement(name = "Link")
|
||||
protected List<Link> link;
|
||||
@XmlElement(name = "NetworkConfig")
|
||||
protected List<VAppNetworkConfiguration<?>> networkConfig;
|
||||
@XmlAnyElement(lax = true)
|
||||
protected List<Object> any;
|
||||
@XmlAttribute
|
||||
@XmlSchemaType(name = "anyURI")
|
||||
protected String href;
|
||||
@XmlAttribute
|
||||
protected String type;
|
||||
|
||||
/**
|
||||
* Gets the value of the link 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 link property.
|
||||
*
|
||||
* <p>
|
||||
* For example, to add a new item, do as follows:
|
||||
* <pre>
|
||||
* getLink().add(newItem);
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* Objects of the following type(s) are allowed in the list
|
||||
* {@link LinkType }
|
||||
*
|
||||
*
|
||||
*/
|
||||
public List<Link> getLink() {
|
||||
if (link == null) {
|
||||
link = new ArrayList<Link>();
|
||||
}
|
||||
return this.link;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the networkConfig 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 networkConfig property.
|
||||
*
|
||||
* <p>
|
||||
* For example, to add a new item, do as follows:
|
||||
* <pre>
|
||||
* getNetworkConfig().add(newItem);
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* Objects of the following type(s) are allowed in the list
|
||||
* {@link VAppNetworkConfigurationType }
|
||||
*
|
||||
*
|
||||
*/
|
||||
public List<VAppNetworkConfiguration<?>> getNetworkConfig() {
|
||||
if (networkConfig == null) {
|
||||
networkConfig = new ArrayList<VAppNetworkConfiguration<?>>();
|
||||
}
|
||||
return this.networkConfig;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the any 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 any property.
|
||||
*
|
||||
* <p>
|
||||
* For example, to add a new item, do as follows:
|
||||
* <pre>
|
||||
* getAny().add(newItem);
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* <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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the href property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getHref() {
|
||||
return href;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the href property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setHref(String value) {
|
||||
this.href = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the type property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getType() {
|
||||
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
|
||||
public boolean equals(Object o) {
|
||||
if (this == o)
|
||||
return true;
|
||||
if (o == null || getClass() != o.getClass())
|
||||
return false;
|
||||
NetworkConfigSection<?> that = NetworkConfigSection.class.cast(o);
|
||||
return equal(link, that.link) &&
|
||||
equal(networkConfig, that.networkConfig) &&
|
||||
equal(any, that.any) &&
|
||||
equal(href, that.href) &&
|
||||
equal(type, that.type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hashCode(link,
|
||||
networkConfig,
|
||||
any,
|
||||
href,
|
||||
type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Objects.toStringHelper("")
|
||||
.add("link", link)
|
||||
.add("networkConfig", networkConfig)
|
||||
.add("any", any)
|
||||
.add("href", href)
|
||||
.add("type", type).toString();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,427 @@
|
|||
/**
|
||||
* Licensed to jclouds, Inc. (jclouds) under one or more
|
||||
* contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. jclouds licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.jclouds.vcloud.director.v1_5.domain;
|
||||
|
||||
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.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
import com.google.common.base.Objects;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Represents a network connection.
|
||||
*
|
||||
*
|
||||
* <p>Java class for NetworkConnection complex type.
|
||||
*
|
||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||
*
|
||||
* <pre>
|
||||
* <complexType name="NetworkConnection">
|
||||
* <complexContent>
|
||||
* <extension base="{http://www.vmware.com/vcloud/v1.5}VCloudExtensibleType">
|
||||
* <sequence>
|
||||
* <element name="NetworkConnectionIndex" type="{http://www.w3.org/2001/XMLSchema}int"/>
|
||||
* <element name="IpAddress" type="{http://www.vmware.com/vcloud/v1.5}IpAddressType" minOccurs="0"/>
|
||||
* <element name="ExternalIpAddress" type="{http://www.vmware.com/vcloud/v1.5}IpAddressType" minOccurs="0"/>
|
||||
* <element name="IsConnected" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
|
||||
* <element name="MACAddress" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
|
||||
* <element name="IpAddressAllocationMode" type="{http://www.w3.org/2001/XMLSchema}string"/>
|
||||
* </sequence>
|
||||
* <attribute name="network" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
|
||||
* <attribute name="needsCustomization" type="{http://www.w3.org/2001/XMLSchema}boolean" />
|
||||
* <anyAttribute processContents='lax' namespace='##other'/>
|
||||
* </extension>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "NetworkConnection", propOrder = {
|
||||
"networkConnectionIndex",
|
||||
"ipAddress",
|
||||
"externalIpAddress",
|
||||
"isConnected",
|
||||
"macAddress",
|
||||
"ipAddressAllocationMode"
|
||||
})
|
||||
public class NetworkConnection {
|
||||
public static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public Builder toBuilder() {
|
||||
return new Builder().fromNetworkConnection(this);
|
||||
}
|
||||
|
||||
public static class Builder {
|
||||
|
||||
private int networkConnectionIndex;
|
||||
private String ipAddress;
|
||||
private String externalIpAddress;
|
||||
private boolean isConnected;
|
||||
private String macAddress;
|
||||
private String ipAddressAllocationMode;
|
||||
private String network;
|
||||
private Boolean needsCustomization;
|
||||
|
||||
/**
|
||||
* @see NetworkConnection#getNetworkConnectionIndex()
|
||||
*/
|
||||
public Builder networkConnectionIndex(int networkConnectionIndex) {
|
||||
this.networkConnectionIndex = networkConnectionIndex;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see NetworkConnection#getIpAddress()
|
||||
*/
|
||||
public Builder ipAddress(String ipAddress) {
|
||||
this.ipAddress = ipAddress;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see NetworkConnection#getExternalIpAddress()
|
||||
*/
|
||||
public Builder externalIpAddress(String externalIpAddress) {
|
||||
this.externalIpAddress = externalIpAddress;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see NetworkConnection#getIsConnected()
|
||||
*/
|
||||
public Builder isConnected(boolean isConnected) {
|
||||
this.isConnected = isConnected;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see NetworkConnection#getMacAddress()
|
||||
*/
|
||||
public Builder macAddress(String macAddress) {
|
||||
this.macAddress = macAddress;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see NetworkConnection#getIpAddressAllocationMode()
|
||||
*/
|
||||
public Builder ipAddressAllocationMode(String ipAddressAllocationMode) {
|
||||
this.ipAddressAllocationMode = ipAddressAllocationMode;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see NetworkConnection#getNetwork()
|
||||
*/
|
||||
public Builder network(String network) {
|
||||
this.network = network;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see NetworkConnection#getNeedsCustomization()
|
||||
*/
|
||||
public Builder needsCustomization(Boolean needsCustomization) {
|
||||
this.needsCustomization = needsCustomization;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public NetworkConnection build() {
|
||||
NetworkConnection networkConnection = new NetworkConnection(macAddress);
|
||||
networkConnection.setNetworkConnectionIndex(networkConnectionIndex);
|
||||
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) {
|
||||
return networkConnectionIndex(in.getNetworkConnectionIndex())
|
||||
.ipAddress(in.getIpAddress())
|
||||
.externalIpAddress(in.getExternalIpAddress())
|
||||
.isConnected(in.isConnected())
|
||||
.macAddress(in.getMACAddress())
|
||||
.ipAddressAllocationMode(in.getIpAddressAllocationMode())
|
||||
.network(in.getNetwork())
|
||||
.needsCustomization(in.needsCustomization());
|
||||
}
|
||||
}
|
||||
|
||||
private NetworkConnection() {
|
||||
// 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the networkConnectionIndex property.
|
||||
*
|
||||
*/
|
||||
public void setNetworkConnectionIndex(int value) {
|
||||
this.networkConnectionIndex = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the ipAddress property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getIpAddress() {
|
||||
return ipAddress;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the ipAddress property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setIpAddress(String value) {
|
||||
this.ipAddress = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the externalIpAddress property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
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
|
||||
public boolean equals(Object o) {
|
||||
if (this == o)
|
||||
return true;
|
||||
if (o == null || getClass() != o.getClass())
|
||||
return false;
|
||||
NetworkConnection that = NetworkConnection.class.cast(o);
|
||||
return equal(networkConnectionIndex, that.networkConnectionIndex) &&
|
||||
equal(ipAddress, that.ipAddress) &&
|
||||
equal(externalIpAddress, that.externalIpAddress) &&
|
||||
equal(isConnected, that.isConnected) &&
|
||||
equal(macAddress, that.macAddress) &&
|
||||
equal(ipAddressAllocationMode, that.ipAddressAllocationMode) &&
|
||||
equal(network, that.network) &&
|
||||
equal(needsCustomization, that.needsCustomization);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hashCode(networkConnectionIndex,
|
||||
ipAddress,
|
||||
externalIpAddress,
|
||||
isConnected,
|
||||
macAddress,
|
||||
ipAddressAllocationMode,
|
||||
network,
|
||||
needsCustomization);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Objects.toStringHelper("")
|
||||
.add("networkConnectionIndex", networkConnectionIndex)
|
||||
.add("ipAddress", ipAddress)
|
||||
.add("externalIpAddress", externalIpAddress)
|
||||
.add("isConnected", isConnected)
|
||||
.add("macAddress", macAddress)
|
||||
.add("ipAddressAllocationMode", ipAddressAllocationMode)
|
||||
.add("network", network)
|
||||
.add("needsCustomization", needsCustomization).toString();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,395 @@
|
|||
/**
|
||||
* Licensed to jclouds, Inc. (jclouds) under one or more
|
||||
* contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. jclouds licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.jclouds.vcloud.director.v1_5.domain;
|
||||
|
||||
import static com.google.common.base.Objects.equal;
|
||||
|
||||
import java.util.ArrayList;
|
||||
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.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlSchemaType;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
import org.jclouds.ovf.Section;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
import com.google.common.base.Objects;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Represents a list of network cards existing in a VM.
|
||||
*
|
||||
*
|
||||
* <p>Java class for NetworkConnectionSection complex type.
|
||||
*
|
||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||
*
|
||||
* <pre>
|
||||
* <complexType name="NetworkConnectionSection">
|
||||
* <complexContent>
|
||||
* <extension base="{http://schemas.dmtf.org/ovf/envelope/1}Section_Type">
|
||||
* <sequence>
|
||||
* <element name="PrimaryNetworkConnectionIndex" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
|
||||
* <element name="NetworkConnection" type="{http://www.vmware.com/vcloud/v1.5}NetworkConnectionType" maxOccurs="unbounded" minOccurs="0"/>
|
||||
* <element name="Link" type="{http://www.vmware.com/vcloud/v1.5}LinkType" maxOccurs="unbounded" minOccurs="0"/>
|
||||
* <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
|
||||
* </sequence>
|
||||
* <attribute name="href" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
|
||||
* <attribute name="type" type="{http://www.w3.org/2001/XMLSchema}string" />
|
||||
* <anyAttribute processContents='lax'/>
|
||||
* </extension>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "NetworkConnectionSection", propOrder = {
|
||||
"primaryNetworkConnectionIndex",
|
||||
"networkConnection",
|
||||
"link",
|
||||
"any"
|
||||
})
|
||||
public class NetworkConnectionSection<T extends NetworkConnectionSection<T>>
|
||||
extends Section<T>
|
||||
|
||||
{
|
||||
public static <T extends NetworkConnectionSection<T>> Builder<T> builder() {
|
||||
return new Builder<T>();
|
||||
}
|
||||
|
||||
public Builder<T> toBuilder() {
|
||||
return new Builder<T>().fromNetworkConnectionSection(this);
|
||||
}
|
||||
|
||||
public static class Builder<T extends NetworkConnectionSection<T>> extends Section.Builder<T> {
|
||||
|
||||
private Integer primaryNetworkConnectionIndex;
|
||||
private List<NetworkConnection> networkConnection;
|
||||
private List<Link> link;
|
||||
private List<Object> any;
|
||||
private String href;
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* @see NetworkConnectionSection#getPrimaryNetworkConnectionIndex()
|
||||
*/
|
||||
public Builder<T> primaryNetworkConnectionIndex(Integer primaryNetworkConnectionIndex) {
|
||||
this.primaryNetworkConnectionIndex = primaryNetworkConnectionIndex;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see NetworkConnectionSection#getNetworkConnection()
|
||||
*/
|
||||
public Builder<T> networkConnection(List<NetworkConnection> networkConnection) {
|
||||
this.networkConnection = networkConnection;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see NetworkConnectionSection#getLink()
|
||||
*/
|
||||
public Builder<T> link(List<Link> link) {
|
||||
this.link = link;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see NetworkConnectionSection#getAny()
|
||||
*/
|
||||
public Builder<T> any(List<Object> any) {
|
||||
this.any = any;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see NetworkConnectionSection#getHref()
|
||||
*/
|
||||
public Builder<T> href(String href) {
|
||||
this.href = href;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see NetworkConnectionSection#getType()
|
||||
*/
|
||||
public Builder<T> type(String type) {
|
||||
this.type = type;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public NetworkConnectionSection<T> build() {
|
||||
NetworkConnectionSection<T> networkConnectionSection = new NetworkConnectionSection<T>(networkConnection, link, any);
|
||||
networkConnectionSection.setPrimaryNetworkConnectionIndex(primaryNetworkConnectionIndex);
|
||||
networkConnectionSection.setHref(href);
|
||||
networkConnectionSection.setType(type);
|
||||
return networkConnectionSection;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public Builder<T> fromSection(Section<T> in) {
|
||||
return Builder.class.cast(super.fromSection(in));
|
||||
}
|
||||
public Builder<T> fromNetworkConnectionSection(NetworkConnectionSection<T> in) {
|
||||
return fromSection(in)
|
||||
.primaryNetworkConnectionIndex(in.getPrimaryNetworkConnectionIndex())
|
||||
.networkConnection(in.getNetworkConnection())
|
||||
.link(in.getLink())
|
||||
.any(in.getAny())
|
||||
.href(in.getHref())
|
||||
.type(in.getType());
|
||||
}
|
||||
}
|
||||
|
||||
private NetworkConnectionSection() {
|
||||
// For JAXB and builder use
|
||||
}
|
||||
|
||||
private NetworkConnectionSection(List<NetworkConnection> networkConnection, List<Link> link, List<Object> any) {
|
||||
this.networkConnection = networkConnection;
|
||||
this.link = link;
|
||||
this.any = any;
|
||||
}
|
||||
|
||||
|
||||
@XmlElement(name = "PrimaryNetworkConnectionIndex")
|
||||
protected Integer primaryNetworkConnectionIndex;
|
||||
@XmlElement(name = "NetworkConnection")
|
||||
protected List<NetworkConnection> networkConnection;
|
||||
@XmlElement(name = "Link")
|
||||
protected List<Link> link;
|
||||
@XmlAnyElement(lax = true)
|
||||
protected List<Object> any;
|
||||
@XmlAttribute
|
||||
@XmlSchemaType(name = "anyURI")
|
||||
protected String href;
|
||||
@XmlAttribute
|
||||
protected String type;
|
||||
|
||||
/**
|
||||
* Gets the value of the primaryNetworkConnectionIndex property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link Integer }
|
||||
*
|
||||
*/
|
||||
public Integer getPrimaryNetworkConnectionIndex() {
|
||||
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.
|
||||
*
|
||||
* <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>
|
||||
* For example, to add a new item, do as follows:
|
||||
* <pre>
|
||||
* getNetworkConnection().add(newItem);
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* Objects of the following type(s) are allowed in the list
|
||||
* {@link NetworkConnectionType }
|
||||
*
|
||||
*
|
||||
*/
|
||||
public List<NetworkConnection> getNetworkConnection() {
|
||||
if (networkConnection == null) {
|
||||
networkConnection = new ArrayList<NetworkConnection>();
|
||||
}
|
||||
return this.networkConnection;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the link 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 link property.
|
||||
*
|
||||
* <p>
|
||||
* For example, to add a new item, do as follows:
|
||||
* <pre>
|
||||
* getLink().add(newItem);
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* Objects of the following type(s) are allowed in the list
|
||||
* {@link LinkType }
|
||||
*
|
||||
*
|
||||
*/
|
||||
public List<Link> getLink() {
|
||||
if (link == null) {
|
||||
link = new ArrayList<Link>();
|
||||
}
|
||||
return this.link;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the any 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 any property.
|
||||
*
|
||||
* <p>
|
||||
* For example, to add a new item, do as follows:
|
||||
* <pre>
|
||||
* getAny().add(newItem);
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* <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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the href property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getHref() {
|
||||
return href;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the href property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setHref(String value) {
|
||||
this.href = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the type property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getType() {
|
||||
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
|
||||
public boolean equals(Object o) {
|
||||
if (this == o)
|
||||
return true;
|
||||
if (o == null || getClass() != o.getClass())
|
||||
return false;
|
||||
NetworkConnectionSection<?> that = NetworkConnectionSection.class.cast(o);
|
||||
return equal(primaryNetworkConnectionIndex, that.primaryNetworkConnectionIndex) &&
|
||||
equal(networkConnection, that.networkConnection) &&
|
||||
equal(link, that.link) &&
|
||||
equal(any, that.any) &&
|
||||
equal(href, that.href) &&
|
||||
equal(type, that.type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hashCode(primaryNetworkConnectionIndex,
|
||||
networkConnection,
|
||||
link,
|
||||
any,
|
||||
href,
|
||||
type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Objects.toStringHelper("")
|
||||
.add("primaryNetworkConnectionIndex", primaryNetworkConnectionIndex)
|
||||
.add("networkConnection", networkConnection)
|
||||
.add("link", link)
|
||||
.add("any", any)
|
||||
.add("href", href)
|
||||
.add("type", type).toString();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,211 @@
|
|||
/**
|
||||
* Licensed to jclouds, Inc. (jclouds) under one or more
|
||||
* contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. jclouds licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.jclouds.vcloud.director.v1_5.domain;
|
||||
|
||||
import static com.google.common.base.Objects.equal;
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import java.net.URI;
|
||||
import java.util.ArrayList;
|
||||
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.XmlType;
|
||||
|
||||
import org.jclouds.ovf.ProductSection;
|
||||
|
||||
import com.google.common.base.Objects;
|
||||
import com.google.common.collect.Sets;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Essentially a container
|
||||
* with a list of product sections.
|
||||
*
|
||||
*
|
||||
* <p>Java class for ProductSectionList complex type.
|
||||
*
|
||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||
*
|
||||
* <pre>
|
||||
* <complexType name="ProductSectionList">
|
||||
* <complexContent>
|
||||
* <extension base="{http://www.vmware.com/vcloud/v1.5}ResourceType">
|
||||
* <sequence>
|
||||
* <element ref="{http://schemas.dmtf.org/ovf/envelope/1}ProductSection" maxOccurs="unbounded" minOccurs="0"/>
|
||||
* </sequence>
|
||||
* <anyAttribute processContents='lax' namespace='##other'/>
|
||||
* </extension>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "ProductSectionList", propOrder = {
|
||||
"productSection"
|
||||
})
|
||||
public class ProductSectionList
|
||||
extends ResourceType<ProductSectionList>
|
||||
|
||||
{
|
||||
@SuppressWarnings("unchecked")
|
||||
public static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public Builder toBuilder() {
|
||||
return new Builder().fromProductSectionList(this);
|
||||
}
|
||||
|
||||
public static class Builder extends ResourceType.Builder<ProductSectionList> {
|
||||
|
||||
private List<ProductSection> productSection;
|
||||
|
||||
/**
|
||||
* @see ProductSectionList#getProductSection()
|
||||
*/
|
||||
public Builder productSection(List<ProductSection> productSection) {
|
||||
this.productSection = productSection;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public ProductSectionList build() {
|
||||
ProductSectionList productSectionList = new ProductSectionList(productSection);
|
||||
return productSectionList;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @see ResourceType#getHref()
|
||||
*/
|
||||
@Override
|
||||
public Builder href(URI href) {
|
||||
super.href(href);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ResourceType#getType()
|
||||
*/
|
||||
@Override
|
||||
public Builder type(String type) {
|
||||
super.type(type);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ResourceType#getLinks()
|
||||
*/
|
||||
@Override
|
||||
public Builder links(Set<Link> links) {
|
||||
super.links(Sets.newLinkedHashSet(checkNotNull(links, "links")));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ResourceType#getLinks()
|
||||
*/
|
||||
@Override
|
||||
public Builder link(Link link) {
|
||||
super.link(link);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Builder fromResourceType(ResourceType<ProductSectionList> in) {
|
||||
return Builder.class.cast(super.fromResourceType(in));
|
||||
}
|
||||
public Builder fromProductSectionList(ProductSectionList in) {
|
||||
return fromResourceType(in)
|
||||
.productSection(in.getProductSection());
|
||||
}
|
||||
}
|
||||
|
||||
private ProductSectionList() {
|
||||
// For JAXB and builder use
|
||||
}
|
||||
|
||||
private ProductSectionList(List<ProductSection> productSection) {
|
||||
this.productSection = productSection;
|
||||
}
|
||||
|
||||
|
||||
@XmlElement(name = "ProductSection", namespace = "http://schemas.dmtf.org/ovf/envelope/1")
|
||||
protected List<ProductSection> productSection;
|
||||
|
||||
/**
|
||||
* Gets the value of the productSection 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 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 ProductSectionType }
|
||||
*
|
||||
*
|
||||
*/
|
||||
public List<ProductSection> getProductSection() {
|
||||
if (productSection == null) {
|
||||
productSection = new ArrayList<ProductSection>();
|
||||
}
|
||||
return this.productSection;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o)
|
||||
return true;
|
||||
if (o == null || getClass() != o.getClass())
|
||||
return false;
|
||||
ProductSectionList that = ProductSectionList.class.cast(o);
|
||||
return equal(productSection, that.productSection);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hashCode(productSection);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Objects.toStringHelper("")
|
||||
.add("productSection", productSection).toString();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,84 @@
|
|||
/**
|
||||
* Licensed to jclouds, Inc. (jclouds) under one or more
|
||||
* contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. jclouds licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.jclouds.vcloud.director.v1_5.domain;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Parameters to be used for vm relocation.
|
||||
*
|
||||
*
|
||||
* <p>Java class for RelocateParams complex type.
|
||||
*
|
||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||
*
|
||||
* <pre>
|
||||
* <complexType name="RelocateParams">
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element name="Datastore" type="{http://www.vmware.com/vcloud/v1.5}ReferenceType"/>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "RelocateParams", propOrder = {
|
||||
"datastore"
|
||||
})
|
||||
public class RelocateParams {
|
||||
|
||||
@XmlElement(name = "Datastore", required = true)
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,326 @@
|
|||
/**
|
||||
* Licensed to jclouds, Inc. (jclouds) under one or more
|
||||
* contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. jclouds licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.jclouds.vcloud.director.v1_5.domain;
|
||||
|
||||
import static com.google.common.base.Objects.equal;
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import java.net.URI;
|
||||
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.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
import com.google.common.base.Objects;
|
||||
import com.google.common.collect.Sets;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Represents a VApp network configuration.
|
||||
*
|
||||
*
|
||||
* <p>Java class for VAppNetworkConfiguration complex type.
|
||||
*
|
||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||
*
|
||||
* <pre>
|
||||
* <complexType name="VAppNetworkConfiguration">
|
||||
* <complexContent>
|
||||
* <extension base="{http://www.vmware.com/vcloud/v1.5}ResourceType">
|
||||
* <sequence>
|
||||
* <element name="Description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
|
||||
* <element name="Configuration" type="{http://www.vmware.com/vcloud/v1.5}NetworkConfigurationType"/>
|
||||
* <element name="IsDeployed" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
|
||||
* </sequence>
|
||||
* <attribute name="networkName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
|
||||
* <anyAttribute processContents='lax' namespace='##other'/>
|
||||
* </extension>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "VAppNetworkConfiguration", propOrder = {
|
||||
"description",
|
||||
"configuration",
|
||||
"isDeployed"
|
||||
})
|
||||
public class VAppNetworkConfiguration<T extends VAppNetworkConfiguration<T>>
|
||||
extends ResourceType<T>
|
||||
|
||||
{
|
||||
public static <T extends VAppNetworkConfiguration<T>> Builder<T> builder() {
|
||||
return new Builder<T>();
|
||||
}
|
||||
|
||||
public Builder<T> toBuilder() {
|
||||
return new Builder<T>().fromVAppNetworkConfiguration(this);
|
||||
}
|
||||
|
||||
public static class Builder<T extends VAppNetworkConfiguration<T>> extends ResourceType.Builder<T> {
|
||||
|
||||
private String description;
|
||||
private NetworkConfiguration configuration;
|
||||
private Boolean isDeployed;
|
||||
private String networkName;
|
||||
|
||||
/**
|
||||
* @see VAppNetworkConfiguration#getDescription()
|
||||
*/
|
||||
public Builder<T> description(String description) {
|
||||
this.description = description;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see VAppNetworkConfiguration#getConfiguration()
|
||||
*/
|
||||
public Builder<T> configuration(NetworkConfiguration configuration) {
|
||||
this.configuration = configuration;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see VAppNetworkConfiguration#getIsDeployed()
|
||||
*/
|
||||
public Builder<T> isDeployed(Boolean isDeployed) {
|
||||
this.isDeployed = isDeployed;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see VAppNetworkConfiguration#getNetworkName()
|
||||
*/
|
||||
public Builder<T> networkName(String networkName) {
|
||||
this.networkName = networkName;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public VAppNetworkConfiguration<T> build() {
|
||||
VAppNetworkConfiguration<T> vAppNetworkConfiguration = new VAppNetworkConfiguration<T>();
|
||||
vAppNetworkConfiguration.setDescription(description);
|
||||
vAppNetworkConfiguration.setConfiguration(configuration);
|
||||
vAppNetworkConfiguration.setIsDeployed(isDeployed);
|
||||
vAppNetworkConfiguration.setNetworkName(networkName);
|
||||
return vAppNetworkConfiguration;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @see ResourceType#getHref()
|
||||
*/
|
||||
@Override
|
||||
public Builder<T> href(URI href) {
|
||||
super.href(href);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ResourceType#getType()
|
||||
*/
|
||||
@Override
|
||||
public Builder<T> type(String type) {
|
||||
super.type(type);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ResourceType#getLinks()
|
||||
*/
|
||||
@Override
|
||||
public Builder<T> links(Set<Link> links) {
|
||||
super.links(Sets.newLinkedHashSet(checkNotNull(links, "links")));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ResourceType#getLinks()
|
||||
*/
|
||||
@Override
|
||||
public Builder<T> link(Link link) {
|
||||
super.link(link);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public Builder<T> fromResourceType(ResourceType<T> in) {
|
||||
return Builder.class.cast(super.fromResourceType(in));
|
||||
}
|
||||
public Builder<T> fromVAppNetworkConfiguration(VAppNetworkConfiguration<T> in) {
|
||||
return fromResourceType(in)
|
||||
.description(in.getDescription())
|
||||
.configuration(in.getConfiguration())
|
||||
.isDeployed(in.isDeployed())
|
||||
.networkName(in.getNetworkName());
|
||||
}
|
||||
}
|
||||
|
||||
private VAppNetworkConfiguration() {
|
||||
// For JAXB and builder use
|
||||
}
|
||||
|
||||
|
||||
|
||||
@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;
|
||||
|
||||
/**
|
||||
* Gets the value of the description property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
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
|
||||
public boolean equals(Object o) {
|
||||
if (this == o)
|
||||
return true;
|
||||
if (o == null || getClass() != o.getClass())
|
||||
return false;
|
||||
VAppNetworkConfiguration<?> that = VAppNetworkConfiguration.class.cast(o);
|
||||
return equal(description, that.description) &&
|
||||
equal(configuration, that.configuration) &&
|
||||
equal(isDeployed, that.isDeployed) &&
|
||||
equal(networkName, that.networkName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hashCode(description,
|
||||
configuration,
|
||||
isDeployed,
|
||||
networkName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Objects.toStringHelper("")
|
||||
.add("description", description)
|
||||
.add("configuration", configuration)
|
||||
.add("isDeployed", isDeployed)
|
||||
.add("networkName", networkName).toString();
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue