Merge pull request #562 from grkvlt/vcloud-domain-objects

Issue 830: vCloud Director Domain Objects
This commit is contained in:
Adrian Cole 2012-04-12 10:33:02 -07:00
commit a5ddf1057f
165 changed files with 1212 additions and 1085 deletions

View File

@ -36,6 +36,14 @@ import org.jclouds.dmtf.ovf.NetworkSection;
import org.jclouds.dmtf.ovf.ProductSection;
import org.jclouds.dmtf.ovf.SectionType;
import org.jclouds.dmtf.ovf.StartupSection;
import org.jclouds.vcloud.director.v1_5.domain.section.CustomizationSection;
import org.jclouds.vcloud.director.v1_5.domain.section.GuestCustomizationSection;
import org.jclouds.vcloud.director.v1_5.domain.section.LeaseSettingsSection;
import org.jclouds.vcloud.director.v1_5.domain.section.NetworkConfigSection;
import org.jclouds.vcloud.director.v1_5.domain.section.NetworkConnectionSection;
import org.jclouds.vcloud.director.v1_5.domain.section.OperatingSystemSection;
import org.jclouds.vcloud.director.v1_5.domain.section.RuntimeInfoSection;
import org.jclouds.vcloud.director.v1_5.domain.section.VirtualHardwareSection;
import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;
@ -52,7 +60,7 @@ import com.google.common.collect.Sets;
* @author grkvlt@apache.org
*/
@XmlType(name = "AbstractVAppType")
public abstract class AbstractVAppType extends ResourceEntityType {
public abstract class AbstractVAppType extends ResourceEntity {
public static Builder<?> builder() {
return new ConcreteBuilder();
@ -66,7 +74,7 @@ public abstract class AbstractVAppType extends ResourceEntityType {
private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
}
public static abstract class Builder<B extends Builder<B>> extends ResourceEntityType.Builder<B> {
public static abstract class Builder<B extends Builder<B>> extends ResourceEntity.Builder<B> {
private Boolean deployed;
private Reference vAppParent;

View File

@ -21,6 +21,7 @@ package org.jclouds.vcloud.director.v1_5.domain;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* Admin representation of the container for meta data (key-value pair) associated to different
* entities in the system.
@ -39,7 +40,7 @@ import javax.xml.bind.annotation.XmlType;
*/
@XmlRootElement(name = "AdminCatalog")
@XmlType(name = "AdminCatalogType")
public class AdminCatalog extends CatalogType {
public class AdminCatalog extends Catalog {
public static Builder<?> builder() {
return new ConcreteBuilder();
@ -53,7 +54,7 @@ public class AdminCatalog extends CatalogType {
private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
}
public static abstract class Builder<B extends Builder<B>> extends CatalogType.Builder<B> {
public static abstract class Builder<B extends Builder<B>> extends Catalog.Builder<B> {
@Override
public AdminCatalog build() {

View File

@ -24,6 +24,7 @@ import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;

View File

@ -18,10 +18,21 @@
*/
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.util.Set;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlType;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Sets;
/**
* Container for references to {@link VAppTemplate} and {@link Media} objects.
@ -30,13 +41,12 @@ import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
* &lt;complexType name="CatalogType" /&gt;
* </pre>
*
* @author grkvlt@apache.org
* @author danikov
*/
@XmlSeeAlso({ AdminCatalog.class })
@XmlRootElement(name = "Catalog")
public class Catalog extends CatalogType {
public static final String MEDIA_TYPE = VCloudDirectorMediaType.CATALOG;
@XmlType(name = "CatalogType")
public class Catalog extends Entity {
public static Builder<?> builder() {
return new ConcreteBuilder();
@ -44,30 +54,131 @@ public class Catalog extends CatalogType {
@Override
public Builder<?> toBuilder() {
return builder().fromCatalog(this);
return builder().fromCatalogType(this);
}
private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
}
public static abstract class Builder<B extends Builder<B>> extends CatalogType.Builder<B> {
public static class Builder<B extends Builder<B>> extends Entity.Builder<B> {
private Owner owner;
private Set<Reference> catalogItems = Sets.newLinkedHashSet();
private Boolean isPublished;
/**
* @see CatalogType#getOwner()
*/
public B owner(Owner owner) {
this.owner = owner;
return self();
}
/**
* @see CatalogItems#getCatalogItems()
*/
public B items(Iterable<Reference> catalogItems) {
this.catalogItems = Sets.newLinkedHashSet(checkNotNull(catalogItems, "catalogItems"));
return self();
}
/**
* @see CatalogItems#getCatalogItems()
*/
public B item(Reference catalogItem) {
this.catalogItems.add(checkNotNull(catalogItem, "catalogItem"));
return self();
}
/**
* @see CatalogType#isPublished()
*/
public B isPublished(Boolean isPublished) {
this.isPublished = isPublished;
return self();
}
/**
* @see CatalogType#isPublished()
*/
public B published() {
this.isPublished = Boolean.TRUE;
return self();
}
@Override
public Catalog build() {
return new Catalog(this);
}
public B fromCatalog(Catalog in) {
return fromCatalogType(in);
public B fromCatalogType(Catalog in) {
return fromEntityType(in).owner(in.getOwner()).items(in.getCatalogItems()).isPublished(in.isPublished());
}
}
public Catalog(Builder<?> builder) {
protected Catalog(Builder<?> builder) {
super(builder);
this.owner = builder.owner;
this.catalogItems = builder.catalogItems == null || builder.catalogItems.isEmpty() ? null : ImmutableSet.copyOf(builder.catalogItems);
this.isPublished = builder.isPublished;
}
@SuppressWarnings("unused")
private Catalog() {
// for JAXB
protected Catalog() {
// For JAXB
}
@XmlElement(name = "Owner")
private Owner owner;
@XmlElementWrapper(name = "CatalogItems")
@XmlElement(name = "CatalogItem")
private Set<Reference> catalogItems;
@XmlElement(name = "IsPublished")
private Boolean isPublished;
/**
* Gets the value of the owner property.
*/
public Owner getOwner() {
return owner;
}
/**
* Gets the value of the catalogItems property.
*/
public Set<Reference> getCatalogItems() {
return catalogItems == null ? ImmutableSet.<Reference>of() : ImmutableSet.copyOf(catalogItems);
}
/**
* Gets the value of the isPublished property.
*/
public Boolean isPublished() {
return isPublished;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
Catalog that = Catalog.class.cast(o);
return super.equals(that) &&
equal(this.owner, that.owner) &&
equal(this.getCatalogItems(), that.getCatalogItems()) &&
equal(this.isPublished, that.isPublished);
}
@Override
public int hashCode() {
return Objects.hashCode(super.hashCode(), owner, getCatalogItems(), catalogItems);
}
@Override
public ToStringHelper string() {
return super.string().add("owner", owner)
.add("catalogItems", getCatalogItems())
.add("isPublished", isPublished);
}
}

View File

@ -41,7 +41,7 @@ import com.google.common.collect.Sets;
* @author grkvlt@apache.org
*/
@XmlRootElement(name = "CatalogItem")
public class CatalogItem extends EntityType {
public class CatalogItem extends Entity {
public static final String MEDIA_TYPE = VCloudDirectorMediaType.CATALOG_ITEM;
@ -57,7 +57,7 @@ public class CatalogItem extends EntityType {
private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
}
public static class Builder<B extends Builder<B>> extends EntityType.Builder<B> {
public static class Builder<B extends Builder<B>> extends Entity.Builder<B> {
private Reference entity;
private Set<Property> properties = Sets.newLinkedHashSet();

View File

@ -1,180 +0,0 @@
/*
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
import static com.google.common.base.Objects.equal;
import static com.google.common.base.Preconditions.checkNotNull;
import java.util.Set;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Sets;
/**
* Container for references to VappTemplate and Media objects.
*
* <pre>
* &lt;complexType name="CatalogType" /&gt;
* </pre>
*
* @author danikov
*/
@XmlRootElement(name = "Catalog")
public class CatalogType extends EntityType {
public static Builder<?> builder() {
return new ConcreteBuilder();
}
@Override
public Builder<?> toBuilder() {
return builder().fromCatalogType(this);
}
private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
}
public static class Builder<B extends Builder<B>> extends EntityType.Builder<B> {
private Owner owner;
private Set<Reference> catalogItems = Sets.newLinkedHashSet();
private Boolean isPublished;
/**
* @see CatalogType#getOwner()
*/
public B owner(Owner owner) {
this.owner = owner;
return self();
}
/**
* @see CatalogItems#getCatalogItems()
*/
public B items(Iterable<Reference> catalogItems) {
this.catalogItems = Sets.newLinkedHashSet(checkNotNull(catalogItems, "catalogItems"));
return self();
}
/**
* @see CatalogItems#getCatalogItems()
*/
public B item(Reference catalogItem) {
this.catalogItems.add(checkNotNull(catalogItem, "catalogItem"));
return self();
}
/**
* @see CatalogType#isPublished()
*/
public B isPublished(Boolean isPublished) {
this.isPublished = isPublished;
return self();
}
/**
* @see CatalogType#isPublished()
*/
public B published() {
this.isPublished = Boolean.TRUE;
return self();
}
@Override
public CatalogType build() {
return new CatalogType(this);
}
public B fromCatalogType(CatalogType in) {
return fromEntityType(in).owner(in.getOwner()).items(in.getCatalogItems()).isPublished(in.isPublished());
}
}
protected CatalogType(Builder<?> builder) {
super(builder);
this.owner = builder.owner;
this.catalogItems = builder.catalogItems == null || builder.catalogItems.isEmpty() ? null : ImmutableSet.copyOf(builder.catalogItems);
this.isPublished = builder.isPublished;
}
protected CatalogType() {
// For JAXB
}
@XmlElement(name = "Owner")
private Owner owner;
@XmlElementWrapper(name = "CatalogItems")
@XmlElement(name = "CatalogItem")
private Set<Reference> catalogItems;
@XmlElement(name = "IsPublished")
private Boolean isPublished;
/**
* Gets the value of the owner property.
*/
public Owner getOwner() {
return owner;
}
/**
* Gets the value of the catalogItems property.
*/
public Set<Reference> getCatalogItems() {
return catalogItems == null ? ImmutableSet.<Reference>of() : ImmutableSet.copyOf(catalogItems);
}
/**
* Gets the value of the isPublished property.
*/
public Boolean isPublished() {
return isPublished;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
CatalogType that = CatalogType.class.cast(o);
return super.equals(that) &&
equal(this.owner, that.owner) &&
equal(this.getCatalogItems(), that.getCatalogItems()) &&
equal(this.isPublished, that.isPublished);
}
@Override
public int hashCode() {
return Objects.hashCode(super.hashCode(), owner, getCatalogItems(), catalogItems);
}
@Override
public ToStringHelper string() {
return super.string().add("owner", owner)
.add("catalogItems", getCatalogItems())
.add("isPublished", isPublished);
}
}

View File

@ -1,4 +1,4 @@
/**
/*
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@ -18,16 +18,37 @@
*/
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.util.List;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
/**
* An entity.
* Basic entity type in the vCloud object model.
*
* Includes the entity name and an optional id, description, and set of running {@link Task}s.
*
* <pre>
* &lt;xs:complexType name="EntityType" /&gt;
* </pre>
*
* @author grkvlt@apache.org
* @author Adam Lowe
*/
@XmlRootElement(name = "Entity")
public class Entity extends EntityType {
@XmlType(name = "EntityType")
public class Entity extends Resource {
public static Builder<?> builder() {
return new ConcreteBuilder();
@ -35,29 +56,162 @@ public class Entity extends EntityType {
@Override
public Builder<?> toBuilder() {
return builder().fromEntity(this);
return builder().fromEntityType(this);
}
private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
}
public static abstract class Builder<B extends Builder<B>> extends EntityType.Builder<B> {
public static abstract class Builder<B extends Builder<B>> extends Resource.Builder<B> {
private String description;
private List<Task> tasks = Lists.newArrayList();
private String name;
private String id;
/**
* @see EntityType#getName()
*/
public B name(String name) {
this.name = name;
return self();
}
/**
* @see EntityType#getDescription()
*/
public B description(String description) {
this.description = description;
return self();
}
/**
* @see EntityType#getId()
*/
public B id(String id) {
this.id = id;
return self();
}
/**
* @see EntityType#getTasks()
*/
public B tasks(Iterable<Task> tasks) {
this.tasks = Lists.newArrayList(checkNotNull(tasks, "tasks"));
return self();
}
/**
* @see EntityType#getTasks()
*/
public B task(Task task) {
this.tasks.add(checkNotNull(task, "task"));
return self();
}
@Override
public Entity build() {
return new Entity(this);
}
public B fromEntity(Entity in) {
return fromEntityType(in);
public B fromEntityType(Entity in) {
return fromResource(in)
.description(in.getDescription())
.tasks(in.getTasks())
.id(in.getId()).name(in.getName());
}
}
private Entity(Builder<?> builder) {
@XmlElement(name = "Description")
private String description;
@XmlElementWrapper(name = "Tasks")
@XmlElement(name = "Task")
private List<Task> tasks;
@XmlAttribute
private String id;
@XmlAttribute(required = true)
private String name;
protected Entity(Builder<?> builder) {
super(builder);
this.description = builder.description;
this.tasks = builder.tasks == null || builder.tasks.isEmpty() ? null : ImmutableList.copyOf(builder.tasks);
this.id = builder.id;
this.name = builder.name;
}
private Entity() {
protected Entity() {
// For JAXB
}
/**
* Optional description.
*/
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
/**
* A list of queued, running, or recently completed tasks associated with this entity.
*/
public List<Task> getTasks() {
return tasks == null ? ImmutableList.<Task>of() : ImmutableList.copyOf(tasks);
}
/**
* 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.
*/
public String getId() {
return id;
}
/**
* Contains the name of the the entity.
*/
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@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) &&
equal(this.id, that.id) && equal(this.description, that.description) &&
equal(this.tasks, that.tasks) && equal(this.name, that.name);
}
@Override
public boolean clone(Object o) {
if (this == o)
return false;
if (o == null || getClass() != o.getClass())
return false;
Entity that = Entity.class.cast(o);
return super.clone(that);
}
@Override
public int hashCode() {
return Objects.hashCode(super.hashCode(), description, tasks, id, name);
}
@Override
public ToStringHelper string() {
return super.string().add("description", description).add("tasks", tasks).add("id", id).add("name", name);
}
}

View File

@ -1,215 +0,0 @@
/*
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
import static com.google.common.base.Objects.equal;
import static com.google.common.base.Preconditions.checkNotNull;
import java.util.List;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlType;
import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
/**
* Basic entity type in the vCloud object model.
*
* Includes the entity name and an optional id, description, and set of running {@link Task}s.
*
* <pre>
* &lt;xs:complexType name="EntityType" /&gt;
* </pre>
*
* @author grkvlt@apache.org
* @author Adam Lowe
*/
@XmlType(name = "EntityType")
public class EntityType extends ResourceType {
public static Builder<?> builder() {
return new ConcreteBuilder();
}
@Override
public Builder<?> toBuilder() {
return builder().fromEntityType(this);
}
private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
}
public static abstract class Builder<B extends Builder<B>> extends ResourceType.Builder<B> {
private String description;
private List<Task> tasks = Lists.newArrayList();
private String name;
private String id;
/**
* @see EntityType#getName()
*/
public B name(String name) {
this.name = name;
return self();
}
/**
* @see EntityType#getDescription()
*/
public B description(String description) {
this.description = description;
return self();
}
/**
* @see EntityType#getId()
*/
public B id(String id) {
this.id = id;
return self();
}
/**
* @see EntityType#getTasks()
*/
public B tasks(Iterable<Task> tasks) {
this.tasks = Lists.newArrayList(checkNotNull(tasks, "tasks"));
return self();
}
/**
* @see EntityType#getTasks()
*/
public B task(Task task) {
this.tasks.add(checkNotNull(task, "task"));
return self();
}
@Override
public EntityType build() {
return new EntityType(this);
}
public B fromEntityType(EntityType in) {
return fromResourceType(in)
.description(in.getDescription())
.tasks(in.getTasks())
.id(in.getId()).name(in.getName());
}
}
@XmlElement(name = "Description")
private String description;
@XmlElementWrapper(name = "Tasks")
@XmlElement(name = "Task")
private List<Task> tasks;
@XmlAttribute
private String id;
@XmlAttribute(required = true)
private String name;
protected EntityType(Builder<?> builder) {
super(builder);
this.description = builder.description;
this.tasks = builder.tasks == null || builder.tasks.isEmpty() ? null : ImmutableList.copyOf(builder.tasks);
this.id = builder.id;
this.name = builder.name;
}
protected EntityType() {
// For JAXB
}
/**
* Optional description.
*/
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
/**
* A list of queued, running, or recently completed tasks associated with this entity.
*/
public List<Task> getTasks() {
return tasks == null ? ImmutableList.<Task>of() : ImmutableList.copyOf(tasks);
}
/**
* 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.
*/
public String getId() {
return id;
}
/**
* Contains the name of the the entity.
*/
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
EntityType that = EntityType.class.cast(o);
return super.equals(that) &&
equal(this.id, that.id) && equal(this.description, that.description) &&
equal(this.tasks, that.tasks) && equal(this.name, that.name);
}
@Override
public boolean clone(Object o) {
if (this == o)
return false;
if (o == null || getClass() != o.getClass())
return false;
EntityType that = EntityType.class.cast(o);
return super.clone(that);
}
@Override
public int hashCode() {
return Objects.hashCode(super.hashCode(), description, tasks, id, name);
}
@Override
public ToStringHelper string() {
return super.string().add("description", description).add("tasks", tasks).add("id", id).add("name", name);
}
}

View File

@ -53,7 +53,7 @@ import com.google.common.base.Objects.ToStringHelper;
* </pre>
*/
@XmlType(name = "File")
public class File extends EntityType {
public class File extends Entity {
public static Builder<?> builder() {
return new ConcreteBuilder();
@ -67,7 +67,7 @@ public class File extends EntityType {
private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
}
public static abstract class Builder<B extends Builder<B>> extends EntityType.Builder<B> {
public static abstract class Builder<B extends Builder<B>> extends Entity.Builder<B> {
private Long size;
private Long bytesTransferred;

View File

@ -56,7 +56,7 @@ import com.google.common.collect.Sets;
"usersList",
"role"
})
public class Group extends EntityType {
public class Group extends Entity {
public static Builder<?> builder() {
return new ConcreteBuilder();
@ -70,7 +70,7 @@ public class Group extends EntityType {
private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
}
public static abstract class Builder<B extends Builder<B>> extends EntityType.Builder<B> {
public static abstract class Builder<B extends Builder<B>> extends Entity.Builder<B> {
private String nameInSource;
private Set<Reference> users = Sets.newLinkedHashSet();

View File

@ -46,7 +46,7 @@ import com.google.common.collect.Maps;
* </pre>
*/
@XmlRootElement(name = "Media")
public class Media extends ResourceEntityType {
public class Media extends ResourceEntity {
@XmlType
@XmlEnum(String.class)
@ -93,7 +93,7 @@ public class Media extends ResourceEntityType {
private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
}
public static abstract class Builder<B extends Builder<B>> extends ResourceEntityType.Builder<B> {
public static abstract class Builder<B extends Builder<B>> extends ResourceEntity.Builder<B> {
private Owner owner;
private ImageType imageType;

View File

@ -44,7 +44,7 @@ import com.google.common.collect.Sets;
* @author danikov
*/
@XmlRootElement(name = "Metadata")
public class Metadata extends ResourceType {
public class Metadata extends Resource {
public static final String MEDIA_TYPE = VCloudDirectorMediaType.METADATA;
@ -60,7 +60,7 @@ public class Metadata extends ResourceType {
private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
}
public static abstract class Builder<B extends Builder<B>> extends ResourceType.Builder<B> {
public static abstract class Builder<B extends Builder<B>> extends Resource.Builder<B> {
private Set<MetadataEntry> metadataEntries = Sets.newLinkedHashSet();
@ -86,7 +86,7 @@ public class Metadata extends ResourceType {
}
public B fromMetadata(Metadata in) {
return fromResourceType(in).entries(in.getMetadataEntries());
return fromResource(in).entries(in.getMetadataEntries());
}
}

View File

@ -43,7 +43,7 @@ import com.google.common.collect.Sets;
* @author danikov
*/
@XmlRootElement(name = "MetadataEntry")
public class MetadataEntry extends ResourceType {
public class MetadataEntry extends Resource {
public static final String MEDIA_TYPE = VCloudDirectorMediaType.METADATA_ENTRY;
@ -59,7 +59,7 @@ public class MetadataEntry extends ResourceType {
private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
}
public static abstract class Builder<B extends Builder<B>> extends ResourceType.Builder<B> {
public static abstract class Builder<B extends Builder<B>> extends Resource.Builder<B> {
private String key;
private String value;
@ -131,7 +131,7 @@ public class MetadataEntry extends ResourceType {
}
public B fromMetadataEntry(MetadataEntry in) {
return fromResourceType(in).entry(key, value);
return fromResource(in).entry(key, value);
}
}

View File

@ -43,7 +43,7 @@ import com.google.common.collect.Sets;
* @author grkvlt@apache.org
*/
@XmlRootElement(name = "MetadataValue")
public class MetadataValue extends ResourceType {
public class MetadataValue extends Resource {
public static final String MEDIA_TYPE = VCloudDirectorMediaType.METADATA_ENTRY;
@ -59,7 +59,7 @@ public class MetadataValue extends ResourceType {
private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
}
public static abstract class Builder<B extends Builder<B>> extends ResourceType.Builder<B> {
public static abstract class Builder<B extends Builder<B>> extends Resource.Builder<B> {
private String value;
/**
@ -112,7 +112,7 @@ public class MetadataValue extends ResourceType {
}
public B fromMetadataValue(MetadataValue in) {
return fromResourceType(in).value(value);
return fromResource(in).value(value);
}
}

View File

@ -38,7 +38,7 @@ import com.google.common.base.Objects.ToStringHelper;
*/
@XmlRootElement(name = "Owner")
@XmlType(name = "OwnerType")
public class Owner extends ResourceType {
public class Owner extends Resource {
public static Builder<?> builder() {
return new ConcreteBuilder();
@ -52,7 +52,7 @@ public class Owner extends ResourceType {
private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
}
public static abstract class Builder<B extends Builder<B>> extends ResourceType.Builder<B> {
public static abstract class Builder<B extends Builder<B>> extends Resource.Builder<B> {
private Reference user;
@ -70,7 +70,7 @@ public class Owner extends ResourceType {
}
public B fromOwner(Owner in) {
return fromResourceType(in)
return fromResource(in)
.user(in.getUser());
}
}

View File

@ -56,7 +56,7 @@ import com.google.common.collect.Sets;
*/
@XmlRootElement(name = "ProductSectionList")
@XmlType(name = "ProductSectionListType")
public class ProductSectionList extends ResourceType implements Set<ProductSection> {
public class ProductSectionList extends Resource implements Set<ProductSection> {
public static Builder<?> builder() {
return new ConcreteBuilder();
@ -70,7 +70,7 @@ public class ProductSectionList extends ResourceType implements Set<ProductSecti
private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
}
public static abstract class Builder<B extends Builder<B>> extends ResourceType.Builder<B> {
public static abstract class Builder<B extends Builder<B>> extends Resource.Builder<B> {
private Set<ProductSection> productSections = Sets.newLinkedHashSet();
@ -96,7 +96,7 @@ public class ProductSectionList extends ResourceType implements Set<ProductSecti
}
public B fromProductSectionList(ProductSectionList in) {
return fromResourceType(in)
return fromResource(in)
.productSections(Sets.newLinkedHashSet(in));
}
}

View File

@ -29,6 +29,8 @@ import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import org.jclouds.vcloud.director.v1_5.domain.dmtf.RasdItem;
import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;
import com.google.common.collect.Sets;
@ -44,7 +46,7 @@ import com.google.common.collect.Sets;
*/
@XmlRootElement(name = "RasdItemsList")
@XmlType(name = "RasdItemsList")
public class RasdItemsList extends ResourceType implements Set<RasdItem> {
public class RasdItemsList extends Resource implements Set<RasdItem> {
public static Builder<?> builder() {
return new ConcreteBuilder();
@ -58,7 +60,7 @@ public class RasdItemsList extends ResourceType implements Set<RasdItem> {
private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
}
public static abstract class Builder<B extends Builder<B>> extends ResourceType.Builder<B> {
public static abstract class Builder<B extends Builder<B>> extends Resource.Builder<B> {
private Set<RasdItem> items = Sets.newLinkedHashSet();
@ -85,7 +87,7 @@ public class RasdItemsList extends ResourceType implements Set<RasdItem> {
}
public B fromRasdItemsList(RasdItemsList in) {
return fromResourceType(in).items(in.getItems());
return fromResource(in).items(in.getItems());
}
}

View File

@ -119,7 +119,7 @@ public class Reference {
return href(in.getHref()).id(in.getId()).name(in.getName()).type(in.getType());
}
public B fromEntity(EntityType in) {
public B fromEntity(Entity in) {
return href(in.getHref()).id(in.getId()).name(in.getName()).type(in.getType());
}

View File

@ -1,4 +1,4 @@
/**
/*
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@ -18,21 +18,49 @@
*/
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.Collections;
import java.util.Set;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import org.jclouds.logging.Logger;
import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Sets;
/**
* A resource.
* The base type for all objects in the vCloud model.
*
* @author grkvlt@apache.org
* Has an optional list of links and href and type attributes.
*
* <pre>
* &lt;xs:complexType name="ResourceType" /&gt;
* </pre>
*
* @author Adrian Cole
*
* @since 0.9
*/
@XmlRootElement(name = "Resource")
public class Resource extends ResourceType {
@XmlType(name = "ResourceType")
public class Resource {
@javax.annotation.Resource
protected static Logger logger = Logger.NULL;
public static Builder<?> builder() {
return new ConcreteBuilder();
}
@Override
public Builder<?> toBuilder() {
return builder().fromResource(this);
}
@ -40,26 +68,112 @@ public class Resource extends ResourceType {
private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
}
public static abstract class Builder<B extends Builder<B>> extends ResourceType.Builder<B> {
public static abstract class Builder<B extends Builder<B>> {
private URI href;
private String type;
private Set<Link> links;
@SuppressWarnings("unchecked")
protected B self() {
return (B) this;
}
/**
* @see ResourceType#getHref()
*/
public B href(URI href) {
this.href = href;
return self();
}
/**
* @see ResourceType#getType()
*/
public B type(String type) {
this.type = type;
return self();
}
/**
* @see ResourceType#getLinks()
*/
public B links(Set<Link> links) {
this.links = Sets.newLinkedHashSet(checkNotNull(links, "links"));
return self();
}
/**
* @see ResourceType#getLinks()
*/
public B link(Link link) {
if (links == null)
links = Sets.newLinkedHashSet();
this.links.add(checkNotNull(link, "link"));
return self();
}
@Override
public Resource build() {
return new Resource(this);
}
protected B fromResource(Resource in) {
return fromResourceType(in);
return href(in.getHref()).type(in.getType()).links(Sets.newLinkedHashSet(in.getLinks()));
}
}
@XmlAttribute
private URI href;
@XmlAttribute
private String type;
@XmlElement(name = "Link")
private Set<Link> links = Sets.newLinkedHashSet();
protected Resource(Builder<?> builder) {
super(builder);
this.href = builder.href;
this.type = builder.type;
this.links = builder.links == null ? Collections.<Link>emptySet() : builder.links;
}
protected Resource() {
// For JAXB
}
/**
* 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 reused. The value of the href attribute is a reference to a view of
* the object, and can be used to access a representation of 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 in future releases.
*
* @return an opaque reference and should never be parsed
*/
public URI getHref() {
return href;
}
/**
* 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.
*
* @return type definition, type, expressed as an HTTP Content-Type
*/
public String getType() {
return type;
}
/**
* Set of optional links to an entity or operation associated with this object.
*/
public Set<Link> getLinks() {
return links == null ? ImmutableSet.<Link>of() : Collections.unmodifiableSet(links);
}
@Override
public boolean equals(Object o) {
if (this == o)
@ -67,6 +181,29 @@ public class Resource extends ResourceType {
if (o == null || getClass() != o.getClass())
return false;
Resource that = Resource.class.cast(o);
return super.equals(that);
return equal(this.href, that.href) && equal(this.links, that.links) && equal(this.type, that.type);
}
public boolean clone(Object o) {
if (this == o)
return false;
if (o == null || getClass() != o.getClass())
return false;
Resource that = Resource.class.cast(o);
return equal(this.type, that.type);
}
@Override
public int hashCode() {
return Objects.hashCode(href, links, type);
}
@Override
public String toString() {
return string().toString();
}
protected ToStringHelper string() {
return Objects.toStringHelper("").add("href", href).add("links", links).add("type", type);
}
}

View File

@ -49,7 +49,7 @@ import com.google.common.collect.Iterables;
* @author grkvlt@apache.org
*/
@XmlType(name = "ResourceEntityType")
public abstract class ResourceEntityType extends EntityType {
public abstract class ResourceEntity extends Entity {
@XmlType(name = "ResourceEntityTypeStatus")
@XmlEnum(Integer.class)
@ -138,7 +138,7 @@ public abstract class ResourceEntityType extends EntityType {
private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
}
public static abstract class Builder<B extends Builder<B>> extends EntityType.Builder<B> {
public static abstract class Builder<B extends Builder<B>> extends Entity.Builder<B> {
private Set<File> files;
private Status status;
@ -166,7 +166,7 @@ public abstract class ResourceEntityType extends EntityType {
return self();
}
public B fromResourceEntityType(ResourceEntityType in) {
public B fromResourceEntityType(ResourceEntity in) {
return fromEntityType(in).files(in.getFiles()).status(in.getStatus());
}
}
@ -177,13 +177,13 @@ public abstract class ResourceEntityType extends EntityType {
@XmlAttribute
private Status status;
public ResourceEntityType(Builder<?> builder) {
public ResourceEntity(Builder<?> builder) {
super(builder);
this.files = builder.files;
this.status = builder.status;
}
protected ResourceEntityType() {
protected ResourceEntity() {
// for JAXB
}
@ -207,7 +207,7 @@ public abstract class ResourceEntityType extends EntityType {
return true;
if (o == null || getClass() != o.getClass())
return false;
ResourceEntityType that = ResourceEntityType.class.cast(o);
ResourceEntity that = ResourceEntity.class.cast(o);
return super.equals(that) && equal(this.files, that.files) && equal(this.status, that.status);
}
@ -217,7 +217,7 @@ public abstract class ResourceEntityType extends EntityType {
return false;
if (o == null || getClass() != o.getClass())
return false;
ResourceEntityType that = ResourceEntityType.class.cast(o);
ResourceEntity that = ResourceEntity.class.cast(o);
return super.clone(that) && equal(this.files, that.files);
}

View File

@ -1,207 +0,0 @@
/*
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
import static com.google.common.base.Objects.equal;
import static com.google.common.base.Preconditions.checkNotNull;
import java.net.URI;
import java.util.Collections;
import java.util.Set;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import org.jclouds.logging.Logger;
import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Sets;
/**
* The base type for all objects in the vCloud model.
*
* Has an optional list of links and href and type attributes.
*
* <pre>
* &lt;xs:complexType name="ResourceType" /&gt;
* </pre>
*
* @author Adrian Cole
*
* @since 0.9
*/
@XmlType(name = "ResourceType")
public class ResourceType {
@javax.annotation.Resource
protected static Logger logger = Logger.NULL;
public static Builder<?> builder() {
return new ConcreteBuilder();
}
public Builder<?> toBuilder() {
return builder().fromResourceType(this);
}
private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
}
public static abstract class Builder<B extends Builder<B>> {
private URI href;
private String type;
private Set<Link> links;
@SuppressWarnings("unchecked")
protected B self() {
return (B) this;
}
/**
* @see ResourceType#getHref()
*/
public B href(URI href) {
this.href = href;
return self();
}
/**
* @see ResourceType#getType()
*/
public B type(String type) {
this.type = type;
return self();
}
/**
* @see ResourceType#getLinks()
*/
public B links(Set<Link> links) {
this.links = Sets.newLinkedHashSet(checkNotNull(links, "links"));
return self();
}
/**
* @see ResourceType#getLinks()
*/
public B link(Link link) {
if (links == null)
links = Sets.newLinkedHashSet();
this.links.add(checkNotNull(link, "link"));
return self();
}
public ResourceType build() {
return new ResourceType(this);
}
protected B fromResourceType(ResourceType in) {
return href(in.getHref()).type(in.getType()).links(Sets.newLinkedHashSet(in.getLinks()));
}
}
@XmlAttribute
private URI href;
@XmlAttribute
private String type;
@XmlElement(name = "Link")
private Set<Link> links = Sets.newLinkedHashSet();
protected ResourceType(Builder<?> builder) {
this.href = builder.href;
this.type = builder.type;
this.links = builder.links == null ? Collections.<Link>emptySet() : builder.links;
}
protected ResourceType() {
// For JAXB
}
/**
* 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 reused. The value of the href attribute is a reference to a view of
* the object, and can be used to access a representation of 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 in future releases.
*
* @return an opaque reference and should never be parsed
*/
public URI getHref() {
return href;
}
/**
* 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.
*
* @return type definition, type, expressed as an HTTP Content-Type
*/
public String getType() {
return type;
}
/**
* Set of optional links to an entity or operation associated with this object.
*/
public Set<Link> getLinks() {
return links == null ? ImmutableSet.<Link>of() : Collections.unmodifiableSet(links);
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
ResourceType that = ResourceType.class.cast(o);
return equal(this.href, that.href) && equal(this.links, that.links) && equal(this.type, that.type);
}
public boolean clone(Object o) {
if (this == o)
return false;
if (o == null || getClass() != o.getClass())
return false;
ResourceType that = ResourceType.class.cast(o);
return equal(this.type, that.type);
}
@Override
public int hashCode() {
return Objects.hashCode(href, links, type);
}
@Override
public String toString() {
return string().toString();
}
protected ToStringHelper string() {
return Objects.toStringHelper("").add("href", href).add("links", links).add("type", type);
}
}

View File

@ -25,14 +25,8 @@ import org.jclouds.vcloud.director.v1_5.domain.query.QueryResultReferences;
/**
*
* Container for ReferenceType elements that reference RoleType objects.
*
*
* <p>Java class for RoleReferences complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="RoleReferences">
* &lt;complexContent>
@ -45,8 +39,6 @@ import org.jclouds.vcloud.director.v1_5.domain.query.QueryResultReferences;
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlRootElement(name = "RoleReferences")
public class RoleReferences extends QueryResultReferences {

View File

@ -53,7 +53,7 @@ import com.google.common.collect.Maps;
* @author grkvlt@apache.org
*/
@XmlRootElement(name = "Task")
public class Task extends EntityType {
public class Task extends Entity {
public static final String MEDIA_TYPE = VCloudDirectorMediaType.TASK;
@ -114,7 +114,7 @@ public class Task extends EntityType {
private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
}
public static abstract class Builder<B extends Builder<B>> extends EntityType.Builder<B> {
public static abstract class Builder<B extends Builder<B>> extends Entity.Builder<B> {
private Error error;
private Reference org;

View File

@ -42,7 +42,7 @@ import com.google.common.collect.Sets;
* @author Adrian Cole
*/
@XmlRootElement(name = "TasksList")
public class TasksList extends ResourceType implements Set<Task> {
public class TasksList extends Resource implements Set<Task> {
public static Builder<?> builder() {
return new ConcreteBuilder();
}
@ -55,7 +55,7 @@ public class TasksList extends ResourceType implements Set<Task> {
private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
}
public static abstract class Builder<B extends Builder<B>> extends ResourceType.Builder<B> {
public static abstract class Builder<B extends Builder<B>> extends Resource.Builder<B> {
private String name;
private Set<Task> tasks;
@ -92,7 +92,7 @@ public class TasksList extends ResourceType implements Set<Task> {
}
public B fromTasksList(TasksList in) {
return fromResourceType(in).tasks(in);
return fromResource(in).tasks(in);
}
}

View File

@ -91,7 +91,7 @@ import com.google.common.collect.Lists;
"password",
"groups"
})
public class User extends EntityType {
public class User extends Entity {
public static Builder<?> builder() {
return new ConcreteBuilder();
@ -105,7 +105,7 @@ public class User extends EntityType {
private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
}
public static abstract class Builder<B extends Builder<B>> extends EntityType.Builder<B> {
public static abstract class Builder<B extends Builder<B>> extends Entity.Builder<B> {
private String fullName;
private String emailAddress;

View File

@ -37,6 +37,14 @@ import org.jclouds.dmtf.ovf.NetworkSection;
import org.jclouds.dmtf.ovf.ProductSection;
import org.jclouds.dmtf.ovf.SectionType;
import org.jclouds.dmtf.ovf.StartupSection;
import org.jclouds.vcloud.director.v1_5.domain.section.CustomizationSection;
import org.jclouds.vcloud.director.v1_5.domain.section.GuestCustomizationSection;
import org.jclouds.vcloud.director.v1_5.domain.section.LeaseSettingsSection;
import org.jclouds.vcloud.director.v1_5.domain.section.NetworkConfigSection;
import org.jclouds.vcloud.director.v1_5.domain.section.NetworkConnectionSection;
import org.jclouds.vcloud.director.v1_5.domain.section.OperatingSystemSection;
import org.jclouds.vcloud.director.v1_5.domain.section.RuntimeInfoSection;
import org.jclouds.vcloud.director.v1_5.domain.section.VirtualHardwareSection;
import com.google.common.base.Objects;
import com.google.common.collect.ImmutableSet;
@ -50,7 +58,7 @@ import com.google.common.collect.Sets;
* </pre>
*/
@XmlRootElement(name = "VAppTemplate")
public class VAppTemplate extends ResourceEntityType {
public class VAppTemplate extends ResourceEntity {
public static Builder<?> builder() {
return new ConcreteBuilder();
@ -64,7 +72,7 @@ public class VAppTemplate extends ResourceEntityType {
private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
}
public static abstract class Builder<B extends Builder<B>> extends ResourceEntityType.Builder<B> {
public static abstract class Builder<B extends Builder<B>> extends ResourceEntity.Builder<B> {
private Owner owner;
private Set<VAppTemplate> children = Sets.newLinkedHashSet();
private Set<SectionType> sections = Sets.newLinkedHashSet();

View File

@ -30,6 +30,7 @@ import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlType;
import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;
import com.google.common.collect.ImmutableSet;
@ -45,7 +46,7 @@ import com.google.common.collect.Sets;
@XmlRootElement(name = "Vdc")
@XmlType(name = "VdcType")
@XmlSeeAlso({ AdminVdc.class })
public class Vdc extends EntityType {
public class Vdc extends Entity {
public static Builder<?> builder() {
return new ConcreteBuilder();
@ -59,7 +60,7 @@ public class Vdc extends EntityType {
private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
}
public static abstract class Builder<B extends Builder<B>> extends EntityType.Builder<B> {
public static abstract class Builder<B extends Builder<B>> extends Entity.Builder<B> {
private String allocationModel;
private CapacityWithUsage storageCapacity;
private ComputeCapacity computeCapacity;

View File

@ -39,7 +39,7 @@ import com.google.common.base.Objects.ToStringHelper;
* @author grkvlt@apache.org
*/
@XmlType(name = "VmPendingQuestion")
public class VmPendingQuestion extends ResourceType {
public class VmPendingQuestion extends Resource {
public static Builder<?> builder() {
return new ConcreteBuilder();
@ -53,7 +53,7 @@ public class VmPendingQuestion extends ResourceType {
private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
}
public static abstract class Builder<B extends Builder<B>> extends ResourceType.Builder<B> {
public static abstract class Builder<B extends Builder<B>> extends Resource.Builder<B> {
private String question;
private String questionId;
@ -90,7 +90,7 @@ public class VmPendingQuestion extends ResourceType {
}
public B fromVmPendingQuestion(VmPendingQuestion in) {
return fromResourceType(in).question(in.getQuestion()).questionId(in.getQuestionId()).choices(in.getChoices());
return fromResource(in).question(in.getQuestion()).questionId(in.getQuestionId()).choices(in.getChoices());
}
}

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.dmtf;
import static org.jclouds.dmtf.DMTFConstants.OVF_NS;

View File

@ -16,10 +16,11 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.dmtf;
import static com.google.common.base.Objects.equal;
import static com.google.common.base.Preconditions.checkNotNull;
import static org.jclouds.dmtf.DMTFConstants.OVF_NS;
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_1_5_NS;
import java.net.URI;
@ -31,6 +32,7 @@ import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSchemaType;
import org.jclouds.dmtf.cim.ResourceAllocationSettingData;
import org.jclouds.vcloud.director.v1_5.domain.Link;
import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;
@ -38,13 +40,11 @@ import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Sets;
/**
* The ResourceAllocationSettingData class represents settings specifically
* related to an allocated resource that are outside the scope of the CIM class
* typically used to represent the resource itself.
* A vCloud specific {@link ResourceAllocationSettingData} extension.
*
* @author grkvlt@apache.org
*/
@XmlRootElement(name = "Item", namespace = VCLOUD_1_5_NS)
@XmlRootElement(name = "Item", namespace = OVF_NS)
public class RasdItem extends ResourceAllocationSettingData {
public static Builder<?> builder() {

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.dmtf;
import static com.google.common.base.Objects.equal;
import static com.google.common.base.Preconditions.checkNotNull;
@ -28,6 +28,8 @@ import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import org.jclouds.dmtf.ovf.internal.BaseVirtualSystem;
import org.jclouds.vcloud.director.v1_5.domain.section.OperatingSystemSection;
import org.jclouds.vcloud.director.v1_5.domain.section.VirtualHardwareSection;
import com.google.common.base.Objects;
import com.google.common.collect.ImmutableSet;

View File

@ -0,0 +1,35 @@
/*
* 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.
*/
@XmlSchema(namespace = VCLOUD_1_5_NS,
elementFormDefault = XmlNsForm.QUALIFIED,
xmlns = {
@XmlNs(prefix = "", namespaceURI = VCLOUD_1_5_NS)
}
)
@XmlAccessorType(XmlAccessType.FIELD)
package org.jclouds.vcloud.director.v1_5.domain.dmtf;
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.XmlNs;
import javax.xml.bind.annotation.XmlNsForm;
import javax.xml.bind.annotation.XmlSchema;

View File

@ -17,7 +17,7 @@
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.network;
import static com.google.common.base.Objects.equal;

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.network;
import static com.google.common.base.Objects.equal;
@ -24,6 +24,7 @@ import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;
/**

View File

@ -17,7 +17,7 @@
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.network;
import static com.google.common.base.Objects.equal;

View File

@ -17,7 +17,7 @@
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.network;
import static com.google.common.base.Objects.equal;

View File

@ -17,7 +17,7 @@
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.network;
import static com.google.common.base.Objects.equal;
import static com.google.common.base.Preconditions.checkNotNull;

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.network;
import static com.google.common.base.Objects.equal;
import static com.google.common.base.Preconditions.checkNotNull;

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.network;
import static com.google.common.base.Objects.equal;

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.network;
import static com.google.common.base.Objects.equal;
import static com.google.common.base.Preconditions.checkNotNull;

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.network;
import static com.google.common.base.Objects.equal;

View File

@ -17,7 +17,7 @@
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.network;
import javax.xml.bind.annotation.XmlRootElement;

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.network;
import static com.google.common.base.Objects.equal;

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.network;
import javax.xml.bind.annotation.XmlSeeAlso;

View File

@ -17,7 +17,7 @@
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.network;
import static com.google.common.base.Objects.equal;

View File

@ -17,7 +17,7 @@
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.network;
import static com.google.common.base.Objects.equal;
import static com.google.common.base.Preconditions.checkNotNull;

View File

@ -17,7 +17,7 @@
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.network;
import javax.xml.bind.annotation.XmlRootElement;

View File

@ -17,7 +17,7 @@
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.network;
import static com.google.common.base.Objects.equal;

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.network;
import javax.xml.bind.annotation.XmlSeeAlso;

View File

@ -17,7 +17,7 @@
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.network;
import static com.google.common.base.Objects.equal;

View File

@ -17,7 +17,7 @@
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.network;
import static com.google.common.base.Objects.equal;

View File

@ -17,7 +17,7 @@
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.network;
import static com.google.common.base.Objects.equal;

View File

@ -17,7 +17,7 @@
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.network;
import static com.google.common.base.Objects.equal;

View File

@ -17,7 +17,7 @@
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.network;
import static com.google.common.base.Objects.equal;
import static com.google.common.base.Preconditions.checkNotNull;

View File

@ -17,7 +17,7 @@
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.network;
import static com.google.common.base.Objects.equal;

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.network;
import static com.google.common.base.Objects.equal;
import static com.google.common.base.Preconditions.checkNotNull;
@ -30,6 +30,10 @@ import javax.xml.bind.annotation.XmlEnumValue;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlType;
import org.jclouds.vcloud.director.v1_5.domain.Entity;
import org.jclouds.vcloud.director.v1_5.domain.Entity.Builder;
import org.jclouds.vcloud.director.v1_5.domain.org.OrgNetwork;
import com.google.common.base.Function;
import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;
@ -38,7 +42,7 @@ import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Maps;
@XmlSeeAlso({ OrgNetwork.class, ExternalNetwork.class })
public abstract class Network extends EntityType {
public abstract class Network extends Entity {
@XmlType
@XmlEnum(String.class)
@ -75,7 +79,7 @@ public abstract class Network extends EntityType {
}
}
public abstract static class Builder<T extends Builder<T>> extends EntityType.Builder<T> {
public abstract static class Builder<T extends Builder<T>> extends Entity.Builder<T> {
protected NetworkConfiguration networkConfiguration;
/**

View File

@ -17,7 +17,7 @@
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.network;
import static com.google.common.base.Objects.equal;

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.network;
import static com.google.common.base.Objects.equal;
import static com.google.common.base.Preconditions.checkNotNull;
@ -25,7 +25,8 @@ import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import org.jclouds.vcloud.director.v1_5.domain.Network.FenceMode;
import org.jclouds.vcloud.director.v1_5.domain.Reference;
import org.jclouds.vcloud.director.v1_5.domain.network.Network.FenceMode;
import com.google.common.base.Objects;

View File

@ -17,7 +17,7 @@
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.network;
import static com.google.common.base.Objects.equal;
import static com.google.common.base.Preconditions.checkNotNull;

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.network;
import static com.google.common.base.Objects.equal;
import static com.google.common.base.Preconditions.checkNotNull;

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.network;
import static com.google.common.base.Objects.equal;

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.network;
import static com.google.common.base.Objects.equal;

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.network;
import static com.google.common.base.Objects.equal;

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.network;
import static com.google.common.base.Objects.equal;
import static com.google.common.base.Preconditions.checkNotNull;

View File

@ -17,7 +17,7 @@
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.network;
import static com.google.common.base.Objects.equal;
import static com.google.common.base.Preconditions.checkNotNull;

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.network;
import static com.google.common.base.Objects.equal;

View File

@ -17,7 +17,7 @@
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.network;
import static com.google.common.base.Objects.equal;

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.network;
import static com.google.common.base.Objects.equal;
@ -25,6 +25,9 @@ import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import org.jclouds.vcloud.director.v1_5.domain.Resource;
import org.jclouds.vcloud.director.v1_5.domain.Resource.Builder;
import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;
@ -37,7 +40,7 @@ import com.google.common.base.Objects.ToStringHelper;
*/
@XmlRootElement(name = "NetworkConfiguration")
@XmlType(name = "VAppNetworkConfiguration")
public class VAppNetworkConfiguration extends ResourceType {
public class VAppNetworkConfiguration extends Resource {
public static Builder<?> builder() {
return new ConcreteBuilder();
@ -51,7 +54,7 @@ public class VAppNetworkConfiguration extends ResourceType {
private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
}
public static abstract class Builder<B extends Builder<B>> extends ResourceType.Builder<B> {
public static abstract class Builder<B extends Builder<B>> extends Resource.Builder<B> {
private String description;
private NetworkConfiguration configuration;
@ -96,7 +99,7 @@ public class VAppNetworkConfiguration extends ResourceType {
}
public B fromVAppNetworkConfiguration(VAppNetworkConfiguration in) {
return fromResourceType(in)
return fromResource(in)
.description(in.getDescription())
.configuration(in.getConfiguration())
.isDeployed(in.isDeployed())

View File

@ -0,0 +1,35 @@
/*
* 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.
*/
@XmlSchema(namespace = VCLOUD_1_5_NS,
elementFormDefault = XmlNsForm.QUALIFIED,
xmlns = {
@XmlNs(prefix = "", namespaceURI = VCLOUD_1_5_NS)
}
)
@XmlAccessorType(XmlAccessType.FIELD)
package org.jclouds.vcloud.director.v1_5.domain.network;
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.XmlNs;
import javax.xml.bind.annotation.XmlNsForm;
import javax.xml.bind.annotation.XmlSchema;

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.org;
import static com.google.common.base.Objects.equal;
import static com.google.common.base.Preconditions.checkNotNull;
@ -28,6 +28,8 @@ import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import org.jclouds.vcloud.director.v1_5.domain.Reference;
import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;
import com.google.common.collect.ImmutableSet;

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.org;
import static com.google.common.base.Objects.equal;
import static com.google.common.base.Preconditions.checkNotNull;
@ -29,6 +29,7 @@ import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.xml.bind.annotation.XmlType;
import com.google.common.base.Function;
import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.org;
import static com.google.common.base.Objects.equal;
@ -25,6 +25,8 @@ import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSeeAlso;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
import org.jclouds.vcloud.director.v1_5.domain.Entity;
import org.jclouds.vcloud.director.v1_5.domain.Entity.Builder;
import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;
@ -42,7 +44,7 @@ import com.google.common.base.Objects.ToStringHelper;
*/
@XmlRootElement(name = "Org")
@XmlSeeAlso({ AdminOrg.class })
public class Org extends EntityType {
public class Org extends Entity {
public static final String MEDIA_TYPE = VCloudDirectorMediaType.ORG;
@ -58,7 +60,7 @@ public class Org extends EntityType {
private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
}
public static abstract class Builder<B extends Builder<B>> extends EntityType.Builder<B> {
public static abstract class Builder<B extends Builder<B>> extends Entity.Builder<B> {
private String fullName;
private Boolean isEnabled;

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.org;
import static com.google.common.base.Objects.equal;
import static com.google.common.base.Preconditions.checkNotNull;
@ -27,6 +27,10 @@ import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import org.jclouds.vcloud.director.v1_5.domain.Resource;
import org.jclouds.vcloud.director.v1_5.domain.Resource.Builder;
import org.jclouds.vcloud.director.v1_5.domain.network.SmtpServerSettings;
import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;
import com.google.common.collect.ImmutableList;
@ -63,7 +67,7 @@ import com.google.common.collect.ImmutableList;
"alertEmailTo",
"smtpServerSettings"
})
public class OrgEmailSettings extends ResourceType {
public class OrgEmailSettings extends Resource {
public static Builder<?> builder() {
return new ConcreteBuilder();
@ -77,7 +81,7 @@ public class OrgEmailSettings extends ResourceType {
private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
}
public static abstract class Builder<B extends Builder<B>> extends ResourceType.Builder<B> {
public static abstract class Builder<B extends Builder<B>> extends Resource.Builder<B> {
private boolean isDefaultSmtpServer;
private boolean isDefaultOrgEmail;
@ -157,7 +161,7 @@ public class OrgEmailSettings extends ResourceType {
}
public B fromOrgEmailSettings(OrgEmailSettings in) {
return fromResourceType(in)
return fromResource(in)
.isDefaultSmtpServer(in.isDefaultSmtpServer())
.isDefaultOrgEmail(in.isDefaultOrgEmail())
.fromEmailAddress(in.getFromEmailAddress())

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.org;
import static com.google.common.base.Objects.equal;
@ -24,6 +24,9 @@ import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import org.jclouds.vcloud.director.v1_5.domain.Resource;
import org.jclouds.vcloud.director.v1_5.domain.Resource.Builder;
import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;
@ -55,7 +58,7 @@ import com.google.common.base.Objects.ToStringHelper;
"useServerBootSequence",
"delayAfterPowerOnSeconds"
})
public class OrgGeneralSettings extends ResourceType {
public class OrgGeneralSettings extends Resource {
public static Builder<?> builder() {
return new ConcreteBuilder();
@ -69,7 +72,7 @@ public class OrgGeneralSettings extends ResourceType {
private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
}
public static abstract class Builder<B extends Builder<B>> extends ResourceType.Builder<B> {
public static abstract class Builder<B extends Builder<B>> extends Resource.Builder<B> {
private Boolean canPublishCatalogs;
private Integer deployedVMQuota;
@ -123,7 +126,7 @@ public class OrgGeneralSettings extends ResourceType {
}
public B fromOrgGeneralSettings(OrgGeneralSettings in) {
return fromResourceType(in)
return fromResource(in)
.canPublishCatalogs(in.canPublishCatalogs())
.deployedVMQuota(in.getDeployedVMQuota())
.storedVmQuota(in.getStoredVmQuota())

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.org;
import static com.google.common.base.Objects.equal;

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.org;
import static com.google.common.base.Objects.equal;
import static com.google.common.base.Preconditions.checkNotNull;
@ -30,6 +30,9 @@ import javax.xml.bind.annotation.XmlEnumValue;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import org.jclouds.vcloud.director.v1_5.domain.Resource;
import org.jclouds.vcloud.director.v1_5.domain.Resource.Builder;
import com.google.common.base.Function;
import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;
@ -60,7 +63,7 @@ import com.google.common.collect.Maps;
"customUsersOu",
"customOrgLdapSettings"
})
public class OrgLdapSettings extends ResourceType {
public class OrgLdapSettings extends Resource {
@XmlType
@XmlEnum(String.class)
@ -108,7 +111,7 @@ public class OrgLdapSettings extends ResourceType {
private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
}
public static abstract class Builder<B extends Builder<B>> extends ResourceType.Builder<B> {
public static abstract class Builder<B extends Builder<B>> extends Resource.Builder<B> {
private LdapMode ldapMode;
private String customUsersOu;
@ -152,7 +155,7 @@ public class OrgLdapSettings extends ResourceType {
}
public B fromOrgLdapSettings(OrgLdapSettings in) {
return fromResourceType(in)
return fromResource(in)
.ldapMode(in.getLdapMode())
.customUsersOu(in.getCustomUsersOu())
.customOrgLdapSettings(in.getCustomOrgLdapSettings());

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.org;
import static com.google.common.base.Objects.equal;

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.org;
import static com.google.common.base.Objects.equal;
@ -24,6 +24,9 @@ import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import org.jclouds.vcloud.director.v1_5.domain.Resource;
import org.jclouds.vcloud.director.v1_5.domain.Resource.Builder;
import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;
@ -51,7 +54,7 @@ import com.google.common.base.Objects.ToStringHelper;
"deploymentLeaseSeconds",
"storageLeaseSeconds"
})
public class OrgLeaseSettings extends ResourceType {
public class OrgLeaseSettings extends Resource {
public static Builder<?> builder() {
return new ConcreteBuilder();
}
@ -64,7 +67,7 @@ public class OrgLeaseSettings extends ResourceType {
private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
}
public static abstract class Builder<B extends Builder<B>> extends ResourceType.Builder<B> {
public static abstract class Builder<B extends Builder<B>> extends Resource.Builder<B> {
private Boolean deleteOnStorageLeaseExpiration;
private Integer deploymentLeaseSeconds;
@ -100,7 +103,7 @@ public class OrgLeaseSettings extends ResourceType {
}
public B fromOrgLeaseSettings(OrgLeaseSettings in) {
return fromResourceType(in)
return fromResource(in)
.deleteOnStorageLeaseExpiration(in.deleteOnStorageLeaseExpiration())
.deploymentLeaseSeconds(in.getDeploymentLeaseSeconds())
.storageLeaseSeconds(in.getStorageLeaseSeconds());

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.org;
import static com.google.common.base.Objects.equal;
import static com.google.common.base.Preconditions.checkNotNull;
@ -28,6 +28,7 @@ import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
import org.jclouds.vcloud.director.v1_5.domain.Reference;
import com.google.common.base.Objects;
import com.google.common.collect.ImmutableSet;

View File

@ -16,13 +16,18 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.org;
import static com.google.common.base.Objects.equal;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import org.jclouds.vcloud.director.v1_5.domain.Reference;
import org.jclouds.vcloud.director.v1_5.domain.network.IpAddresses;
import org.jclouds.vcloud.director.v1_5.domain.network.Network;
import org.jclouds.vcloud.director.v1_5.domain.network.Network.Builder;
import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.org;
import static com.google.common.base.Objects.equal;
@ -24,6 +24,9 @@ import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import org.jclouds.vcloud.director.v1_5.domain.Resource;
import org.jclouds.vcloud.director.v1_5.domain.Resource.Builder;
import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;
@ -40,7 +43,7 @@ import com.google.common.base.Objects.ToStringHelper;
"invalidLoginsBeforeLockout",
"accountLockoutIntervalMinutes"
})
public class OrgPasswordPolicySettings extends ResourceType {
public class OrgPasswordPolicySettings extends Resource {
public static Builder<?> builder() {
return new ConcreteBuilder();
}
@ -53,7 +56,7 @@ public class OrgPasswordPolicySettings extends ResourceType {
private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
}
public static abstract class Builder<B extends Builder<B>> extends ResourceType.Builder<B> {
public static abstract class Builder<B extends Builder<B>> extends Resource.Builder<B> {
private boolean accountLockoutEnabled;
private int invalidLoginsBeforeLockout;
@ -89,7 +92,7 @@ public class OrgPasswordPolicySettings extends ResourceType {
}
public B fromOrgPasswordPolicySettings(OrgPasswordPolicySettings in) {
return fromResourceType(in)
return fromResource(in)
.accountLockoutEnabled(in.isAccountLockoutEnabled())
.invalidLoginsBeforeLockout(in.getInvalidLoginsBeforeLockout())
.accountLockoutIntervalMinutes(in.getAccountLockoutIntervalMinutes());

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.org;
import static com.google.common.base.Objects.equal;
@ -24,6 +24,9 @@ import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import org.jclouds.vcloud.director.v1_5.domain.Resource;
import org.jclouds.vcloud.director.v1_5.domain.Resource.Builder;
import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;
/**
@ -59,7 +62,7 @@ import com.google.common.base.Objects.ToStringHelper;
"emailSettings",
"passwordPolicy"
})
public class OrgSettings extends ResourceType {
public class OrgSettings extends Resource {
public static Builder<?> builder() {
return new ConcreteBuilder();
}
@ -72,7 +75,7 @@ public class OrgSettings extends ResourceType {
private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
}
public static abstract class Builder<B extends Builder<B>> extends ResourceType.Builder<B> {
public static abstract class Builder<B extends Builder<B>> extends Resource.Builder<B> {
private OrgGeneralSettings generalSettings;
private OrgLeaseSettings vAppLeaseSettings;
@ -135,7 +138,7 @@ public class OrgSettings extends ResourceType {
}
public B fromOrgSettings(OrgSettings in) {
return fromResourceType(in)
return fromResource(in)
.generalSettings(in.getGeneralSettings())
.vAppLeaseSettings(in.getVAppLeaseSettings())
.vAppTemplateLeaseSettings(in.getVAppTemplateLeaseSettings())

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.org;
import static com.google.common.base.Objects.equal;
@ -24,6 +24,9 @@ import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import org.jclouds.vcloud.director.v1_5.domain.Resource;
import org.jclouds.vcloud.director.v1_5.domain.Resource.Builder;
import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;
@ -49,7 +52,7 @@ import com.google.common.base.Objects.ToStringHelper;
"deleteOnStorageLeaseExpiration",
"storageLeaseSeconds"
})
public class OrgVAppTemplateLeaseSettings extends ResourceType {
public class OrgVAppTemplateLeaseSettings extends Resource {
public static Builder<?> builder() {
return new ConcreteBuilder();
}
@ -62,7 +65,7 @@ public class OrgVAppTemplateLeaseSettings extends ResourceType {
private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
}
public static abstract class Builder<B extends Builder<B>> extends ResourceType.Builder<B> {
public static abstract class Builder<B extends Builder<B>> extends Resource.Builder<B> {
private Boolean deleteOnStorageLeaseExpiration;
private Integer storageLeaseSeconds;
@ -90,7 +93,7 @@ public class OrgVAppTemplateLeaseSettings extends ResourceType {
}
public B fromOrgVAppTemplateLeaseSettings(OrgVAppTemplateLeaseSettings in) {
return fromResourceType(in)
return fromResource(in)
.deleteOnStorageLeaseExpiration(in.deleteOnStorageLeaseExpiration())
.storageLeaseSeconds(in.getStorageLeaseSeconds());
}

View File

@ -0,0 +1,35 @@
/*
* 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.
*/
@XmlSchema(namespace = VCLOUD_1_5_NS,
elementFormDefault = XmlNsForm.QUALIFIED,
xmlns = {
@XmlNs(prefix = "", namespaceURI = VCLOUD_1_5_NS)
}
)
@XmlAccessorType(XmlAccessType.FIELD)
package org.jclouds.vcloud.director.v1_5.domain.org;
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.XmlNs;
import javax.xml.bind.annotation.XmlNsForm;
import javax.xml.bind.annotation.XmlSchema;

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.params;
import static com.google.common.base.Objects.equal;
import static com.google.common.base.Preconditions.checkNotNull;
@ -37,6 +37,15 @@ import org.jclouds.dmtf.ovf.NetworkSection;
import org.jclouds.dmtf.ovf.ProductSection;
import org.jclouds.dmtf.ovf.SectionType;
import org.jclouds.dmtf.ovf.StartupSection;
import org.jclouds.vcloud.director.v1_5.domain.Reference;
import org.jclouds.vcloud.director.v1_5.domain.section.CustomizationSection;
import org.jclouds.vcloud.director.v1_5.domain.section.GuestCustomizationSection;
import org.jclouds.vcloud.director.v1_5.domain.section.LeaseSettingsSection;
import org.jclouds.vcloud.director.v1_5.domain.section.NetworkConfigSection;
import org.jclouds.vcloud.director.v1_5.domain.section.NetworkConnectionSection;
import org.jclouds.vcloud.director.v1_5.domain.section.OperatingSystemSection;
import org.jclouds.vcloud.director.v1_5.domain.section.RuntimeInfoSection;
import org.jclouds.vcloud.director.v1_5.domain.section.VirtualHardwareSection;
import com.google.common.base.Objects;
import com.google.common.collect.ImmutableSet;

View File

@ -17,7 +17,7 @@
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.params;
import static com.google.common.base.Objects.equal;
@ -25,6 +25,9 @@ import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import org.jclouds.vcloud.director.v1_5.domain.Reference;
import org.jclouds.vcloud.director.v1_5.domain.params.ParamsType.Builder;
import com.google.common.base.Objects;

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.params;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

View File

@ -17,7 +17,7 @@
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.params;
import static com.google.common.base.Objects.equal;
@ -27,6 +27,9 @@ import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import org.jclouds.vcloud.director.v1_5.domain.Reference;
import org.jclouds.vcloud.director.v1_5.domain.params.ParamsType.Builder;
import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.params;
import static com.google.common.base.Objects.equal;
import static com.google.common.base.Preconditions.checkNotNull;
@ -28,6 +28,8 @@ import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import org.jclouds.vcloud.director.v1_5.domain.params.VAppCreationParams.Builder;
import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;
import com.google.common.collect.ImmutableList;

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.params;
import static com.google.common.base.Objects.equal;
import static com.google.common.base.Preconditions.checkNotNull;
@ -30,6 +30,8 @@ import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import org.jclouds.vcloud.director.v1_5.domain.AccessSetting;
import com.google.common.base.Objects;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Iterables;

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.params;
import static com.google.common.base.Objects.equal;

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.params;
import static com.google.common.base.Objects.equal;
@ -24,6 +24,8 @@ import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import org.jclouds.vcloud.director.v1_5.domain.params.VAppCreationParams.Builder;
import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.params;
import static com.google.common.base.Objects.equal;
@ -28,6 +28,8 @@ import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
import org.jclouds.vcloud.director.v1_5.domain.Reference;
import org.jclouds.vcloud.director.v1_5.domain.params.VAppCreationParams.Builder;
import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.params;
import static com.google.common.base.Objects.equal;

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.params;
import static com.google.common.base.Objects.equal;
import static com.google.common.base.Preconditions.checkNotNull;
@ -35,6 +35,14 @@ import org.jclouds.dmtf.ovf.NetworkSection;
import org.jclouds.dmtf.ovf.ProductSection;
import org.jclouds.dmtf.ovf.SectionType;
import org.jclouds.dmtf.ovf.StartupSection;
import org.jclouds.vcloud.director.v1_5.domain.section.CustomizationSection;
import org.jclouds.vcloud.director.v1_5.domain.section.GuestCustomizationSection;
import org.jclouds.vcloud.director.v1_5.domain.section.LeaseSettingsSection;
import org.jclouds.vcloud.director.v1_5.domain.section.NetworkConfigSection;
import org.jclouds.vcloud.director.v1_5.domain.section.NetworkConnectionSection;
import org.jclouds.vcloud.director.v1_5.domain.section.OperatingSystemSection;
import org.jclouds.vcloud.director.v1_5.domain.section.RuntimeInfoSection;
import org.jclouds.vcloud.director.v1_5.domain.section.VirtualHardwareSection;
import com.google.common.base.Objects;
import com.google.common.collect.ImmutableSet;

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.params;
import static com.google.common.base.Objects.equal;
@ -24,6 +24,8 @@ import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import org.jclouds.vcloud.director.v1_5.domain.Reference;
import com.google.common.base.Objects;
/**

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.params;
import static com.google.common.base.Objects.equal;

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.params;
import static com.google.common.base.Objects.equal;

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.params;
import static com.google.common.base.Objects.equal;
@ -27,6 +27,9 @@ import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import org.jclouds.vcloud.director.v1_5.domain.Reference;
import org.jclouds.vcloud.director.v1_5.domain.Vm;
import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;

View File

@ -17,7 +17,7 @@
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
package org.jclouds.vcloud.director.v1_5.domain.params;
import static com.google.common.base.Objects.equal;
import static com.google.common.base.Preconditions.checkNotNull;
@ -26,6 +26,8 @@ import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import org.jclouds.vcloud.director.v1_5.domain.Reference;
import com.google.common.base.Objects;

Some files were not shown because too many files have changed in this diff Show More