diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/VCloudDirectorAsyncClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/VCloudDirectorAsyncClient.java index 3e20e9fbe5..2772320545 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/VCloudDirectorAsyncClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/VCloudDirectorAsyncClient.java @@ -41,6 +41,7 @@ import org.jclouds.vcloud.director.v1_5.features.QueryAsyncClient; import org.jclouds.vcloud.director.v1_5.features.TaskAsyncClient; import org.jclouds.vcloud.director.v1_5.features.UploadAsyncClient; import org.jclouds.vcloud.director.v1_5.features.UserAsyncClient; +import org.jclouds.vcloud.director.v1_5.features.VAppAsyncClient; import org.jclouds.vcloud.director.v1_5.features.VAppTemplateAsyncClient; import org.jclouds.vcloud.director.v1_5.features.VdcAsyncClient; @@ -108,15 +109,20 @@ public interface VCloudDirectorAsyncClient { @Delegate UploadAsyncClient getUploadClient(); + /** + * @return asynchronous access to {@link VApp} features + */ + @Delegate + VAppAsyncClient getVAppClient(); /** - * @return asynchronous access to {@link org.jclouds.vcloud.director.v1_5.domain.VAppTemplate} features + * @return asynchronous access to {@link VAppTemplate} features */ @Delegate VAppTemplateAsyncClient getVAppTemplateClient(); /** - * @return asynchronous access to {@link Catalog} features + * @return asynchronous access to {@link Catalog} admin features */ @Delegate AdminCatalogAsyncClient getAdminCatalogClient(); diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/VCloudDirectorClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/VCloudDirectorClient.java index 041c4195fb..44575c7562 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/VCloudDirectorClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/VCloudDirectorClient.java @@ -45,6 +45,7 @@ import org.jclouds.vcloud.director.v1_5.features.QueryClient; import org.jclouds.vcloud.director.v1_5.features.TaskClient; import org.jclouds.vcloud.director.v1_5.features.UploadClient; import org.jclouds.vcloud.director.v1_5.features.UserClient; +import org.jclouds.vcloud.director.v1_5.features.VAppClient; import org.jclouds.vcloud.director.v1_5.features.VAppTemplateClient; import org.jclouds.vcloud.director.v1_5.features.VdcClient; @@ -107,19 +108,25 @@ public interface VCloudDirectorClient { VdcClient getVdcClient(); /** - * @return synchronous access to {@link Upload} features + * @return synchronous access to upload features */ @Delegate UploadClient getUploadClient(); /** - * @return synchronous access to {@link org.jclouds.vcloud.director.v1_5.domain.VAppTemplate} features + * @return synchronous access to {@link VApp} features + */ + @Delegate + VAppClient getVAppClient(); + + /** + * @return synchronous access to {@link VAppTemplate} features */ @Delegate VAppTemplateClient getVAppTemplateClient(); /** - * @return synchronous access to {@link Catalog} features + * @return synchronous access to {@link Catalog} admin features */ @Delegate AdminCatalogClient getAdminCatalogClient(); diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/VCloudDirectorConstants.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/VCloudDirectorConstants.java index c42c0bcc8f..0ac42eb6df 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/VCloudDirectorConstants.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/VCloudDirectorConstants.java @@ -18,7 +18,6 @@ */ package org.jclouds.vcloud.director.v1_5; - /** * Constants used by VCloudDirector clients * diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/VCloudDirectorException.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/VCloudDirectorException.java index 55a73625e0..c79aa42824 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/VCloudDirectorException.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/VCloudDirectorException.java @@ -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 @@ -24,26 +24,36 @@ import org.jclouds.vcloud.director.v1_5.domain.Task; /** * @author grkvlt@apache.org */ -public class VCloudDirectorException extends RuntimeException { +public class VCloudDirectorException extends VCloudDirectorRuntimeException { /** The serialVersionUID. */ private static final long serialVersionUID = -5292516858598372960L; + private static final String MSG_FMT = "%s: %s"; + private final Error error; private final Task task; public VCloudDirectorException(Error error) { - super("ERR-801: Error: " + error.getMessage()); + super(String.format(MSG_FMT, "Error", error.getMessage())); this.error = error; this.task = null; } public VCloudDirectorException(Task task) { - super("ERR-802: Task error: " + task.getError().getMessage()); + super(String.format(MSG_FMT, "Task error", task.getError().getMessage())); this.error = task.getError(); this.task = task; } + public Integer getMajorErrorCode() { + return error.getMajorErrorCode(); + } + + public Error.Code getCode() { + return Error.Code.fromCode(error.getMajorErrorCode()); + } + public Error getError() { return error; } @@ -55,5 +65,4 @@ public class VCloudDirectorException extends RuntimeException { public Task getTask() { return task; } - } diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/VCloudDirectorMediaType.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/VCloudDirectorMediaType.java index add7469d07..7f2bf0373f 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/VCloudDirectorMediaType.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/VCloudDirectorMediaType.java @@ -34,6 +34,10 @@ public class VCloudDirectorMediaType { public static final String ANY = "*/*"; + public static final String ANY_IMAGE = "image/*"; + + public static final String APPLICATION_XML_1_5 = "application/*+xml;version=1.5"; + public static final String SESSION = "application/vnd.vmware.vcloud.session+xml"; public static final String ERROR = "application/vnd.vmware.vcloud.error+xml"; @@ -74,30 +78,23 @@ public class VCloudDirectorMediaType { public static final String ADMIN_USER = "application/vnd.vmware.admin.user+xml"; - public static final String V_APP = "application/vnd.vmware.vcloud.vApp+xml"; + public static final String VAPP = "application/vnd.vmware.vcloud.vApp+xml"; - public static final String V_APP_TEMPLATE = "application/vnd.vmware.vcloud.vAppTemplate+xml"; + public static final String VAPP_TEMPLATE = "application/vnd.vmware.vcloud.vAppTemplate+xml"; - public static final String CAPTURE_VAPP_PARAMS = - "application/vnd.vmware.vcloud.captureVAppParams+xml"; + public static final String CAPTURE_VAPP_PARAMS = "application/vnd.vmware.vcloud.captureVAppParams+xml"; - public static final String CLONE_MEDIA_PARAMS = - "application/vnd.vmware.vcloud.cloneMediaParams+xml"; + public static final String CLONE_MEDIA_PARAMS = "application/vnd.vmware.vcloud.cloneMediaParams+xml"; - public static final String CLONE_V_APP_PARAMS = - "application/vnd.vmware.vcloud.cloneVAppParams+xml"; + public static final String CLONE_VAPP_PARAMS = "application/vnd.vmware.vcloud.cloneVAppParams+xml"; - public static final String CLONE_V_APP_TEMPLATE_PARAMS = - "application/vnd.vmware.vcloud.cloneVAppTemplateParams+xml"; + public static final String CLONE_VAPP_TEMPLATE_PARAMS = "application/vnd.vmware.vcloud.cloneVAppTemplateParams+xml"; - public static final String COMPOSE_VAPP_PARAMS = - "application/vnd.vmware.vcloud.composeVAppParams+xml"; + public static final String COMPOSE_VAPP_PARAMS = "application/vnd.vmware.vcloud.composeVAppParams+xml"; - public static final String INSTANTIATE_VAPP_TEMPLATE_PARAMS = - "application/vnd.vmware.vcloud.instantiateVAppTemplateParams+xml"; + public static final String INSTANTIATE_VAPP_TEMPLATE_PARAMS = "application/vnd.vmware.vcloud.instantiateVAppTemplateParams+xml"; - public static final String UPLOAD_VAPP_TEMPLATE_PARAMS = - "application/vnd.vmware.vcloud.uploadVAppTemplateParams+xml"; + public static final String UPLOAD_VAPP_TEMPLATE_PARAMS = "application/vnd.vmware.vcloud.uploadVAppTemplateParams+xml"; public static final String QUERY_RESULT_RECORDS = "application/vnd.vmware.vcloud.query.records+xml"; @@ -107,26 +104,38 @@ public class VCloudDirectorMediaType { public static final String CONTROL_ACCESS = "application/vnd.vmware.vcloud.controlAccess+xml"; - public static final String VAPP_TEMPLATE = "application/vnd.vmware.vcloud.vAppTemplate+xml"; - public static final String CUSTOMIZATION_SECTION = "application/vnd.vmware.vcloud.customizationSection+xml"; public static final String GUEST_CUSTOMIZATION_SECTION = "application/vnd.vmware.vcloud.guestCustomizationSection+xml"; + public static final String LEASE_SETTINGS_SECTION = "application/vnd.vmware.vcloud.leaseSettingsSection+xml"; + public static final String NETWORK_SECTION = "application/vnd.vmware.vcloud.networkSection+xml"; public static final String NETWORK_CONFIG_SECTION = "application/vnd.vmware.vcloud.networkConfigSection+xml"; public static final String NETWORK_CONNECTION_SECTION = "application/vnd.vmware.vcloud.networkConnectionSection+xml"; + public static final String OPERATING_SYSTEM_SECTION = "application/vnd.vmware.vcloud.operatingSystemSection+xml"; + public static final String PRODUCT_SECTION_LIST = "application/vnd.vmware.vcloud.productSection+xml"; - public static final String RELOCATE_TEMPLATE = "application/vnd.vmware.vcloud.relocateTemplate+xml"; + public static final String STARTUP_SECTION = "application/vnd.vmware.vcloud.startupSection+xml"; - public static final String LEASE_SETTINGS_SECTION = "application/vnd.vmware.vcloud.leaseSettingsSection+xml"; + public static final String VIRTUAL_HARDWARE_SECTION = "application/vnd.vmware.vcloud.virtualHardwareSection+xml"; + + public static final String RELOCATE_TEMPLATE = "application/vnd.vmware.vcloud.relocateTemplate+xml"; public static final String ENVELOPE = "application/vnd.???"; + public static final String VM_PENDING_ANSWER = "application/vnd.vmware.vcloud.vmPendingAnswer+xml"; + + public static final String VM_PENDING_QUESTION = "application/vnd.vmware.vcloud.vmPendingQuestion+xml"; + + public static final String OVF_RASD_ITEM = "application/vnd.vmware.vcloud.rasdItem+xml"; + + public static final String OVF_RASD_ITEMS_LIST = "application/vnd.vmware.vcloud.rasdItemsList+xml"; + public static final String ADMIN_CATALOG = "application/vnd.vmware.admin.catalog+xml"; public static final String ADMIN_ORG = "application/vnd.vmware.admin.organization+xml"; @@ -156,6 +165,14 @@ public class VCloudDirectorMediaType { public static final String USER = "application/vnd.vmware.admin.user+xml"; public static final String ROLE = "application/vnd.vmware.admin.role+xml"; + + public static final String DEPLOY_VAPP_PARAMS = "application/vnd.vmware.vcloud.deployVAppParams+xml"; + + public static final String RECOMPOSE_VAPP_PARAMS = "application/vnd.vmware.vcloud.recomposeVAppParams+xml"; + + public static final String RELOCATE_VM_PARAMS = "application/vnd.vmware.vcloud.relocateVmParams+xml"; + + public static final String UNDEPLOY_VAPP_PARAMS = "application/vnd.vmware.vcloud.undeployVAppParams+xml"; public static final String ADMIN_VDC = "application/vnd.vmware.admin.vdc+xml"; @@ -165,20 +182,23 @@ public class VCloudDirectorMediaType { * This list must be updated whenever a new media type constant is added. */ public static final List ALL = ImmutableList.of( - SESSION, ERROR, ORG_LIST, METADATA, METADATA_ENTRY, - METADATA_VALUE, ORG, TASKS_LIST, TASK, NETWORK, ORG_NETWORK, - CATALOG, CATALOG_ITEM, CATALOG_ITEMS, CATALOGS_LIST, PROPERTY, - MEDIA, OWNER, VDC, ADMIN_USER, V_APP, V_APP_TEMPLATE, - CAPTURE_VAPP_PARAMS, CLONE_V_APP_PARAMS, CLONE_V_APP_TEMPLATE_PARAMS, - COMPOSE_VAPP_PARAMS, INSTANTIATE_VAPP_TEMPLATE_PARAMS, - UPLOAD_VAPP_TEMPLATE_PARAMS, ADMIN_CATALOG, ADMIN_ORG, - QUERY_RESULT_RECORDS, QUERY_RESULT_REFERENCES, QUERY_RESULT_ID_RECORDS, - CONTROL_ACCESS, VAPP_TEMPLATE, CUSTOMIZATION_SECTION, GUEST_CUSTOMIZATION_SECTION, - NETWORK_SECTION, NETWORK_CONFIG_SECTION, NETWORK_CONNECTION_SECTION, - CLONE_MEDIA_PARAMS, LEASE_SETTINGS_SECTION, RELOCATE_TEMPLATE, ENVELOPE, - PUBLISH_CATALOG_PARAMS, GROUP, ORG_VAPP_TEMPLATE_LEASE_SETTINGS, - ORG_LEASE_SETTINGS, ORG_PASSWORD_POLICY_SETTINGS, ORG_LDAP_SETTINGS, - ORG_GENERAL_SETTINGS, ORG_EMAIL_SETTINGS, ORG_SETTINGS, ADMIN_NETWORK, - ADMIN_ORG_NETWORK, USER, ROLE, ADMIN_VDC + SESSION, ERROR, ORG_LIST, METADATA, METADATA_ENTRY, METADATA_VALUE, + ORG, TASKS_LIST, TASK, NETWORK, ORG_NETWORK, CATALOG, CATALOG_ITEM, + CATALOG_ITEMS, CATALOGS_LIST, PROPERTY, MEDIA, OWNER, VDC, ADMIN_USER, + VAPP, VAPP_TEMPLATE, CAPTURE_VAPP_PARAMS, CLONE_MEDIA_PARAMS, + CLONE_VAPP_PARAMS, CLONE_VAPP_TEMPLATE_PARAMS, COMPOSE_VAPP_PARAMS, + INSTANTIATE_VAPP_TEMPLATE_PARAMS, UPLOAD_VAPP_TEMPLATE_PARAMS, + QUERY_RESULT_RECORDS, QUERY_RESULT_REFERENCES, QUERY_RESULT_ID_RECORDS, + CONTROL_ACCESS, CUSTOMIZATION_SECTION, GUEST_CUSTOMIZATION_SECTION, + LEASE_SETTINGS_SECTION, NETWORK_SECTION, NETWORK_CONFIG_SECTION, + NETWORK_CONNECTION_SECTION, OPERATING_SYSTEM_SECTION, + PRODUCT_SECTION_LIST, STARTUP_SECTION, VIRTUAL_HARDWARE_SECTION, + RELOCATE_TEMPLATE, ENVELOPE, VM_PENDING_ANSWER, VM_PENDING_QUESTION, + OVF_RASD_ITEM, OVF_RASD_ITEMS_LIST, ADMIN_CATALOG, + PUBLISH_CATALOG_PARAMS, GROUP, ORG_VAPP_TEMPLATE_LEASE_SETTINGS, + ORG_LEASE_SETTINGS, ORG_PASSWORD_POLICY_SETTINGS, ORG_LDAP_SETTINGS, + ORG_GENERAL_SETTINGS, ORG_EMAIL_SETTINGS, ORG_SETTINGS, ADMIN_NETWORK, + ADMIN_ORG_NETWORK, USER, ROLE, DEPLOY_VAPP_PARAMS, RECOMPOSE_VAPP_PARAMS, + RELOCATE_VM_PARAMS, UNDEPLOY_VAPP_PARAMS, ADMIN_VDC ); } diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/VCloudDirectorPropertiesBuilder.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/VCloudDirectorPropertiesBuilder.java index 3385404a17..67bbbfc732 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/VCloudDirectorPropertiesBuilder.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/VCloudDirectorPropertiesBuilder.java @@ -41,6 +41,7 @@ public class VCloudDirectorPropertiesBuilder extends PropertiesBuilder { public Properties defaultProperties() { Properties properties = super.defaultProperties(); + /** FIXME this should not be the default */ properties.setProperty(PROPERTY_ENDPOINT, "https://vcloudbeta.bluelock.com/api"); properties.setProperty(PROPERTY_SESSION_INTERVAL, Integer.toString(30 * 60)); properties.setProperty(PROPERTY_API_VERSION, "1.5"); diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/VCloudDirectorRuntimeException.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/VCloudDirectorRuntimeException.java new file mode 100644 index 0000000000..3008e9986a --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/VCloudDirectorRuntimeException.java @@ -0,0 +1,32 @@ +/* + * 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; + +/** + * @author grkvlt@apache.org + */ +public class VCloudDirectorRuntimeException extends RuntimeException { + + /** The serialVersionUID. */ + private static final long serialVersionUID = -8590262859549695447L; + + public VCloudDirectorRuntimeException(String message) { + super(message); + } +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/config/VCloudDirectorRestClientModule.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/config/VCloudDirectorRestClientModule.java index 859060432d..881ab3b383 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/config/VCloudDirectorRestClientModule.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/config/VCloudDirectorRestClientModule.java @@ -17,8 +17,8 @@ */ package org.jclouds.vcloud.director.v1_5.config; -import static com.google.common.base.Throwables.propagate; -import static org.jclouds.rest.config.BinderUtils.bindClientAndAsyncClient; +import static com.google.common.base.Throwables.*; +import static org.jclouds.rest.config.BinderUtils.*; import java.net.URI; import java.util.Map; @@ -66,6 +66,8 @@ import org.jclouds.vcloud.director.v1_5.features.UploadAsyncClient; import org.jclouds.vcloud.director.v1_5.features.UploadClient; import org.jclouds.vcloud.director.v1_5.features.UserAsyncClient; import org.jclouds.vcloud.director.v1_5.features.UserClient; +import org.jclouds.vcloud.director.v1_5.features.VAppAsyncClient; +import org.jclouds.vcloud.director.v1_5.features.VAppClient; import org.jclouds.vcloud.director.v1_5.features.VAppTemplateAsyncClient; import org.jclouds.vcloud.director.v1_5.features.VAppTemplateClient; import org.jclouds.vcloud.director.v1_5.features.VdcAsyncClient; @@ -104,6 +106,7 @@ public class VCloudDirectorRestClientModule extends RestClientModule + * <complexType name="AbstractVAppType" > + * + * + * @author grkvlt@apache.org + */ +public abstract class AbstractVAppType> extends ResourceEntityType { + + public static abstract class Builder> extends ResourceEntityType.Builder { + + protected Boolean deployed; + protected Reference vAppParent; + protected List> sections = Lists.newArrayList(); + + /** + * @see AbstractVAppType#isDeployed() + */ + public Builder isDeployed(Boolean deployed) { + this.deployed = deployed; + return this; + } + + /** + * @see AbstractVAppType#isDeployed() + */ + public Builder deployed() { + this.deployed = Boolean.TRUE; + return this; + } + + /** + * @see AbstractVAppType#isDeployed() + */ + public Builder notDeployed() { + this.deployed = Boolean.FALSE; + return this; + } + + /** + * @see AbstractVAppType#getVAppParent() + */ + public Builder parent(Reference vAppParent) { + this.vAppParent = vAppParent; + return this; + } + + /** + * @see AbstractVAppType#getSections() + */ + public Builder sections(List> sections) { + if (checkNotNull(sections, "sections").size() > 0) + this.sections = Lists.newArrayList(sections); + return this; + } + + /** + * @see AbstractVAppType#getSections() + */ + public Builder section(SectionType section) { + if (this.sections == null) + this.sections = Lists.newArrayList(); + this.sections.add(checkNotNull(section, "section")); + return this; + } + + /** + * @see ResourceEntityType#getFiles() + */ + @Override + public Builder files(FilesList files) { + this.files = files; + return this; + } + + /** + * @see ResourceEntityType#getStatus() + */ + @Override + public Builder status(Integer status) { + this.status = status; + return this; + } + + /** + * @see EntityType#getId() + */ + @Override + public Builder id(String id) { + this.id = id; + return this; + } + + /** + * @see EntityType#getTasks() + */ + @Override + public Builder tasks(Set tasks) { + if (checkNotNull(tasks, "tasks").size() > 0) + this.tasks = Sets.newLinkedHashSet(tasks); + return this; + } + + /** + * @see EntityType#getTasks() + */ + @Override + public Builder task(Task task) { + if (tasks == null) + tasks = Sets.newLinkedHashSet(); + this.tasks.add(checkNotNull(task, "task")); + return this; + } + + /** + * @see ResourceType#getHref() + */ + @Override + public Builder href(URI href) { + this.href = href; + return this; + } + + /** + * @see ResourceType#getType() + */ + @Override + public Builder type(String type) { + this.type = type; + return this; + } + + /** + * @see ResourceType#getLinks() + */ + @Override + public Builder links(Set links) { + if (checkNotNull(links, "links").size() > 0) + this.links = Sets.newLinkedHashSet(links); + return this; + } + + /** + * @see ResourceType#getLinks() + */ + @Override + public Builder link(Link link) { + if (links == null) + links = Sets.newLinkedHashSet(); + this.links.add(checkNotNull(link, "link")); + return this; + } + + @Override + public Builder fromResourceEntityType(ResourceEntityType in) { + return Builder.class.cast(super.fromResourceEntityType(in)); + } + + public Builder fromAbstractVAppType(AbstractVAppType in) { + return fromResourceEntityType(in).parent(vAppParent).sections(sections).isDeployed(deployed); + } + } + + @XmlElement(name = "VAppParent") + protected Reference vAppParent; + @XmlElementRef(name = "Section", namespace = VCloudDirectorConstants.VCLOUD_OVF_NS) + protected List> sections = Lists.newArrayList(); + @XmlAttribute + protected Boolean deployed; + + protected AbstractVAppType() { + // for JAXB and Builders + } + + public AbstractVAppType(URI href, String type, @Nullable Set links, String description, @Nullable Set tasks, String id, String name, FilesList files, Integer status, Reference vAppParent, + @Nullable List> sections, Boolean deployed) { + super(href, type, links, description, tasks, id, name, files, status); + this.vAppParent = vAppParent; + this.sections = sections; + this.deployed = deployed; + } + + /** + * Gets the value of the vAppParent property. + */ + public Reference getVAppParent() { + return vAppParent; + } + + /** + * Specific ovf:Section with additional information for the vApp. + * + * Objects of the following type(s) are allowed in the list: + *
    + *
  • SectionType + *
  • VirtualHardwareSectionType + *
  • LeaseSettingsSectionType + *
  • EulaSectionType + *
  • RuntimeInfoSectionType + *
  • AnnotationSectionType + *
  • DeploymentOptionSectionType + *
  • StartupSectionType + *
  • ResourceAllocationSectionType + *
  • NetworkConnectionSectionType + *
  • CustomizationSectionType + *
  • ProductSectionType + *
  • GuestCustomizationSectionType + *
  • OperatingSystemSectionType + *
  • NetworkConfigSectionType + *
  • NetworkSectionType + *
  • DiskSectionType + *
  • InstallSectionType + *
+ */ + public List> getSections() { + return this.sections; + } + + /** + * Gets the value of the deployed property. + */ + public Boolean isDeployed() { + return deployed; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + Vm that = Vm.class.cast(o); + return super.equals(that) && + equal(this.vAppParent, that.vAppParent) && equal(this.sections, that.sections) && equal(this.deployed, that.deployed); + } + + @Override + public int hashCode() { + return Objects.hashCode(super.hashCode(), vAppParent, sections, deployed); + } + + @Override + public ToStringHelper string() { + return super.string().add("vAppParent", vAppParent).add("sections", sections).add("deployed", deployed); + } +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/AccessSetting.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/AccessSetting.java new file mode 100644 index 0000000000..bd16987721 --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/AccessSetting.java @@ -0,0 +1,128 @@ +/* + * 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.*; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +import com.google.common.base.Objects; + +/** + * Specifies who can access the resource. + * + *
+ * <complexType name="AccessSetting" />
+ * 
+ */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "AccessSetting") +public class AccessSetting { + + public static Builder builder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder().fromAccessSetting(this); + } + + public static class Builder { + + private Reference subject; + private String accessLevel; + + /** + * @see AccessSetting#getSubject() + */ + public Builder subject(Reference subject) { + this.subject = subject; + return this; + } + + /** + * @see AccessSetting#getAccessLevel() + */ + public Builder accessLevel(String accessLevel) { + this.accessLevel = accessLevel; + return this; + } + + public AccessSetting build() { + AccessSetting accessSetting = new AccessSetting(subject, accessLevel); + return accessSetting; + } + + public Builder fromAccessSetting(AccessSetting in) { + return subject(in.getSubject()).accessLevel(in.getAccessLevel()); + } + } + + protected AccessSetting() { + // For JAXB and builder use + } + + public AccessSetting(Reference subject, String accessLevel) { + this.subject = subject; + this.accessLevel = accessLevel; + } + + @XmlElement(name = "Subject", required = true) + protected Reference subject; + @XmlElement(name = "AccessLevel", required = true) + protected String accessLevel; + + /** + * Gets the value of the subject property. + */ + public Reference getSubject() { + return subject; + } + + /** + * Gets the value of the accessLevel property. + */ + public String getAccessLevel() { + return accessLevel; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + AccessSetting that = AccessSetting.class.cast(o); + return equal(this.subject, that.subject) && equal(this.accessLevel, that.accessLevel); + } + + @Override + public int hashCode() { + return Objects.hashCode(subject, accessLevel); + } + + @Override + public String toString() { + return Objects.toStringHelper("").add("subject", subject).add("accessLevel", accessLevel).toString(); + } +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/AccessSettings.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/AccessSettings.java new file mode 100644 index 0000000000..16087017e5 --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/AccessSettings.java @@ -0,0 +1,119 @@ +/* + * 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.*; +import static com.google.common.base.Preconditions.*; + +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + +import com.google.common.base.Objects; +import com.google.common.collect.Lists; + +/** + * A list of access settings for a resource. + * + *
+ * <complexType name="AccessSettings" />
+ * 
+ */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "AccessSettings") +public class AccessSettings { + + public static Builder builder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder().fromAccessSettings(this); + } + + public static class Builder { + + private List accessSettings = Lists.newArrayList(); + + /** + * @see AccessSettings#getAccessSettings() + */ + public Builder accessSettings(List accessSettings) { + this.accessSettings = checkNotNull(accessSettings, "accessSettings"); + return this; + } + + /** + * @see AccessSettings#getAccessSettings() + */ + public Builder accessSetting(AccessSetting accessSetting) { + this.accessSettings.add(checkNotNull(accessSetting, "accessSetting")); + return this; + } + + public AccessSettings build() { + return new AccessSettings(accessSettings); + } + + public Builder fromAccessSettings(AccessSettings in) { + return accessSettings(in.getAccessSettings()); + } + } + + protected AccessSettings() { + // For JAXB and builder use + } + + public AccessSettings(List accessSettings) { + this.accessSettings = accessSettings; + } + + @XmlElement(name = "AccessSetting", required = true) + protected List accessSettings = Lists.newArrayList(); + + /** + * Gets the value of the accessSetting property. + */ + public List getAccessSettings() { + return accessSettings; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + AccessSettings that = AccessSettings.class.cast(o); + return equal(this.accessSettings, that.accessSettings); + } + + @Override + public int hashCode() { + return Objects.hashCode(accessSettings); + } + + @Override + public String toString() { + return Objects.toStringHelper("").add("accessSettings", accessSettings).toString(); + } +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/CloneVAppParams.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/CloneVAppParams.java index 065f7dcf4f..70f2ab7704 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/CloneVAppParams.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/CloneVAppParams.java @@ -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 @@ -16,51 +16,106 @@ * specific language governing permissions and limitations * under the License. */ - package org.jclouds.vcloud.director.v1_5.domain; import javax.xml.bind.annotation.XmlType; - /** * Represents parameters for copying a vApp and optionally deleting the source. - *

- *

- *

Java class for CloneVAppParams complex type. - *

- *

The following schema fragment specifies the expected content contained within this class. - *

+ * *

- * <complexType name="CloneVAppParams">
- *   <complexContent>
- *     <extension base="{http://www.vmware.com/vcloud/v1.5}InstantiateVAppParamsType">
- *       <anyAttribute processContents='lax' namespace='##other'/>
- *     </extension>
- *   </complexContent>
- * </complexType>
+ * <complexType name="CloneVAppParams" />
  * 
+ * + * @author grkvlt@apache.org */ @XmlType(name = "CloneVAppParams") -public class CloneVAppParams - extends InstantiateVAppParamsType { +public class CloneVAppParams extends InstantiateVAppParamsType { + @SuppressWarnings("unchecked") public static Builder builder() { return new Builder(); } + @Override public Builder toBuilder() { return new Builder().fromCloneVAppParams(this); } public static class Builder extends InstantiateVAppParamsType.Builder { + @Override public CloneVAppParams build() { - return new CloneVAppParams(description, name, vAppParent, instantiationParams, deploy, powerOn, source, isSourceDelete, linkedClone); + return new CloneVAppParams(description, name, vAppParent, instantiationParams, deploy, powerOn, source, sourceDelete, linkedClone); + } + + /** + * @see InstantiateVAppParamsType#getSource() + */ + @Override + public Builder source(ReferenceType source) { + this.source = source; + return this; + } + + /** + * @see InstantiateVAppParamsType#isSourceDelete() + */ + @Override + public Builder isSourceDelete(Boolean sourceDelete) { + this.sourceDelete = sourceDelete; + return this; + } + + /** + * @see InstantiateVAppParamsType#isSourceDelete() + */ + @Override + public Builder sourceDelete() { + this.sourceDelete = Boolean.TRUE; + return this; + } + + /** + * @see InstantiateVAppParamsType#isSourceDelete() + */ + @Override + public Builder notSourceDelete() { + this.sourceDelete = Boolean.FALSE; + return this; + } + + /** + * @see InstantiateVAppParamsType#isLinkedClone() + */ + @Override + public Builder isLinkedClone(Boolean linkedClone) { + this.linkedClone = linkedClone; + return this; + } + + /** + * @see InstantiateVAppParamsType#isLinkedClone() + */ + @Override + public Builder linkedClone() { + this.linkedClone = Boolean.TRUE; + return this; + } + + /** + * @see InstantiateVAppParamsType#isLinkedClone() + */ + @Override + public Builder notLinkedClone() { + this.linkedClone = Boolean.FALSE; + return this; } /** * @see ParamsType#getDescription() */ + @Override public Builder description(String description) { super.description(description); return this; @@ -69,6 +124,7 @@ public class CloneVAppParams /** * @see ParamsType#getName() */ + @Override public Builder name(String name) { super.name(name); return this; @@ -77,56 +133,72 @@ public class CloneVAppParams /** * @see VAppCreationParamsType#getVAppParent() */ + @Override public Builder vAppParent(Reference vAppParent) { - super.vAppParent(vAppParent); + this.vAppParent = vAppParent; return this; } /** * @see VAppCreationParamsType#getInstantiationParams() */ + @Override public Builder instantiationParams(InstantiationParams instantiationParams) { - super.instantiationParams(instantiationParams); + this.instantiationParams = instantiationParams; return this; } /** * @see VAppCreationParamsType#isDeploy() */ + @Override public Builder deploy(Boolean deploy) { - super.deploy(deploy); + this.deploy = deploy; + return this; + } + + /** + * @see VAppCreationParamsType#isDeploy() + */ + @Override + public Builder deploy() { + this.deploy = Boolean.TRUE; + return this; + } + + /** + * @see VAppCreationParamsType#isDeploy() + */ + @Override + public Builder notDeploy() { + this.deploy = Boolean.FALSE; return this; } /** * @see VAppCreationParamsType#isPowerOn() */ + @Override public Builder powerOn(Boolean powerOn) { - super.powerOn(powerOn); + this.powerOn = powerOn; return this; } /** - * @see InstantiateVAppParamsType#getSource() + * @see VAppCreationParamsType#isPowerOn() */ - public Builder source(Reference source) { - super.source(source); + @Override + public Builder powerOn() { + this.powerOn = Boolean.TRUE; return this; } /** - * @see InstantiateVAppParamsType#isSourceDelete() + * @see VAppCreationParamsType#isPowerOn() */ - public Builder isSourceDelete(Boolean isSourceDelete) { - super.isSourceDelete(isSourceDelete); - return this; - } - - /** - * @see InstantiateVAppParamsType#isLinkedClone() - */ - public Builder linkedClone(Boolean linkedClone) { - super.linkedClone(linkedClone); + @Override + public Builder notPowerOn() { + this.powerOn = Boolean.FALSE; return this; } @@ -140,12 +212,12 @@ public class CloneVAppParams } } - private CloneVAppParams(String description, String name, Reference vAppParent, InstantiationParams instantiationParams, Boolean deploy, Boolean powerOn, Reference source, Boolean sourceDelete, Boolean linkedClone) { + protected CloneVAppParams() { + // For JAXB and builder use + } + + public CloneVAppParams(String description, String name, Reference vAppParent, InstantiationParams instantiationParams, + Boolean deploy, Boolean powerOn, ReferenceType source, Boolean sourceDelete, Boolean linkedClone) { super(description, name, vAppParent, instantiationParams, deploy, powerOn, source, sourceDelete, linkedClone); } - - private CloneVAppParams() { - // For JAXB - } - - } +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ComposeVAppParams.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ComposeVAppParams.java index b7a0e5d1da..b47b4d9888 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ComposeVAppParams.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ComposeVAppParams.java @@ -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 @@ -19,57 +19,32 @@ 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 static com.google.common.base.Objects.*; +import static com.google.common.base.Preconditions.*; -import java.util.Collections; -import java.util.Set; +import java.util.List; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlSeeAlso; import javax.xml.bind.annotation.XmlType; import com.google.common.base.Objects; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Sets; - +import com.google.common.base.Objects.ToStringHelper; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; /** * Represents vApp composition parameters. - *

- *

- *

Java class for ComposeVAppParams complex type. - *

- *

The following schema fragment specifies the expected content contained within this class. - *

+ * *

- * <complexType name="ComposeVAppParams">
- *   <complexContent>
- *     <extension base="{http://www.vmware.com/vcloud/v1.5}VAppCreationParamsType">
- *       <sequence>
- *         <element name="SourcedItem" type="{http://www.vmware.com/vcloud/v1.5}SourcedCompositionItemParamType" maxOccurs="unbounded" minOccurs="0"/>
- *         <element ref="{http://www.vmware.com/vcloud/v1.5}AllEULAsAccepted" minOccurs="0"/>
- *       </sequence>
- *       <attribute name="linkedClone" type="{http://www.w3.org/2001/XMLSchema}boolean" />
- *       <anyAttribute processContents='lax' namespace='##other'/>
- *     </extension>
- *   </complexContent>
- * </complexType>
+ * <complexType name="ComposeVAppParams" />
  * 
+ * + * @author grkvlt@apache.org */ -@XmlType(name = "ComposeVAppParams", propOrder = { - "sourcedItems", - "allEULAsAccepted" -}) -@XmlSeeAlso({ -// RecomposeVAppParamsType.class -}) -public class ComposeVAppParams - extends VAppCreationParamsType +@XmlType(name = "ComposeVAppParams") +public class ComposeVAppParams extends VAppCreationParamsType { -{ - @SuppressWarnings("unchecked") public static Builder builder() { return new Builder(); } @@ -80,15 +55,23 @@ public class ComposeVAppParams public static class Builder extends VAppCreationParamsType.Builder { - private Set sourcedItems = Sets.newLinkedHashSet(); + private List sourcedItemList = Lists.newArrayList(); private Boolean allEULAsAccepted; private Boolean linkedClone; /** * @see ComposeVAppParams#getSourcedItems() */ - public Builder sourcedItems(Set sourcedItems) { - this.sourcedItems = checkNotNull(sourcedItems, "sourcedItems"); + public Builder sourcedItemList(List sourcedItemList) { + this.sourcedItemList = Lists.newArrayList(checkNotNull(sourcedItemList, "sourcedItemList")); + return this; + } + + /** + * @see ComposeVAppParams#getSourcedItem() + */ + public Builder sourcedItem(SourcedCompositionItemParam sourcedItem) { + this.sourcedItemList.add(checkNotNull(sourcedItem, "sourcedItem")); return this; } @@ -101,19 +84,107 @@ public class ComposeVAppParams } /** - * @see ComposeVAppParams#isLinkedClone() () + * @see ComposeVAppParams#isLinkedClone() */ public Builder linkedClone(Boolean linkedClone) { this.linkedClone = linkedClone; return this; } - + @Override public ComposeVAppParams build() { - return new ComposeVAppParams(description, name, vAppParent, instantiationParams, deploy, powerOn, - sourcedItems, allEULAsAccepted, linkedClone); + return new ComposeVAppParams(description, name, vAppParent, instantiationParams, deploy, powerOn, sourcedItemList, allEULAsAccepted, linkedClone); } + /** + * @see VAppCreationParamsType#getVAppParent() + */ + @Override + public Builder vAppParent(Reference vAppParent) { + this.vAppParent = vAppParent; + return this; + } + + /** + * @see VAppCreationParamsType#getInstantiationParams() + */ + @Override + public Builder instantiationParams(InstantiationParams instantiationParams) { + this.instantiationParams = instantiationParams; + return this; + } + + /** + * @see VAppCreationParamsType#isDeploy() + */ + @Override + public Builder deploy(Boolean deploy) { + this.deploy = deploy; + return this; + } + + /** + * @see VAppCreationParamsType#isDeploy() + */ + @Override + public Builder deploy() { + this.deploy = Boolean.TRUE; + return this; + } + + /** + * @see VAppCreationParamsType#isDeploy() + */ + @Override + public Builder notDeploy() { + this.deploy = Boolean.FALSE; + return this; + } + + /** + * @see VAppCreationParamsType#isPowerOn() + */ + @Override + public Builder powerOn(Boolean powerOn) { + this.powerOn = powerOn; + return this; + } + + /** + * @see VAppCreationParamsType#isPowerOn() + */ + @Override + public Builder powerOn() { + this.powerOn = Boolean.TRUE; + return this; + } + + /** + * @see VAppCreationParamsType#isPowerOn() + */ + @Override + public Builder notPowerOn() { + this.powerOn = Boolean.FALSE; + return this; + } + + /** + * @see ParamsType#getDescription() + */ + @Override + public Builder description(String description) { + this.description = description; + return this; + } + + /** + * @see ParamsType#getName() + */ + @Override + public Builder name(String name) { + this.name = name; + return this; + } @Override public Builder fromVAppCreationParamsType(VAppCreationParamsType in) { @@ -121,28 +192,24 @@ public class ComposeVAppParams } public Builder fromComposeVAppParams(ComposeVAppParams in) { - return fromVAppCreationParamsType(in) - .sourcedItems(in.getSourcedItems()) - .allEULAsAccepted(in.isAllEULAsAccepted()) - .linkedClone(in.isLinkedClone()); + return fromVAppCreationParamsType(in).sourcedItemList(in.getSourcedItemList()).allEULAsAccepted(in.isAllEULAsAccepted()).linkedClone(in.isLinkedClone()); } } - public ComposeVAppParams(String description, String name, Reference vAppParent, InstantiationParams instantiationParams, - Boolean deploy, Boolean powerOn, Set sourcedItems, Boolean allEULAsAccepted, Boolean linkedClone) { + public ComposeVAppParams(String description, String name, Reference vAppParent, InstantiationParams instantiationParams, Boolean deploy, Boolean powerOn, + List sourcedItems, Boolean allEULAsAccepted, Boolean linkedClone) { super(description, name, vAppParent, instantiationParams, deploy, powerOn); - this.sourcedItems = ImmutableSet.copyOf(sourcedItems); + this.sourcedItemList = ImmutableList.copyOf(sourcedItemList); this.allEULAsAccepted = allEULAsAccepted; this.linkedClone = linkedClone; } - private ComposeVAppParams() { + protected ComposeVAppParams() { // for JAXB } - @XmlElement(name = "SourcedItem") - protected Set sourcedItems = Sets.newLinkedHashSet(); + protected List sourcedItemList = Lists.newArrayList(); @XmlElement(name = "AllEULAsAccepted") protected Boolean allEULAsAccepted; @XmlAttribute @@ -151,19 +218,15 @@ public class ComposeVAppParams /** * Gets the value of the sourcedItem property. */ - public Set getSourcedItems() { - return Collections.unmodifiableSet(this.sourcedItems); + public List getSourcedItemList() { + return ImmutableList.copyOf(this.sourcedItemList); } /** - * Used to confirm acceptance of all EULAs in a - * vApp template. Instantiation fails if this - * element is missing, empty, or set to false - * and one or more EulaSection elements are - * present. + * Used to confirm acceptance of all EULAs in a vApp template. * - * @return possible object is - * {@link Boolean } + * Instantiation fails if this element is missing, empty, or set to + * false and one or more EulaSection elements are present. */ public Boolean isAllEULAsAccepted() { return allEULAsAccepted; @@ -171,9 +234,6 @@ public class ComposeVAppParams /** * Gets the value of the linkedClone property. - * - * @return possible object is - * {@link Boolean } */ public Boolean isLinkedClone() { return linkedClone; @@ -186,24 +246,18 @@ public class ComposeVAppParams if (o == null || getClass() != o.getClass()) return false; ComposeVAppParams that = ComposeVAppParams.class.cast(o); - return equal(sourcedItems, that.sourcedItems) && - equal(allEULAsAccepted, that.allEULAsAccepted) && - equal(linkedClone, that.linkedClone); + return super.equals(that) && + equal(this.sourcedItemList, that.sourcedItemList) && equal(this.allEULAsAccepted, that.allEULAsAccepted) && equal(this.linkedClone, that.linkedClone); } @Override public int hashCode() { - return Objects.hashCode(sourcedItems, - allEULAsAccepted, - linkedClone); + return Objects.hashCode(super.hashCode(), sourcedItemList, allEULAsAccepted, linkedClone); } @Override - public String toString() { - return Objects.toStringHelper("") - .add("sourcedItem", sourcedItems) - .add("allEULAsAccepted", allEULAsAccepted) - .add("linkedClone", linkedClone).toString(); + public ToStringHelper string() { + return super.string().add("sourcedItemList", sourcedItemList).add("allEULAsAccepted", allEULAsAccepted).add("linkedClone", linkedClone); } } diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ControlAccessParams.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ControlAccessParams.java new file mode 100644 index 0000000000..f954d76fbc --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ControlAccessParams.java @@ -0,0 +1,166 @@ +/* + * 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.*; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + +import com.google.common.base.Objects; + +/** + * Used to control access to resources. + * + *
+ * <complexType name="ControlAccessParams" />
+ * 
+ */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "ControlAccessParams") +public class ControlAccessParams { + + public static Builder builder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder().fromControlAccessParams(this); + } + + public static class Builder { + + private Boolean sharedToEveryone = Boolean.FALSE; + private String everyoneAccessLevel; + private AccessSettings accessSettings; + + /** + * @see ControlAccessParams#getIsSharedToEveryone() + */ + public Builder isSharedToEveryone(Boolean sharedToEveryone) { + this.sharedToEveryone = sharedToEveryone; + return this; + } + + /** + * @see ControlAccessParams#getIsSharedToEveryone() + */ + public Builder sharedToEveryone() { + this.sharedToEveryone = Boolean.TRUE; + return this; + } + + /** + * @see ControlAccessParams#getIsSharedToEveryone() + */ + public Builder notSharedToEveryone() { + this.sharedToEveryone = Boolean.FALSE; + return this; + } + + /** + * @see ControlAccessParams#getEveryoneAccessLevel() + */ + public Builder everyoneAccessLevel(String everyoneAccessLevel) { + this.everyoneAccessLevel = everyoneAccessLevel; + return this; + } + + /** + * @see ControlAccessParams#getAccessSettings() + */ + public Builder accessSettings(AccessSettings accessSettings) { + this.accessSettings = accessSettings; + return this; + } + + public ControlAccessParams build() { + ControlAccessParams controlAccessParams = new ControlAccessParams(sharedToEveryone, everyoneAccessLevel, accessSettings); + return controlAccessParams; + } + + public Builder fromControlAccessParams(ControlAccessParams in) { + return isSharedToEveryone(in.isSharedToEveryone()).everyoneAccessLevel(in.getEveryoneAccessLevel()).accessSettings(in.getAccessSettings()); + } + } + + protected ControlAccessParams() { + // For JAXB and builder use + } + + public ControlAccessParams(Boolean sharedToEveryone, String everyoneAccessLevel, AccessSettings accessSettings) { + this.sharedToEveryone = sharedToEveryone; + this.everyoneAccessLevel = everyoneAccessLevel; + this.accessSettings = accessSettings; + } + + @XmlElement(name = "IsSharedToEveryone", required = true) + protected Boolean sharedToEveryone; + @XmlElement(name = "EveryoneAccessLevel") + protected String everyoneAccessLevel; + @XmlElement(name = "AccessSettings") + protected AccessSettings accessSettings; + + /** + * If true, this means that the resource is shared with everyone in the organization. + * + * Defaults to false. Sharing settings must be manipulated through the organization. + */ + public Boolean isSharedToEveryone() { + return sharedToEveryone; + } + + /** + * If {@link #isSharedToEveryone()} is true, this element must be present and determines the access level. + */ + public String getEveryoneAccessLevel() { + return everyoneAccessLevel; + } + + /** + * The access settings to be applied if {@link #isSharedToEveryone()} is false. + * + * Required on create and modify if {@link #isSharedToEveryone()} is false. + */ + public AccessSettings getAccessSettings() { + return accessSettings; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + ControlAccessParams that = ControlAccessParams.class.cast(o); + return equal(this.sharedToEveryone, that.sharedToEveryone) && equal(this.everyoneAccessLevel, that.everyoneAccessLevel) && equal(this.accessSettings, that.accessSettings); + } + + @Override + public int hashCode() { + return Objects.hashCode(sharedToEveryone, everyoneAccessLevel, accessSettings); + } + + @Override + public String toString() { + return Objects.toStringHelper("").add("sharedToEveryone", sharedToEveryone).add("everyoneAccessLevel", everyoneAccessLevel).add("accessSettings", accessSettings).toString(); + } +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/CustomizationSection.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/CustomizationSection.java index 72580d253f..a08a999a08 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/CustomizationSection.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/CustomizationSection.java @@ -123,7 +123,7 @@ public class CustomizationSection extends SectionType { } public Builder fromCustomizationSection(CustomizationSection in) { - return fromSection(in) + return fromSectionType(in) .customizeOnInstantiate(in.isCustomizeOnInstantiate()) .links(in.getLinks()) .href(in.getHref()) @@ -134,8 +134,8 @@ public class CustomizationSection extends SectionType { * {@inheritDoc} */ @Override - public Builder fromSection(SectionType in) { - return Builder.class.cast(super.fromSection(in)); + public Builder fromSectionType(SectionType in) { + return Builder.class.cast(super.fromSectionType(in)); } /** diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/DeployVAppParams.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/DeployVAppParams.java new file mode 100644 index 0000000000..fb91fd1800 --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/DeployVAppParams.java @@ -0,0 +1,197 @@ +/** + * 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.*; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlType; + +/** + * Represents vApp/VM deployment parameters. + * + *
+ * <complexType name="DeployVAppParams" />
+ * 
+ */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "DeployVAppParams") +public class DeployVAppParams { + + @SuppressWarnings("unchecked") + public static Builder builder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder().fromDeployVAppParams(this); + } + + public static class Builder { + + private Boolean powerOn = Boolean.TRUE; + private Integer deploymentLeaseSeconds; + private Boolean forceCustomization = Boolean.FALSE; + + /** + * @see DeployVAppParams#isPowerOn() + */ + public Builder powerOn(Boolean powerOn) { + this.powerOn = powerOn; + return this; + } + + /** + * @see DeployVAppParams#isPowerOn() + */ + public Builder powerOn() { + this.powerOn = Boolean.TRUE; + return this; + } + + /** + * @see DeployVAppParams#isPowerOn() + */ + public Builder notPowerOn() { + this.powerOn = Boolean.FALSE; + return this; + } + + /** + * @see DeployVAppParams#getDeploymentLeaseSeconds() + */ + public Builder deploymentLeaseSeconds(Integer deploymentLeaseSeconds) { + this.deploymentLeaseSeconds = deploymentLeaseSeconds; + return this; + } + + /** + * @see DeployVAppParams#isForceCustomization() + */ + public Builder forceCustomization(Boolean forceCustomization) { + this.forceCustomization = forceCustomization; + return this; + } + + /** + * @see DeployVAppParams#isForceCustomization() + */ + public Builder forceCustomization() { + this.forceCustomization = Boolean.TRUE; + return this; + } + + /** + * @see DeployVAppParams#isForceCustomization() + */ + public Builder notForceCustomization() { + this.forceCustomization = Boolean.FALSE; + return this; + } + + public DeployVAppParams build() { + DeployVAppParams deployVAppParams = new DeployVAppParams(powerOn, deploymentLeaseSeconds, forceCustomization); + return deployVAppParams; + } + + + public Builder fromDeployVAppParams(DeployVAppParams in) { + return powerOn(in.isPowerOn()) + .deploymentLeaseSeconds(in.getDeploymentLeaseSeconds()) + .forceCustomization(in.isForceCustomization()); + } + } + + protected DeployVAppParams() { + // For JAXB and builder use + } + + public DeployVAppParams(Boolean powerOn, Integer deploymentLeaseSeconds, Boolean forceCustomization) { + this.powerOn = powerOn; + this.deploymentLeaseSeconds = deploymentLeaseSeconds; + this.forceCustomization = forceCustomization; + } + + @XmlAttribute + protected Boolean powerOn; + @XmlAttribute + protected Integer deploymentLeaseSeconds; + @XmlAttribute + protected Boolean forceCustomization; + + /** + * Used to specify whether to power on vapp on deployment, if not set default value is true. + */ + public Boolean isPowerOn() { + return powerOn; + } + + public void setPowerOn(Boolean value) { + this.powerOn = value; + } + + /** + * Lease in seconds for deployment. + */ + public Integer getDeploymentLeaseSeconds() { + return deploymentLeaseSeconds; + } + + public void setDeploymentLeaseSeconds(Integer value) { + this.deploymentLeaseSeconds = value; + } + + /** + * Used to specify whether to force customization on deployment, if not set default value is false. + */ + public Boolean isForceCustomization() { + return forceCustomization; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + DeployVAppParams that = DeployVAppParams.class.cast(o); + return equal(powerOn, that.powerOn) && + equal(deploymentLeaseSeconds, that.deploymentLeaseSeconds) && + equal(forceCustomization, that.forceCustomization); + } + + @Override + public int hashCode() { + return Objects.hashCode(powerOn, + deploymentLeaseSeconds, + forceCustomization); + } + + @Override + public String toString() { + return Objects.toStringHelper("") + .add("powerOn", powerOn) + .add("deploymentLeaseSeconds", deploymentLeaseSeconds) + .add("forceCustomization", forceCustomization).toString(); + } + +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/EntityType.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/EntityType.java index 5c23f0beda..a59ca9e6ee 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/EntityType.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/EntityType.java @@ -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 @@ -30,6 +30,7 @@ import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElementWrapper; import org.jclouds.javax.annotation.Nullable; +import org.jclouds.vcloud.director.v1_5.domain.AbstractVAppType.Builder; import com.google.common.base.Objects; import com.google.common.base.Objects.ToStringHelper; @@ -38,11 +39,11 @@ import com.google.common.collect.Sets; /** * Basic entity type in the vCloud object model. - *

+ * * Includes a name, an optional description, and an optional list of links - *

+ * *

- * <xs:complexType name="EntityType">
+ * <xs:complexType name="EntityType" />
  * 
* * @author grkvlt@apache.org @@ -167,25 +168,27 @@ public abstract class EntityType> extends ResourceType links(Set links) { - return Builder.class.cast(super.links(links)); + if (checkNotNull(links, "links").size() > 0) + this.links = Sets.newLinkedHashSet(links); + return this; } /** * @see ResourceType#getLinks() */ - @SuppressWarnings("unchecked") @Override public Builder link(Link link) { - return Builder.class.cast(super.link(link)); + if (links == null) + links = Sets.newLinkedHashSet(); + this.links.add(checkNotNull(link, "link")); + return this; } /** * {@inheritDoc} */ - @SuppressWarnings("unchecked") @Override public Builder fromResourceType(ResourceType in) { return Builder.class.cast(super.fromResourceType(in)); @@ -228,6 +231,10 @@ public abstract class EntityType> extends ResourceType> extends ResourceType> extends ResourceType + * *
- * <xs:complexType name="ErrorType">
+ * <xs:complexType name="ErrorType" />
  * 
* * @author grkvlt@apache.org @@ -40,6 +46,47 @@ import com.google.common.base.Objects; @XmlRootElement(name = "Error") public class Error { + public static enum Code { + + OK(200), + CREATED(201), + ACCEPTED(202), + NO_CONTENT(204), + SEE_OTHER(303), + BAD_REQUEST(400), + UNAUTHORIZED(401), + FORBIDDEN(403), // NOTE also means 'not found' for entities + NOT_FOUND(404), + NOT_ALLOWED(405), + INTERNAL_ERROR(500), + NOT_IMPLEMENTED(501), + UNAVAILABLE(503); + + private Integer majorErrorCode; + + private Code(Integer majorErrorCode) { + this.majorErrorCode = majorErrorCode; + } + + public Integer getCode() { + return majorErrorCode; + } + + public static Code fromCode(final int majorErrorCode) { + Optional found = Iterables.tryFind(Arrays.asList(values()), new Predicate() { + @Override + public boolean apply(Code code) { + return code.getCode().equals(majorErrorCode); + } + }); + if (found.isPresent()) { + return found.get(); + } else { + throw new VCloudDirectorRuntimeException(String.format("Illegal major error code '%d'", majorErrorCode)); + } + } + } + public static final String MEDIA_TYPE = VCloudDirectorMediaType.ERROR; public static Builder builder() { diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/GuestCustomizationSection.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/GuestCustomizationSection.java index 879110f744..793b3e888e 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/GuestCustomizationSection.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/GuestCustomizationSection.java @@ -271,7 +271,7 @@ public class GuestCustomizationSection extends SectionType in) { - return Builder.class.cast(super.fromSection(in)); + public Builder fromSectionType(SectionType in) { + return Builder.class.cast(super.fromSectionType(in)); } /** diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/InstantiateOvfParams.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/InstantiateOvfParams.java new file mode 100644 index 0000000000..9e0a1203ae --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/InstantiateOvfParams.java @@ -0,0 +1,246 @@ +/* + * 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.*; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +import com.google.common.base.Objects; +import com.google.common.base.Objects.ToStringHelper; + +/** + * Represents vApp instantiation from OVF parameters + * + *
+ * <complexType name="InstantiateOvfParams" />
+ * 
+ * + * @author grkvlt@apache.org + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "InstantiateOvfParams") +public class InstantiateOvfParams extends VAppCreationParamsType { + + public static Builder builder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder().fromInstantiateOvfParams(this); + } + + public static class Builder extends VAppCreationParamsType.Builder { + + private Boolean allEULAsAccepted; + private String transferFormat; + + /** + * @see InstantiateOvfParams#isAllEULAsAccepted() + */ + public Builder isAllEULAsAccepted(Boolean allEULAsAccepted) { + this.allEULAsAccepted = allEULAsAccepted; + return this; + } + + /** + * @see InstantiateOvfParams#isAllEULAsAccepted() + */ + public Builder allEULAsAccepted() { + this.allEULAsAccepted = Boolean.TRUE; + return this; + } + + /** + * @see InstantiateOvfParams#isAllEULAsAccepted() + */ + public Builder allEULAsNotAccepted() { + this.allEULAsAccepted = Boolean.FALSE; + return this; + } + + /** + * @see InstantiateOvfParams#getTransferFormat() + */ + public Builder transferFormat(String transferFormat) { + this.transferFormat = transferFormat; + return this; + } + + @Override + public InstantiateOvfParams build() { + InstantiateOvfParams instantiateOvfParams = new InstantiateOvfParams(description, name, vAppParent, instantiationParams, deploy, powerOn, allEULAsAccepted, transferFormat); + return instantiateOvfParams; + } + + /** + * @see VAppCreationParamsType#getVAppParent() + */ + @Override + public Builder vAppParent(Reference vAppParent) { + this.vAppParent = vAppParent; + return this; + } + + /** + * @see VAppCreationParamsType#getInstantiationParams() + */ + @Override + public Builder instantiationParams(InstantiationParams instantiationParams) { + this.instantiationParams = instantiationParams; + return this; + } + + /** + * @see VAppCreationParamsType#isDeploy() + */ + @Override + public Builder deploy(Boolean deploy) { + this.deploy = deploy; + return this; + } + + /** + * @see VAppCreationParamsType#isDeploy() + */ + @Override + public Builder deploy() { + this.deploy = Boolean.TRUE; + return this; + } + + /** + * @see VAppCreationParamsType#isDeploy() + */ + @Override + public Builder notDeploy() { + this.deploy = Boolean.FALSE; + return this; + } + + /** + * @see VAppCreationParamsType#isPowerOn() + */ + @Override + public Builder powerOn(Boolean powerOn) { + this.powerOn = powerOn; + return this; + } + + /** + * @see VAppCreationParamsType#isPowerOn() + */ + @Override + public Builder powerOn() { + this.powerOn = Boolean.TRUE; + return this; + } + + /** + * @see VAppCreationParamsType#isPowerOn() + */ + @Override + public Builder notPowerOn() { + this.powerOn = Boolean.FALSE; + return this; + } + + /** + * @see ParamsType#getDescription() + */ + @Override + public Builder description(String description) { + this.description = description; + return this; + } + + /** + * @see ParamsType#getName() + */ + @Override + public Builder name(String name) { + this.name = name; + return this; + } + + @Override + public Builder fromVAppCreationParamsType(VAppCreationParamsType in) { + return Builder.class.cast(super.fromVAppCreationParamsType(in)); + } + + public Builder fromInstantiateOvfParams(InstantiateOvfParams in) { + return fromVAppCreationParamsType(in).isAllEULAsAccepted(in.isAllEULAsAccepted()).transferFormat(in.getTransferFormat()); + } + } + + protected InstantiateOvfParams() { + // For JAXB and builder use + } + + public InstantiateOvfParams(String description, String name, Reference vAppParent, InstantiationParams instantiationParams, Boolean deploy, Boolean powerOn, Boolean allEULAsAccepted, + String transferFormat) { + super(description, name, vAppParent, instantiationParams, deploy, powerOn); + this.allEULAsAccepted = allEULAsAccepted; + this.transferFormat = transferFormat; + } + + @XmlElement(name = "AllEULAsAccepted") + protected Boolean allEULAsAccepted; + @XmlAttribute + protected String transferFormat; + + /** + * Gets the value of the allEULAsAccepted property. + */ + public Boolean isAllEULAsAccepted() { + return allEULAsAccepted; + } + + /** + * Gets the value of the transferFormat property. + */ + public String getTransferFormat() { + return transferFormat; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + InstantiateOvfParams that = InstantiateOvfParams.class.cast(o); + return super.equals(that) && equal(this.allEULAsAccepted, that.allEULAsAccepted) && equal(this.transferFormat, that.transferFormat); + } + + @Override + public int hashCode() { + return Objects.hashCode(super.hashCode(), allEULAsAccepted, transferFormat); + } + + @Override + public ToStringHelper string() { + return super.string().add("allEULAsAccepted", allEULAsAccepted).add("transferFormat", transferFormat); + } +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/InstantiateVAppParams.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/InstantiateVAppParams.java index 78a8550c18..269d4d473e 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/InstantiateVAppParams.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/InstantiateVAppParams.java @@ -20,13 +20,13 @@ package org.jclouds.vcloud.director.v1_5.domain; + /** * Parameters for Instantiating a vApp * * @author danikov */ -public class InstantiateVAppParams - extends InstantiateVAppParamsType { +public class InstantiateVAppParams extends InstantiateVAppParamsType { @SuppressWarnings("unchecked") public static Builder builder() { @@ -38,40 +38,81 @@ public class InstantiateVAppParams return new Builder(); } - public static class Builder - extends InstantiateVAppParamsType.Builder { + public static class Builder extends InstantiateVAppParamsType.Builder { + @Override public InstantiateVAppParams build() { - return new InstantiateVAppParams(description, name, vAppParent, instantiationParams, deploy, powerOn, source, isSourceDelete, linkedClone); + return new InstantiateVAppParams(description, name, vAppParent, instantiationParams, deploy, powerOn, source, sourceDelete, linkedClone); } /** - * @see InstantiateVAppParams#getSource() + * @see InstantiateVAppParamsType#getSource() */ - public Builder source(Reference source) { - super.source(source); + @Override + public Builder source(ReferenceType source) { + this.source = source; return this; } /** - * @see InstantiateVAppParams#isSourceDelete() + * @see InstantiateVAppParamsType#isSourceDelete() */ - public Builder isSourceDelete(Boolean isSourceDelete) { - super.isSourceDelete(isSourceDelete); + @Override + public Builder isSourceDelete(Boolean sourceDelete) { + this.sourceDelete = sourceDelete; return this; } /** - * @see InstantiateVAppParams#isLinkedClone() + * @see InstantiateVAppParamsType#isSourceDelete() */ - public Builder linkedClone(Boolean linkedClone) { - super.linkedClone(linkedClone); + @Override + public Builder sourceDelete() { + this.sourceDelete = Boolean.TRUE; return this; } + /** + * @see InstantiateVAppParamsType#isSourceDelete() + */ + @Override + public Builder notSourceDelete() { + this.sourceDelete = Boolean.FALSE; + return this; + } + + /** + * @see InstantiateVAppParamsType#isLinkedClone() + */ + @Override + public Builder isLinkedClone(Boolean linkedClone) { + this.linkedClone = linkedClone; + return this; + } + + /** + * @see InstantiateVAppParamsType#isLinkedClone() + */ + @Override + public Builder linkedClone() { + this.linkedClone = Boolean.TRUE; + return this; + } + + /** + * @see InstantiateVAppParamsType#isLinkedClone() + */ + @Override + public Builder notLinkedClone() { + this.linkedClone = Boolean.FALSE; + return this; + } + + /** * @see ParamsType#getDescription() */ + @Override public Builder description(String description) { super.description(description); return this; @@ -80,40 +121,81 @@ public class InstantiateVAppParams /** * @see ParamsType#getName() */ + @Override public Builder name(String name) { super.name(name); return this; } /** - * @see VAppCreationParamsType#getVAppParent() + * @see VAppCreationParams#getVAppParent() */ + @Override public Builder vAppParent(Reference vAppParent) { - super.vAppParent(vAppParent); + this.vAppParent = vAppParent; return this; } /** - * @see VAppCreationParamsType#getInstantiationParams() + * @see VAppCreationParams#getInstantiationParams() */ + @Override public Builder instantiationParams(InstantiationParams instantiationParams) { - super.instantiationParams(instantiationParams); + this.instantiationParams = instantiationParams; return this; } /** - * @see VAppCreationParamsType#isDeploy() + * @see VAppCreationParams#isDeploy() */ + @Override public Builder deploy(Boolean deploy) { - super.deploy(deploy); + this.deploy = deploy; return this; } /** - * @see VAppCreationParamsType#isPowerOn() + * @see VAppCreationParams#isDeploy() */ + @Override + public Builder deploy() { + this.deploy = Boolean.TRUE; + return this; + } + + /** + * @see VAppCreationParams#isDeploy() + */ + @Override + public Builder notDeploy() { + this.deploy = Boolean.FALSE; + return this; + } + + /** + * @see VAppCreationParams#isPowerOn() + */ + @Override public Builder powerOn(Boolean powerOn) { - super.powerOn(powerOn); + this.powerOn = powerOn; + return this; + } + + /** + * @see VAppCreationParams#isPowerOn() + */ + @Override + public Builder powerOn() { + this.powerOn = Boolean.TRUE; + return this; + } + + /** + * @see VAppCreationParams#isPowerOn() + */ + @Override + public Builder notPowerOn() { + this.powerOn = Boolean.FALSE; return this; } @@ -121,8 +203,7 @@ public class InstantiateVAppParams * {@inheritDoc} */ @Override - public Builder fromInstantiateVAppParamsType( - InstantiateVAppParamsType in) { + public Builder fromInstantiateVAppParamsType(InstantiateVAppParamsType in) { return Builder.class.cast(super.fromVAppCreationParamsType(in)); } @@ -131,8 +212,8 @@ public class InstantiateVAppParams } } - private InstantiateVAppParams(String description, String name, Reference vAppParent, InstantiationParams instantiationParams, - Boolean deploy, Boolean powerOn, Reference source, Boolean sourceDelete, Boolean linkedClone) { + public InstantiateVAppParams(String description, String name, Reference vAppParent, InstantiationParams instantiationParams, + Boolean deploy, Boolean powerOn, ReferenceType source, Boolean sourceDelete, Boolean linkedClone) { super(description, name, vAppParent, instantiationParams, deploy, powerOn, source, sourceDelete, linkedClone); } @@ -149,5 +230,4 @@ public class InstantiateVAppParams InstantiateVAppParams that = InstantiateVAppParams.class.cast(o); return super.equals(that); } - } diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/InstantiateVAppParamsType.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/InstantiateVAppParamsType.java index 566ffd1239..dfe38c361a 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/InstantiateVAppParamsType.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/InstantiateVAppParamsType.java @@ -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 @@ -16,54 +16,29 @@ * 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.Objects.*; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlSeeAlso; import javax.xml.bind.annotation.XmlType; + import com.google.common.base.Objects; - /** * Represents vApp instantiation parameters. - *

- *

- *

Java class for InstantiateVAppParams complex type. - *

- *

The following schema fragment specifies the expected content contained within this class. - *

+ * *

- * <complexType name="InstantiateVAppParams">
- *   <complexContent>
- *     <extension base="{http://www.vmware.com/vcloud/v1.5}VAppCreationParamsType">
- *       <sequence>
- *         <element name="Source" type="{http://www.vmware.com/vcloud/v1.5}ReferenceType"/>
- *         <element name="IsSourceDelete" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
- *       </sequence>
- *       <attribute name="linkedClone" type="{http://www.w3.org/2001/XMLSchema}boolean" />
- *       <anyAttribute processContents='lax' namespace='##other'/>
- *     </extension>
- *   </complexContent>
- * </complexType>
+ * <complexType name="InstantiateVAppParams" />
  * 
+ * + * @author grkvlt@apache.org */ -@XmlType(name = "InstantiateVAppParams", propOrder = { - "source", - "isSourceDelete" -}) -@XmlSeeAlso({ -// InstantiateVAppTemplateParamsType.class, -// CloneVAppParamsType.class -}) -public class InstantiateVAppParamsType> - extends VAppCreationParamsType +@XmlType(name = "InstantiateVAppParams") +public class InstantiateVAppParamsType> extends VAppCreationParamsType { -{ public static > Builder builder() { return new Builder(); } @@ -74,14 +49,14 @@ public class InstantiateVAppParamsType> public static class Builder> extends VAppCreationParamsType.Builder { - protected Reference source; - protected Boolean isSourceDelete; + protected ReferenceType source; + protected Boolean sourceDelete; protected Boolean linkedClone; /** * @see InstantiateVAppParamsType#getSource() */ - public Builder source(Reference source) { + public Builder source(ReferenceType source) { this.source = source; return this; } @@ -89,26 +64,60 @@ public class InstantiateVAppParamsType> /** * @see InstantiateVAppParamsType#isSourceDelete() */ - public Builder isSourceDelete(Boolean isSourceDelete) { - this.isSourceDelete = isSourceDelete; + public Builder isSourceDelete(Boolean sourceDelete) { + this.sourceDelete = sourceDelete; + return this; + } + + /** + * @see InstantiateVAppParamsType#isSourceDelete() + */ + public Builder sourceDelete() { + this.sourceDelete = Boolean.TRUE; + return this; + } + + /** + * @see InstantiateVAppParamsType#isSourceDelete() + */ + public Builder notSourceDelete() { + this.sourceDelete = Boolean.FALSE; return this; } /** * @see InstantiateVAppParamsType#isLinkedClone() */ - public Builder linkedClone(Boolean linkedClone) { + public Builder isLinkedClone(Boolean linkedClone) { this.linkedClone = linkedClone; return this; } + /** + * @see InstantiateVAppParamsType#isLinkedClone() + */ + public Builder linkedClone() { + this.linkedClone = Boolean.TRUE; + return this; + } + + /** + * @see InstantiateVAppParamsType#isLinkedClone() + */ + public Builder notLinkedClone() { + this.linkedClone = Boolean.FALSE; + return this; + } + + @Override public InstantiateVAppParamsType build() { - return new InstantiateVAppParamsType(description, name, vAppParent, instantiationParams, deploy, powerOn, source, isSourceDelete, linkedClone); + return new InstantiateVAppParamsType(description, name, vAppParent, instantiationParams, deploy, powerOn, source, sourceDelete, linkedClone); } /** * @see ParamsType#getDescription() */ + @Override public Builder description(String description) { super.description(description); return this; @@ -117,6 +126,7 @@ public class InstantiateVAppParamsType> /** * @see ParamsType#getName() */ + @Override public Builder name(String name) { super.name(name); return this; @@ -125,39 +135,75 @@ public class InstantiateVAppParamsType> /** * @see VAppCreationParamsType#getVAppParent() */ + @Override public Builder vAppParent(Reference vAppParent) { - super.vAppParent(vAppParent); + this.vAppParent = vAppParent; return this; } /** * @see VAppCreationParamsType#getInstantiationParams() */ + @Override public Builder instantiationParams(InstantiationParams instantiationParams) { - super.instantiationParams(instantiationParams); + this.instantiationParams = instantiationParams; return this; } /** * @see VAppCreationParamsType#isDeploy() */ + @Override public Builder deploy(Boolean deploy) { - super.deploy(deploy); + this.deploy = deploy; + return this; + } + + /** + * @see VAppCreationParamsType#isDeploy() + */ + @Override + public Builder deploy() { + this.deploy = Boolean.TRUE; + return this; + } + + /** + * @see VAppCreationParamsType#isDeploy() + */ + @Override + public Builder notDeploy() { + this.deploy = Boolean.FALSE; return this; } /** * @see VAppCreationParamsType#isPowerOn() */ + @Override public Builder powerOn(Boolean powerOn) { - super.powerOn(powerOn); + this.powerOn = powerOn; return this; } /** - * {@inheritDoc} + * @see VAppCreationParamsType#isPowerOn() */ - @SuppressWarnings("unchecked") + @Override + public Builder powerOn() { + this.powerOn = Boolean.TRUE; + return this; + } + + /** + * @see VAppCreationParamsType#isPowerOn() + */ + @Override + public Builder notPowerOn() { + this.powerOn = Boolean.FALSE; + return this; + } + @Override public Builder fromVAppCreationParamsType(VAppCreationParamsType in) { return Builder.class.cast(super.fromVAppCreationParamsType(in)); @@ -167,55 +213,45 @@ public class InstantiateVAppParamsType> return fromVAppCreationParamsType(in) .source(in.getSource()) .isSourceDelete(in.isSourceDelete()) - .linkedClone(in.isLinkedClone()); + .isLinkedClone(in.isLinkedClone()); } } + + protected InstantiateVAppParamsType() { + // For JAXB and builder use + } - protected InstantiateVAppParamsType(String description, String name, Reference vAppParent, InstantiationParams instantiationParams, - Boolean deploy, Boolean powerOn, Reference source, Boolean sourceDelete, Boolean linkedClone) { + public InstantiateVAppParamsType(String description, String name, Reference vAppParent, InstantiationParams instantiationParams, + Boolean deploy, Boolean powerOn, ReferenceType source, Boolean sourceDelete, Boolean linkedClone) { super(description, name, vAppParent, instantiationParams, deploy, powerOn); this.source = source; - isSourceDelete = sourceDelete; + this.sourceDelete = sourceDelete; this.linkedClone = linkedClone; } - protected InstantiateVAppParamsType() { - // for JAXB - } - - @XmlElement(name = "Source", required = true) - private Reference source; + protected ReferenceType source; @XmlElement(name = "IsSourceDelete") - private Boolean isSourceDelete; + protected Boolean sourceDelete; @XmlAttribute - private Boolean linkedClone; + protected Boolean linkedClone; /** * Gets the value of the source property. - * - * @return possible object is - * {@link Reference } */ - public Reference getSource() { + public ReferenceType getSource() { return source; } /** * Gets the value of the isSourceDelete property. - * - * @return possible object is - * {@link Boolean } */ public Boolean isSourceDelete() { - return isSourceDelete; + return sourceDelete; } /** * Gets the value of the linkedClone property. - * - * @return possible object is - * {@link Boolean } */ public Boolean isLinkedClone() { return linkedClone; @@ -228,24 +264,22 @@ public class InstantiateVAppParamsType> if (o == null || getClass() != o.getClass()) return false; InstantiateVAppParamsType that = InstantiateVAppParamsType.class.cast(o); - return equal(source, that.source) && - equal(isSourceDelete, that.isSourceDelete) && - equal(linkedClone, that.linkedClone); + return super.equals(that) && + equal(this.source, that.source) && + equal(this.sourceDelete, that.sourceDelete) && + equal(this.linkedClone, that.linkedClone); } @Override public int hashCode() { - return Objects.hashCode(source, - isSourceDelete, - linkedClone); + return Objects.hashCode(super.hashCode(), source, sourceDelete, linkedClone); } @Override - public String toString() { - return Objects.toStringHelper("") + public ToStringHelper string() { + return super.string() .add("source", source) - .add("isSourceDelete", isSourceDelete) - .add("linkedClone", linkedClone).toString(); + .add("isSourceDelete", sourceDelete) + .add("linkedClone", linkedClone); } - } diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/InstantiateVAppTemplateParams.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/InstantiateVAppTemplateParams.java index f51ae78286..91c887e8aa 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/InstantiateVAppTemplateParams.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/InstantiateVAppTemplateParams.java @@ -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 @@ -16,49 +16,34 @@ * 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.Objects.*; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; -import com.google.common.base.Objects; +import org.jclouds.vcloud.director.v1_5.domain.InstantiateVAppParamsType.Builder; +import com.google.common.base.Objects; +import com.google.common.base.Objects.ToStringHelper; /** * Represents vApp template instantiation parameters. - *

- *

- *

Java class for InstantiateVAppTemplateParams complex type. - *

- *

The following schema fragment specifies the expected content contained within this class. - *

+ * *

- * <complexType name="InstantiateVAppTemplateParams">
- *   <complexContent>
- *     <extension base="{http://www.vmware.com/vcloud/v1.5}InstantiateVAppParamsType">
- *       <sequence>
- *         <element ref="{http://www.vmware.com/vcloud/v1.5}AllEULAsAccepted" minOccurs="0"/>
- *       </sequence>
- *       <anyAttribute processContents='lax' namespace='##other'/>
- *     </extension>
- *   </complexContent>
- * </complexType>
+ * <complexType name="InstantiateVAppTemplateParams" />
  * 
*/ -@XmlType(name = "InstantiateVAppTemplateParams", propOrder = { - "allEULAsAccepted" -}) -public class InstantiateVAppTemplateParams - extends InstantiateVAppParamsType { +@XmlType(name = "InstantiateVAppTemplateParams") +public class InstantiateVAppTemplateParams extends InstantiateVAppParamsType { @SuppressWarnings("unchecked") public static Builder builder() { return new Builder(); } + @Override public Builder toBuilder() { return new Builder().fromInstantiateVAppTemplateParams(this); } @@ -75,13 +60,78 @@ public class InstantiateVAppTemplateParams return this; } + @Override public InstantiateVAppTemplateParams build() { - return new InstantiateVAppTemplateParams(description, name, vAppParent, instantiationParams, deploy, powerOn, source, isSourceDelete, linkedClone, allEULAsAccepted); + return new InstantiateVAppTemplateParams(description, name, vAppParent, instantiationParams, deploy, powerOn, source, sourceDelete, linkedClone, allEULAsAccepted); + } + + /** + * @see InstantiateVAppParamsType#getSource() + */ + @Override + public Builder source(ReferenceType source) { + this.source = source; + return this; + } + + /** + * @see InstantiateVAppParamsType#isSourceDelete() + */ + @Override + public Builder isSourceDelete(Boolean sourceDelete) { + this.sourceDelete = sourceDelete; + return this; + } + + /** + * @see InstantiateVAppParamsType#isSourceDelete() + */ + @Override + public Builder sourceDelete() { + this.sourceDelete = Boolean.TRUE; + return this; + } + + /** + * @see InstantiateVAppParamsType#isSourceDelete() + */ + @Override + public Builder notSourceDelete() { + this.sourceDelete = Boolean.FALSE; + return this; + } + + /** + * @see InstantiateVAppParamsType#isLinkedClone() + */ + @Override + public Builder isLinkedClone(Boolean linkedClone) { + this.linkedClone = linkedClone; + return this; + } + + /** + * @see InstantiateVAppParamsType#isLinkedClone() + */ + @Override + public Builder linkedClone() { + this.linkedClone = Boolean.TRUE; + return this; + } + + /** + * @see InstantiateVAppParamsType#isLinkedClone() + */ + @Override + public Builder notLinkedClone() { + this.linkedClone = Boolean.FALSE; + return this; } /** * @see ParamsType#getDescription() */ + @Override public Builder description(String description) { super.description(description); return this; @@ -90,6 +140,7 @@ public class InstantiateVAppTemplateParams /** * @see ParamsType#getName() */ + @Override public Builder name(String name) { super.name(name); return this; @@ -98,32 +149,72 @@ public class InstantiateVAppTemplateParams /** * @see VAppCreationParamsType#getVAppParent() */ + @Override public Builder vAppParent(Reference vAppParent) { - super.vAppParent(vAppParent); + this.vAppParent = vAppParent; return this; } /** * @see VAppCreationParamsType#getInstantiationParams() */ + @Override public Builder instantiationParams(InstantiationParams instantiationParams) { - super.instantiationParams(instantiationParams); + this.instantiationParams = instantiationParams; return this; } /** * @see VAppCreationParamsType#isDeploy() */ + @Override public Builder deploy(Boolean deploy) { - super.deploy(deploy); + this.deploy = deploy; + return this; + } + + /** + * @see VAppCreationParamsType#isDeploy() + */ + @Override + public Builder deploy() { + this.deploy = Boolean.TRUE; + return this; + } + + /** + * @see VAppCreationParamsType#isDeploy() + */ + @Override + public Builder notDeploy() { + this.deploy = Boolean.FALSE; return this; } /** * @see VAppCreationParamsType#isPowerOn() */ + @Override public Builder powerOn(Boolean powerOn) { - super.powerOn(powerOn); + this.powerOn = powerOn; + return this; + } + + /** + * @see VAppCreationParamsType#isPowerOn() + */ + @Override + public Builder powerOn() { + this.powerOn = Boolean.TRUE; + return this; + } + + /** + * @see VAppCreationParamsType#isPowerOn() + */ + @Override + public Builder notPowerOn() { + this.powerOn = Boolean.FALSE; return this; } @@ -136,18 +227,17 @@ public class InstantiateVAppTemplateParams } public Builder fromInstantiateVAppTemplateParams(InstantiateVAppTemplateParams in) { - return fromInstantiateVAppParamsType(in) - .allEULAsAccepted(in.isAllEULAsAccepted()); + return fromInstantiateVAppParamsType(in).allEULAsAccepted(in.isAllEULAsAccepted()); } } public InstantiateVAppTemplateParams(String description, String name, Reference vAppParent, InstantiationParams instantiationParams, - Boolean deploy, Boolean powerOn, Reference source, Boolean sourceDelete, Boolean linkedClone, Boolean allEULAsAccepted) { + Boolean deploy, Boolean powerOn, ReferenceType source, Boolean sourceDelete, Boolean linkedClone, Boolean allEULAsAccepted) { super(description, name, vAppParent, instantiationParams, deploy, powerOn, source, sourceDelete, linkedClone); this.allEULAsAccepted = allEULAsAccepted; } - private InstantiateVAppTemplateParams() { + protected InstantiateVAppTemplateParams() { // for JAXB } @@ -161,9 +251,6 @@ public class InstantiateVAppTemplateParams * element is missing, empty, or set to false * and one or more EulaSection elements are * present. - * - * @return possible object is - * {@link Boolean } */ public Boolean isAllEULAsAccepted() { return allEULAsAccepted; @@ -176,18 +263,16 @@ public class InstantiateVAppTemplateParams if (o == null || getClass() != o.getClass()) return false; InstantiateVAppTemplateParams that = InstantiateVAppTemplateParams.class.cast(o); - return equal(allEULAsAccepted, that.allEULAsAccepted); + return super.equals(that) && equal(this.allEULAsAccepted, that.allEULAsAccepted); } @Override public int hashCode() { - return Objects.hashCode(allEULAsAccepted); + return Objects.hashCode(super.hashCode(), allEULAsAccepted); } @Override - public String toString() { - return Objects.toStringHelper("") - .add("allEULAsAccepted", allEULAsAccepted).toString(); + public ToStringHelper string() { + return super.string().add("allEULAsAccepted", allEULAsAccepted); } - } diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/InstantiationParams.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/InstantiationParams.java index 4df90cd487..cce8e7afd6 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/InstantiationParams.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/InstantiationParams.java @@ -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 @@ -16,11 +16,10 @@ * 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 static com.google.common.base.Objects.*; +import static com.google.common.base.Preconditions.*; import java.util.Collections; import java.util.Set; @@ -28,42 +27,23 @@ import java.util.Set; import javax.xml.bind.annotation.XmlElementRef; import javax.xml.bind.annotation.XmlType; -import org.jclouds.vcloud.director.v1_5.domain.ovf.DeploymentOptionSection; -import org.jclouds.vcloud.director.v1_5.domain.ovf.DiskSection; -import org.jclouds.vcloud.director.v1_5.domain.ovf.NetworkSection; -import org.jclouds.vcloud.director.v1_5.domain.ovf.ProductSection; import org.jclouds.vcloud.director.v1_5.domain.ovf.SectionType; -import org.jclouds.vcloud.director.v1_5.domain.ovf.VirtualHardwareSection; import com.google.common.base.Objects; import com.google.common.collect.Sets; - /** * Represents a list of ovf:Section to configure for instantiating a VApp. - *

- *

- *

Java class for InstantiationParams complex type. - *

- *

The following schema fragment specifies the expected content contained within this class. - *

+ * *

- * <complexType name="InstantiationParams">
- *   <complexContent>
- *     <extension base="{http://www.vmware.com/vcloud/v1.5}VCloudExtensibleType">
- *       <sequence>
- *         <element ref="{http://schemas.dmtf.org/ovf/envelope/1}Section" maxOccurs="unbounded" minOccurs="0"/>
- *       </sequence>
- *       <anyAttribute processContents='lax' namespace='##other'/>
- *     </extension>
- *   </complexContent>
- * </complexType>
+ * <complexType name="InstantiationParams" />
  * 
+ * + * @author grkvlt@apache.org */ -@XmlType(name = "InstantiationParams", propOrder = { - "section" -}) +@XmlType(name = "InstantiationParams") public class InstantiationParams { + public static Builder builder() { return new Builder(); } @@ -73,7 +53,7 @@ public class InstantiationParams { } public static class Builder { - private Set> sections = Sets.newLinkedHashSet(); + private Set> sections = Sets.newLinkedHashSet(); /** * @see InstantiationParams#getSections() @@ -83,13 +63,11 @@ public class InstantiationParams { return this; } - public InstantiationParams build() { InstantiationParams instantiationParams = new InstantiationParams(sections); return instantiationParams; } - public Builder fromInstantiationParams(InstantiationParams in) { return sections(in.getSections()); } @@ -103,34 +81,33 @@ public class InstantiationParams { this.sections = sections; } - @XmlElementRef protected Set> sections = Sets.newLinkedHashSet(); /** - * An ovf:Section to configure for instantiation. - *

- * Gets the value of the section property. - *

+ * An {@code ovf:Section} to configure for instantiation. + * * Objects of the following type(s) are allowed in the list - * {@link SectionType } - * {@link VirtualHardwareSection } - * {@link LeaseSettingsSection } - * {@link EulaSection } - * {@link RuntimeInfoSection } - * {@link AnnotationSection } - * {@link DeploymentOptionSection } - * {@link StartupSection } - * {@link ResourceAllocationSection } - * {@link NetworkConnectionSection } - * {@link CustomizationSection } - * {@link ProductSection } - * {@link GuestCustomizationSection } - * {@link org.jclouds.ovf.OperatingSystemSection } - * {@link NetworkConfigSection } - * {@link NetworkSection } - * {@link DiskSection } - * {@link InstallSection } + *

    + *
  • {@link SectionType} + *
  • {@link VirtualHardwareSection} + *
  • {@link LeaseSettingsSection} + *
  • {@link EulaSection} + *
  • {@link RuntimeInfoSection} + *
  • {@link AnnotationSection} + *
  • {@link DeploymentOptionSection} + *
  • {@link StartupSection} + *
  • {@link ResourceAllocationSection} + *
  • {@link NetworkConnectionSection} + *
  • {@link CustomizationSection} + *
  • {@link ProductSection} + *
  • {@link GuestCustomizationSection} + *
  • {@link OperatingSystemSection} + *
  • {@link NetworkConfigSection} + *
  • {@link NetworkSection} + *
  • {@link DiskSection} + *
  • {@link InstallSection} + *
*/ public Set> getSections() { return Collections.unmodifiableSet(this.sections); @@ -153,8 +130,6 @@ public class InstantiationParams { @Override public String toString() { - return Objects.toStringHelper("") - .add("sections", sections).toString(); + return Objects.toStringHelper("").add("sections", sections).toString(); } - } diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/LeaseSettingsSection.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/LeaseSettingsSection.java index 314e16405a..8d21970728 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/LeaseSettingsSection.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/LeaseSettingsSection.java @@ -159,7 +159,7 @@ public class LeaseSettingsSection extends SectionType { } public Builder fromLeaseSettingsSection(LeaseSettingsSection in) { - return fromSection(in) + return fromSectionType(in) .links(in.getLinks()) .deploymentLeaseInSeconds(in.getDeploymentLeaseInSeconds()) .storageLeaseInSeconds(in.getStorageLeaseInSeconds()) @@ -173,8 +173,8 @@ public class LeaseSettingsSection extends SectionType { * {@inheritDoc} */ @Override - public Builder fromSection(SectionType in) { - return Builder.class.cast(super.fromSection(in)); + public Builder fromSectionType(SectionType in) { + return Builder.class.cast(super.fromSectionType(in)); } /** diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Link.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Link.java index 83948fdd48..4e563c2405 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Link.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Link.java @@ -45,31 +45,80 @@ import com.google.common.base.Objects.ToStringHelper; public class Link extends ReferenceType { public static final class Rel { - public static final String UP = "up"; - public static final String DOWN = "down"; - public static final String EDIT = "edit"; public static final String ADD = "add"; - public static final String DELETE = "delete"; - public static final String REMOVE = "remove"; - public static final String CATALOG_ITEM = "catalogItem"; - public static final String TASK_CANCEL = "task:cancel"; public static final String ALTERNATE = "alternate"; - public static final String NEXT_PAGE = "nextPage"; - public static final String PREVIOUS_PAGE = "previousPage"; - public static final String LAST_PAGE = "lastPage"; - public static final String FIRST_PAGE = "firstPage"; + public static final String CATALOG_ITEM = "catalogItem"; + public static final String COLLABORATION_ABORT = "collaboration:abort"; + public static final String COLLABORATION_FAIL = "collaboration:fail"; + public static final String COLLABORATION_RESUME = "collaboration:resume"; + public static final String CONSOLIDATE = "consolidate"; public static final String CONTROL_ACCESS = "controlAccess"; + public static final String COPY = "copy"; + public static final String DEPLOY = "deploy"; + public static final String DISABLE = "disable"; + public static final String DISCARD_STATE = "discardState"; + public static final String DOWN = "down"; + public static final String DOWNLOAD_ALTERNATE = "download:alternate"; + public static final String DOWNLOAD_DEFAULT = "download:default"; + public static final String EDIT = "edit"; + public static final String ENABLE = "enable"; + public static final String FIRST_PAGE = "firstPage"; + public static final String INSTALL_VMWARE_TOOLS = "installVmwareTools"; + public static final String LAST_PAGE = "lastPage"; + public static final String EJECT_MEDIA = "media:ejectMedia"; + public static final String INSERT_MEDIA = "media:insertMedia"; + public static final String MOVE = "move"; + public static final String NEXT_PAGE = "nextPage"; + public static final String OVA = "ova"; + public static final String OVF = "ovf"; + public static final String POWER_OFF = "power:powerOff"; + public static final String POWER_ON = "power:powerOn"; + public static final String REBOOT = "power:reboot"; + public static final String RESET = "power:reset"; + public static final String SHUTDOWN = "power:shutdown"; + public static final String SUSPEND = "power:suspend"; + public static final String PREVIOUS_PAGE = "previousPage"; + public static final String PUBLISH = "publish"; + public static final String RECOMPOSE = "recompose"; + public static final String RECONNECT = "reconnect"; + public static final String REGISTER = "register"; + public static final String REJECT = "reject"; + public static final String RELOCATE = "relocate"; + public static final String REMOVE = "remove"; + public static final String REPAIR = "repair"; + public static final String SCREEN_ACQUIRE_TICKET = "screen:acquireTicket"; + public static final String SCREEN_THUMBNAIL = "screen:thumbnail"; + public static final String TASK_CANCEL = "task:cancel"; + public static final String BLOCKING_TASK = "blockingTask"; + public static final String TASK_OWNER = "taskOwner"; + public static final String TASK_PARAMS = "taskParams"; + public static final String TASK_REQUEST = "taskRequest"; + public static final String UNDEPLOY = "undeploy"; + public static final String UNLOCK = "unlock"; + public static final String UNREGISTER = "unregister"; + public static final String UP = "up"; + public static final String UPDATE_PROGRESS = "updateProgress"; + public static final String UPGRADE = "upgrade"; + public static final String UPLOAD_ALTERNATE = "upload:alternate"; public static final String UPLOAD_DEFAULT = "upload:default"; /** * All acceptable {@link Link#getRel()} values. - *

+ * * This list must be updated whenever a new relationship is added. */ public static final List ALL = Arrays.asList( - UP, DOWN, EDIT, ADD, DELETE, REMOVE, CATALOG_ITEM, TASK_CANCEL, - ALTERNATE, NEXT_PAGE, PREVIOUS_PAGE, LAST_PAGE, FIRST_PAGE, - CONTROL_ACCESS, UPLOAD_DEFAULT + ADD, ALTERNATE, CATALOG_ITEM, COLLABORATION_ABORT, + COLLABORATION_FAIL, COLLABORATION_RESUME, CONSOLIDATE, + CONTROL_ACCESS, COPY, DEPLOY, DISABLE, DISCARD_STATE, DOWN, + DOWNLOAD_ALTERNATE, DOWNLOAD_DEFAULT, EDIT, ENABLE, FIRST_PAGE, + INSTALL_VMWARE_TOOLS, LAST_PAGE, EJECT_MEDIA, INSERT_MEDIA, MOVE, + NEXT_PAGE, OVA, OVF, POWER_OFF, POWER_ON, REBOOT, RESET, SHUTDOWN, + SUSPEND, PREVIOUS_PAGE, PUBLISH, RECOMPOSE, RECONNECT, REGISTER, + REJECT, RELOCATE, REMOVE, REPAIR, SCREEN_ACQUIRE_TICKET, + SCREEN_THUMBNAIL, TASK_CANCEL, BLOCKING_TASK, TASK_OWNER, + TASK_PARAMS, TASK_REQUEST, UNDEPLOY, UNLOCK, UNREGISTER, UP, + UPDATE_PROGRESS, UPGRADE, UPLOAD_ALTERNATE, UPLOAD_DEFAULT ); } @@ -198,7 +247,7 @@ public class Link extends ReferenceType { @Override public int hashCode() { - return super.hashCode() + Objects.hashCode(rel); + return Objects.hashCode(super.hashCode(), rel); } @Override diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Media.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Media.java index 209361b246..8a86482367 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Media.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Media.java @@ -258,7 +258,7 @@ public class Media extends ResourceEntityType { @Override public int hashCode() { - return super.hashCode() + Objects.hashCode(owner, imageType, size); + return Objects.hashCode(super.hashCode(), owner, imageType, size); } @Override diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/MediaInsertOrEjectParams.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/MediaInsertOrEjectParams.java new file mode 100644 index 0000000000..4726f5ef92 --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/MediaInsertOrEjectParams.java @@ -0,0 +1,111 @@ +/* + * 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.*; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +import com.google.common.base.Objects; + +/** + * Represents parameters for inserting/ejecting media to VM. + * + *

+ * <complexType name="MediaInsertOrEjectParams" />
+ * 
+ * + * @author grkvlt@apache.org + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "MediaInsertOrEjectParams") +public class MediaInsertOrEjectParams { + + public static Builder builder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder().fromMediaInsertOrEjectParams(this); + } + + public static class Builder { + + private Reference media; + + /** + * @see MediaInsertOrEjectParams#getMedia() + */ + public Builder media(Reference media) { + this.media = media; + return this; + } + + public MediaInsertOrEjectParams build() { + MediaInsertOrEjectParams mediaInsertOrEjectParams = new MediaInsertOrEjectParams(media); + return mediaInsertOrEjectParams; + } + + public Builder fromMediaInsertOrEjectParams(MediaInsertOrEjectParams in) { + return media(in.getMedia()); + } + } + + protected MediaInsertOrEjectParams() { + // For JAXB and builder use + } + + public MediaInsertOrEjectParams(Reference media) { + this.media = media; + } + + @XmlElement(name = "Media", required = true) + protected Reference media; + + /** + * Gets the value of the media property. + */ + public Reference getMedia() { + return media; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + MediaInsertOrEjectParams that = MediaInsertOrEjectParams.class.cast(o); + return equal(media, that.media); + } + + @Override + public int hashCode() { + return Objects.hashCode(media); + } + + @Override + public String toString() { + return Objects.toStringHelper("").add("media", media).toString(); + } +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Metadata.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Metadata.java index 1e8b8fc180..16ee3ad802 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Metadata.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Metadata.java @@ -161,7 +161,7 @@ public class Metadata extends ResourceType { @Override public int hashCode() { - return super.hashCode() + Objects.hashCode(metadataEntries); + return Objects.hashCode(super.hashCode(), metadataEntries); } @Override diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/MetadataEntry.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/MetadataEntry.java index f0c73ca532..b6bc181b92 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/MetadataEntry.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/MetadataEntry.java @@ -181,7 +181,7 @@ public class MetadataEntry extends ResourceType { @Override public int hashCode() { - return super.hashCode() + Objects.hashCode(key, value); + return Objects.hashCode(super.hashCode(), key, value); } @Override diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/MetadataValue.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/MetadataValue.java index c5131ae1f5..4cf9ea8254 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/MetadataValue.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/MetadataValue.java @@ -153,7 +153,7 @@ public class MetadataValue extends ResourceType { @Override public int hashCode() { - return super.hashCode() + Objects.hashCode(value); + return Objects.hashCode(super.hashCode(), value); } @Override diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/NetworkConfigSection.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/NetworkConfigSection.java index 2a680852bc..cb25bb427c 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/NetworkConfigSection.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/NetworkConfigSection.java @@ -19,8 +19,8 @@ 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 static com.google.common.base.Objects.*; +import static com.google.common.base.Preconditions.*; import java.net.URI; import java.util.Collections; @@ -30,7 +30,6 @@ import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; import org.jclouds.javax.annotation.Nullable; import org.jclouds.vcloud.director.v1_5.domain.ovf.SectionType; @@ -39,42 +38,21 @@ import com.google.common.base.Objects; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Sets; - /** * Represents the network config section of a vApp. - *

- *

- *

Java class for NetworkConfigSection complex type. - *

- *

The following schema fragment specifies the expected content contained within this class. - *

+ * *

- * <complexType name="NetworkConfigSection">
- *   <complexContent>
- *     <extension base="{http://schemas.dmtf.org/ovf/envelope/1}Section_Type">
- *       <sequence>
- *         <element name="Link" type="{http://www.vmware.com/vcloud/v1.5}LinkType" maxOccurs="unbounded" minOccurs="0"/>
- *         <element name="NetworkConfig" type="{http://www.vmware.com/vcloud/v1.5}VAppNetworkConfigurationType" maxOccurs="unbounded" minOccurs="0"/>
- *         <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
- *       </sequence>
- *       <attribute name="href" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
- *       <attribute name="type" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <anyAttribute processContents='lax'/>
- *     </extension>
- *   </complexContent>
- * </complexType>
+ * <complexType name="NetworkConfigSection" />
  * 
*/ @XmlRootElement(name = "NetworkConfigSection") -@XmlType(propOrder = { - "links", - "networkConfigs" -}) public class NetworkConfigSection extends SectionType { + public static Builder builder() { return new Builder(); } + @Override public Builder toBuilder() { return new Builder().fromNetworkConfigSection(this); } @@ -119,12 +97,13 @@ public class NetworkConfigSection extends SectionType { } + @Override public NetworkConfigSection build() { return new NetworkConfigSection(info, required, links, networkConfigs, href, type); } public Builder fromNetworkConfigSection(NetworkConfigSection in) { - return fromSection(in) + return fromSectionType(in) .links(in.getLinks()) .networkConfigs(in.getNetworkConfigs()) .href(in.getHref()) @@ -135,8 +114,8 @@ public class NetworkConfigSection extends SectionType { * {@inheritDoc} */ @Override - public Builder fromSection(SectionType in) { - return Builder.class.cast(super.fromSection(in)); + public Builder fromSectionType(SectionType in) { + return Builder.class.cast(super.fromSectionType(in)); } /** @@ -176,7 +155,7 @@ public class NetworkConfigSection extends SectionType { this.type = type; } - private NetworkConfigSection() { + protected NetworkConfigSection() { // For JAXB } @@ -203,9 +182,6 @@ public class NetworkConfigSection extends SectionType { /** * Gets the value of the type property. - * - * @return possible object is - * {@link String } */ public String getType() { return type; @@ -218,29 +194,17 @@ public class NetworkConfigSection extends SectionType { if (o == null || getClass() != o.getClass()) return false; NetworkConfigSection that = NetworkConfigSection.class.cast(o); - return super.equals(that) && - equal(links, that.links) && - equal(networkConfigs, that.networkConfigs) && - equal(href, that.href) && - equal(type, that.type); + return super.equals(that) && equal(links, that.links) && equal(networkConfigs, that.networkConfigs) && equal(href, that.href) && equal(type, that.type); } @Override public int hashCode() { - return Objects.hashCode(super.hashCode(), - links, - networkConfigs, - href, - type); + return Objects.hashCode(super.hashCode(), links, networkConfigs, href, type); } @Override public Objects.ToStringHelper string() { - return super.string() - .add("links", links) - .add("networkConfigs", networkConfigs) - .add("href", href) - .add("type", type); + return super.string().add("links", links).add("networkConfigs", networkConfigs).add("href", href).add("type", type); } } diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/NetworkConnectionSection.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/NetworkConnectionSection.java index 73e8c5ebc7..0119c5339a 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/NetworkConnectionSection.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/NetworkConnectionSection.java @@ -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 @@ -16,7 +16,6 @@ * 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; @@ -39,39 +38,14 @@ import com.google.common.base.Objects; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Sets; - /** * Represents a list of network cards existing in a VM. - *

- *

- *

Java class for NetworkConnectionSection complex type. - *

- *

The following schema fragment specifies the expected content contained within this class. - *

+ * *

- * <complexType name="NetworkConnectionSection">
- *   <complexContent>
- *     <extension base="{http://schemas.dmtf.org/ovf/envelope/1}Section_Type">
- *       <sequence>
- *         <element name="PrimaryNetworkConnectionIndex" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
- *         <element name="NetworkConnection" type="{http://www.vmware.com/vcloud/v1.5}NetworkConnectionType" maxOccurs="unbounded" minOccurs="0"/>
- *         <element name="Link" type="{http://www.vmware.com/vcloud/v1.5}LinkType" maxOccurs="unbounded" minOccurs="0"/>
- *         <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
- *       </sequence>
- *       <attribute name="href" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
- *       <attribute name="type" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <anyAttribute processContents='lax'/>
- *     </extension>
- *   </complexContent>
- * </complexType>
+ * <complexType name="NetworkConnectionSection" />
  * 
*/ @XmlRootElement(name = "NetworkConnectionSection") -@XmlType(propOrder = { - "primaryNetworkConnectionIndex", - "networkConnections", - "links" -}) public class NetworkConnectionSection extends SectionType { public static Builder builder() { @@ -130,27 +104,22 @@ public class NetworkConnectionSection extends SectionType in) { - return Builder.class.cast(super.fromSection(in)); + public Builder fromSectionType(SectionType in) { + return Builder.class.cast(super.fromSectionType(in)); } /** @@ -171,8 +140,8 @@ public class NetworkConnectionSection extends SectionType networkConnections, Set links, URI href, String type) { + private NetworkConnectionSection(@Nullable String info, @Nullable Boolean required, Integer primaryNetworkConnectionIndex, Set networkConnections, Set links, URI href, + String type) { super(info, required); this.primaryNetworkConnectionIndex = primaryNetworkConnectionIndex; this.networkConnections = ImmutableSet.copyOf(networkConnections); @@ -199,9 +168,8 @@ public class NetworkConnectionSection extends SectionType - * Objects of the following type(s) are allowed in the list - * {@link NetworkConnection } + * Objects of the following type(s) are allowed in the list {@link NetworkConnection } */ public Set getNetworkConnections() { return Collections.unmodifiableSet(this.networkConnections); @@ -220,8 +187,7 @@ public class NetworkConnectionSection extends SectionType - * Objects of the following type(s) are allowed in the list - * {@link Link } + * Objects of the following type(s) are allowed in the list {@link Link } */ public Set getLinks() { return Collections.unmodifiableSet(this.links); @@ -236,9 +202,8 @@ public class NetworkConnectionSection extends SectionType> extends EntityType { @Override public int hashCode() { - return super.hashCode() + Objects.hashCode(networkConfiguration); + return Objects.hashCode(super.hashCode(), networkConfiguration); } @Override diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Org.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Org.java index 368d8024f1..0606bd0557 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Org.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Org.java @@ -24,6 +24,7 @@ import static com.google.common.base.Preconditions.checkNotNull; import java.net.URI; import java.util.Set; +import javax.annotation.Nullable; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @@ -34,10 +35,10 @@ import com.google.common.base.Objects.ToStringHelper; import com.google.common.collect.Sets; /** - * iRepresents an organization. - *

+ * Represents an organization. + * * Unit of multi-tenancy and a top-level container. Contain vDCs, TasksList, Catalogs and Shared Network entities. - *

+ * *

  * <xs:complexType name="OrgType">
  * 
@@ -53,6 +54,7 @@ public class Org extends EntityType { return new ConcreteBuilder(); } + @Override public NewBuilder toNewBuilder() { return new ConcreteBuilder().fromOrg(this); } @@ -172,18 +174,30 @@ public class Org extends EntityType { this.id = id; return this; } - + /** * @see EntityType#getTasks() */ @Override public Builder tasks(Set tasks) { - super.tasks(tasks); + if (checkNotNull(tasks, "tasks").size() > 0) + this.tasks = Sets.newLinkedHashSet(tasks); return this; } /** - * @see ReferenceType#getHref() + * @see EntityType#getTasks() + */ + @Override + public Builder task(Task task) { + if (tasks == null) + tasks = Sets.newLinkedHashSet(); + this.tasks.add(checkNotNull(task, "task")); + return this; + } + + /** + * @see ResourceType#getHref() */ @Override public Builder href(URI href) { @@ -192,7 +206,7 @@ public class Org extends EntityType { } /** - * @see ReferenceType#getType() + * @see ResourceType#getType() */ @Override public Builder type(String type) { @@ -201,19 +215,22 @@ public class Org extends EntityType { } /** - * @see EntityType#getLinks() + * @see ResourceType#getLinks() */ @Override public Builder links(Set links) { - this.links = Sets.newLinkedHashSet(checkNotNull(links, "links")); + if (checkNotNull(links, "links").size() > 0) + this.links = Sets.newLinkedHashSet(links); return this; } /** - * @see EntityType#getLinks() + * @see ResourceType#getLinks() */ @Override public Builder link(Link link) { + if (links == null) + links = Sets.newLinkedHashSet(); this.links.add(checkNotNull(link, "link")); return this; } @@ -232,12 +249,12 @@ public class Org extends EntityType { // for JAXB } - public Org(URI href, String type, Set links, String description, - Set tasksInProgress, String id, String name, + public Org(URI href, String type, @Nullable Set links, String description, + @Nullable Set tasks, String id, String name, String fullName, Boolean enabled) { - super(href, type, links, description, tasksInProgress, id, name); + super(href, type, links, description, tasks, id, name); this.fullName = fullName; - isEnabled = enabled; + this.isEnabled = enabled; } @XmlElement(name = "FullName", required = true) @@ -253,7 +270,7 @@ public class Org extends EntityType { } /** - * Full name of the organization. + * Is the organization enabled. */ public Boolean isEnabled() { return isEnabled; @@ -271,7 +288,7 @@ public class Org extends EntityType { @Override public int hashCode() { - return super.hashCode() + Objects.hashCode(fullName, isEnabled); + return Objects.hashCode(super.hashCode(), fullName, isEnabled); } @Override diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/OrgNetwork.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/OrgNetwork.java index b65c593b6c..2bf670c4a4 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/OrgNetwork.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/OrgNetwork.java @@ -72,6 +72,7 @@ public class OrgNetwork extends NetworkType { /** * @see NetworkType#getConfiguration() */ + @Override public Builder configuration(NetworkConfiguration networkConfiguration) { this.networkConfiguration = networkConfiguration; return this; @@ -150,12 +151,12 @@ public class OrgNetwork extends NetworkType { } @Override - public Builder fromEntityType(EntityType in) { + public Builder fromNetworkType(NetworkType in) { return Builder.class.cast(super.fromEntityType(in)); } public Builder fromOrgNetwork(OrgNetwork in) { - return fromEntityType(in).configuration(in.getConfiguration()) + return fromNetworkType(in).configuration(in.getConfiguration()) .networkPool(in.getNetworkPool()) .allowedExternalIpAddresses(in.getAllowedExternalIpAddresses()); } @@ -202,7 +203,7 @@ public class OrgNetwork extends NetworkType { @Override public int hashCode() { - return super.hashCode() + Objects.hashCode(networkPool, allowedExternalIpAddresses); + return Objects.hashCode(super.hashCode(), networkPool, allowedExternalIpAddresses); } @Override diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/OrgPasswordPolicySettings.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/OrgPasswordPolicySettings.java index 3974e1ca04..79881c6108 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/OrgPasswordPolicySettings.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/OrgPasswordPolicySettings.java @@ -35,28 +35,11 @@ import com.google.common.base.Objects.ToStringHelper; /** - * 1.5 - * - *

Java class for OrgPasswordPolicySettings complex type. - * - *

The following schema fragment specifies the expected content contained within this class. + * Java class for OrgPasswordPolicySettings complex type. * *

- * <complexType name="OrgPasswordPolicySettings">
- *   <complexContent>
- *     <extension base="{http://www.vmware.com/vcloud/v1.5}ResourceType">
- *       <sequence>
- *         <element name="AccountLockoutEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
- *         <element name="InvalidLoginsBeforeLockout" type="{http://www.w3.org/2001/XMLSchema}int"/>
- *         <element name="AccountLockoutIntervalMinutes" type="{http://www.w3.org/2001/XMLSchema}int"/>
- *       </sequence>
- *       <anyAttribute processContents='lax' namespace='##other'/>
- *     </extension>
- *   </complexContent>
- * </complexType>
+ * <complexType name="OrgPasswordPolicySettings" />
  * 
- * - * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlRootElement(name = "OrgPasswordPolicySettings") diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ParamsType.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ParamsType.java index a76364559d..e5b77f1d02 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ParamsType.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ParamsType.java @@ -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 @@ -16,62 +16,29 @@ * 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.Objects.*; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlSeeAlso; import javax.xml.bind.annotation.XmlType; import com.google.common.base.Objects; - +import com.google.common.base.Objects.ToStringHelper; /** * A basic type used to specify parameters for operations. - *

- *

- *

Java class for Params complex type. - *

- *

The following schema fragment specifies the expected content contained within this class. - *

+ * *

- * <complexType name="Params">
- *   <complexContent>
- *     <extension base="{http://www.vmware.com/vcloud/v1.5}VCloudExtensibleType">
- *       <sequence>
- *         <element name="Description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- *       </sequence>
- *       <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <anyAttribute processContents='lax' namespace='##other'/>
- *     </extension>
- *   </complexContent>
- * </complexType>
+ * <complexType name="Params" />
  * 
*/ -@XmlType(name = "Params", propOrder = { - "description" -}) -@XmlSeeAlso({ -// CaptureVAppParams.class, // FIXME! - CloneVAppTemplateParams.class, - CloneMediaParams.class, - UploadVAppTemplateParams.class -//, ImportVmAsVAppTemplateParams.class, -// ImportMediaParams.class, -// UpdateResourcePoolSetParams.class, -// VAppCreationParams.class -}) +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "Params") public class ParamsType> { - public static > Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder().fromParamsType(this); - } public static class Builder> { @@ -94,7 +61,6 @@ public class ParamsType> { return this; } - public ParamsType build() { return new ParamsType(description, name); } @@ -105,7 +71,7 @@ public class ParamsType> { } } - protected ParamsType(String description, String name) { + public ParamsType(String description, String name) { this.description = description; this.name = name; } @@ -122,9 +88,6 @@ public class ParamsType> { /** * Gets the value of the description property. - * - * @return possible object is - * {@link String } */ public String getDescription() { return description; @@ -132,9 +95,6 @@ public class ParamsType> { /** * Gets the value of the name property. - * - * @return possible object is - * {@link String } */ public String getName() { return name; @@ -147,21 +107,20 @@ public class ParamsType> { if (o == null || getClass() != o.getClass()) return false; ParamsType that = ParamsType.class.cast(o); - return equal(description, that.description) && - equal(name, that.name); + return equal(this.description, that.description) && equal(this.name, that.name); } @Override public int hashCode() { - return Objects.hashCode(description, - name); + return Objects.hashCode(description, name); } @Override public String toString() { - return Objects.toStringHelper("") - .add("description", description) - .add("name", name).toString(); + return string().toString(); } + public ToStringHelper string() { + return Objects.toStringHelper("").add("description", description).add("name", name); + } } diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/RasdItemsList.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/RasdItemsList.java new file mode 100644 index 0000000000..b4e2670c05 --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/RasdItemsList.java @@ -0,0 +1,170 @@ +/* + * 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.*; +import static com.google.common.base.Preconditions.*; + +import java.net.URI; +import java.util.List; +import java.util.Set; + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + +import org.jclouds.vcloud.director.v1_5.domain.ovf.RASD; + +import com.google.common.base.Objects; +import com.google.common.base.Objects.ToStringHelper; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; + +/** + * Represents a list of RASD items. + * + *
+ * <complexType name="RasdItemsList" />
+ * 
+ * + * @author grkvlt@apache.org + */ +@XmlType(name = "RasdItemsList") +public class RasdItemsList extends ResourceType { + + public static Builder builder() { + return new Builder(); + } + + @Override + public Builder toBuilder() { + return new Builder().fromRasdItemsList(this); + } + + public static class Builder extends ResourceType.Builder { + + private List items = Lists.newArrayList(); + + /** + * @see RasdItemsList#getItems() + */ + public Builder items(List items) { + this.items = checkNotNull(items, "items"); + return this; + } + + /** + * @see RasdItemsList#getItems() + */ + public Builder item(RASD item) { + this.items.add(checkNotNull(item, "item")); + return this; + } + + @Override + public RasdItemsList build() { + RasdItemsList rasdItemsList = new RasdItemsList(href, type, links, items); + return rasdItemsList; + } + + /** + * @see ResourceType#getHref() + */ + @Override + public Builder href(URI href) { + super.href(href); + return this; + } + + /** + * @see ResourceType#getType() + */ + @Override + public Builder type(String type) { + super.type(type); + return this; + } + + /** + * @see ResourceType#getLinks() + */ + @Override + public Builder links(Set links) { + super.links(Sets.newLinkedHashSet(checkNotNull(links, "links"))); + return this; + } + + /** + * @see ResourceType#getLinks() + */ + @Override + public Builder link(Link link) { + super.link(link); + return this; + } + + @Override + public Builder fromResourceType(ResourceType in) { + return Builder.class.cast(super.fromResourceType(in)); + } + + public Builder fromRasdItemsList(RasdItemsList in) { + return fromResourceType(in).items(in.getItems()); + } + } + + protected RasdItemsList() { + // For JAXB and builder use + } + + public RasdItemsList(URI href, String type, Set links, List items) { + super(href, type, links); + this.items = items; + } + + @XmlElement(name = "Item") + protected List items = Lists.newArrayList(); + + /** + * A RASD item content. + */ + public List getItems() { + return items; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + RasdItemsList that = RasdItemsList.class.cast(o); + return super.equals(that) && equal(this.items, that.items); + } + + @Override + public int hashCode() { + return Objects.hashCode(super.hashCode(), items); + } + + @Override + public ToStringHelper string() { + return super.string().add("items", items); + } + +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/RecomposeVAppParams.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/RecomposeVAppParams.java new file mode 100644 index 0000000000..9a47a7d99c --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/RecomposeVAppParams.java @@ -0,0 +1,209 @@ +/** + * 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 java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + * + * Represents vApp re-composition parameters. + * + * + *

Java class for RecomposeVAppParams complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="RecomposeVAppParams">
+ *   <complexContent>
+ *     <extension base="{http://www.vmware.com/vcloud/v1.5}ComposeVAppParamsType">
+ *       <sequence>
+ *         <element name="CreateItem" type="{http://www.vmware.com/vcloud/v1.5}VmType" maxOccurs="unbounded" minOccurs="0"/>
+ *         <element name="DeleteItem" type="{http://www.vmware.com/vcloud/v1.5}ReferenceType" maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "RecomposeVAppParams", propOrder = { + "createItem", + "deleteItem" +}) +public class RecomposeVAppParams + extends ComposeVAppParamsType + +{ + @SuppressWarnings("unchecked") + public static Builder builder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder().fromRecomposeVAppParams(this); + } + + public static class Builder extends ComposeVAppParamsType.Builder { + + private List createItem; + private List deleteItem; + + /** + * @see RecomposeVAppParams#getCreateItem() + */ + public Builder createItem(List createItem) { + this.createItem = createItem; + return this; + } + + /** + * @see RecomposeVAppParams#getDeleteItem() + */ + public Builder deleteItem(List deleteItem) { + this.deleteItem = deleteItem; + return this; + } + + + public RecomposeVAppParams build() { + RecomposeVAppParams recomposeVAppParams = new RecomposeVAppParams(createItem, deleteItem); + return recomposeVAppParams; + } + + + @Override + public Builder fromComposeVAppParamsType(ComposeVAppParamsType in) { + return Builder.class.cast(super.fromComposeVAppParamsType(in)); + } + public Builder fromRecomposeVAppParams(RecomposeVAppParams in) { + return fromComposeVAppParamsType(in) + .createItem(in.getCreateItem()) + .deleteItem(in.getDeleteItem()); + } + } + + private RecomposeVAppParams() { + // For JAXB and builder use + } + + private RecomposeVAppParams(List createItem, List deleteItem) { + this.createItem = createItem; + this.deleteItem = deleteItem; + } + + + @XmlElement(name = "CreateItem") + protected List createItem; + @XmlElement(name = "DeleteItem") + protected List deleteItem; + + /** + * Gets the value of the createItem property. + * + *

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

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

+     *    getCreateItem().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link VmType } + * + * + */ + public List getCreateItem() { + if (createItem == null) { + createItem = new ArrayList(); + } + return this.createItem; + } + + /** + * Gets the value of the deleteItem property. + * + *

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

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

+     *    getDeleteItem().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link ReferenceType } + * + * + */ + public List getDeleteItem() { + if (deleteItem == null) { + deleteItem = new ArrayList(); + } + return this.deleteItem; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + RecomposeVAppParams that = RecomposeVAppParams.class.cast(o); + return equal(createItem, that.createItem) && + equal(deleteItem, that.deleteItem); + } + + @Override + public int hashCode() { + return Objects.hashCode(createItem, + deleteItem); + } + + @Override + public String toString() { + return Objects.toStringHelper("") + .add("createItem", createItem) + .add("deleteItem", deleteItem).toString(); + } + +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ReferenceType.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ReferenceType.java index 8ae9ce74e6..12aa595eec 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ReferenceType.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ReferenceType.java @@ -31,9 +31,9 @@ import com.google.common.base.Objects.ToStringHelper; /** * A reference to a resource. - *

+ * * Contains an href attribute and optional name and type attributes. - *

+ *

*

  * <xs:complexType name="ReferenceType">
  * 
diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ResourceEntities.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ResourceEntities.java index 400b536844..c528fe22ac 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ResourceEntities.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ResourceEntities.java @@ -35,29 +35,16 @@ import com.google.common.collect.Sets; /** * Represents a list of references to resource entities. - *

- *

- *

Java class for ResourceEntities complex type. - *

- *

The following schema fragment specifies the expected content contained within this class. - *

+ * *

- * <complexType name="ResourceEntities">
- *   <complexContent>
- *     <extension base="{http://www.vmware.com/vcloud/v1.5}VCloudExtensibleType">
- *       <sequence>
- *         <element name="ResourceEntity" type="{http://www.vmware.com/vcloud/v1.5}ReferenceType" maxOccurs="unbounded" minOccurs="0"/>
- *       </sequence>
- *       <anyAttribute processContents='lax' namespace='##other'/>
- *     </extension>
- *   </complexContent>
- * </complexType>
+ * <complexType name="ResourceEntities" />
  * 
+ * + * @author grkvlt@apache.org */ -@XmlType(name = "ResourceEntities", propOrder = { - "resourceEntities" -}) +@XmlType(name = "ResourceEntities") public class ResourceEntities { + public static Builder builder() { return new Builder(); } diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ResourceEntityType.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ResourceEntityType.java index 8cbb354b72..6bdcbc109f 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ResourceEntityType.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ResourceEntityType.java @@ -19,29 +19,108 @@ package org.jclouds.vcloud.director.v1_5.domain; -import static com.google.common.base.Objects.equal; +import static com.google.common.base.Objects.*; +import static com.google.common.base.Preconditions.*; import java.net.URI; +import java.util.Arrays; import java.util.Set; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; +import org.jclouds.vcloud.director.v1_5.VCloudDirectorRuntimeException; +import org.jclouds.vcloud.director.v1_5.domain.AbstractVAppType.Builder; + import com.google.common.base.Objects; import com.google.common.base.Objects.ToStringHelper; +import com.google.common.base.Optional; +import com.google.common.base.Predicate; +import com.google.common.collect.Iterables; +import com.google.common.collect.Sets; /** * Base type that represents a resource entity such as a vApp template or virtual media. - *

+ * *

- * <complexType name="ResourceEntity" >
+ * <complexType name="ResourceEntity" />
  * 
* * @author danikov * @author Adam Lowe + * @author grkvlt@apache.org */ public abstract class ResourceEntityType> extends EntityType { + public static enum Status { + + FAILED_CREATION(-1, "The object could not be created.", true, true, true), + UNRESOLVED(0, "The object is unresolved.", true, true, true), + RESOLVED(1, "The object is resolved.", true, true, true), + DEPLOYED(2, "The object is deployed.", false, false, false), + SUSPENDED(3, "The object is suspended.", false, true, true), + POWERED_ON(4, "The object is powered on.", false, true, true), + WAITING_FOR_INPUT(5, "The object is waiting for user input.", false, true, true), + UNKNOWN(6, "The object is in an unknown state.", true, true, true), + UNRECOGNIZED(7, "The object is in an unrecognized state.", true, true, true), + POWERED_OFF(8, "The object is powered off.", true, true, true), + INCONSISTENT_STATE(9, "The object is in an inconsistent state.", false, true, true), + MIXED(10, "Children do not all have the same status.", true, true, false), + UPLOAD_OVF_PENDING(11, "Upload initiated, OVF descriptor pending.", true, false, false), + UPLOAD_COPYING(12, "Upload initiated, copying contents.", true, false, false), + UPLOAD_DISK_PENDING(13, "Upload initiated , disk contents pending.", true, false, false), + UPLOAD_QUARANTINED(14, "Upload has been quarantined.", true, false, false), + UPLOAD_QUARANTINE_EXPIRED(15, "Upload quarantine period has expired.", true, false, false); + + private Integer value; + private String description; + private boolean vAppTemplate; + private boolean vApp; + private boolean vm; + + private Status(int value, String description, boolean vAppTemplate, boolean vApp, boolean vm) { + this.value = value; + this.description = description; + this.vAppTemplate = vAppTemplate; + this.vApp = vApp; + this.vm = vm; + } + + public Integer getValue() { + return value; + } + + public String getDescription() { + return description; + } + + public boolean isVAppTemplate() { + return vAppTemplate; + } + + public boolean isVApp() { + return vApp; + } + + public boolean isVm() { + return vm; + } + + public static Status fromValue(final int value) { + Optional found = Iterables.tryFind(Arrays.asList(values()), new Predicate() { + @Override + public boolean apply(Status status) { + return status.getValue() == value; + } + }); + if (found.isPresent()) { + return found.get(); + } else { + throw new VCloudDirectorRuntimeException(String.format("Illegal status value '%d'", value)); + } + } + } + public static abstract class Builder> extends EntityType.Builder { protected FilesList files; protected Integer status; @@ -99,29 +178,33 @@ public abstract class ResourceEntityType> extend } /** - * @see ResourceEntityType#getLinks() + * @see EntityType#getLinks() */ + @Override public Builder links(Set links) { - super.links(links); + if (checkNotNull(links, "links").size() > 0) + this.links = Sets.newLinkedHashSet(links); return this; } /** - * @see ResourceEntityType#getLinks() + * @see EntityType#getLinks() */ + @Override public Builder link(Link link) { - super.link(link); + if (links == null) + links = Sets.newLinkedHashSet(); + this.links.add(checkNotNull(link, "link")); return this; } - @SuppressWarnings("unchecked") @Override - public Builder fromResourceType(ResourceType in) { - return Builder.class.cast(super.fromResourceType(in)); + public Builder fromEntityType(EntityType in) { + return Builder.class.cast(super.fromEntityType(in)); } public Builder fromResourceEntityType(ResourceEntityType in) { - return fromResourceType(in).files(in.getFiles()).status(in.getStatus()); + return fromEntityType(in).files(in.getFiles()).status(in.getStatus()); } } @@ -177,7 +260,7 @@ public abstract class ResourceEntityType> extend @Override public int hashCode() { - return super.hashCode() + Objects.hashCode(files, status); + return Objects.hashCode(super.hashCode(), files, status); } @Override diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ResourceType.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ResourceType.java index 24843d43be..1cc3e2bb71 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ResourceType.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ResourceType.java @@ -29,6 +29,7 @@ import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import org.jclouds.javax.annotation.Nullable; +import org.jclouds.vcloud.director.v1_5.domain.AbstractVAppType.Builder; import com.google.common.base.Objects; import com.google.common.base.Objects.ToStringHelper; @@ -37,7 +38,7 @@ 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. *

*

@@ -128,7 +129,8 @@ public abstract class ResourceType> {
        * @see ResourceType#getLinks()
        */
       public Builder links(Set links) {
-         this.links = Sets.newLinkedHashSet(checkNotNull(links, "links"));
+         if (checkNotNull(links, "links").size() > 0)
+            this.links = Sets.newLinkedHashSet(links);
          return this;
       }
 
@@ -156,11 +158,11 @@ public abstract class ResourceType> {
    @XmlElement(name = "Link")
    private Set links;
 
-   protected ResourceType(URI href, String type, @Nullable Set links) {
+   public ResourceType(URI href, String type, @Nullable Set links) {
       this.href = href;
       this.type = type;
       // nullable so that jaxb wont persist empty collections
-      this.links = links != null && links.size() == 0 ? null : links;
+      this.links = links != null && links.isEmpty() ? null : links;
    }
 
    protected ResourceType() {
@@ -169,7 +171,7 @@ public abstract class ResourceType> {
 
    /**
     * 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 @@ -186,7 +188,7 @@ public abstract class ResourceType> { /** * 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. * diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/RuntimeInfoSection.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/RuntimeInfoSection.java new file mode 100644 index 0000000000..20a310a1f8 --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/RuntimeInfoSection.java @@ -0,0 +1,146 @@ +/* + * 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.*; + +import java.util.List; + +import javax.xml.bind.annotation.XmlAnyElement; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + +import org.jclouds.vcloud.director.v1_5.domain.ovf.SectionType; + +import com.google.common.base.Objects; +import com.google.common.base.Objects.ToStringHelper; +import com.google.common.collect.Lists; + +/** + * Runtime information for a specific vm + * + *

+ * <complexType name="RuntimeInfoSection" />
+ * 
+ * + * @author grkvlt@apache.org + */ +@XmlType(name = "RuntimeInfoSection") +public class RuntimeInfoSection extends SectionType { + + public static Builder builder() { + return new Builder(); + } + + @Override + public Builder toBuilder() { + return new Builder().fromRuntimeInfoSection(this); + } + + public static class Builder extends SectionType.Builder { + + private VMWareTools vmWareTools; + private List any = Lists.newArrayList(); + + /** + * @see RuntimeInfoSection#getVmWareTools() + */ + public Builder vmWareTools(VMWareTools vmWareTools) { + this.vmWareTools = vmWareTools; + return this; + } + + /** + * @see RuntimeInfoSection#getAny() + */ + public Builder any(List any) { + this.any = any; + return this; + } + + + @Override + public RuntimeInfoSection build() { + RuntimeInfoSection runtimeInfoSection = new RuntimeInfoSection(vmWareTools, any); + return runtimeInfoSection; + } + + @Override + public Builder fromSectionType(SectionType in) { + return Builder.class.cast(super.fromSectionType(in)); + } + + public Builder fromRuntimeInfoSection(RuntimeInfoSection in) { + return fromSectionType(in) + .vmWareTools(in.getVMWareTools()) + .any(in.getAny()); + } + } + + protected RuntimeInfoSection() { + // For JAXB and builder use + } + + public RuntimeInfoSection(VMWareTools vmWareTools, List any) { + this.vmWareTools = vmWareTools; + this.any = any; + } + + + @XmlElement(name = "VMWareTools") + protected VMWareTools vmWareTools; + @XmlAnyElement(lax = true) + protected List any = Lists.newArrayList(); + + /** + * Gets the value of the vmWareTools property. + */ + public VMWareTools getVMWareTools() { + return vmWareTools; + } + + /** + * Gets the value of the any property. + */ + public List getAny() { + return this.any; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + RuntimeInfoSection that = RuntimeInfoSection.class.cast(o); + return super.equals(that) && + equal(vmWareTools, that.vmWareTools) && equal(any, that.any); + } + + @Override + public int hashCode() { + return Objects.hashCode(super.hashCode(), vmWareTools, any); + } + + @Override + public ToStringHelper string() { + return super.string().add("vmWareTools", vmWareTools).add("any", any); + } + +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ScreenTicket.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ScreenTicket.java new file mode 100644 index 0000000000..fbd840b4fa --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ScreenTicket.java @@ -0,0 +1,47 @@ +/** + * Licensed to jclouds, Inc. (jclouds) under one or more + * contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. jclouds licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.jclouds.vcloud.director.v1_5.domain; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlValue; + +/** + * The ticket for accessing the console of a VM. + * + *
+ * <complexType name="ScreenTicket" />
+ * 
+ */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "ScreenTicket") +public class ScreenTicket { + + @XmlValue + protected String value; + + /** + * Gets the value of the value property. + */ + public String getValue() { + return value; + } +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Task.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Task.java index b6f1ca88b4..156b024197 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Task.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Task.java @@ -446,7 +446,7 @@ public class Task extends EntityType { @Override public int hashCode() { - return super.hashCode() + Objects.hashCode(error, org, progress, status, operation, operationName, + return Objects.hashCode(super.hashCode(), error, org, progress, status, operation, operationName, startTime, endTime, expiryTime); } diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/TasksList.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/TasksList.java index 510edb27d4..2435b3a818 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/TasksList.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/TasksList.java @@ -170,7 +170,7 @@ public class TasksList extends ResourceType implements Set { @Override public int hashCode() { - return super.hashCode() + Objects.hashCode(delegate(), name); + return Objects.hashCode(super.hashCode(), delegate(), name); } private Set delegate() { @@ -252,4 +252,4 @@ public class TasksList extends ResourceType implements Set { return delegate().toArray(array); } -} \ No newline at end of file +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/UndeployVAppParams.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/UndeployVAppParams.java new file mode 100644 index 0000000000..2366c892b9 --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/UndeployVAppParams.java @@ -0,0 +1,148 @@ +/** + * Licensed to jclouds, Inc. (jclouds) under one or more + * contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. jclouds licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.jclouds.vcloud.director.v1_5.domain; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + * + * Represents vApp/VM undeployment parameters. + * + * + *

Java class for UndeployVAppParams complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="UndeployVAppParams">
+ *   <complexContent>
+ *     <extension base="{http://www.vmware.com/vcloud/v1.5}VCloudExtensibleType">
+ *       <sequence>
+ *         <element name="UndeployPowerAction" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "UndeployVAppParams", propOrder = { + "undeployPowerAction" +}) +public class UndeployVAppParams + + +{ + @SuppressWarnings("unchecked") + public static Builder builder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder().fromUndeployVAppParams(this); + } + + public static class Builder { + + private String undeployPowerAction; + + /** + * @see UndeployVAppParams#getUndeployPowerAction() + */ + public Builder undeployPowerAction(String undeployPowerAction) { + this.undeployPowerAction = undeployPowerAction; + return this; + } + + + public UndeployVAppParams build() { + UndeployVAppParams undeployVAppParams = new UndeployVAppParams(); + undeployVAppParams.setUndeployPowerAction(undeployPowerAction); + return undeployVAppParams; + } + + + public Builder fromUndeployVAppParams(UndeployVAppParams in) { + return undeployPowerAction(in.getUndeployPowerAction()); + } + } + + private UndeployVAppParams() { + // For JAXB and builder use + } + + + + @XmlElement(name = "UndeployPowerAction") + protected String undeployPowerAction; + + /** + * Gets the value of the undeployPowerAction property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getUndeployPowerAction() { + return undeployPowerAction; + } + + /** + * Sets the value of the undeployPowerAction property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setUndeployPowerAction(String value) { + this.undeployPowerAction = value; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + UndeployVAppParams that = UndeployVAppParams.class.cast(o); + return equal(undeployPowerAction, that.undeployPowerAction); + } + + @Override + public int hashCode() { + return Objects.hashCode(undeployPowerAction); + } + + @Override + public String toString() { + return Objects.toStringHelper("") + .add("undeployPowerAction", undeployPowerAction).toString(); + } + +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/VApp.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/VApp.java index d7a1888e2d..23361df96c 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/VApp.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/VApp.java @@ -1,5 +1,363 @@ +/* + * 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; -public class VApp { - // Placeholder for merge +import static com.google.common.base.Objects.*; +import static com.google.common.base.Preconditions.*; + +import java.net.URI; +import java.util.List; +import java.util.Set; + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; + +import org.jclouds.javax.annotation.Nullable; +import org.jclouds.vcloud.director.v1_5.domain.ovf.SectionType; + +import com.google.common.base.Objects; +import com.google.common.base.Objects.ToStringHelper; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; + +/** + * Represents a vApp. + * + *
+ * <complexType name="VApp" />
+ * 
+ * + * @author grkvlt@apache.org + */ +public class VApp extends AbstractVAppType { + + public static Builder builder() { + return new Builder(); + } + + @Override + public Builder toBuilder() { + return new Builder().fromVApp(this); + } + + public static class Builder extends AbstractVAppType.Builder { + + private Owner owner; + private Boolean inMaintenanceMode; + private VAppChildren children; + private Boolean ovfDescriptorUploaded; + + /** + * @see VApp#getOwner() + */ + public Builder owner(Owner owner) { + this.owner = owner; + return this; + } + + /** + * @see VApp#isInMaintenanceMode() + */ + public Builder isInMaintenanceMode(Boolean inMaintenanceMode) { + this.inMaintenanceMode = inMaintenanceMode; + return this; + } + + /** + * @see VApp#isInMaintenanceMode() + */ + public Builder inMaintenanceMode() { + this.inMaintenanceMode = Boolean.TRUE; + return this; + } + + /** + * @see VApp#isInMaintenanceMode() + */ + public Builder notInMaintenanceMode() { + this.inMaintenanceMode = Boolean.FALSE; + return this; + } + + /** + * @see VApp#getChildren() + */ + public Builder children(VAppChildren children) { + this.children = children; + return this; + } + + /** + * @see VApp#isOvfDescriptorUploaded() + */ + public Builder isOvfDescriptorUploaded(Boolean ovfDescriptorUploaded) { + this.ovfDescriptorUploaded = ovfDescriptorUploaded; + return this; + } + + /** + * @see VApp#isOvfDescriptorUploaded() + */ + public Builder ovfDescriptorUploaded() { + this.ovfDescriptorUploaded = Boolean.TRUE; + return this; + } + + /** + * @see VApp#isOvfDescriptorUploaded() + */ + public Builder ovfDescriptorNotUploaded() { + this.ovfDescriptorUploaded = Boolean.FALSE; + return this; + } + + @Override + public VApp build() { + VApp vApp = new VApp(href, type, links, description, tasks, id, name, files, status, vAppParent, sections, inMaintenanceMode, + owner, inMaintenanceMode, children, ovfDescriptorUploaded); + return vApp; + } + + /** + * @see AbstractVAppType#isDeployed() + */ + @Override + public Builder isDeployed(Boolean deployed) { + this.deployed = deployed; + return this; + } + + /** + * @see AbstractVAppType#isDeployed() + */ + @Override + public Builder deployed() { + this.deployed = Boolean.TRUE; + return this; + } + + /** + * @see AbstractVAppType#isDeployed() + */ + @Override + public Builder notDeployed() { + this.deployed = Boolean.FALSE; + return this; + } + + /** + * @see AbstractVAppType#getVAppParent() + */ + @Override + public Builder parent(Reference vAppParent) { + this.vAppParent = vAppParent; + return this; + } + + /** + * @see AbstractVAppType#getSections() + */ + @Override + public Builder sections(List> sections) { + if (checkNotNull(sections, "sections").size() > 0) + this.sections = Lists.newArrayList(sections); + return this; + } + + /** + * @see AbstractVAppType#getSections() + */ + @Override + public Builder section(SectionType section) { + if (this.sections == null) + this.sections = Lists.newArrayList(); + this.sections.add(checkNotNull(section, "section")); + return this; + } + + /** + * @see ResourceEntityType#getFiles() + */ + @Override + public Builder files(FilesList files) { + this.files = files; + return this; + } + + /** + * @see ResourceEntityType#getStatus() + */ + @Override + public Builder status(Integer status) { + this.status = status; + return this; + } + + /** + * @see EntityType#getId() + */ + @Override + public Builder id(String id) { + this.id = id; + return this; + } + + /** + * @see EntityType#getTasks() + */ + @Override + public Builder tasks(Set tasks) { + if (checkNotNull(tasks, "tasks").size() > 0) + this.tasks = Sets.newLinkedHashSet(tasks); + return this; + } + + /** + * @see EntityType#getTasks() + */ + @Override + public Builder task(Task task) { + if (tasks == null) + tasks = Sets.newLinkedHashSet(); + this.tasks.add(checkNotNull(task, "task")); + return this; + } + + /** + * @see ReferenceType#getHref() + */ + @Override + public Builder href(URI href) { + this.href = href; + return this; + } + + /** + * @see ReferenceType#getType() + */ + @Override + public Builder type(String type) { + this.type = type; + return this; + } + + /** + * @see EntityType#getLinks() + */ + @Override + public Builder links(Set links) { + if (checkNotNull(links, "links").size() > 0) + this.links = Sets.newLinkedHashSet(links); + return this; + } + + /** + * @see EntityType#getLinks() + */ + @Override + public Builder link(Link link) { + if (links == null) + links = Sets.newLinkedHashSet(); + this.links.add(checkNotNull(link, "link")); + return this; + } + + @Override + public Builder fromAbstractVAppType(AbstractVAppType in) { + return Builder.class.cast(super.fromAbstractVAppType(in)); + } + + public Builder fromVApp(VApp in) { + return fromAbstractVAppType(in).owner(in.getOwner()).isInMaintenanceMode(in.isInMaintenanceMode()).children(in.getChildren()).isOvfDescriptorUploaded(in.isOvfDescriptorUploaded()); + } + } + + protected VApp() { + // For JAXB and builder use + } + + public VApp(URI href, String type, @Nullable Set links, String description, @Nullable Set tasks, String id, String name, FilesList files, Integer status, Reference vAppParent, + @Nullable List> sections, Boolean deployed, Owner owner, Boolean inMaintenanceMode, VAppChildren children, Boolean ovfDescriptorUploaded) { + super(href, type, links, description, tasks, id, name, files, status, vAppParent, sections, deployed); + this.owner = owner; + this.inMaintenanceMode = inMaintenanceMode; + this.children = children; + this.ovfDescriptorUploaded = ovfDescriptorUploaded; + } + + @XmlElement(name = "Owner") + protected Owner owner; + @XmlElement(name = "InMaintenanceMode") + protected Boolean inMaintenanceMode; + @XmlElement(name = "Children") + protected VAppChildren children; + @XmlAttribute + protected Boolean ovfDescriptorUploaded; + + /** + * Gets the value of the owner property. + */ + public Owner getOwner() { + return owner; + } + + /** + * Gets the value of the inMaintenanceMode property. + */ + public Boolean isInMaintenanceMode() { + return inMaintenanceMode; + } + + /** + * Gets the value of the children property. + */ + public VAppChildren getChildren() { + return children; + } + + /** + * Gets the value of the ovfDescriptorUploaded property. + */ + public Boolean isOvfDescriptorUploaded() { + return ovfDescriptorUploaded; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + VApp that = VApp.class.cast(o); + return super.equals(that) && + equal(this.owner, that.owner) && equal(this.inMaintenanceMode, that.inMaintenanceMode) && + equal(this.children, that.children) && equal(this.ovfDescriptorUploaded, that.ovfDescriptorUploaded); + } + + @Override + public int hashCode() { + return Objects.hashCode(super.hashCode(), owner, inMaintenanceMode, children, ovfDescriptorUploaded); + } + + @Override + public ToStringHelper string() { + return super.string().add("owner", owner).add("inMaintenanceMode", inMaintenanceMode) + .add("children", children).add("ovfDescriptorUploaded", ovfDescriptorUploaded); + } } diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/VAppChildren.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/VAppChildren.java new file mode 100644 index 0000000000..b6389f62e1 --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/VAppChildren.java @@ -0,0 +1,151 @@ +/* + * 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.*; +import static com.google.common.base.Preconditions.*; + +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + +import com.google.common.base.Objects; +import com.google.common.collect.Lists; + +/** + * Represents vApp children. + * + *
+ * <complexType name="VAppChildren" />
+ * 
+ * + * @author grkvlt@apache.org + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "VAppChildren") +public class VAppChildren { + + public static Builder builder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder().fromVAppChildren(this); + } + + public static class Builder { + + private List vApps = Lists.newArrayList(); + private List vms = Lists.newArrayList(); + + /** + * @see VAppChildren#getVApps() + */ + public Builder vApps(List vApps) { + this.vApps = checkNotNull(vApps, "vApps"); + return this; + } + + /** + * @see VAppChildren#getVApps() + */ + public Builder vApp(VApp vApp) { + this.vApps.add(checkNotNull(vApp, "vApp")); + return this; + } + + /** + * @see VAppChildren#getVms() + */ + public Builder vms(List vms) { + this.vms = checkNotNull(vms, "vms"); + return this; + } + + /** + * @see VAppChildren#getVms() + */ + public Builder vm(Vm vm) { + this.vms.add(checkNotNull(vm, "vm")); + return this; + } + + public VAppChildren build() { + VAppChildren vAppChildren = new VAppChildren(vApps, vms); + return vAppChildren; + } + + public Builder fromVAppChildren(VAppChildren in) { + return vApps(in.getVApps()).vms(in.getVms()); + } + } + + private VAppChildren() { + // For JAXB and builder use + } + + private VAppChildren(List vApps, List vms) { + this.vApps = vApps; + this.vms = vms; + } + + @XmlElement(name = "VApp") + protected List vApps = Lists.newArrayList(); + @XmlElement(name = "Vm") + protected List vms = Lists.newArrayList(); + + /** + * Reserved. + * + * Unimplemented. + */ + public List getVApps() { + return vApps; + } + + /** + * Child VMs. + */ + public List getVms() { + return vms; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + VAppChildren that = VAppChildren.class.cast(o); + return equal(this.vApps, that.vApps) && equal(this.vms, that.vms); + } + + @Override + public int hashCode() { + return Objects.hashCode(vApps, vms); + } + + @Override + public String toString() { + return Objects.toStringHelper("").add("vApps", vApps).add("vms", vms).toString(); + } +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/VAppCreationParams.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/VAppCreationParams.java new file mode 100644 index 0000000000..6d9f7c03d6 --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/VAppCreationParams.java @@ -0,0 +1,169 @@ +/* + * Licensed to jclouds, Inc. (jclouds) under one or more + * contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. jclouds licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.jclouds.vcloud.director.v1_5.domain; + +import javax.xml.bind.annotation.XmlType; + + +/** + * Represents vApp creation parameters. + * + *
+ * <complexType name="VAppCreationParams" />
+ * 
+ * + * @author grkvlt@apache.org + */ +@XmlType(name = "VAppCreationParams") +public class VAppCreationParams extends VAppCreationParamsType { + + public static Builder builder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder().fromVAppCreationParams(this); + } + + public static class Builder extends VAppCreationParamsType.Builder { + + @Override + public VAppCreationParams build() { + VAppCreationParams vAppCreationParams = new VAppCreationParams(description, name, vAppParent, instantiationParams, deploy, powerOn); + return vAppCreationParams; + } + + /** + * @see VAppCreationParamsType#getVAppParent() + */ + @Override + public Builder vAppParent(Reference vAppParent) { + this.vAppParent = vAppParent; + return this; + } + + /** + * @see VAppCreationParamsType#getInstantiationParams() + */ + @Override + public Builder instantiationParams(InstantiationParams instantiationParams) { + this.instantiationParams = instantiationParams; + return this; + } + + /** + * @see VAppCreationParamsType#isDeploy() + */ + @Override + public Builder deploy(Boolean deploy) { + this.deploy = deploy; + return this; + } + + /** + * @see VAppCreationParamsType#isDeploy() + */ + @Override + public Builder deploy() { + this.deploy = Boolean.TRUE; + return this; + } + + /** + * @see VAppCreationParamsType#isDeploy() + */ + @Override + public Builder notDeploy() { + this.deploy = Boolean.FALSE; + return this; + } + + /** + * @see VAppCreationParamsType#isPowerOn() + */ + @Override + public Builder powerOn(Boolean powerOn) { + this.powerOn = powerOn; + return this; + } + + /** + * @see VAppCreationParamsType#isPowerOn() + */ + @Override + public Builder powerOn() { + this.powerOn = Boolean.TRUE; + return this; + } + + /** + * @see VAppCreationParamsType#isPowerOn() + */ + @Override + public Builder notPowerOn() { + this.powerOn = Boolean.FALSE; + return this; + } + + /** + * @see ParamsType#getDescription() + */ + @Override + public Builder description(String description) { + this.description = description; + return this; + } + + /** + * @see ParamsType#getName() + */ + @Override + public Builder name(String name) { + this.name = name; + return this; + } + + @Override + public Builder fromVAppCreationParamsType(VAppCreationParamsType in) { + return Builder.class.cast(super.fromVAppCreationParamsType(in)); + } + + public Builder fromVAppCreationParams(VAppCreationParams in) { + return fromVAppCreationParamsType(in); + } + } + + protected VAppCreationParams() { + // For JAXB and builder use + } + + public VAppCreationParams(String description, String name, Reference vAppParent, InstantiationParams instantiationParams, Boolean deploy, Boolean powerOn) { + super(description, name, vAppParent, instantiationParams, deploy, powerOn); + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + VAppCreationParams that = VAppCreationParams.class.cast(o); + return super.equals(that); + } +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/VAppCreationParamsType.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/VAppCreationParamsType.java index 2b5c6d8923..edc624b80a 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/VAppCreationParamsType.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/VAppCreationParamsType.java @@ -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 @@ -16,64 +16,27 @@ * 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.Objects.*; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; -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; /** * Represents vApp creation parameters. - *

- *

- *

Java class for VAppCreationParams complex type. - *

- *

The following schema fragment specifies the expected content contained within this class. - *

+ * *

- * <complexType name="VAppCreationParams">
- *   <complexContent>
- *     <extension base="{http://www.vmware.com/vcloud/v1.5}ParamsType">
- *       <sequence>
- *         <element name="VAppParent" type="{http://www.vmware.com/vcloud/v1.5}ReferenceType" minOccurs="0"/>
- *         <element name="InstantiationParams" type="{http://www.vmware.com/vcloud/v1.5}InstantiationParamsType" minOccurs="0"/>
- *       </sequence>
- *       <attribute name="deploy" type="{http://www.w3.org/2001/XMLSchema}boolean" />
- *       <attribute name="powerOn" type="{http://www.w3.org/2001/XMLSchema}boolean" />
- *       <anyAttribute processContents='lax' namespace='##other'/>
- *     </extension>
- *   </complexContent>
- * </complexType>
+ * <complexType name="VAppCreationParams" />
  * 
+ * + * @author grkvlt@apache.org */ -@XmlType(name = "VAppCreationParams", propOrder = { - "vAppParent", - "instantiationParams" -}) -@XmlSeeAlso({ -// InstantiateOvfParamsType.class, -// ComposeVAppParamsType.class, -// InstantiateVAppParamsType.class, -// ImportVmAsVAppParamsType.class -}) -public class VAppCreationParamsType> - extends ParamsType - -{ - public static > Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder().fromVAppCreationParamsType(this); - } +public class VAppCreationParamsType> extends ParamsType { public static class Builder> extends ParamsType.Builder { @@ -106,6 +69,22 @@ public class VAppCreationParamsType> return this; } + /** + * @see VAppCreationParamsType#isDeploy() + */ + public Builder deploy() { + this.deploy = Boolean.TRUE; + return this; + } + + /** + * @see VAppCreationParamsType#isDeploy() + */ + public Builder notDeploy() { + this.deploy = Boolean.FALSE; + return this; + } + /** * @see VAppCreationParamsType#isPowerOn() */ @@ -114,45 +93,68 @@ public class VAppCreationParamsType> return this; } + /** + * @see VAppCreationParamsType#isPowerOn() + */ + public Builder powerOn() { + this.powerOn = Boolean.TRUE; + return this; + } + /** + * @see VAppCreationParamsType#isPowerOn() + */ + public Builder notPowerOn() { + this.powerOn = Boolean.FALSE; + return this; + } + + @Override public VAppCreationParamsType build() { - return new VAppCreationParamsType(description, name, vAppParent, instantiationParams,deploy, powerOn); + VAppCreationParamsType vAppCreationParams = new VAppCreationParamsType(description, name, vAppParent, instantiationParams, deploy, powerOn); + return vAppCreationParams; } /** * @see ParamsType#getDescription() */ + @Override public Builder description(String description) { - super.description(description); + this.description = description; return this; } /** * @see ParamsType#getName() */ + @Override public Builder name(String name) { - super.name(name); + this.name = name; return this; } - /** - * {@inheritDoc} - */ - @SuppressWarnings("unchecked") @Override public Builder fromParamsType(ParamsType in) { return Builder.class.cast(super.fromParamsType(in)); } public Builder fromVAppCreationParamsType(VAppCreationParamsType in) { - return fromParamsType(in) - .vAppParent(in.getVAppParent()) - .instantiationParams(in.getInstantiationParams()) - .deploy(in.isDeploy()) - .powerOn(in.isPowerOn()); + return fromParamsType(in).vAppParent(in.getVAppParent()).instantiationParams(in.getInstantiationParams()).deploy(in.isDeploy()).powerOn(in.isPowerOn()); } } + protected VAppCreationParamsType() { + // For JAXB and builder use + } + + public VAppCreationParamsType(String description, String name, Reference vAppParent, InstantiationParams instantiationParams, Boolean deploy, Boolean powerOn) { + super(description, name); + this.vAppParent = vAppParent; + this.instantiationParams = instantiationParams; + this.deploy = deploy; + this.powerOn = powerOn; + } + @XmlElement(name = "VAppParent") protected Reference vAppParent; @XmlElement(name = "InstantiationParams") @@ -162,24 +164,8 @@ public class VAppCreationParamsType> @XmlAttribute protected Boolean powerOn; - public VAppCreationParamsType(String description, String name, Reference vAppParent, - InstantiationParams instantiationParams, Boolean deploy, Boolean powerOn) { - super(description, name); - this.vAppParent = vAppParent; - this.instantiationParams = instantiationParams; - this.deploy = deploy; - this.powerOn = powerOn; - } - - protected VAppCreationParamsType() { - // for JAXB - } - /** * Gets the value of the vAppParent property. - * - * @return possible object is - * {@link Reference } */ public Reference getVAppParent() { return vAppParent; @@ -187,9 +173,6 @@ public class VAppCreationParamsType> /** * Gets the value of the instantiationParams property. - * - * @return possible object is - * {@link InstantiationParams } */ public InstantiationParams getInstantiationParams() { return instantiationParams; @@ -197,9 +180,6 @@ public class VAppCreationParamsType> /** * Gets the value of the deploy property. - * - * @return possible object is - * {@link Boolean } */ public Boolean isDeploy() { return deploy; @@ -207,9 +187,6 @@ public class VAppCreationParamsType> /** * Gets the value of the powerOn property. - * - * @return possible object is - * {@link Boolean } */ public Boolean isPowerOn() { return powerOn; @@ -222,7 +199,8 @@ public class VAppCreationParamsType> if (o == null || getClass() != o.getClass()) return false; VAppCreationParamsType that = VAppCreationParamsType.class.cast(o); - return equal(vAppParent, that.vAppParent) && + return super.equals(that) && + equal(vAppParent, that.vAppParent) && equal(instantiationParams, that.instantiationParams) && equal(deploy, that.deploy) && equal(powerOn, that.powerOn); @@ -230,19 +208,15 @@ public class VAppCreationParamsType> @Override public int hashCode() { - return Objects.hashCode(vAppParent, - instantiationParams, - deploy, - powerOn); + return Objects.hashCode(super.hashCode(), vAppParent, instantiationParams, deploy, powerOn); } @Override - public String toString() { + public ToStringHelper string() { return Objects.toStringHelper("") .add("vAppParent", vAppParent) .add("instantiationParams", instantiationParams) .add("deploy", deploy) - .add("powerOn", powerOn).toString(); + .add("powerOn", powerOn); } - } diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/VAppNetwork.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/VAppNetwork.java new file mode 100644 index 0000000000..8b53bd8b79 --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/VAppNetwork.java @@ -0,0 +1,235 @@ +/** + * 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.*; +import static com.google.common.base.Preconditions.*; + +import java.net.URI; +import java.util.Set; + +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlType; + +import org.jclouds.javax.annotation.Nullable; + +import com.google.common.base.Objects; +import com.google.common.base.Objects.ToStringHelper; +import com.google.common.collect.Sets; + +/** + * Represents a vApp network. + * + *
+ * <complexType name="VAppNetwork" />
+ * 
+ */ +@XmlType(name = "VAppNetwork") +public class VAppNetwork extends NetworkType { + + @SuppressWarnings("unchecked") + public static Builder builder() { + return new Builder(); + } + + @Override + public Builder toBuilder() { + return new Builder().fromVAppNetwork(this); + } + + public static class Builder extends NetworkType.Builder { + + private Boolean deployed; + + /** + * @see VAppNetwork#isDeployed() + */ + public Builder isDeployed(Boolean deployed) { + this.deployed = deployed; + return this; + } + + /** + * @see VAppNetwork#isDeployed() + */ + public Builder deployed() { + this.deployed = Boolean.TRUE; + return this; + } + + /** + * @see VAppNetwork#isDeployed() + */ + public Builder notDeployed() { + this.deployed = Boolean.FALSE; + return this; + } + + @Override + public VAppNetwork build() { + VAppNetwork vAppNetwork = new VAppNetwork(href, type, links, description, tasks, id, name, networkConfiguration); + vAppNetwork.deployed = deployed; + return vAppNetwork; + } + + /** + * @see NetworkType#getConfiguration() + */ + @Override + public Builder configuration(NetworkConfiguration networkConfiguration) { + this.networkConfiguration = networkConfiguration; + return this; + } + + /** + * @see EntityType#getName() + */ + @Override + public Builder name(String name) { + this.name = name; + return this; + } + + /** + * @see EntityType#getDescription() + */ + @Override + public Builder description(String description) { + this.description = description; + return this; + } + + /** + * @see EntityType#getId() + */ + @Override + public Builder id(String id) { + this.id = id; + return this; + } + + /** + * @see EntityType#getTasks() + */ + @Override + public Builder tasks(Set tasks) { + if (checkNotNull(tasks, "tasks").size() > 0) + this.tasks = Sets.newLinkedHashSet(tasks); + return this; + } + + /** + * @see EntityType#getTasks() + */ + @Override + public Builder task(Task task) { + if (tasks == null) + tasks = Sets.newLinkedHashSet(); + this.tasks.add(checkNotNull(task, "task")); + return this; + } + + /** + * @see ResourceType#getHref() + */ + @Override + public Builder href(URI href) { + this.href = href; + return this; + } + + /** + * @see ResourceType#getType() + */ + @Override + public Builder type(String type) { + this.type = type; + return this; + } + + /** + * @see ResourceType#getLinks() + */ + @Override + public Builder links(Set links) { + if (checkNotNull(links, "links").size() > 0) + this.links = Sets.newLinkedHashSet(links); + return this; + } + + /** + * @see ResourceType#getLinks() + */ + @Override + public Builder link(Link link) { + if (links == null) + links = Sets.newLinkedHashSet(); + this.links.add(checkNotNull(link, "link")); + return this; + } + + @Override + public Builder fromNetworkType(NetworkType in) { + return Builder.class.cast(super.fromNetworkType(in)); + } + + public Builder fromVAppNetwork(VAppNetwork in) { + return fromNetworkType(in).isDeployed(in.isDeployed()); + } + } + + protected VAppNetwork() { + // For JAXB and builder use + } + + public VAppNetwork(URI href, String type, @Nullable Set links, String description, @Nullable Set tasks, String id, String name, NetworkConfiguration networkConfiguration) { + super(href, type, links, description, tasks, id, name, networkConfiguration); + } + + @XmlAttribute + protected Boolean deployed; + + /** + * Gets the value of the deployed property. + */ + public Boolean isDeployed() { + return deployed; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + VAppNetwork that = VAppNetwork.class.cast(o); + return super.equals(that) && equal(this.deployed, that.deployed); + } + + @Override + public int hashCode() { + return Objects.hashCode(super.hashCode(), deployed); + } + + @Override + public ToStringHelper string() { + return super.string().add("deployed", deployed); + } +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/VAppNetworkConfiguration.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/VAppNetworkConfiguration.java index b8c6517025..7a535468ae 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/VAppNetworkConfiguration.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/VAppNetworkConfiguration.java @@ -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 @@ -16,11 +16,10 @@ * 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 static com.google.common.base.Objects.*; +import static com.google.common.base.Preconditions.*; import java.net.URI; import java.util.Set; @@ -30,40 +29,20 @@ import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; import com.google.common.base.Objects; +import com.google.common.base.Objects.ToStringHelper; import com.google.common.collect.Sets; - /** * Represents a VApp network configuration. - *

- *

- *

Java class for VAppNetworkConfiguration complex type. - *

- *

The following schema fragment specifies the expected content contained within this class. - *

+ * *

- * <complexType name="VAppNetworkConfiguration">
- *   <complexContent>
- *     <extension base="{http://www.vmware.com/vcloud/v1.5}ResourceType">
- *       <sequence>
- *         <element name="Description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- *         <element name="Configuration" type="{http://www.vmware.com/vcloud/v1.5}NetworkConfigurationType"/>
- *         <element name="IsDeployed" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
- *       </sequence>
- *       <attribute name="networkName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <anyAttribute processContents='lax' namespace='##other'/>
- *     </extension>
- *   </complexContent>
- * </complexType>
+ * <complexType name="VAppNetworkConfiguration" />
  * 
*/ -@XmlType(name = "VAppNetworkConfiguration", propOrder = { - "description", - "configuration", - "isDeployed" -}) +@XmlType(name = "VAppNetworkConfiguration") public class VAppNetworkConfiguration extends ResourceType { - public static Builder builder() { + + public static Builder builder() { return new Builder(); } @@ -76,7 +55,7 @@ public class VAppNetworkConfiguration extends ResourceType in) { return Builder.class.cast(super.fromResourceType(in)); } @@ -176,7 +153,7 @@ public class VAppNetworkConfiguration extends ResourceType - *

- *

Java class for VAppTemplate complex type. - *

- *

The following schema fragment specifies the expected content contained within this class. - *

+ * *

- * <complexType name="VAppTemplate">
- *   <complexContent>
- *     <extension base="{http://www.vmware.com/vcloud/v1.5}ResourceEntityType">
- *       <sequence>
- *         <element name="Owner" type="{http://www.vmware.com/vcloud/v1.5}OwnerType" minOccurs="0"/>
- *         <element name="Children" type="{http://www.vmware.com/vcloud/v1.5}VAppTemplateChildrenType" minOccurs="0"/>
- *         <element ref="{http://schemas.dmtf.org/ovf/envelope/1}Section" maxOccurs="unbounded" minOccurs="0"/>
- *         <element name="VAppScopedLocalId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- *       </sequence>
- *       <attribute name="ovfDescriptorUploaded" type="{http://www.w3.org/2001/XMLSchema}boolean" />
- *       <attribute name="goldMaster" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
- *       <anyAttribute processContents='lax' namespace='##other'/>
- *     </extension>
- *   </complexContent>
- * </complexType>
+ * <complexType name="VAppTemplate" />
  * 
*/ @XmlRootElement(name = "VAppTemplate") -@XmlType(propOrder = { - "owner", - "children", - "sections", - "vAppScopedLocalId" -}) public class VAppTemplate extends ResourceEntityType { + public static Builder builder() { return new Builder(); } diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/VMWareTools.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/VMWareTools.java new file mode 100644 index 0000000000..f32573a54f --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/VMWareTools.java @@ -0,0 +1,105 @@ +/* + * 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.*; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlType; + +import com.google.common.base.Objects; + +/** + * @author grkvlt@apache.org + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "VMWareTools") +public class VMWareTools { + + public static Builder builder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder().fromVMWareTools(this); + } + + public static class Builder { + + private String version; + + /** + * @see VMWareTools#getVersion() + */ + public Builder version(String version) { + this.version = version; + return this; + } + + public VMWareTools build() { + VMWareTools vmWareTools = new VMWareTools(version); + return vmWareTools; + } + + public Builder fromVMWareTools(VMWareTools in) { + return version(in.getVersion()); + } + } + + @XmlAttribute(required = true) + protected String version; + + protected VMWareTools() { + // For JAXB and builder use + } + + public VMWareTools(String version) { + this.version = version; + } + + /** + * Gets the value of the version property. + */ + public String getVersion() { + return version; + } + + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + VMWareTools that = VMWareTools.class.cast(o); + return equal(this.version, that.version); + } + + @Override + public int hashCode() { + return Objects.hashCode(version); + } + + @Override + public String toString() { + return Objects.toStringHelper("").add("version", version).toString(); + } +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Vm.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Vm.java new file mode 100644 index 0000000000..e1a268b7d6 --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Vm.java @@ -0,0 +1,333 @@ +/* + * 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.*; +import static com.google.common.base.Preconditions.*; + +import java.net.URI; +import java.util.List; +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.javax.annotation.Nullable; +import org.jclouds.vcloud.director.v1_5.domain.ovf.SectionType; +import org.jclouds.vcloud.director.v1_5.domain.ovf.environment.EnvironmentType; + +import com.google.common.base.Objects; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; + +/** + * Represents a VM. + * + *
+ * <complexType name="Vm" />
+ * 
+ * + * @author grkvlt@apache.org + */ +@XmlType(name = "Vm") +public class Vm extends AbstractVAppType { + + public static Builder builder() { + return new Builder(); + } + + @Override + public Builder toBuilder() { + return new Builder().fromVm(this); + } + + public static class Builder extends AbstractVAppType.Builder { + + private String vAppScopedLocalId; + private EnvironmentType environment; + private Boolean needsCustomization; + + /** + * @see Vm#getVAppScopedLocalId() + */ + public Builder vAppScopedLocalId(String vAppScopedLocalId) { + this.vAppScopedLocalId = vAppScopedLocalId; + return this; + } + + /** + * @see Vm#getEnvironment() + */ + public Builder environment(EnvironmentType environment) { + this.environment = environment; + return this; + } + + /** + * @see Vm#getNeedsCustomization() + */ + public Builder isNeedsCustomization(Boolean needsCustomization) { + this.needsCustomization = needsCustomization; + return this; + } + + /** + * @see Vm#getNeedsCustomization() + */ + public Builder needsCustomization() { + this.needsCustomization = Boolean.TRUE; + return this; + } + + /** + * @see Vm#getNeedsCustomization() + */ + public Builder notNeedsCustomization() { + this.needsCustomization = Boolean.FALSE; + return this; + } + + @Override + public Vm build() { + Vm vm = new Vm(href, type, links, description, tasks, id, name, files, status, vAppParent, sections, deployed, vAppScopedLocalId, environment, needsCustomization); + return vm; + } + + /** + * @see AbstractVAppType#isDeployed() + */ + @Override + public Builder isDeployed(Boolean deployed) { + this.deployed = deployed; + return this; + } + + /** + * @see AbstractVAppType#isDeployed() + */ + @Override + public Builder deployed() { + this.deployed = Boolean.TRUE; + return this; + } + + /** + * @see AbstractVAppType#isDeployed() + */ + @Override + public Builder notDeployed() { + this.deployed = Boolean.FALSE; + return this; + } + + /** + * @see AbstractVAppType#getVAppParent() + */ + @Override + public Builder parent(Reference vAppParent) { + this.vAppParent = vAppParent; + return this; + } + + /** + * @see AbstractVAppType#getSections() + */ + @Override + public Builder sections(List> sections) { + if (checkNotNull(sections, "sections").size() > 0) + this.sections = Lists.newArrayList(sections); + return this; + } + + /** + * @see AbstractVAppType#getSections() + */ + @Override + public Builder section(SectionType section) { + if (this.sections == null) + this.sections = Lists.newArrayList(); + this.sections.add(checkNotNull(section, "section")); + return this; + } + + /** + * @see ResourceEntityType#getFiles() + */ + @Override + public Builder files(FilesList files) { + this.files = files; + return this; + } + + /** + * @see ResourceEntityType#getStatus() + */ + @Override + public Builder status(Integer status) { + this.status = status; + return this; + } + + /** + * @see EntityType#getId() + */ + @Override + public Builder id(String id) { + this.id = id; + return this; + } + + /** + * @see EntityType#getTasks() + */ + @Override + public Builder tasks(Set tasks) { + if (checkNotNull(tasks, "tasks").size() > 0) + this.tasks = Sets.newLinkedHashSet(tasks); + return this; + } + + /** + * @see EntityType#getTasks() + */ + @Override + public Builder task(Task task) { + if (tasks == null) + tasks = Sets.newLinkedHashSet(); + this.tasks.add(checkNotNull(task, "task")); + return this; + } + + /** + * @see ReferenceType#getHref() + */ + @Override + public Builder href(URI href) { + this.href = href; + return this; + } + + /** + * @see ReferenceType#getType() + */ + @Override + public Builder type(String type) { + this.type = type; + return this; + } + + /** + * @see ResourceType#getLinks() + */ + @Override + public Builder links(Set links) { + if (checkNotNull(links, "links").size() > 0) + this.links = Sets.newLinkedHashSet(links); + return this; + } + + /** + * @see ResourceType#getLinks() + */ + @Override + public Builder link(Link link) { + if (links == null) + links = Sets.newLinkedHashSet(); + this.links.add(checkNotNull(link, "link")); + return this; + } + + @Override + public Builder fromAbstractVAppType(AbstractVAppType in) { + return Builder.class.cast(super.fromAbstractVAppType(in)); + } + + public Builder fromVm(Vm in) { + return fromAbstractVAppType(in).vAppScopedLocalId(in.getVAppScopedLocalId()).environment(in.getEnvironment()).isNeedsCustomization(in.isNeedsCustomization()); + } + } + + protected Vm() { + // for JAXB and Builders + } + + public Vm(URI href, String type, @Nullable Set links, String description, @Nullable Set tasks, String id, String name, FilesList files, Integer status, Reference vAppParent, + @Nullable List> sections, Boolean deployed, String vAppScopedlocalId, EnvironmentType environment, Boolean needsCustomization) { + super(href, type, links, description, tasks, id, name, files, status, vAppParent, sections, deployed); + this.vAppScopedLocalId = vAppScopedlocalId; + this.environment = environment; + this.needsCustomization = needsCustomization; + } + + @XmlElement(name = "VAppScopedLocalId") + protected String vAppScopedLocalId; + @XmlElement(name = "Environment", namespace = "http://schemas.dmtf.org/ovf/environment/1") + protected EnvironmentType environment; + @XmlAttribute + protected Boolean needsCustomization; + + /** + * Gets the value of the vAppScopedLocalId property. + * + * @return possible object is {@link String } + */ + public String getVAppScopedLocalId() { + return vAppScopedLocalId; + } + + /** + * OVF environment section + * + * @return possible object is {@link Environment } + */ + public EnvironmentType getEnvironment() { + return environment; + } + + /** + * Gets the value of the needsCustomization property. + * + * @return possible object is {@link Boolean } + */ + public Boolean isNeedsCustomization() { + return needsCustomization; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + Vm that = Vm.class.cast(o); + return super.equals(that) && + equal(this.vAppScopedLocalId, that.vAppScopedLocalId) && equal(this.environment, that.environment) && equal(this.needsCustomization, that.needsCustomization); + } + + @Override + public int hashCode() { + return Objects.hashCode(super.hashCode(), vAppScopedLocalId, environment, needsCustomization); + } + + @Override + public ToStringHelper string() { + return super.string().add("vAppScopedLocalId", vAppScopedLocalId).add("environment", environment).add("needsCustomization", needsCustomization); + } +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/VmPendingQuestion.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/VmPendingQuestion.java new file mode 100644 index 0000000000..b350ee9baa --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/VmPendingQuestion.java @@ -0,0 +1,200 @@ +/* + * 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.*; +import static com.google.common.base.Preconditions.*; + +import java.net.URI; +import java.util.List; +import java.util.Set; + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +import com.google.common.base.Objects; +import com.google.common.base.Objects.ToStringHelper; +import com.google.common.collect.Sets; + +/** + * Represents a question which vSphere issued for a VM in a stuck state(WAITING_FOR_INPUT). It has a question element, a question ID + * element, and a list of choices with at least one element. + * + *
+ * <complexType name="VmPendingQuestion" />
+ * 
+ * + * @author grkvlt@apache.org + */ +@XmlType(name = "VmPendingQuestion") +public class VmPendingQuestion extends ResourceType { + + public static Builder builder() { + return new Builder(); + } + + @Override + public Builder toBuilder() { + return new Builder().fromVmPendingQuestion(this); + } + + public static class Builder extends ResourceType.Builder { + + private String question; + private String questionId; + private List choices; + + /** + * @see VmPendingQuestion#getQuestion() + */ + public Builder question(String question) { + this.question = question; + return this; + } + + /** + * @see VmPendingQuestion#getQuestionId() + */ + public Builder questionId(String questionId) { + this.questionId = questionId; + return this; + } + + /** + * @see VmPendingQuestion#getChoices() + */ + public Builder choices(List choices) { + this.choices = choices; + return this; + } + + @Override + public VmPendingQuestion build() { + VmPendingQuestion vmPendingQuestion = new VmPendingQuestion(href, type, links, question, questionId, choices); + return vmPendingQuestion; + } + + /** + * @see ResourceType#getHref() + */ + @Override + public Builder href(URI href) { + super.href(href); + return this; + } + + /** + * @see ResourceType#getType() + */ + @Override + public Builder type(String type) { + super.type(type); + return this; + } + + /** + * @see ResourceType#getLinks() + */ + @Override + public Builder links(Set links) { + super.links(Sets.newLinkedHashSet(checkNotNull(links, "links"))); + return this; + } + + /** + * @see ResourceType#getLinks() + */ + @Override + public Builder link(Link link) { + super.link(link); + return this; + } + + @Override + public Builder fromResourceType(ResourceType in) { + return Builder.class.cast(super.fromResourceType(in)); + } + + public Builder fromVmPendingQuestion(VmPendingQuestion in) { + return fromResourceType(in).question(in.getQuestion()).questionId(in.getQuestionId()).choices(in.getChoices()); + } + } + + protected VmPendingQuestion() { + // For JAXB and builder use + } + + public VmPendingQuestion(URI href, String type, Set links, String question, String questionId, List choices) { + super(href, type, links); + this.question = question; + this.questionId = questionId; + this.choices = choices; + } + + @XmlElement(name = "Question", required = true) + protected String question; + @XmlElement(name = "QuestionId", required = true) + protected String questionId; + @XmlElement(name = "Choices", required = true) + protected List choices; + + /** + * Gets the value of the question property. + */ + public String getQuestion() { + return question; + } + + /** + * Gets the value of the questionId property. + */ + public String getQuestionId() { + return questionId; + } + + /** + * Gets the value of the choices property. + */ + public List getChoices() { + return choices; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + VmPendingQuestion that = VmPendingQuestion.class.cast(o); + return super.equals(that) && + equal(this.question, that.question) && equal(this.questionId, that.questionId) && equal(this.choices, that.choices); + } + + @Override + public int hashCode() { + return Objects.hashCode(super.hashCode(), question, questionId, choices); + } + + @Override + public ToStringHelper string() { + return super.string().add("question", question).add("questionId", questionId).add("choices", choices); + } + +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/VmQuestionAnswer.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/VmQuestionAnswer.java new file mode 100644 index 0000000000..5066cda843 --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/VmQuestionAnswer.java @@ -0,0 +1,107 @@ +/** + * Licensed to jclouds, Inc. (jclouds) under one or more + * contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. jclouds licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.jclouds.vcloud.director.v1_5.domain; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + * + * Represents a VM answer to a question when the VM is in a stuck + * (WAITING_FOR_INPUT) state. + * + * + *

Java class for VmQuestionAnswer complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="VmQuestionAnswer">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="ChoiceId" type="{http://www.w3.org/2001/XMLSchema}int"/>
+ *         <element name="QuestionId" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "VmQuestionAnswer", propOrder = { + "choiceId", + "questionId" +}) +public class VmQuestionAnswer { + + // TODO builder + + @XmlElement(name = "ChoiceId") + protected int choiceId; + @XmlElement(name = "QuestionId", required = true) + protected String questionId; + + /** + * Gets the value of the choiceId property. + * + */ + public int getChoiceId() { + return choiceId; + } + + /** + * Sets the value of the choiceId property. + * + */ + public void setChoiceId(int value) { + this.choiceId = value; + } + + /** + * Gets the value of the questionId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getQuestionId() { + return questionId; + } + + /** + * Sets the value of the questionId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setQuestionId(String value) { + this.questionId = value; + } + +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/VmQuestionAnswerChoice.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/VmQuestionAnswerChoice.java new file mode 100644 index 0000000000..dc3c790baf --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/VmQuestionAnswerChoice.java @@ -0,0 +1,104 @@ +/** + * Licensed to jclouds, Inc. (jclouds) under one or more + * contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. jclouds licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.jclouds.vcloud.director.v1_5.domain; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + * + * Represents a pair of ID and text of an answer choice of a VM question. + * + * + *

Java class for VmQuestionAnswerChoice complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="VmQuestionAnswerChoice">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="Id" type="{http://www.w3.org/2001/XMLSchema}int"/>
+ *         <element name="Text" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "VmQuestionAnswerChoice", propOrder = { + "id", + "text" +}) +public class VmQuestionAnswerChoice { + + @XmlElement(name = "Id") + protected int id; + @XmlElement(name = "Text") + protected String text; + + /** + * Gets the value of the id property. + * + */ + public int getId() { + return id; + } + + /** + * Sets the value of the id property. + * + */ + public void setId(int value) { + this.id = value; + } + + /** + * Gets the value of the text property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getText() { + return text; + } + + /** + * Sets the value of the text property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setText(String value) { + this.text = value; + } + +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/AutomaticRecoveryAction.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/AutomaticRecoveryAction.java new file mode 100644 index 0000000000..fa461c2415 --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/AutomaticRecoveryAction.java @@ -0,0 +1,33 @@ +/* + * Licensed to jclouds, Inc. (jclouds) under one or more + * contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. jclouds licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.jclouds.vcloud.director.v1_5.domain.cim; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + +/** + * Java class for anonymous complex type. + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "") +public class AutomaticRecoveryAction extends CimAnySimpleType { + + +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/AutomaticShutdownAction.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/AutomaticShutdownAction.java new file mode 100644 index 0000000000..82a87d7311 --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/AutomaticShutdownAction.java @@ -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. + */ +package org.jclouds.vcloud.director.v1_5.domain.cim; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + +/** + * Java class for anonymous complex type. + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "") +public class AutomaticShutdownAction + extends CimAnySimpleType +{ + + +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/AutomaticStartupAction.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/AutomaticStartupAction.java new file mode 100644 index 0000000000..25366e010d --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/AutomaticStartupAction.java @@ -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. + */ +package org.jclouds.vcloud.director.v1_5.domain.cim; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + +/** + * Java class for anonymous complex type. + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "") +public class AutomaticStartupAction + extends CimAnySimpleType +{ + + +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/CIMResourceAllocationSettingDataType.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/CIMResourceAllocationSettingDataType.java new file mode 100644 index 0000000000..0462b22f42 --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/CIMResourceAllocationSettingDataType.java @@ -0,0 +1,785 @@ +/* + * Licensed to jclouds, Inc. (jclouds) under one or more + * contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. jclouds licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.jclouds.vcloud.director.v1_5.domain.cim; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyAttribute; +import javax.xml.bind.annotation.XmlAnyElement; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlElementRef; +import javax.xml.bind.annotation.XmlType; +import javax.xml.namespace.QName; + +/** + * Java class for CIM_ResourceAllocationSettingData_Type complex type. + * + *
+ * <complexType name="CIM_ResourceAllocationSettingData_Type" />
+ * 
+ */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CIM_ResourceAllocationSettingData_Type", namespace = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData") +public class CIMResourceAllocationSettingDataType { + + @XmlElement(name = "Address", nillable = true) + protected CimString address; + @XmlElement(name = "AddressOnParent", nillable = true) + protected CimString addressOnParent; + @XmlElement(name = "AllocationUnits", nillable = true) + protected CimString allocationUnits; + @XmlElement(name = "AutomaticAllocation", nillable = true) + protected CimBoolean automaticAllocation; + @XmlElement(name = "AutomaticDeallocation", nillable = true) + protected CimBoolean automaticDeallocation; + @XmlElementRef(name = "Caption", namespace = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData", type = ResourceAllocationCaption.class) + protected ResourceAllocationCaption caption; + @XmlElementRef(name = "ChangeableType", namespace = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData", type = ResourceAllocationChangeableType.class) + protected ResourceAllocationChangeableType changeableType; + @XmlElement(name = "ConfigurationName", nillable = true) + protected CimString configurationName; + @XmlElement(name = "Connection", nillable = true) + protected List connection; + @XmlElement(name = "ConsumerVisibility", nillable = true) + protected ConsumerVisibility consumerVisibility; + @XmlElement(name = "Description", nillable = true) + protected CimString description; + @XmlElement(name = "ElementName", required = true) + protected CimString elementName; + @XmlElement(name = "Generation", nillable = true) + protected CimUnsignedLong generation; + @XmlElement(name = "HostResource", nillable = true) + protected List hostResource; + @XmlElement(name = "InstanceID", required = true) + protected CimString instanceID; + @XmlElement(name = "Limit", nillable = true) + protected CimUnsignedLong limit; + @XmlElement(name = "MappingBehavior", nillable = true) + protected MappingBehavior mappingBehavior; + @XmlElement(name = "OtherResourceType", nillable = true) + protected CimString otherResourceType; + @XmlElement(name = "Parent", nillable = true) + protected CimString parent; + @XmlElement(name = "PoolID", nillable = true) + protected CimString poolID; + @XmlElement(name = "Reservation", nillable = true) + protected CimUnsignedLong reservation; + @XmlElement(name = "ResourceSubType", nillable = true) + protected CimString resourceSubType; + @XmlElement(name = "ResourceType", nillable = true) + protected ResourceType resourceType; + @XmlElement(name = "VirtualQuantity", nillable = true) + protected CimUnsignedLong virtualQuantity; + @XmlElement(name = "VirtualQuantityUnits", nillable = true) + protected CimString virtualQuantityUnits; + @XmlElement(name = "Weight", nillable = true) + protected CimUnsignedInt weight; + @XmlAnyElement(lax = true) + protected List any; + @XmlAnyAttribute + private Map otherAttributes = new HashMap(); + + /** + * Gets the value of the address property. + * + * @return + * possible object is + * {@link CimString } + * + */ + public CimString getAddress() { + return address; + } + + /** + * Sets the value of the address property. + * + * @param value + * allowed object is + * {@link CimString } + * + */ + public void setAddress(CimString value) { + this.address = value; + } + + /** + * Gets the value of the addressOnParent property. + * + * @return + * possible object is + * {@link CimString } + * + */ + public CimString getAddressOnParent() { + return addressOnParent; + } + + /** + * Sets the value of the addressOnParent property. + * + * @param value + * allowed object is + * {@link CimString } + * + */ + public void setAddressOnParent(CimString value) { + this.addressOnParent = value; + } + + /** + * Gets the value of the allocationUnits property. + * + * @return + * possible object is + * {@link CimString } + * + */ + public CimString getAllocationUnits() { + return allocationUnits; + } + + /** + * Sets the value of the allocationUnits property. + * + * @param value + * allowed object is + * {@link CimString } + * + */ + public void setAllocationUnits(CimString value) { + this.allocationUnits = value; + } + + /** + * Gets the value of the automaticAllocation property. + * + * @return + * possible object is + * {@link CimBoolean } + * + */ + public CimBoolean getAutomaticAllocation() { + return automaticAllocation; + } + + /** + * Sets the value of the automaticAllocation property. + * + * @param value + * allowed object is + * {@link CimBoolean } + * + */ + public void setAutomaticAllocation(CimBoolean value) { + this.automaticAllocation = value; + } + + /** + * Gets the value of the automaticDeallocation property. + * + * @return + * possible object is + * {@link CimBoolean } + * + */ + public CimBoolean getAutomaticDeallocation() { + return automaticDeallocation; + } + + /** + * Sets the value of the automaticDeallocation property. + * + * @param value + * allowed object is + * {@link CimBoolean } + * + */ + public void setAutomaticDeallocation(CimBoolean value) { + this.automaticDeallocation = value; + } + + /** + * Gets the value of the caption property. + * + * @return + * possible object is + * {@link ResourceAllocationCaption } + * + */ + public ResourceAllocationCaption getCaption() { + return caption; + } + + /** + * Sets the value of the caption property. + * + * @param value + * allowed object is + * {@link ResourceAllocationCaption } + * + */ + public void setCaption(ResourceAllocationCaption value) { + this.caption = value; + } + + /** + * Gets the value of the changeableType property. + * + * @return + * possible object is + * {@link ResourceAllocationChangeableType } + * + */ + public ResourceAllocationChangeableType getChangeableType() { + return changeableType; + } + + /** + * Sets the value of the changeableType property. + * + * @param value + * allowed object is + * {@link ResourceAllocationChangeableType } + * + */ + public void setChangeableType(ResourceAllocationChangeableType value) { + this.changeableType = value; + } + + /** + * Gets the value of the configurationName property. + * + * @return + * possible object is + * {@link CimString } + * + */ + public CimString getConfigurationName() { + return configurationName; + } + + /** + * Sets the value of the configurationName property. + * + * @param value + * allowed object is + * {@link CimString } + * + */ + public void setConfigurationName(CimString value) { + this.configurationName = value; + } + + /** + * Gets the value of the connection property. + * + *

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

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

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

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

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

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

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

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

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

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

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

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

+ * the map is keyed by the name of the attribute and + * the value is the string value of the attribute. + * + * the map returned by this method is live, and you can add new attribute + * by updating the map directly. Because of this design, there's no setter. + * + * + * @return + * always non-null + */ + public Map getOtherAttributes() { + return otherAttributes; + } + +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/CimAnySimpleType.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/CimAnySimpleType.java new file mode 100644 index 0000000000..be868d9a5f --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/CimAnySimpleType.java @@ -0,0 +1,93 @@ +/* + * Licensed to jclouds, Inc. (jclouds) under one or more + * contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. jclouds licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.jclouds.vcloud.director.v1_5.domain.cim; + +import java.util.HashMap; +import java.util.Map; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyAttribute; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlValue; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import javax.xml.namespace.QName; + +/** + *

Java class for cimAnySimpleType complex type. + * + *

+ * <complexType name="cimAnySimpleType" />
+ * 
+ */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "cimAnySimpleType", namespace = "http://schemas.dmtf.org/wbem/wscim/1/common") +public class CimAnySimpleType { + + @XmlValue + @XmlJavaTypeAdapter(CimAnySimpleTypeAdapter.class) + @XmlSchemaType(name = "anySimpleType") + protected String value; + @XmlAnyAttribute + private Map otherAttributes = new HashMap(); + + /** + * Gets the value of the value property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getValue() { + return value; + } + + /** + * Sets the value of the value property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setValue(String value) { + this.value = value; + } + + /** + * Gets a map that contains attributes that aren't bound to any typed property on this class. + * + *

+ * the map is keyed by the name of the attribute and + * the value is the string value of the attribute. + * + * the map returned by this method is live, and you can add new attribute + * by updating the map directly. Because of this design, there's no setter. + * + * + * @return + * always non-null + */ + public Map getOtherAttributes() { + return otherAttributes; + } + +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/CimAnySimpleTypeAdapter.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/CimAnySimpleTypeAdapter.java new file mode 100644 index 0000000000..8eff91d360 --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/CimAnySimpleTypeAdapter.java @@ -0,0 +1,38 @@ +/* + * Licensed to jclouds, Inc. (jclouds) under one or more + * contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. jclouds licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.jclouds.vcloud.director.v1_5.domain.cim; + +import javax.xml.bind.annotation.adapters.XmlAdapter; + +public class CimAnySimpleTypeAdapter extends XmlAdapter { + + @Override + public String unmarshal(String value) { + return (javax.xml.bind.DatatypeConverter.parseAnySimpleType(value)); + } + + @Override + public String marshal(String value) { + if (value == null) { + return null; + } + return (javax.xml.bind.DatatypeConverter.printAnySimpleType(value)); + } + +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/CimBoolean.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/CimBoolean.java new file mode 100644 index 0000000000..984dbe453a --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/CimBoolean.java @@ -0,0 +1,81 @@ +/* + * Licensed to jclouds, Inc. (jclouds) under one or more + * contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. jclouds licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.jclouds.vcloud.director.v1_5.domain.cim; + +import java.util.HashMap; +import java.util.Map; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyAttribute; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlValue; +import javax.xml.namespace.QName; + +/** + * Java class for cimBoolean complex type. + * + *

+ * <complexType name="cimBoolean" />
+ * 
+ */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "cimBoolean", namespace = "http://schemas.dmtf.org/wbem/wscim/1/common") +public class CimBoolean { + + @XmlValue + protected boolean value; + @XmlAnyAttribute + private Map otherAttributes = new HashMap(); + + /** + * Gets the value of the value property. + * + */ + public boolean isValue() { + return value; + } + + /** + * Sets the value of the value property. + * + */ + public void setValue(boolean value) { + this.value = value; + } + + /** + * Gets a map that contains attributes that aren't bound to any typed property on this class. + * + *

+ * the map is keyed by the name of the attribute and + * the value is the string value of the attribute. + * + * the map returned by this method is live, and you can add new attribute + * by updating the map directly. Because of this design, there's no setter. + * + * + * @return + * always non-null + */ + public Map getOtherAttributes() { + return otherAttributes; + } + +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/CimReference.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/CimReference.java new file mode 100644 index 0000000000..855d0c80e0 --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/CimReference.java @@ -0,0 +1,97 @@ +/* + * Licensed to jclouds, Inc. (jclouds) under one or more + * contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. jclouds licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.jclouds.vcloud.director.v1_5.domain.cim; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyAttribute; +import javax.xml.bind.annotation.XmlAnyElement; +import javax.xml.bind.annotation.XmlType; +import javax.xml.namespace.QName; + +/** + * Java class for cimReference complex type. + * + *

+ * <complexType name="cimReference" />
+ * 
+ */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "cimReference", namespace = "http://schemas.dmtf.org/wbem/wscim/1/common") +public class CimReference { + + @XmlAnyElement(lax = true) + protected List any; + @XmlAnyAttribute + private Map otherAttributes = new HashMap(); + + /** + * Gets the value of the any property. + * + *

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

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

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

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

+ * the map is keyed by the name of the attribute and + * the value is the string value of the attribute. + * + * the map returned by this method is live, and you can add new attribute + * by updating the map directly. Because of this design, there's no setter. + * + * + * @return + * always non-null + */ + public Map getOtherAttributes() { + return otherAttributes; + } + +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/CimString.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/CimString.java new file mode 100644 index 0000000000..cfb6391906 --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/CimString.java @@ -0,0 +1,91 @@ +/* + * Licensed to jclouds, Inc. (jclouds) under one or more + * contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. jclouds licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.jclouds.vcloud.director.v1_5.domain.cim; + +import java.util.HashMap; +import java.util.Map; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyAttribute; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlValue; +import javax.xml.namespace.QName; + +/** + * Java class for cimString complex type. + * + *

+ * <complexType name="cimString" />
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "cimString", namespace = "http://schemas.dmtf.org/wbem/wscim/1/common") +public class CimString { + + @XmlValue + protected String value; + @XmlAnyAttribute + private Map otherAttributes = new HashMap(); + + /** + * Gets the value of the value property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getValue() { + return value; + } + + /** + * Sets the value of the value property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setValue(String value) { + this.value = value; + } + + /** + * Gets a map that contains attributes that aren't bound to any typed property on this class. + * + *

+ * the map is keyed by the name of the attribute and + * the value is the string value of the attribute. + * + * the map returned by this method is live, and you can add new attribute + * by updating the map directly. Because of this design, there's no setter. + * + * + * @return + * always non-null + */ + public Map getOtherAttributes() { + return otherAttributes; + } + +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/CimUnsignedInt.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/CimUnsignedInt.java new file mode 100644 index 0000000000..88bdceddf3 --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/CimUnsignedInt.java @@ -0,0 +1,83 @@ +/* + * Licensed to jclouds, Inc. (jclouds) under one or more + * contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. jclouds licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.jclouds.vcloud.director.v1_5.domain.cim; + +import java.util.HashMap; +import java.util.Map; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyAttribute; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlValue; +import javax.xml.namespace.QName; + +/** + * Java class for cimUnsignedInt complex type. + * + *

+ * <complexType name="cimUnsignedInt" />
+ * 
+ */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "cimUnsignedInt", namespace = "http://schemas.dmtf.org/wbem/wscim/1/common") +public class CimUnsignedInt { + + @XmlValue + @XmlSchemaType(name = "unsignedInt") + protected long value; + @XmlAnyAttribute + private Map otherAttributes = new HashMap(); + + /** + * Gets the value of the value property. + * + */ + public long getValue() { + return value; + } + + /** + * Sets the value of the value property. + * + */ + public void setValue(long value) { + this.value = value; + } + + /** + * Gets a map that contains attributes that aren't bound to any typed property on this class. + * + *

+ * the map is keyed by the name of the attribute and + * the value is the string value of the attribute. + * + * the map returned by this method is live, and you can add new attribute + * by updating the map directly. Because of this design, there's no setter. + * + * + * @return + * always non-null + */ + public Map getOtherAttributes() { + return otherAttributes; + } + +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/CimUnsignedLong.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/CimUnsignedLong.java new file mode 100644 index 0000000000..250611374a --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/CimUnsignedLong.java @@ -0,0 +1,91 @@ +/* + * Licensed to jclouds, Inc. (jclouds) under one or more + * contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. jclouds licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.jclouds.vcloud.director.v1_5.domain.cim; + +import java.math.BigInteger; +import java.util.HashMap; +import java.util.Map; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyAttribute; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlValue; +import javax.xml.namespace.QName; + +/** + * Java class for cimUnsignedLong complex type. + * + *

+ * <complexType name="cimUnsignedLong" />
+ * 
+ */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "cimUnsignedLong", namespace = "http://schemas.dmtf.org/wbem/wscim/1/common") +public class CimUnsignedLong { + + @XmlValue + @XmlSchemaType(name = "unsignedLong") + protected BigInteger value; + @XmlAnyAttribute + private Map otherAttributes = new HashMap(); + + /** + * Gets the value of the value property. + * + * @return + * possible object is + * {@link BigInteger } + * + */ + public BigInteger getValue() { + return value; + } + + /** + * Sets the value of the value property. + * + * @param value + * allowed object is + * {@link BigInteger } + * + */ + public void setValue(BigInteger value) { + this.value = value; + } + + /** + * Gets a map that contains attributes that aren't bound to any typed property on this class. + * + *

+ * the map is keyed by the name of the attribute and + * the value is the string value of the attribute. + * + * the map returned by this method is live, and you can add new attribute + * by updating the map directly. Because of this design, there's no setter. + * + * + * @return + * always non-null + */ + public Map getOtherAttributes() { + return otherAttributes; + } + +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/CimUnsignedShort.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/CimUnsignedShort.java new file mode 100644 index 0000000000..c17d8704f4 --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/CimUnsignedShort.java @@ -0,0 +1,90 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2012.02.08 at 02:47:44 PM GMT +// + + +package org.jclouds.vcloud.director.v1_5.domain.cim; + +import java.util.HashMap; +import java.util.Map; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyAttribute; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlValue; +import javax.xml.namespace.QName; + + +/** + *

Java class for cimUnsignedShort complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="cimUnsignedShort">
+ *   <simpleContent>
+ *     <extension base="<http://www.w3.org/2001/XMLSchema>unsignedShort">
+ *       <anyAttribute processContents='lax'/>
+ *     </extension>
+ *   </simpleContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "cimUnsignedShort", namespace = "http://schemas.dmtf.org/wbem/wscim/1/common", propOrder = { + "value" +}) +@XmlSeeAlso({ + VirtualSystemChangeableTypeType.class, + ResourceAllocationChangeableTypeType.class +}) +public class CimUnsignedShort { + + @XmlValue + @XmlSchemaType(name = "unsignedShort") + protected int value; + @XmlAnyAttribute + private Map otherAttributes = new HashMap(); + + /** + * Gets the value of the value property. + * + */ + public int getValue() { + return value; + } + + /** + * Sets the value of the value property. + * + */ + public void setValue(int value) { + this.value = value; + } + + /** + * Gets a map that contains attributes that aren't bound to any typed property on this class. + * + *

+ * the map is keyed by the name of the attribute and + * the value is the string value of the attribute. + * + * the map returned by this method is live, and you can add new attribute + * by updating the map directly. Because of this design, there's no setter. + * + * + * @return + * always non-null + */ + public Map getOtherAttributes() { + return otherAttributes; + } + +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/ConsumerVisibility.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/ConsumerVisibility.java new file mode 100644 index 0000000000..7bc11dd55c --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/ConsumerVisibility.java @@ -0,0 +1,33 @@ +/* + * Licensed to jclouds, Inc. (jclouds) under one or more + * contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. jclouds licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.jclouds.vcloud.director.v1_5.domain.cim; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + +/** + * Java class for anonymous complex type. + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "") +public class ConsumerVisibility extends CimAnySimpleType { + + +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/MappingBehavior.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/MappingBehavior.java new file mode 100644 index 0000000000..424727f447 --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/MappingBehavior.java @@ -0,0 +1,33 @@ +/* + * Licensed to jclouds, Inc. (jclouds) under one or more + * contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. jclouds licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.jclouds.vcloud.director.v1_5.domain.cim; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + +/** + * Java class for anonymous complex type. + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "") +public class MappingBehavior extends CimAnySimpleType { + + +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/ResourceAllocationCaption.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/ResourceAllocationCaption.java new file mode 100644 index 0000000000..e3b67859e0 --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/ResourceAllocationCaption.java @@ -0,0 +1,28 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2012.02.08 at 02:47:44 PM GMT +// + + +package org.jclouds.vcloud.director.v1_5.domain.cim; + +import javax.xml.bind.JAXBElement; +import javax.xml.namespace.QName; + +public class ResourceAllocationCaption + extends JAXBElement +{ + + protected final static QName NAME = new QName("http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData", "Caption"); + + public ResourceAllocationCaption(ResourceAllocationCaptionType value) { + super(NAME, ((Class) ResourceAllocationCaptionType.class), null, value); + } + + public ResourceAllocationCaption() { + super(NAME, ((Class) ResourceAllocationCaptionType.class), null, null); + } + +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/ResourceAllocationCaptionType.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/ResourceAllocationCaptionType.java new file mode 100644 index 0000000000..fa428defc7 --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/ResourceAllocationCaptionType.java @@ -0,0 +1,41 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2012.02.08 at 02:47:44 PM GMT +// + + +package org.jclouds.vcloud.director.v1_5.domain.cim; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <simpleContent>
+ *     <restriction base="<http://schemas.dmtf.org/wbem/wscim/1/common>cimString">
+ *       <anyAttribute processContents='lax'/>
+ *     </restriction>
+ *   </simpleContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "") +public class ResourceAllocationCaptionType + extends CimString +{ + + +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/ResourceAllocationChangeableType.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/ResourceAllocationChangeableType.java new file mode 100644 index 0000000000..25899c4686 --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/ResourceAllocationChangeableType.java @@ -0,0 +1,28 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2012.02.08 at 02:47:44 PM GMT +// + + +package org.jclouds.vcloud.director.v1_5.domain.cim; + +import javax.xml.bind.JAXBElement; +import javax.xml.namespace.QName; + +public class ResourceAllocationChangeableType + extends JAXBElement +{ + + protected final static QName NAME = new QName("http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData", "ChangeableType"); + + public ResourceAllocationChangeableType(ResourceAllocationChangeableTypeType value) { + super(NAME, ((Class) ResourceAllocationChangeableTypeType.class), null, value); + } + + public ResourceAllocationChangeableType() { + super(NAME, ((Class) ResourceAllocationChangeableTypeType.class), null, null); + } + +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/ResourceAllocationChangeableTypeType.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/ResourceAllocationChangeableTypeType.java new file mode 100644 index 0000000000..11521347e3 --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/ResourceAllocationChangeableTypeType.java @@ -0,0 +1,39 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2012.02.08 at 02:47:44 PM GMT +// + + +package org.jclouds.vcloud.director.v1_5.domain.cim; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <simpleContent>
+ *     <restriction base="<http://schemas.dmtf.org/wbem/wscim/1/common>cimUnsignedShort">
+ *       <anyAttribute processContents='lax'/>
+ *     </restriction>
+ *   </simpleContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "") +public class ResourceAllocationChangeableTypeType extends CimUnsignedShort { + + +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/ResourceType.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/ResourceType.java new file mode 100644 index 0000000000..73d17bc8f5 --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/ResourceType.java @@ -0,0 +1,41 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2012.02.08 at 02:47:44 PM GMT +// + + +package org.jclouds.vcloud.director.v1_5.domain.cim; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <simpleContent>
+ *     <restriction base="<http://schemas.dmtf.org/wbem/wscim/1/common>cimAnySimpleType">
+ *       <anyAttribute processContents='lax'/>
+ *     </restriction>
+ *   </simpleContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "") +public class ResourceType + extends CimAnySimpleType +{ + + +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/VirtualSystemCaption.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/VirtualSystemCaption.java new file mode 100644 index 0000000000..dd0148954f --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/VirtualSystemCaption.java @@ -0,0 +1,28 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2012.02.08 at 02:47:44 PM GMT +// + + +package org.jclouds.vcloud.director.v1_5.domain.cim; + +import javax.xml.bind.JAXBElement; +import javax.xml.namespace.QName; + +public class VirtualSystemCaption + extends JAXBElement +{ + + protected final static QName NAME = new QName("http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData", "Caption"); + + public VirtualSystemCaption(VirtualSystemCaptionType value) { + super(NAME, ((Class) VirtualSystemCaptionType.class), null, value); + } + + public VirtualSystemCaption() { + super(NAME, ((Class) VirtualSystemCaptionType.class), null, null); + } + +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/VirtualSystemCaptionType.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/VirtualSystemCaptionType.java new file mode 100644 index 0000000000..b08fd4f8af --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/VirtualSystemCaptionType.java @@ -0,0 +1,41 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2012.02.08 at 02:47:44 PM GMT +// + + +package org.jclouds.vcloud.director.v1_5.domain.cim; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <simpleContent>
+ *     <restriction base="<http://schemas.dmtf.org/wbem/wscim/1/common>cimString">
+ *       <anyAttribute processContents='lax'/>
+ *     </restriction>
+ *   </simpleContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "") +public class VirtualSystemCaptionType + extends CimString +{ + + +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/VirtualSystemChangeableType.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/VirtualSystemChangeableType.java new file mode 100644 index 0000000000..38441ba664 --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/VirtualSystemChangeableType.java @@ -0,0 +1,28 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2012.02.08 at 02:47:44 PM GMT +// + + +package org.jclouds.vcloud.director.v1_5.domain.cim; + +import javax.xml.bind.JAXBElement; +import javax.xml.namespace.QName; + +public class VirtualSystemChangeableType + extends JAXBElement +{ + + protected final static QName NAME = new QName("http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData", "ChangeableType"); + + public VirtualSystemChangeableType(VirtualSystemChangeableTypeType value) { + super(NAME, ((Class) VirtualSystemChangeableTypeType.class), null, value); + } + + public VirtualSystemChangeableType() { + super(NAME, ((Class) VirtualSystemChangeableTypeType.class), null, null); + } + +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/VirtualSystemChangeableTypeType.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/VirtualSystemChangeableTypeType.java new file mode 100644 index 0000000000..05eae9a478 --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/cim/VirtualSystemChangeableTypeType.java @@ -0,0 +1,41 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2012.02.08 at 02:47:44 PM GMT +// + + +package org.jclouds.vcloud.director.v1_5.domain.cim; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <simpleContent>
+ *     <restriction base="<http://schemas.dmtf.org/wbem/wscim/1/common>cimUnsignedShort">
+ *       <anyAttribute processContents='lax'/>
+ *     </restriction>
+ *   </simpleContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "") +public class VirtualSystemChangeableTypeType + extends CimUnsignedShort +{ + + +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/DeploymentOptionSection.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/DeploymentOptionSection.java index 134a868aa1..805eb86105 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/DeploymentOptionSection.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/DeploymentOptionSection.java @@ -93,8 +93,8 @@ public class DeploymentOptionSection extends SectionType in) { - return Builder.class.cast(super.fromSection(in)); + public Builder fromSectionType(SectionType in) { + return Builder.class.cast(super.fromSectionType(in)); } /** diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/DiskSection.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/DiskSection.java index 108bfdb505..55582e1f43 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/DiskSection.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/DiskSection.java @@ -95,8 +95,8 @@ public class DiskSection extends SectionType { * {@inheritDoc} */ @Override - public Builder fromSection(SectionType in) { - return Builder.class.cast(super.fromSection(in)); + public Builder fromSectionType(SectionType in) { + return Builder.class.cast(super.fromSectionType(in)); } /** diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/Envelope.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/Envelope.java index 561a3940f9..26a9f33ea1 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/Envelope.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/Envelope.java @@ -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 @@ -33,7 +33,6 @@ import com.google.common.collect.Multimap; @XmlRootElement(name = "Envelope", namespace = VCLOUD_OVF_NS) public class Envelope extends BaseEnvelope { - @SuppressWarnings("unchecked") public static Builder builder() { return new Builder(); } @@ -41,6 +40,7 @@ public class Envelope extends BaseEnvelope { /** * {@inheritDoc} */ + @Override public Builder toBuilder() { return new Builder().fromEnvelope(this); } @@ -50,6 +50,7 @@ public class Envelope extends BaseEnvelope { /** * {@inheritDoc} */ + @Override public Envelope build() { return new Envelope(diskSections, networkSections, additionalSections, virtualSystem); } @@ -57,18 +58,16 @@ public class Envelope extends BaseEnvelope { /** * {@inheritDoc} */ - @SuppressWarnings("unchecked") @Override - public Builder additionalSection(String name, SectionType additionalSection) { + public Builder additionalSection(String name, SectionType additionalSection) { return Builder.class.cast(super.additionalSection(name, additionalSection)); } /** * {@inheritDoc} */ - @SuppressWarnings("unchecked") @Override - public Builder additionalSections(Multimap additionalSections) { + public Builder additionalSections(Multimap> additionalSections) { return Builder.class.cast(super.additionalSections(additionalSections)); } @@ -122,9 +121,8 @@ public class Envelope extends BaseEnvelope { } - @SuppressWarnings("unchecked") private Envelope(Iterable diskSections, Iterable networkSections, - Multimap additionalSections, VirtualSystem virtualSystem) { + Multimap> additionalSections, VirtualSystem virtualSystem) { super(diskSections, networkSections, additionalSections, virtualSystem); } diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/Item.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/Item.java new file mode 100644 index 0000000000..d81d710695 --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/Item.java @@ -0,0 +1,272 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2012.02.08 at 02:47:44 PM GMT +// + + +package org.jclouds.vcloud.director.v1_5.domain.ovf; + +import java.util.HashMap; +import java.util.Map; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyAttribute; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.bind.annotation.XmlType; +import javax.xml.namespace.QName; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="order" use="required" type="{http://www.w3.org/2001/XMLSchema}unsignedShort" />
+ *       <attribute name="startDelay" type="{http://www.w3.org/2001/XMLSchema}unsignedShort" default="0" />
+ *       <attribute name="waitingForGuest" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+ *       <attribute name="stopDelay" type="{http://www.w3.org/2001/XMLSchema}unsignedShort" default="0" />
+ *       <attribute name="startAction" type="{http://www.w3.org/2001/XMLSchema}string" default="powerOn" />
+ *       <attribute name="stopAction" type="{http://www.w3.org/2001/XMLSchema}string" default="powerOff" />
+ *       <anyAttribute processContents='lax'/>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "") +@XmlSeeAlso({ + StartupSectionItem.class +}) +public class Item { + + @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1", required = true) + protected String id; + @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1", required = true) + @XmlSchemaType(name = "unsignedShort") + protected int order; + @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1") + @XmlSchemaType(name = "unsignedShort") + protected Integer startDelay; + @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1") + protected Boolean waitingForGuest; + @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1") + @XmlSchemaType(name = "unsignedShort") + protected Integer stopDelay; + @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1") + protected String startAction; + @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1") + protected String stopAction; + @XmlAnyAttribute + private Map otherAttributes = new HashMap(); + + /** + * Gets the value of the id property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getId() { + return id; + } + + /** + * Sets the value of the id property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setId(String value) { + this.id = value; + } + + /** + * Gets the value of the order property. + * + */ + public int getOrder() { + return order; + } + + /** + * Sets the value of the order property. + * + */ + public void setOrder(int value) { + this.order = value; + } + + /** + * Gets the value of the startDelay property. + * + * @return + * possible object is + * {@link Integer } + * + */ + public int getStartDelay() { + if (startDelay == null) { + return 0; + } else { + return startDelay; + } + } + + /** + * Sets the value of the startDelay property. + * + * @param value + * allowed object is + * {@link Integer } + * + */ + public void setStartDelay(Integer value) { + this.startDelay = value; + } + + /** + * Gets the value of the waitingForGuest property. + * + * @return + * possible object is + * {@link Boolean } + * + */ + public boolean isWaitingForGuest() { + if (waitingForGuest == null) { + return false; + } else { + return waitingForGuest; + } + } + + /** + * Sets the value of the waitingForGuest property. + * + * @param value + * allowed object is + * {@link Boolean } + * + */ + public void setWaitingForGuest(Boolean value) { + this.waitingForGuest = value; + } + + /** + * Gets the value of the stopDelay property. + * + * @return + * possible object is + * {@link Integer } + * + */ + public int getStopDelay() { + if (stopDelay == null) { + return 0; + } else { + return stopDelay; + } + } + + /** + * Sets the value of the stopDelay property. + * + * @param value + * allowed object is + * {@link Integer } + * + */ + public void setStopDelay(Integer value) { + this.stopDelay = value; + } + + /** + * Gets the value of the startAction property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getStartAction() { + if (startAction == null) { + return "powerOn"; + } else { + return startAction; + } + } + + /** + * Sets the value of the startAction property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setStartAction(String value) { + this.startAction = value; + } + + /** + * Gets the value of the stopAction property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getStopAction() { + if (stopAction == null) { + return "powerOff"; + } else { + return stopAction; + } + } + + /** + * Sets the value of the stopAction property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setStopAction(String value) { + this.stopAction = value; + } + + /** + * Gets a map that contains attributes that aren't bound to any typed property on this class. + * + *

+ * the map is keyed by the name of the attribute and + * the value is the string value of the attribute. + * + * the map returned by this method is live, and you can add new attribute + * by updating the map directly. Because of this design, there's no setter. + * + * + * @return + * always non-null + */ + public Map getOtherAttributes() { + return otherAttributes; + } + +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/NetworkSection.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/NetworkSection.java index 0b6751cd1d..ef5b929dcf 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/NetworkSection.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/NetworkSection.java @@ -87,8 +87,8 @@ public class NetworkSection extends SectionType { * {@inheritDoc} */ @Override - public Builder fromSection(SectionType in) { - return Builder.class.cast(super.fromSection(in)); + public Builder fromSectionType(SectionType in) { + return Builder.class.cast(super.fromSectionType(in)); } /** diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/OperatingSystemSection.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/OperatingSystemSection.java index 0983bff042..32452001d1 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/OperatingSystemSection.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/OperatingSystemSection.java @@ -93,8 +93,8 @@ public class OperatingSystemSection extends SectionType * {@inheritDoc} */ @Override - public Builder fromSection(SectionType in) { - return Builder.class.cast(super.fromSection(in)); + public Builder fromSectionType(SectionType in) { + return Builder.class.cast(super.fromSectionType(in)); } /** diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/ProductSection.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/ProductSection.java index bce96e6e7b..0761d86363 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/ProductSection.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/ProductSection.java @@ -91,8 +91,8 @@ public class ProductSection extends SectionType { * {@inheritDoc} */ @Override - public Builder fromSection(SectionType in) { - return Builder.class.cast(super.fromSection(in)); + public Builder fromSectionType(SectionType in) { + return Builder.class.cast(super.fromSectionType(in)); } /** diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/RASD.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/RASD.java new file mode 100644 index 0000000000..febff77083 --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/RASD.java @@ -0,0 +1,115 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2012.02.08 at 02:47:44 PM GMT +// + + +package org.jclouds.vcloud.director.v1_5.domain.ovf; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlType; + +import org.jclouds.vcloud.director.v1_5.domain.cim.CIMResourceAllocationSettingDataType; + + +/** + * Wrapper for CIM_ResourceAllocationSettingData_Type + * + *

+ * <complexType name="RASD_Type" />
+ * 
+ * + * @author grkvlt@apache.org + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "RASD_Type") +public class RASD extends CIMResourceAllocationSettingDataType { + + @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1") + protected Boolean required; + @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1") + protected String configuration; + @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/envelope/1") + protected String bound; + + /** + * Gets the value of the required property. + * + * @return + * possible object is + * {@link Boolean } + * + */ + public boolean isRequired() { + if (required == null) { + return true; + } else { + return required; + } + } + + /** + * Sets the value of the required property. + * + * @param value + * allowed object is + * {@link Boolean } + * + */ + public void setRequired(Boolean value) { + this.required = value; + } + + /** + * Gets the value of the configuration property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getConfiguration() { + return configuration; + } + + /** + * Sets the value of the configuration property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setConfiguration(String value) { + this.configuration = value; + } + + /** + * Gets the value of the bound property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getBound() { + return bound; + } + + /** + * Sets the value of the bound property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setBound(String value) { + this.bound = value; + } + +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/SectionType.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/SectionType.java index 144bee79a9..f61810d984 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/SectionType.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/SectionType.java @@ -81,7 +81,7 @@ public abstract class SectionType> { return this; } - public Builder fromSection(SectionType in) { + public Builder fromSectionType(SectionType in) { return info(in.getInfo()).required(in.isRequired()); } } @@ -110,6 +110,10 @@ public abstract class SectionType> { return info; } + public void setInfo(String info) { + this.info = info; + } + public Boolean isRequired() { return required; } diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/StartupSection.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/StartupSection.java new file mode 100644 index 0000000000..4300719e6f --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/StartupSection.java @@ -0,0 +1,81 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2012.02.08 at 02:47:44 PM GMT +// + +package org.jclouds.vcloud.director.v1_5.domain.ovf; + +import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.*; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.XmlAnyElement; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * Specifies the order in which entities in a VirtualSystemCollection are powered on and shut down + * + *
+ * <complexType name="StartupSection_Type" />
+ * 
+ */ +@XmlRootElement(name = "StartupSection", namespace = VCLOUD_OVF_NS) +public class StartupSection extends SectionType { + + /** @see org.jclouds.vcloud.director.v1_5.domain.ovf.SectionType#toBuilder() */ + @Override + public org.jclouds.vcloud.director.v1_5.domain.ovf.SectionType.Builder toBuilder() { + return null; + } + + @XmlElement(name = "Item") + protected List item; + @XmlAnyElement(lax = true) + protected List any; + + /** + * Gets the value of the item property. + *

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

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

+    * getItem().add(newItem);
+    * 
+ *

+ * Objects of the following type(s) are allowed in the list {@link StartupSectionItem } + */ + public List getItem() { + if (item == null) { + item = new ArrayList(); + } + return this.item; + } + + /** + * Gets the value of the any property. + *

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

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

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

+ * Objects of the following type(s) are allowed in the list {@link Object } {@link Element } + */ + public List getAny() { + if (any == null) { + any = new ArrayList(); + } + return this.any; + } +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/StartupSectionItem.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/StartupSectionItem.java new file mode 100644 index 0000000000..7c34c96988 --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/StartupSectionItem.java @@ -0,0 +1,51 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2012.02.08 at 02:47:44 PM GMT +// + + +package org.jclouds.vcloud.director.v1_5.domain.ovf; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for Item element declaration. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <element name="Item">
+ *   <complexType>
+ *     <complexContent>
+ *       <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *         <attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *         <attribute name="order" use="required" type="{http://www.w3.org/2001/XMLSchema}unsignedShort" />
+ *         <attribute name="startDelay" type="{http://www.w3.org/2001/XMLSchema}unsignedShort" default="0" />
+ *         <attribute name="waitingForGuest" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+ *         <attribute name="stopDelay" type="{http://www.w3.org/2001/XMLSchema}unsignedShort" default="0" />
+ *         <attribute name="startAction" type="{http://www.w3.org/2001/XMLSchema}string" default="powerOn" />
+ *         <attribute name="stopAction" type="{http://www.w3.org/2001/XMLSchema}string" default="powerOff" />
+ *         <anyAttribute processContents='lax'/>
+ *       </restriction>
+ *     </complexContent>
+ *   </complexType>
+ * </element>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "") +@XmlRootElement(name = "Item") +public class StartupSectionItem + extends Item +{ + + +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/VirtualHardwareSection.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/VirtualHardwareSection.java index e958becfef..5c85a35a6a 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/VirtualHardwareSection.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/VirtualHardwareSection.java @@ -18,8 +18,8 @@ */ package org.jclouds.vcloud.director.v1_5.domain.ovf; -import static com.google.common.base.Preconditions.checkNotNull; -import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_OVF_NS; +import static com.google.common.base.Preconditions.*; +import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.*; import java.util.Set; @@ -46,7 +46,6 @@ import com.google.common.collect.Sets; @XmlRootElement(name = "VirtualHardwareSection", namespace = VCLOUD_OVF_NS) public class VirtualHardwareSection extends SectionType { - @SuppressWarnings("unchecked") public static Builder builder() { return new Builder(); } @@ -114,7 +113,7 @@ public class VirtualHardwareSection extends SectionType } public Builder fromVirtualHardwareSection(VirtualHardwareSection in) { - return fromSection(in).items(in.getItems()).transports(in.getTransports()).system( + return fromSectionType(in).items(in.getItems()).transports(in.getTransports()).system( in.getSystem()).info(in.getInfo()); } @@ -122,8 +121,8 @@ public class VirtualHardwareSection extends SectionType * {@inheritDoc} */ @Override - public Builder fromSection(SectionType in) { - return Builder.class.cast(super.fromSection(in)); + public Builder fromSectionType(SectionType in) { + return Builder.class.cast(super.fromSectionType(in)); } /** diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/VirtualSystem.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/VirtualSystem.java index beec809be4..3b225eaaaf 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/VirtualSystem.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/VirtualSystem.java @@ -18,7 +18,7 @@ */ package org.jclouds.vcloud.director.v1_5.domain.ovf; -import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_OVF_NS; +import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.*; import javax.xml.bind.annotation.XmlRootElement; @@ -50,25 +50,22 @@ public class VirtualSystem extends BaseVirtualSystem { */ @Override public VirtualSystem build() { - return new VirtualSystem(id, info, required, name, operatingSystem, virtualHardwareSections, productSections, - additionalSections); + return new VirtualSystem(id, info, required, name, operatingSystem, virtualHardwareSections, productSections, additionalSections); } /** * {@inheritDoc} */ - @SuppressWarnings("unchecked") @Override - public Builder additionalSection(String name, SectionType additionalSection) { + public Builder additionalSection(String name, SectionType additionalSection) { return Builder.class.cast(super.additionalSection(name, additionalSection)); } /** * {@inheritDoc} */ - @SuppressWarnings("unchecked") @Override - public Builder additionalSections(Multimap additionalSections) { + public Builder additionalSections(Multimap> additionalSections) { return Builder.class.cast(super.additionalSections(additionalSections)); } @@ -76,8 +73,8 @@ public class VirtualSystem extends BaseVirtualSystem { * {@inheritDoc} */ @Override - public Builder fromSection(SectionType in) { - return Builder.class.cast(super.fromSection(in)); + public Builder fromSectionType(SectionType in) { + return Builder.class.cast(super.fromSectionType(in)); } /** @@ -164,7 +161,7 @@ public class VirtualSystem extends BaseVirtualSystem { private VirtualSystem(String id, String info, @Nullable Boolean required, String name, OperatingSystemSection operatingSystem, Iterable virtualHardwareSections, - Iterable productSections, Multimap additionalSections) { + Iterable productSections, Multimap> additionalSections) { super(id, info, required, name, operatingSystem, virtualHardwareSections, productSections, additionalSections); } diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/environment/EntityType.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/environment/EntityType.java new file mode 100644 index 0000000000..eee62b52b1 --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/environment/EntityType.java @@ -0,0 +1,181 @@ +/* + * Licensed to jclouds, Inc. (jclouds) under one or more + * contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. jclouds licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.jclouds.vcloud.director.v1_5.domain.ovf.environment; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.xml.bind.JAXBElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyAttribute; +import javax.xml.bind.annotation.XmlAnyElement; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElementRef; +import javax.xml.bind.annotation.XmlType; +import javax.xml.namespace.QName; +import org.w3c.dom.Element; + + +/** + * Container of sections for a specific entity + * + * + *

Java class for Entity_Type complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="Entity_Type">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element ref="{http://schemas.dmtf.org/ovf/environment/1}Section" maxOccurs="unbounded" minOccurs="0"/>
+ *         <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *       <attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <anyAttribute processContents='lax'/>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "Entity_Type", propOrder = { + "section", + "any" +}) +public class EntityType { + + @XmlElementRef(name = "Section", namespace = "http://schemas.dmtf.org/ovf/environment/1", type = JAXBElement.class) + protected List> section; + @XmlAnyElement(lax = true) + protected List any; + @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/environment/1", required = true) + protected String id; + @XmlAnyAttribute + private Map otherAttributes = new HashMap(); + + /** + * Gets the value of the section property. + * + *

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

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

+     *    getSection().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link JAXBElement }{@code <}{@link SectionType }{@code >} + * {@link JAXBElement }{@code <}{@link PropertySectionType }{@code >} + * {@link JAXBElement }{@code <}{@link PlatformSectionType }{@code >} + * + * + */ + public List> getSection() { + if (section == null) { + section = new ArrayList>(); + } + return this.section; + } + + /** + * Gets the value of the any property. + * + *

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

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

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

+ * Objects of the following type(s) are allowed in the list + * {@link Object } + * {@link Element } + * + * + */ + public List getAny() { + if (any == null) { + any = new ArrayList(); + } + return this.any; + } + + /** + * Gets the value of the id property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getId() { + return id; + } + + /** + * Sets the value of the id property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setId(String value) { + this.id = value; + } + + /** + * Gets a map that contains attributes that aren't bound to any typed property on this class. + * + *

+ * the map is keyed by the name of the attribute and + * the value is the string value of the attribute. + * + * the map returned by this method is live, and you can add new attribute + * by updating the map directly. Because of this design, there's no setter. + * + * + * @return + * always non-null + */ + public Map getOtherAttributes() { + return otherAttributes; + } + +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/environment/EnvironmentType.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/environment/EnvironmentType.java new file mode 100644 index 0000000000..1aac59cd1d --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/environment/EnvironmentType.java @@ -0,0 +1,219 @@ +/* + * Licensed to jclouds, Inc. (jclouds) under one or more + * contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. jclouds licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.jclouds.vcloud.director.v1_5.domain.ovf.environment; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.xml.bind.JAXBElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyAttribute; +import javax.xml.bind.annotation.XmlAnyElement; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlElementRef; +import javax.xml.bind.annotation.XmlType; +import javax.xml.namespace.QName; +import org.w3c.dom.Element; + + +/** + * Type for root OVF environment + * + *

Java class for Environment_Type complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="Environment_Type">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element ref="{http://schemas.dmtf.org/ovf/environment/1}Section" maxOccurs="unbounded" minOccurs="0"/>
+ *         <element name="Entity" type="{http://schemas.dmtf.org/ovf/environment/1}Entity_Type" maxOccurs="unbounded" minOccurs="0"/>
+ *         <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *       <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}string" default="" />
+ *       <anyAttribute processContents='lax'/>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "Environment_Type", propOrder = { + "section", + "entity", + "any" +}) +public class EnvironmentType { + + @XmlElementRef(name = "Section", namespace = "http://schemas.dmtf.org/ovf/environment/1", type = JAXBElement.class) + protected List> section; + @XmlElement(name = "Entity") + protected List entity; + @XmlAnyElement(lax = true) + protected List any; + @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/environment/1") + protected String id; + @XmlAnyAttribute + private Map otherAttributes = new HashMap(); + + /** + * Entity independent meta-data + * sections Gets the value of the section property. + * + *

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

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

+     *    getSection().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link JAXBElement }{@code <}{@link SectionType }{@code >} + * {@link JAXBElement }{@code <}{@link PropertySectionType }{@code >} + * {@link JAXBElement }{@code <}{@link PlatformSectionType }{@code >} + * + * + */ + public List> getSection() { + if (section == null) { + section = new ArrayList>(); + } + return this.section; + } + + /** + * Gets the value of the entity property. + * + *

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

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

+     *    getEntity().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link EntityType } + * + * + */ + public List getEntity() { + if (entity == null) { + entity = new ArrayList(); + } + return this.entity; + } + + /** + * Gets the value of the any property. + * + *

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

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

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

+ * Objects of the following type(s) are allowed in the list + * {@link Object } + * {@link Element } + * + * + */ + public List getAny() { + if (any == null) { + any = new ArrayList(); + } + return this.any; + } + + /** + * Gets the value of the id property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getId() { + if (id == null) { + return ""; + } else { + return id; + } + } + + /** + * Sets the value of the id property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setId(String value) { + this.id = value; + } + + /** + * Gets a map that contains attributes that aren't bound to any typed property on this class. + * + *

+ * the map is keyed by the name of the attribute and + * the value is the string value of the attribute. + * + * the map returned by this method is live, and you can add new attribute + * by updating the map directly. Because of this design, there's no setter. + * + * + * @return + * always non-null + */ + public Map getOtherAttributes() { + return otherAttributes; + } + +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/environment/PlatformSectionType.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/environment/PlatformSectionType.java new file mode 100644 index 0000000000..3806303f0c --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/environment/PlatformSectionType.java @@ -0,0 +1,114 @@ +/* + * Licensed to jclouds, Inc. (jclouds) under one or more + * contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. jclouds licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.jclouds.vcloud.director.v1_5.domain.ovf.environment; + +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyElement; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + +import org.jclouds.vcloud.director.v1_5.domain.cim.CimString; + +/** + * Information about deployment platform + *

+ * Java class for PlatformSection_Type complex type. + *

+ * The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="PlatformSection_Type">
+ *   <complexContent>
+ *     <extension base="{http://schemas.dmtf.org/ovf/environment/1}Section_Type">
+ *       <sequence>
+ *         <element name="Kind" type="{http://schemas.dmtf.org/wbem/wscim/1/common}cimString" minOccurs="0"/>
+ *         <element name="Version" type="{http://schemas.dmtf.org/wbem/wscim/1/common}cimString" minOccurs="0"/>
+ *         <element name="Vendor" type="{http://schemas.dmtf.org/wbem/wscim/1/common}cimString" minOccurs="0"/>
+ *         <element name="Locale" type="{http://schemas.dmtf.org/wbem/wscim/1/common}cimString" minOccurs="0"/>
+ *         <element name="Timezone" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
+ *         <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *       <anyAttribute processContents='lax'/>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "PlatformSection_Type", propOrder = { "kind", "version", "vendor", "locale", "timezone", "any" }) +public class PlatformSectionType extends SectionType { + + @XmlElement(name = "Kind") + protected CimString kind; + @XmlElement(name = "Version") + protected CimString version; + @XmlElement(name = "Vendor") + protected CimString vendor; + @XmlElement(name = "Locale") + protected CimString locale; + @XmlElement(name = "Timezone") + protected Integer timezone; + @XmlAnyElement(lax = true) + protected List any; + + /** + * Gets the value of the kind property. + */ + public CimString getKind() { + return kind; + } + + /** + * Gets the value of the version property. + */ + public CimString getVersion() { + return version; + } + + /** + * Gets the value of the vendor property. + */ + public CimString getVendor() { + return vendor; + } + + /** + * Gets the value of the locale property. + */ + public CimString getLocale() { + return locale; + } + + /** + * Gets the value of the timezone property. + */ + public Integer getTimezone() { + return timezone; + } + + /** + * Gets the value of the any property. + */ + public List getAny() { + return any; + } +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/environment/Property.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/environment/Property.java new file mode 100644 index 0000000000..78bee415bc --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/environment/Property.java @@ -0,0 +1,127 @@ +/* + * Licensed to jclouds, Inc. (jclouds) under one or more + * contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. jclouds licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.jclouds.vcloud.director.v1_5.domain.ovf.environment; + +import java.util.HashMap; +import java.util.Map; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyAttribute; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlType; +import javax.xml.namespace.QName; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute name="key" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="value" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <anyAttribute processContents='lax'/>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "") +public class Property { + + @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/environment/1", required = true) + protected String key; + @XmlAttribute(namespace = "http://schemas.dmtf.org/ovf/environment/1", required = true) + protected String value; + @XmlAnyAttribute + private Map otherAttributes = new HashMap(); + + /** + * Gets the value of the key property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getKey() { + return key; + } + + /** + * Sets the value of the key property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setKey(String value) { + this.key = value; + } + + /** + * Gets the value of the value property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getValue() { + return value; + } + + /** + * Sets the value of the value property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setValue(String value) { + this.value = value; + } + + /** + * Gets a map that contains attributes that aren't bound to any typed property on this class. + * + *

+ * the map is keyed by the name of the attribute and + * the value is the string value of the attribute. + * + * the map returned by this method is live, and you can add new attribute + * by updating the map directly. Because of this design, there's no setter. + * + * + * @return + * always non-null + */ + public Map getOtherAttributes() { + return otherAttributes; + } + +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/environment/PropertySectionType.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/environment/PropertySectionType.java new file mode 100644 index 0000000000..c737a120c0 --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/environment/PropertySectionType.java @@ -0,0 +1,138 @@ +/* + * Licensed to jclouds, Inc. (jclouds) under one or more + * contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. jclouds licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.jclouds.vcloud.director.v1_5.domain.ovf.environment; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyElement; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; +import org.w3c.dom.Element; + + +/** + * Key/value pairs of assigned properties for an + * entity + * + *

Java class for PropertySection_Type complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="PropertySection_Type">
+ *   <complexContent>
+ *     <extension base="{http://schemas.dmtf.org/ovf/environment/1}Section_Type">
+ *       <sequence>
+ *         <element name="Property" maxOccurs="unbounded" minOccurs="0">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <attribute name="key" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                 <attribute name="value" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                 <anyAttribute processContents='lax'/>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *       <anyAttribute processContents='lax'/>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "PropertySection_Type", propOrder = { + "property", + "any" +}) +public class PropertySectionType + extends SectionType +{ + + @XmlElement(name = "Property") + protected List property; + @XmlAnyElement(lax = true) + protected List any; + + /** + * Gets the value of the property property. + * + *

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

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

+     *    getProperty().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Property } + * + * + */ + public List getProperty() { + if (property == null) { + property = new ArrayList(); + } + return this.property; + } + + /** + * Gets the value of the any property. + * + *

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

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

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

+ * Objects of the following type(s) are allowed in the list + * {@link Object } + * {@link Element } + * + * + */ + public List getAny() { + if (any == null) { + any = new ArrayList(); + } + return this.any; + } + +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/environment/SectionType.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/environment/SectionType.java new file mode 100644 index 0000000000..a6b59d584a --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/environment/SectionType.java @@ -0,0 +1,80 @@ +/* + * Licensed to jclouds, Inc. (jclouds) under one or more + * contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. jclouds licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.jclouds.vcloud.director.v1_5.domain.ovf.environment; + +import java.util.HashMap; +import java.util.Map; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyAttribute; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.bind.annotation.XmlType; +import javax.xml.namespace.QName; + + +/** + * Abstract type for all sections in + * environment + * + *

Java class for Section_Type complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="Section_Type">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <anyAttribute processContents='lax'/>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "Section_Type") +@XmlSeeAlso({ + PlatformSectionType.class, + PropertySectionType.class +}) +public abstract class SectionType { + + @XmlAnyAttribute + private Map otherAttributes = new HashMap(); + + /** + * Gets a map that contains attributes that aren't bound to any typed property on this class. + * + *

+ * the map is keyed by the name of the attribute and + * the value is the string value of the attribute. + * + * the map returned by this method is live, and you can add new attribute + * by updating the map directly. Because of this design, there's no setter. + * + * + * @return + * always non-null + */ + public Map getOtherAttributes() { + return otherAttributes; + } + +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/vapp/package-info.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/environment/package-info.java similarity index 61% rename from labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/vapp/package-info.java rename to labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/environment/package-info.java index c8acc0be09..fd65d2535f 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/vapp/package-info.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/environment/package-info.java @@ -16,19 +16,10 @@ * specific language governing permissions and limitations * under the License. */ -@XmlSchema(namespace = VCLOUD_1_5_NS, location="http://vcloudbeta.bluelock.com/api/v1.5/schema/master.xsd", elementFormDefault = XmlNsForm.QUALIFIED, - xmlns = { - @XmlNs(prefix = "cim", namespaceURI=VCLOUD_CIM_NS), - @XmlNs(prefix = "ovf", namespaceURI=VCLOUD_OVF_NS) - } -) -package org.jclouds.vcloud.director.v1_5.domain.vapp; +@XmlSchema(namespace = VCLOUD_OVF_NS, elementFormDefault = XmlNsForm.QUALIFIED) +package org.jclouds.vcloud.director.v1_5.domain.ovf.environment; -import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_1_5_NS; -import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_CIM_NS; -import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_OVF_NS; +import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.*; -import javax.xml.bind.annotation.XmlNs; -import javax.xml.bind.annotation.XmlNsForm; import javax.xml.bind.annotation.XmlSchema; - +import javax.xml.bind.annotation.XmlNsForm; diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/internal/BaseEnvelope.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/internal/BaseEnvelope.java index 6a4a0394e5..c45b133681 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/internal/BaseEnvelope.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/internal/BaseEnvelope.java @@ -43,8 +43,7 @@ public abstract class BaseEnvelope, E extends Bas public static abstract class Builder, E extends BaseEnvelope> { protected Set diskSections = Sets.newLinkedHashSet(); protected Set networkSections = Sets.newLinkedHashSet(); - @SuppressWarnings("unchecked") - protected Multimap additionalSections = LinkedHashMultimap.create(); + protected Multimap> additionalSections = LinkedHashMultimap.create(); protected V virtualSystem; /** @@ -82,8 +81,7 @@ public abstract class BaseEnvelope, E extends Bas /** * @see BaseEnvelope#getAdditionalSections */ - @SuppressWarnings("unchecked") - public Builder additionalSection(String name, SectionType additionalSection) { + public Builder additionalSection(String name, SectionType additionalSection) { this.additionalSections.put(checkNotNull(name, "name"), checkNotNull(additionalSection, "additionalSection")); return this; } @@ -91,9 +89,8 @@ public abstract class BaseEnvelope, E extends Bas /** * @see BaseEnvelope#getAdditionalSections */ - @SuppressWarnings("unchecked") - public Builder additionalSections(Multimap additionalSections) { - this.additionalSections = ImmutableMultimap. copyOf(checkNotNull(additionalSections, + public Builder additionalSections(Multimap> additionalSections) { + this.additionalSections = ImmutableMultimap.> copyOf(checkNotNull(additionalSections, "additionalSections")); return this; } @@ -106,7 +103,6 @@ public abstract class BaseEnvelope, E extends Bas return this; } - @SuppressWarnings("unchecked") public abstract E build() ; public Builder fromEnvelope(BaseEnvelope in) { @@ -118,13 +114,11 @@ public abstract class BaseEnvelope, E extends Bas private Set diskSections; private Set networkSections; - @SuppressWarnings("unchecked") - private Multimap additionalSections; + private Multimap> additionalSections; private V virtualSystem; - @SuppressWarnings("unchecked") protected BaseEnvelope(Iterable diskSections, Iterable networkSections, - Multimap additionalSections, V virtualSystem) { + Multimap> additionalSections, V virtualSystem) { this.diskSections = ImmutableSet.copyOf(checkNotNull(diskSections, "diskSections")); this.networkSections = ImmutableSet.copyOf(checkNotNull(networkSections, "networkSections")); this.additionalSections = ImmutableMultimap.copyOf(checkNotNull(additionalSections, "additionalSections")); @@ -143,8 +137,7 @@ public abstract class BaseEnvelope, E extends Bas return diskSections; } - @SuppressWarnings("unchecked") - public Multimap getAdditionalSections() { + public Multimap> getAdditionalSections() { return additionalSections; } diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/internal/BaseVirtualSystem.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/internal/BaseVirtualSystem.java index 171b73af13..3b5e2bd8d7 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/internal/BaseVirtualSystem.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ovf/internal/BaseVirtualSystem.java @@ -41,13 +41,13 @@ import com.google.common.collect.Sets; public abstract class BaseVirtualSystem> extends SectionType { public static abstract class Builder> extends SectionType.Builder { + protected String id; protected String name; protected OperatingSystemSection operatingSystem; protected Set virtualHardwareSections = Sets.newLinkedHashSet(); protected Set productSections = Sets.newLinkedHashSet(); - @SuppressWarnings("unchecked") - protected Multimap additionalSections = LinkedHashMultimap.create(); + protected Multimap> additionalSections = LinkedHashMultimap.create(); /** * @see BaseVirtualSystem#getName @@ -109,8 +109,7 @@ public abstract class BaseVirtualSystem> extends /** * @see BaseVirtualSystem#getAdditionalSections */ - @SuppressWarnings("unchecked") - public Builder additionalSection(String name, SectionType additionalSection) { + public Builder additionalSection(String name, SectionType additionalSection) { this.additionalSections.put(checkNotNull(name, "name"), checkNotNull(additionalSection, "additionalSection")); return this; } @@ -118,9 +117,8 @@ public abstract class BaseVirtualSystem> extends /** * @see BaseVirtualSystem#getAdditionalSections */ - @SuppressWarnings("unchecked") - public Builder additionalSections(Multimap additionalSections) { - this.additionalSections = ImmutableMultimap. copyOf(checkNotNull(additionalSections, + public Builder additionalSections(Multimap> additionalSections) { + this.additionalSections = ImmutableMultimap.> copyOf(checkNotNull(additionalSections, "additionalSections")); return this; } @@ -132,9 +130,10 @@ public abstract class BaseVirtualSystem> extends public abstract BaseVirtualSystem build(); public Builder fromVirtualSystem(BaseVirtualSystem in) { - return fromSection(in).id(in.getId()).name(in.getName()) - .operatingSystemSection(in.getOperatingSystemSection()).virtualHardwareSections( - in.getVirtualHardwareSections()).productSections(in.getProductSections()) + return fromSectionType(in).id(in.getId()).name(in.getName()) + .operatingSystemSection(in.getOperatingSystemSection()) + .virtualHardwareSections(in.getVirtualHardwareSections()) + .productSections(in.getProductSections()) .additionalSections(in.getAdditionalSections()); } @@ -142,8 +141,8 @@ public abstract class BaseVirtualSystem> extends * {@inheritDoc} */ @Override - public Builder fromSection(SectionType in) { - return (Builder) super.fromSection(in); + public Builder fromSectionType(SectionType in) { + return (Builder) super.fromSectionType(in); } /** @@ -161,13 +160,11 @@ public abstract class BaseVirtualSystem> extends private OperatingSystemSection operatingSystem; private Set virtualHardwareSections; private Set productSections; - @SuppressWarnings("unchecked") - private Multimap additionalSections; + private Multimap> additionalSections; - @SuppressWarnings("unchecked") protected BaseVirtualSystem(String id, String info, @Nullable Boolean required, String name, OperatingSystemSection operatingSystem, Iterable virtualHardwareSections, - Iterable productSections, Multimap additionalSections) { + Iterable productSections, Multimap> additionalSections) { super(info, required); this.id = id; this.name = name; @@ -210,8 +207,7 @@ public abstract class BaseVirtualSystem> extends return productSections; } - @SuppressWarnings("unchecked") - public Multimap getAdditionalSections() { + public Multimap> getAdditionalSections() { return additionalSections; } @@ -236,6 +232,7 @@ public abstract class BaseVirtualSystem> extends && Objects.equal(additionalSections, other.additionalSections); } + @Override protected Objects.ToStringHelper string() { return super.string().add("id", id).add("name", name) .add("operatingSystem", operatingSystem).add("virtualHardwareSections", virtualHardwareSections) diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/query/CatalogReferences.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/query/CatalogReferences.java index a16659448c..140f0b7909 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/query/CatalogReferences.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/query/CatalogReferences.java @@ -33,7 +33,7 @@ import com.google.common.collect.Sets; /** * Represents the results from a vCloud query as references. - *

+ * *

  * <complexType name="QueryResultReferences" />
  * 
@@ -43,6 +43,7 @@ import com.google.common.collect.Sets; @XmlRootElement(name = "CatalogReferences") public class CatalogReferences extends QueryResultReferences { + @SuppressWarnings("unchecked") public static Builder builder() { return new Builder(); } diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/query/ContainerType.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/query/ContainerType.java index eea703e85b..e2b80cdd6e 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/query/ContainerType.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/query/ContainerType.java @@ -36,7 +36,7 @@ import com.google.common.collect.Sets; /** * Container for query result sets. - *

+ * *

  * <complexType name="Container" />
  * 
@@ -207,7 +207,7 @@ public class ContainerType> extends ResourceType { @Override public int hashCode() { - return super.hashCode() + Objects.hashCode(name, page, pageSize, total); + return Objects.hashCode(super.hashCode(), name, page, pageSize, total); } @Override diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/query/QueryList.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/query/QueryList.java index 7fcd8cc107..99ac057714 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/query/QueryList.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/query/QueryList.java @@ -25,25 +25,17 @@ import com.google.common.base.Objects.ToStringHelper; /** * Container for the list of typed queries available to the * requesting user. - *

- *

- *

Java class for QueryList complex type. - *

- *

The following schema fragment specifies the expected content contained within this class. - *

+ * *

- * <complexType name="QueryList">
- *   <complexContent>
- *     <extension base="{http://www.vmware.com/vcloud/v1.5}ContainerType">
- *       <anyAttribute processContents='lax' namespace='##other'/>
- *     </extension>
- *   </complexContent>
- * </complexType>
+ * <complexType name="QueryList" />
  * 
+ * + * @author grkvlt@apache.org */ @XmlType(name = "QueryList") public class QueryList extends ContainerType { + @SuppressWarnings("unchecked") public static Builder builder() { return new Builder(); } @@ -55,6 +47,7 @@ public class QueryList extends ContainerType { public static class Builder extends ContainerType.Builder { + @Override public QueryList build() { QueryList queryList = new QueryList(); return queryList; diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/query/QueryResultCatalogRecord.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/query/QueryResultCatalogRecord.java index f2d81e92d8..e0c70256e9 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/query/QueryResultCatalogRecord.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/query/QueryResultCatalogRecord.java @@ -38,7 +38,7 @@ import com.google.common.collect.Sets; /** * Represents the results from a Catalog vCloud query as a record. - *

+ * *

  * <complexType name="QueryResultCatalogRecord" />
  * 
@@ -358,7 +358,7 @@ public class QueryResultCatalogRecord extends QueryResultRecordType + * *
  * <complexType name="QueryResultNetworkRecord" />
  * 
@@ -43,6 +43,7 @@ import com.google.common.collect.Sets; * @author grkvlt@apache.org */ public class QueryResultNetworkRecord extends QueryResultRecordType { + @SuppressWarnings("unchecked") public static Builder builder() { return new Builder(); diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/query/QueryResultRecordType.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/query/QueryResultRecordType.java index 7e9f275486..ed302c76f3 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/query/QueryResultRecordType.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/query/QueryResultRecordType.java @@ -37,7 +37,7 @@ import com.google.common.collect.Sets; /** * Base type for query result Records. Subtypes define more specific elements. - *

+ * *

  * <complexType name="QueryResultRecordType" />
  * 
diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/query/QueryResultRecords.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/query/QueryResultRecords.java index 139cdcf423..a48d44fc8d 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/query/QueryResultRecords.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/query/QueryResultRecords.java @@ -19,8 +19,8 @@ package org.jclouds.vcloud.director.v1_5.domain.query; -import static com.google.common.base.Objects.equal; -import static com.google.common.base.Preconditions.checkNotNull; +import static com.google.common.base.Objects.*; +import static com.google.common.base.Preconditions.*; import java.net.URI; import java.util.Set; @@ -29,7 +29,6 @@ import javax.xml.bind.annotation.XmlElementRef; import javax.xml.bind.annotation.XmlRootElement; import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType; -import org.jclouds.vcloud.director.v1_5.domain.EntityType; import org.jclouds.vcloud.director.v1_5.domain.Link; import com.google.common.base.Objects; @@ -39,7 +38,7 @@ import com.google.common.collect.Sets; /** * Represents the results from a vCloud query as records. - *

+ * *

  * <complexType name="QueryResultRecords" />
  * 
@@ -198,7 +197,7 @@ public class QueryResultRecords> extends Cont @Override public int hashCode() { - return super.hashCode() + Objects.hashCode(records); + return Objects.hashCode(super.hashCode(), records); } @Override diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/query/QueryResultReferences.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/query/QueryResultReferences.java index f0c6612bbc..5f6c166a17 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/query/QueryResultReferences.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/query/QueryResultReferences.java @@ -38,7 +38,7 @@ import com.google.common.collect.Sets; /** * Represents the results from a vCloud query as references. - *

+ * *

  * <complexType name="QueryResultReferences" />
  * 
@@ -197,7 +197,7 @@ public class QueryResultReferences> extends Container @Override public int hashCode() { - return super.hashCode() + Objects.hashCode(references); + return Objects.hashCode(super.hashCode(), references); } @Override diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/vapp/AbstractVAppType.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/vapp/AbstractVAppType.java deleted file mode 100644 index 7a1e6013f3..0000000000 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/vapp/AbstractVAppType.java +++ /dev/null @@ -1,139 +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.vapp; - -import org.jclouds.vcloud.director.v1_5.domain.ResourceEntityType; - - -/** - * Represents a base type for VAppType and VmType. - *

- *

- * <complexType name="AbstractVAppType" >
- * 
- * - * @author grkvlt@apache.org - */ -public abstract class AbstractVAppType> extends ResourceEntityType { - - public static abstract class Builder> extends ResourceEntityType.Builder {} -// @XmlElement(name = "VAppParent") -// protected ReferenceType vAppParent; -// @XmlElementRef(name = "Section", namespace = "http://schemas.dmtf.org/ovf/envelope/1", type = JAXBElement.class) -// protected List> section; -// @XmlAttribute -// protected Boolean deployed; -// -// /** -// * Gets the value of the vAppParent property. -// * -// * @return -// * possible object is -// * {@link ReferenceType } -// * -// */ -// public ReferenceType getVAppParent() { -// return vAppParent; -// } -// -// /** -// * Sets the value of the vAppParent property. -// * -// * @param value -// * allowed object is -// * {@link ReferenceType } -// * -// */ -// public void setVAppParent(ReferenceType value) { -// this.vAppParent = value; -// } -// -// /** -// * -// * Specific ovf:Section with additional information for the vApp. -// * Gets the value of the section property. -// * -// *

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

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

-//     *    getSection().add(newItem);
-//     * 
-// * -// * -// *

-// * Objects of the following type(s) are allowed in the list -// * {@link JAXBElement }{@code <}{@link SectionType }{@code >} -// * {@link JAXBElement }{@code <}{@link VirtualHardwareSectionType }{@code >} -// * {@link JAXBElement }{@code <}{@link LeaseSettingsSectionType }{@code >} -// * {@link JAXBElement }{@code <}{@link EulaSectionType }{@code >} -// * {@link JAXBElement }{@code <}{@link RuntimeInfoSectionType }{@code >} -// * {@link JAXBElement }{@code <}{@link AnnotationSectionType }{@code >} -// * {@link JAXBElement }{@code <}{@link DeploymentOptionSectionType }{@code >} -// * {@link JAXBElement }{@code <}{@link StartupSectionType }{@code >} -// * {@link JAXBElement }{@code <}{@link ResourceAllocationSectionType }{@code >} -// * {@link JAXBElement }{@code <}{@link NetworkConnectionSectionType }{@code >} -// * {@link JAXBElement }{@code <}{@link CustomizationSectionType }{@code >} -// * {@link JAXBElement }{@code <}{@link ProductSectionType }{@code >} -// * {@link JAXBElement }{@code <}{@link GuestCustomizationSectionType }{@code >} -// * {@link JAXBElement }{@code <}{@link OperatingSystemSectionType }{@code >} -// * {@link JAXBElement }{@code <}{@link NetworkConfigSectionType }{@code >} -// * {@link JAXBElement }{@code <}{@link NetworkSectionType }{@code >} -// * {@link JAXBElement }{@code <}{@link DiskSectionType }{@code >} -// * {@link JAXBElement }{@code <}{@link InstallSectionType }{@code >} -// * -// * -// */ -// public List> getSection() { -// if (section == null) { -// section = new ArrayList>(); -// } -// return this.section; -// } -// -// /** -// * Gets the value of the deployed property. -// * -// * @return -// * possible object is -// * {@link Boolean } -// * -// */ -// public Boolean isDeployed() { -// return deployed; -// } -// -// /** -// * Sets the value of the deployed property. -// * -// * @param value -// * allowed object is -// * {@link Boolean } -// * -// */ -// public void setDeployed(Boolean value) { -// this.deployed = value; -// } - -} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/vapp/VApp.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/vapp/VApp.java deleted file mode 100644 index 23c87fbc48..0000000000 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/vapp/VApp.java +++ /dev/null @@ -1,252 +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.vapp; - -/** - * Represents a vApp. - *

- *

- * <complexType name="VApp" />
- * 
- * - * @author grkvlt@apache.org - */ -public class VApp extends AbstractVAppType { - // - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - // - @Override - public Builder toBuilder() { - return new Builder().fromVApp(this); - } - - public static class Builder extends AbstractVAppType.Builder { - // -// private Owner owner; -// private Boolean inMaintenanceMode; -// private VAppChildren children; -// private Boolean ovfDescriptorUploaded; -// -// /** -// * @see VApp#getOwner() -// */ -// public Builder owner(Owner owner) { -// this.owner = owner; -// return this; -// } -// -// /** -// * @see VApp#getInMaintenanceMode() -// */ -// public Builder inMaintenanceMode(Boolean inMaintenanceMode) { -// this.inMaintenanceMode = inMaintenanceMode; -// return this; -// } -// -// /** -// * @see VApp#getChildren() -// */ -// public Builder children(VAppChildren children) { -// this.children = children; -// return this; -// } -// -// /** -// * @see VApp#getOvfDescriptorUploaded() -// */ -// public Builder ovfDescriptorUploaded(Boolean ovfDescriptorUploaded) { -// this.ovfDescriptorUploaded = ovfDescriptorUploaded; -// return this; -// } -// -// - public VApp build() { - return new VApp(); - } - - // VApp vApp = new VApp(); -// vApp.setOwner(owner); -// vApp.setInMaintenanceMode(inMaintenanceMode); -// vApp.setChildren(children); -// vApp.setOvfDescriptorUploaded(ovfDescriptorUploaded); -// return vApp; -// } -// -// -// @Override -// public Builder fromAbstractVAppType(AbstractVAppType in) { -// return Builder.class.cast(super.fromAbstractVAppType(in)); -// } - public Builder fromVApp(VApp in) { - return new Builder(); - } -// return fromAbstractVAppType(in) -// .owner(in.getOwner()) -// .inMaintenanceMode(in.getInMaintenanceMode()) -// .children(in.getChildren()) -// .ovfDescriptorUploaded(in.getOvfDescriptorUploaded()); -// } - } - - private VApp() { - // For JAXB and builder use - } -// -// -// -// @XmlElement(name = "Owner") -// protected Owner owner; -// @XmlElement(name = "InMaintenanceMode") -// protected Boolean inMaintenanceMode; -// @XmlElement(name = "Children") -// protected VAppChildren children; -// @XmlAttribute -// protected Boolean ovfDescriptorUploaded; -// -// /** -// * Gets the value of the owner property. -// * -// * @return -// * possible object is -// * {@link Owner } -// * -// */ -// public Owner getOwner() { -// return owner; -// } -// -// /** -// * Sets the value of the owner property. -// * -// * @param value -// * allowed object is -// * {@link Owner } -// * -// */ -// public void setOwner(Owner value) { -// this.owner = value; -// } -// -// /** -// * Gets the value of the inMaintenanceMode property. -// * -// * @return -// * possible object is -// * {@link Boolean } -// * -// */ -// public Boolean isInMaintenanceMode() { -// return inMaintenanceMode; -// } -// -// /** -// * Sets the value of the inMaintenanceMode property. -// * -// * @param value -// * allowed object is -// * {@link Boolean } -// * -// */ -// public void setInMaintenanceMode(Boolean value) { -// this.inMaintenanceMode = value; -// } -// -// /** -// * Gets the value of the children property. -// * -// * @return -// * possible object is -// * {@link VAppChildren } -// * -// */ -// public VAppChildren getChildren() { -// return children; -// } -// -// /** -// * Sets the value of the children property. -// * -// * @param value -// * allowed object is -// * {@link VAppChildren } -// * -// */ -// public void setChildren(VAppChildren value) { -// this.children = value; -// } -// -// /** -// * Gets the value of the ovfDescriptorUploaded property. -// * -// * @return -// * possible object is -// * {@link Boolean } -// * -// */ -// public Boolean isOvfDescriptorUploaded() { -// return ovfDescriptorUploaded; -// } -// -// /** -// * Sets the value of the ovfDescriptorUploaded property. -// * -// * @param value -// * allowed object is -// * {@link Boolean } -// * -// */ -// public void setOvfDescriptorUploaded(Boolean value) { -// this.ovfDescriptorUploaded = value; -// } -// -// @Override -// public boolean equals(Object o) { -// if (this == o) -// return true; -// if (o == null || getClass() != o.getClass()) -// return false; -// VApp that = VApp.class.cast(o); -// return equal(owner, that.owner) && -// equal(inMaintenanceMode, that.inMaintenanceMode) && -// equal(children, that.children) && -// equal(ovfDescriptorUploaded, that.ovfDescriptorUploaded); -// } -// -// @Override -// public int hashCode() { -// return Objects.hashCode(owner, -// inMaintenanceMode, -// children, -// ovfDescriptorUploaded); -// } -// -// @Override -// public String toString() { -// return Objects.toStringHelper("") -// .add("owner", owner) -// .add("inMaintenanceMode", inMaintenanceMode) -// .add("children", children) -// .add("ovfDescriptorUploaded", ovfDescriptorUploaded).toString(); -// } - -} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/CatalogAsyncClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/CatalogAsyncClient.java index 831359b695..7073aec5d7 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/CatalogAsyncClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/CatalogAsyncClient.java @@ -38,7 +38,6 @@ import org.jclouds.rest.binders.BindToXMLPayload; import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType; import org.jclouds.vcloud.director.v1_5.domain.CatalogItem; import org.jclouds.vcloud.director.v1_5.domain.CatalogType; -import org.jclouds.vcloud.director.v1_5.features.MetadataAsyncClient.Writable; import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest; import org.jclouds.vcloud.director.v1_5.functions.ThrowVCloudErrorOn4xx; diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/CatalogClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/CatalogClient.java index 287cc17f6a..9d6c6c676d 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/CatalogClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/CatalogClient.java @@ -23,10 +23,8 @@ import java.util.concurrent.TimeUnit; import org.jclouds.concurrent.Timeout; import org.jclouds.rest.annotations.Delegate; -import org.jclouds.vcloud.director.v1_5.domain.Catalog; import org.jclouds.vcloud.director.v1_5.domain.CatalogItem; import org.jclouds.vcloud.director.v1_5.domain.CatalogType; -import org.jclouds.vcloud.director.v1_5.domain.Metadata; /** * Provides synchronous access to {@link Catalog} objects. diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/GroupClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/GroupClient.java index 9d0edfb9f9..faf2cfcf51 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/GroupClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/GroupClient.java @@ -44,6 +44,7 @@ public interface GroupClient { * @return a group */ Group getGroup(URI groupUri); + /** * Modifies a group. * diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VAppAsyncClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VAppAsyncClient.java new file mode 100644 index 0000000000..8113cfec33 --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VAppAsyncClient.java @@ -0,0 +1,680 @@ +/** + * 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.features; + +import java.net.URI; + +import javax.ws.rs.Consumes; +import javax.ws.rs.DELETE; +import javax.ws.rs.GET; +import javax.ws.rs.POST; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; + +import org.jclouds.rest.annotations.BinderParam; +import org.jclouds.rest.annotations.Delegate; +import org.jclouds.rest.annotations.EndpointParam; +import org.jclouds.rest.annotations.ExceptionParser; +import org.jclouds.rest.annotations.JAXBResponseParser; +import org.jclouds.rest.annotations.RequestFilters; +import org.jclouds.rest.binders.BindToXMLPayload; +import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType; +import org.jclouds.vcloud.director.v1_5.domain.ControlAccessParams; +import org.jclouds.vcloud.director.v1_5.domain.DeployVAppParams; +import org.jclouds.vcloud.director.v1_5.domain.GuestCustomizationSection; +import org.jclouds.vcloud.director.v1_5.domain.LeaseSettingsSection; +import org.jclouds.vcloud.director.v1_5.domain.MediaInsertOrEjectParams; +import org.jclouds.vcloud.director.v1_5.domain.NetworkConfigSection; +import org.jclouds.vcloud.director.v1_5.domain.NetworkConnectionSection; +import org.jclouds.vcloud.director.v1_5.domain.Owner; +import org.jclouds.vcloud.director.v1_5.domain.ProductSectionList; +import org.jclouds.vcloud.director.v1_5.domain.RasdItemsList; +import org.jclouds.vcloud.director.v1_5.domain.RecomposeVAppParams; +import org.jclouds.vcloud.director.v1_5.domain.RelocateParams; +import org.jclouds.vcloud.director.v1_5.domain.RuntimeInfoSection; +import org.jclouds.vcloud.director.v1_5.domain.ScreenTicket; +import org.jclouds.vcloud.director.v1_5.domain.Task; +import org.jclouds.vcloud.director.v1_5.domain.UndeployVAppParams; +import org.jclouds.vcloud.director.v1_5.domain.VApp; +import org.jclouds.vcloud.director.v1_5.domain.VmPendingQuestion; +import org.jclouds.vcloud.director.v1_5.domain.VmQuestionAnswer; +import org.jclouds.vcloud.director.v1_5.domain.ovf.NetworkSection; +import org.jclouds.vcloud.director.v1_5.domain.ovf.OperatingSystemSection; +import org.jclouds.vcloud.director.v1_5.domain.ovf.RASD; +import org.jclouds.vcloud.director.v1_5.domain.ovf.StartupSection; +import org.jclouds.vcloud.director.v1_5.domain.ovf.VirtualHardwareSection; +import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest; +import org.jclouds.vcloud.director.v1_5.functions.ThrowVCloudErrorOn4xx; + +import com.google.common.util.concurrent.ListenableFuture; + +/** + * @author grkvlt@apache.org + * @see VAppClient + */ +@RequestFilters(AddVCloudAuthorizationToRequest.class) +public interface VAppAsyncClient { + + /** + * @see VAppClient#getVApp(URI) + */ + @GET + @Consumes + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture getVApp(@EndpointParam URI vAppURI); + + /** + * @see VAppClient#modifyVApp(URI, VApp) + */ + @PUT + @Produces(VCloudDirectorMediaType.VAPP) + @Consumes(VCloudDirectorMediaType.TASK) + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture modifyVApp(@EndpointParam URI vAppURI, @BinderParam(BindToXMLPayload.class) VApp vApp); + + /** + * @see VAppClient#deleteVApp(URI) + */ + @DELETE + @Consumes(VCloudDirectorMediaType.TASK) + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture deleteVApp(@EndpointParam URI vAppURI); + + /** + * @see VAppClient#consolidateVApp(URI) + */ + @POST + @Path("/action/consolidate") + @Consumes(VCloudDirectorMediaType.TASK) + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture consolidate(@EndpointParam URI vAppURI); + + /** + * @see VAppClient#controlAccess(URI, ControlAccessParams) + */ + @POST + @Path("/action/controlAccess") + @Produces(VCloudDirectorMediaType.CONTROL_ACCESS) + @Consumes(VCloudDirectorMediaType.CONTROL_ACCESS) + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture controlAccess(@EndpointParam URI vAppURI, @BinderParam(BindToXMLPayload.class) ControlAccessParams params); + + /** + * @see VAppClient#deploy(URI, DeployVAppParams) + */ + @POST + @Path("/action/deploy") + @Produces(VCloudDirectorMediaType.DEPLOY_VAPP_PARAMS) + @Consumes(VCloudDirectorMediaType.TASK) + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture deploy(@EndpointParam URI vAppURI, @BinderParam(BindToXMLPayload.class) DeployVAppParams params); + + /** + * @see VAppClient#discardSuspendedState(URI) + */ + @POST + @Path("/action/discardSuspendedState") + @Consumes(VCloudDirectorMediaType.TASK) + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture discardSuspendedState(@EndpointParam URI vAppURI); + + /** + * @see VAppClient#enterMaintenanceMode(URI) + */ + @POST + @Path("/action/enterMaintenanceMode") + @Consumes + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture enterMaintenanceMode(@EndpointParam URI vAppURI); + + /** + * @see VAppClient#exitMaintenanceMode(URI) + */ + @POST + @Path("/action/exitMaintenanceMode") + @Consumes + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture exitMaintenanceMode(@EndpointParam URI vAppURI); + + /** + * @see VAppClient#installVMwareTools(URI) + */ + @POST + @Path("/action/installVMwareTools") + @Consumes(VCloudDirectorMediaType.TASK) + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture installVMwareTools(@EndpointParam URI vAppURI); + + /** + * @see VAppClient#recomposeVApp(URI, RecomposeVAppParams) + */ + @POST + @Path("/action/recomposeVApp") + @Produces(VCloudDirectorMediaType.RECOMPOSE_VAPP_PARAMS) + @Consumes(VCloudDirectorMediaType.TASK) + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture recomposeVApp(@EndpointParam URI vAppURI, @BinderParam(BindToXMLPayload.class) RecomposeVAppParams params); + + /** + * @see VAppClient#relocate(URI, RelocateParams) + */ + @POST + @Path("/action/relocate") + @Produces(VCloudDirectorMediaType.RELOCATE_VM_PARAMS) + @Consumes(VCloudDirectorMediaType.TASK) + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture relocate(@EndpointParam URI vAppURI, @BinderParam(BindToXMLPayload.class) RelocateParams params); + + /** + * @see VAppClient#undeploy(URI, UndeployVAppParams) + */ + @POST + @Path("/action/undeploy") + @Produces(VCloudDirectorMediaType.UNDEPLOY_VAPP_PARAMS) + @Consumes(VCloudDirectorMediaType.TASK) + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture undeploy(@EndpointParam URI vAppURI, @BinderParam(BindToXMLPayload.class) UndeployVAppParams params); + + /** + * @see VAppClient#upgradeHardwareVersion(URI) + */ + @POST + @Path("/action/upgradeHardwareVersion") + @Consumes(VCloudDirectorMediaType.TASK) + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture upgradeHardwareVersion(@EndpointParam URI vAppURI); + + /** + * @see VAppClient#getControlAccess(URI) + */ + @GET + @Path("/controlAccess") + @Consumes(VCloudDirectorMediaType.CONTROL_ACCESS) + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture controlAccess(@EndpointParam URI vAppURI); + + /** + * @see VAppClient#powerOff(URI) + */ + @POST + @Path("/power/action/powerOff") + @Consumes(VCloudDirectorMediaType.TASK) + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture powerOff(@EndpointParam URI vAppURI); + + /** + * @see VAppClient#powerOn(URI) + */ + @POST + @Path("/power/action/powerOn") + @Consumes(VCloudDirectorMediaType.TASK) + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture powerOn(@EndpointParam URI vAppURI); + + /** + * @see VAppClient#reboot(URI) + */ + @POST + @Path("/power/action/powerOff") + @Consumes(VCloudDirectorMediaType.TASK) + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture reboot(@EndpointParam URI vAppURI); + + /** + * @see VAppClient#reset(URI) + */ + @POST + @Path("/power/action/reset") + @Consumes(VCloudDirectorMediaType.TASK) + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture reset(@EndpointParam URI vAppURI); + + /** + * @see VAppClient#shutdown(URI) + */ + @POST + @Path("/power/action/shutdown") + @Consumes(VCloudDirectorMediaType.TASK) + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture shutdown(@EndpointParam URI vAppURI); + + /** + * @see VAppClient#suspend(URI) + */ + @POST + @Path("/power/action/suspend") + @Consumes(VCloudDirectorMediaType.TASK) + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture suspend(@EndpointParam URI vAppURI); + + /** + * @see VAppClient#getGuestCustomizationSection(URI) + */ + @GET + @Path("/guestCustomizationSection") + @Consumes + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture getGuestCustomizationSection(@EndpointParam URI vAppURI); + + /** + * @see VAppClient#modifyGuestCustomizationSection(URI, GuestCustomizationSection) + */ + @PUT + @Path("/guestCustomizationSection") + @Produces(VCloudDirectorMediaType.GUEST_CUSTOMIZATION_SECTION) + @Consumes(VCloudDirectorMediaType.TASK) + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture modifyGuestCustomizationSection(@EndpointParam URI vAppURI, @BinderParam(BindToXMLPayload.class) GuestCustomizationSection section); + + /** + * @see VAppClient#getLeaseSettingsSection(URI) + */ + @GET + @Path("/leaseSettingsSection") + @Consumes + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture getLeaseSettingsSection(@EndpointParam URI vAppURI); + + /** + * @see VAppClient#modifyLeaseSettingsSection(URI, LeaseSettingsSection) + */ + @PUT + @Path("/leaseSettingsSection") + @Produces(VCloudDirectorMediaType.LEASE_SETTINGS_SECTION) + @Consumes(VCloudDirectorMediaType.TASK) + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture modifyLeaseSettingsSection(@EndpointParam URI vAppURI, @BinderParam(BindToXMLPayload.class) LeaseSettingsSection section); + + /** + * @see VAppClient#ejectMedia(URI, MediaInsertOrEjectParams) + */ + @POST + @Path("/media/action/ejectMedia") + @Consumes(VCloudDirectorMediaType.TASK) + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture ejectMedia(@EndpointParam URI vAppURI, @BinderParam(BindToXMLPayload.class) MediaInsertOrEjectParams mediaParams); + + + /** + * @see VAppClient#insertMedia(URI, MediaInsertOrEjectParams) + */ + @POST + @Path("/media/action/insertMedia") + @Consumes(VCloudDirectorMediaType.TASK) + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture insertMedia(@EndpointParam URI vAppURI, @BinderParam(BindToXMLPayload.class) MediaInsertOrEjectParams mediaParams); + + /** + * @return asynchronous access to {@link Writable} features + */ + @Delegate + MetadataAsyncClient.Writable getMetadataClient(); + + /** + * @see VAppClient#getNetworkConfigSection(URI) + */ + @GET + @Path("/networkConfigSection") + @Consumes + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture getNetworkConfigSection(@EndpointParam URI vAppURI); + + /** + * @see VAppClient#modifyNetworkConfigSection(URI, NetworkConfigSection) + */ + @PUT + @Path("/networkConfigSection") + @Produces(VCloudDirectorMediaType.NETWORK_CONFIG_SECTION) + @Consumes(VCloudDirectorMediaType.TASK) + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture modifyNetworkConfigSection(@EndpointParam URI vAppURI, @BinderParam(BindToXMLPayload.class) NetworkConfigSection section); + + /** + * @see VAppClient#getNetworkConnectionSection(URI) + */ + @GET + @Path("/networkConnectionSection") + @Consumes + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture getNetworkConnectionSection(@EndpointParam URI vAppURI); + + /** + * @see VAppClient#modifyNetworkConnectionSection(URI, NetworkConnectionSection) + */ + @PUT + @Path("/networkConfigSection") + @Produces(VCloudDirectorMediaType.NETWORK_CONFIG_SECTION) + @Consumes(VCloudDirectorMediaType.TASK) + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture modifyNetworkConnectionSection(@EndpointParam URI vAppURI, @BinderParam(BindToXMLPayload.class) NetworkConnectionSection section); + + /** + * @see VAppClient#getNetworkSection(URI) + */ + @GET + @Path("/networkSection") + @Consumes + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture getNetworkSection(@EndpointParam URI vAppURI); + + /** + * @see VAppClient#getOperatingSystemSection(URI) + */ + @GET + @Path("/operatingSystemSection") + @Consumes + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture getOperatingSystemSection(@EndpointParam URI vAppURI); + + /** + * @see VAppClient#modifyOperatingSystemSection(URI, OperatingSystemSection) + */ + @PUT + @Path("/operatingSystemSection") + @Produces(VCloudDirectorMediaType.OPERATING_SYSTEM_SECTION) + @Consumes(VCloudDirectorMediaType.TASK) + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture modifyOperatingSystemSection(@EndpointParam URI vAppURI, @BinderParam(BindToXMLPayload.class) OperatingSystemSection section); + + /** + * @see VAppClient#getOwner(URI) + */ + @GET + @Path("/owner") + @Consumes + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture getOwner(@EndpointParam URI vAppURI); + + /** + * @see VAppClient#modifyOwner(URI, Owner) + */ + @PUT + @Path("/owner") + @Produces(VCloudDirectorMediaType.OWNER) + @Consumes(VCloudDirectorMediaType.TASK) + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture modifyOwner(@EndpointParam URI vAppURI, @BinderParam(BindToXMLPayload.class) Owner owner); + + /** + * @see VAppClient#getProductSections(URI) + */ + @GET + @Path("/productSections") + @Consumes + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture getProductSections(@EndpointParam URI vAppURI); + + /** + * @see VAppClient#modifyProductSections(URI, ProductSectionList) + */ + @PUT + @Path("/productSections") + @Produces(VCloudDirectorMediaType.PRODUCT_SECTION_LIST) + @Consumes(VCloudDirectorMediaType.TASK) + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture modifyProductSections(@EndpointParam URI vAppURI, @BinderParam(BindToXMLPayload.class) ProductSectionList sectionList); + + /** + * @see VAppClient#getPendingQuestion(URI) + */ + @GET + @Path("/question") + @Consumes + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture getPendingQuestion(@EndpointParam URI vAppURI); + + /** + * @see VAppClient#answerQuestion(URI, VmQuestionAnswer) + */ + @PUT + @Path("/question/action/answer") + @Produces(VCloudDirectorMediaType.VM_PENDING_ANSWER) + @Consumes + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture answerQuestion(@EndpointParam URI vAppURI, @BinderParam(BindToXMLPayload.class) VmQuestionAnswer answer); + + /** + * @see VAppClient#getRuntimeInfoSection(URI) + */ + @GET + @Path("/runtimeInfoSection") + @Consumes + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture getRuntimeInfoSection(@EndpointParam URI vAppURI); + + /** + * @see VAppClient#getScreenImage(URI) + */ + @GET + @Path("/screen") + @Consumes(VCloudDirectorMediaType.ANY_IMAGE) + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture getScreenImage(@EndpointParam URI vAppURI); + + /** + * @see VAppClient#getScreenTicket(URI) + */ + @POST + @Path("/screen/action/acquireTicket") + @Consumes + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture getScreenTicket(@EndpointParam URI vAppURI); + + /** + * @see VAppClient#getStartupSection(URI) + */ + @GET + @Path("/startupSection") + @Consumes + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture getStartupSection(@EndpointParam URI vAppURI); + + /** + * @see VAppClient#modifyStartupSection(URI, StartupSection) + */ + @PUT + @Path("/startupSection") + @Produces(VCloudDirectorMediaType.STARTUP_SECTION) + @Consumes(VCloudDirectorMediaType.TASK) + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture modifyStartupSection(@EndpointParam URI vAppURI, @BinderParam(BindToXMLPayload.class) StartupSection section); + + /** + * @see VAppClient#getVirtualHardwareSection(URI) + */ + @GET + @Path("/virtualHardwareSection") + @Consumes + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture getVirtualHardwareSection(@EndpointParam URI vAppURI); + + /** + * @see VAppClient#modifyVirtualHardwareSection(URI, VirtualHardwareSection) + */ + @PUT + @Path("/virtualHardwareSection") + @Produces(VCloudDirectorMediaType.VIRTUAL_HARDWARE_SECTION) + @Consumes(VCloudDirectorMediaType.TASK) + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture modifyVirtualHardwareSection(@EndpointParam URI vAppURI, @BinderParam(BindToXMLPayload.class) VirtualHardwareSection section); + + /** + * @see VAppClient#getVirtualHardwareSectionCpu(URI) + */ + @GET + @Path("/virtualHardwareSection/cpu") + @Consumes + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture getVirtualHardwareSectionCpu(@EndpointParam URI vAppURI); + + /** + * @see VAppClient#modifyVirtualHardwareSectionCpu(URI, RASD) + */ + @PUT + @Path("/virtualHardwareSection/cpu") + @Produces(VCloudDirectorMediaType.OVF_RASD_ITEM) + @Consumes(VCloudDirectorMediaType.TASK) + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture modifyVirtualHardwareSectionCpu(@EndpointParam URI vAppURI, @BinderParam(BindToXMLPayload.class) RASD rasd); + + /** + * @see VAppClient#getVirtualHardwareSectionDisks(URI) + */ + @GET + @Path("/virtualHardwareSection/disks") + @Consumes + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture getVirtualHardwareSectionDisks(@EndpointParam URI vAppURI); + + /** + * @see VAppClient#modifyVirtualHardwareSectionDisks(URI, RasdItemsList) + */ + @PUT + @Path("/virtualHardwareSection/disks") + @Produces(VCloudDirectorMediaType.OVF_RASD_ITEMS_LIST) + @Consumes(VCloudDirectorMediaType.TASK) + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture modifyVirtualHardwareSectionDisks(@EndpointParam URI vAppURI, @BinderParam(BindToXMLPayload.class) RasdItemsList rasdItemsList); + + /** + * @see VAppClient#getVirtualHardwareSectionMedia(URI) + */ + @GET + @Path("/virtualHardwareSection/media") + @Consumes + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture getVirtualHardwareSectionMedia(@EndpointParam URI vAppURI); + + /** + * @see VAppClient#getVirtualHardwareSectionMemory(URI) + */ + @GET + @Path("/virtualHardwareSection/memory") + @Consumes + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture getVirtualHardwareSectionMemory(@EndpointParam URI vAppURI); + + /** + * @see VAppClient#modifyVirtualHardwareSectionMemory(URI, RASD) + */ + @PUT + @Path("/virtualHardwareSection/memory") + @Produces(VCloudDirectorMediaType.OVF_RASD_ITEM) + @Consumes(VCloudDirectorMediaType.TASK) + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture modifyVirtualHardwareSectionMemory(@EndpointParam URI vAppURI, @BinderParam(BindToXMLPayload.class) RASD rasd); + + /** + * @see VAppClient#getVirtualHardwareSectionNetworkCards(URI) + */ + @GET + @Path("/virtualHardwareSection/networkCards") + @Consumes + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture getVirtualHardwareSectionNetworkCards(@EndpointParam URI vAppURI); + + /** + * @see VAppClient#modifyVirtualHardwareSectionNetworkCards(URI, RasdItemsList) + */ + @PUT + @Path("/virtualHardwareSection/networkCards") + @Produces(VCloudDirectorMediaType.OVF_RASD_ITEMS_LIST) + @Consumes(VCloudDirectorMediaType.TASK) + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture modifyVirtualHardwareSectionNetworkCards(@EndpointParam URI vAppURI, @BinderParam(BindToXMLPayload.class) RasdItemsList rasdItemsList); + + /** + * @see VAppClient#getVirtualHardwareSectionSerialPorts(URI) + */ + @GET + @Path("/virtualHardwareSection/serialPorts") + @Consumes + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture getVirtualHardwareSectionSerialPorts(@EndpointParam URI vAppURI); + + /** + * @see VAppClient#modifyVirtualHardwareSectionSerialPorts(URI, RasdItemsList) + */ + @PUT + @Path("/virtualHardwareSection/serialPorts") + @Produces(VCloudDirectorMediaType.OVF_RASD_ITEMS_LIST) + @Consumes(VCloudDirectorMediaType.TASK) + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture modifyVirtualHardwareSectionSerialPorts(@EndpointParam URI vAppURI, @BinderParam(BindToXMLPayload.class) RasdItemsList rasdItemsList); + +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VAppClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VAppClient.java new file mode 100644 index 0000000000..9762a4b0ea --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VAppClient.java @@ -0,0 +1,794 @@ +/* + * 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.features; + +import java.net.URI; +import java.util.concurrent.TimeUnit; + +import org.jclouds.concurrent.Timeout; +import org.jclouds.rest.annotations.Delegate; +import org.jclouds.vcloud.director.v1_5.domain.ControlAccessParams; +import org.jclouds.vcloud.director.v1_5.domain.DeployVAppParams; +import org.jclouds.vcloud.director.v1_5.domain.GuestCustomizationSection; +import org.jclouds.vcloud.director.v1_5.domain.LeaseSettingsSection; +import org.jclouds.vcloud.director.v1_5.domain.MediaInsertOrEjectParams; +import org.jclouds.vcloud.director.v1_5.domain.NetworkConfigSection; +import org.jclouds.vcloud.director.v1_5.domain.NetworkConnectionSection; +import org.jclouds.vcloud.director.v1_5.domain.Owner; +import org.jclouds.vcloud.director.v1_5.domain.ProductSectionList; +import org.jclouds.vcloud.director.v1_5.domain.RasdItemsList; +import org.jclouds.vcloud.director.v1_5.domain.RecomposeVAppParams; +import org.jclouds.vcloud.director.v1_5.domain.RelocateParams; +import org.jclouds.vcloud.director.v1_5.domain.RuntimeInfoSection; +import org.jclouds.vcloud.director.v1_5.domain.ScreenTicket; +import org.jclouds.vcloud.director.v1_5.domain.Task; +import org.jclouds.vcloud.director.v1_5.domain.UndeployVAppParams; +import org.jclouds.vcloud.director.v1_5.domain.VApp; +import org.jclouds.vcloud.director.v1_5.domain.VmPendingQuestion; +import org.jclouds.vcloud.director.v1_5.domain.VmQuestionAnswer; +import org.jclouds.vcloud.director.v1_5.domain.ovf.NetworkSection; +import org.jclouds.vcloud.director.v1_5.domain.ovf.OperatingSystemSection; +import org.jclouds.vcloud.director.v1_5.domain.ovf.RASD; +import org.jclouds.vcloud.director.v1_5.domain.ovf.StartupSection; +import org.jclouds.vcloud.director.v1_5.domain.ovf.VirtualHardwareSection; + +/** + * Provides synchronous access to {@link VApp} objects. + * + * @author grkvlt@apache.org + * @see VAppAsyncClient + * @version 1.5 + */ +@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS) +public interface VAppClient { + + /** + * Retrieves a vApp/VM. + * + * The vApp/VM could be in one of these statuses: + *
    + *
  • {@link org.jclouds.vcloud.director.v1_5.domain.ResourceEntityType.Status#FAILED_CREATION} - + * Transient entity state, e.g., model object is created but the corresponding VC backing does not + * exist yet. This is further sub-categorized in the respective entities. + *
  • {@link org.jclouds.vcloud.director.v1_5.domain.ResourceEntityType.Status#UNRESOLVED} - + * Entity is whole, e.g., VM creation is complete and all the required model objects and VC backings are + * created. + *
  • {@link org.jclouds.vcloud.director.v1_5.domain.ResourceEntityType.Status#RESOLVED} - + * Entity is resolved. + *
  • {@link org.jclouds.vcloud.director.v1_5.domain.ResourceEntityType.Status#DEPLOYED} - + * Entity is deployed. + *
  • {@link org.jclouds.vcloud.director.v1_5.domain.ResourceEntityType.Status#SUSPENDED} - + * All VMs of the vApp are suspended. + *
  • {@link org.jclouds.vcloud.director.v1_5.domain.ResourceEntityType.Status#POWERED_ON} - + * All VMs of the vApp are powered on. + *
  • {@link org.jclouds.vcloud.director.v1_5.domain.ResourceEntityType.Status#WAITING_FOR_INPUT} - + * VM is pending response on a question. + *
  • {@link org.jclouds.vcloud.director.v1_5.domain.ResourceEntityType.Status#UNKNOWN} - + * Entity state could not be retrieved from the inventory, e.g., VM power state is null. + *
  • {@link org.jclouds.vcloud.director.v1_5.domain.ResourceEntityType.Status#UNRECOGNIZED} - + * Entity state was retrieved from the inventory but could not be mapped to an internal state. + *
  • {@link org.jclouds.vcloud.director.v1_5.domain.ResourceEntityType.Status#POWERED_OFF} - + * All VMs of the vApp are powered off. + *
  • {@link org.jclouds.vcloud.director.v1_5.domain.ResourceEntityType.Status#INCONSISTENT_STATE} - + * Apply to VM status, if a vm is {@code POWERED_ON}, or {@code WAITING_FOR_INPUT}, but is + * undeployed, it is in an inconsistent state. + *
  • {@link org.jclouds.vcloud.director.v1_5.domain.ResourceEntityType.Status#MIXED} - + * vApp status is set to {@code MIXED} when the VMs in the vApp are in different power states + *
+ * + *
+    * GET /vApp/{id}
+    * 
+ * + * @since 0.9 + */ + VApp getVApp(URI vAppURI); + + /** + * Modifies the name/description of a vApp/VM. + * + *
+    * PUT /vApp/{id}
+    * 
+ * + * @since 0.9 + */ + Task modifyVApp(URI vAppURI, VApp vApp); + + /** + * Deletes a vApp/VM. + * + *
+    * DELETE /vApp/{id}
+    * 
+ * + * @since 0.9 + */ + Task deleteVApp(URI vAppURI); + + /** + * Consolidates a vm. + * + *
+    * POST /vApp/{id}/action/consolidate
+    * 
+ * + * @since 1.5 + */ + Task consolidateVApp(URI vAppURI); + + /** + * Modifies the control access of a vApp. + * + *
+    * POST /vApp/{id}/action/controlAccess
+    * 
+ * + * @since 0.9 + */ + ControlAccessParams controlAccess(URI vAppURI, ControlAccessParams params); + + /** + * Deploys a vApp/VM. + * + * Deployment means allocation of all resource for a vApp/VM like CPU and memory + * from a vDC resource pool. Deploying a vApp automatically deploys all of the + * virtual machines it contains. As of version 1.5 the operation supports force + * customization passed with {@link DeployVAppParamsType#setForceCustomization(Boolean)} + * parameter. + * + *
+    * POST /vApp/{id}/action/deploy
+    * 
+ * + * @since 0.9 + */ + Task deploy(URI vAppURI, DeployVAppParams params); + + /** + * Discard suspended state of a vApp/VM. + * + * Discarding suspended state of a vApp automatically discarded suspended + * states of all of the virtual machines it contains. + * + *
+    * POST /vApp/{id}/action/discardSuspendedState
+    * 
+ * + * @since 0.9 + */ + Task discardSuspendedState(URI vAppURI); + + /** + * Place the vApp into maintenance mode. + * + * While in maintenance mode, a system admin can operate on the vApp as + * usual, but end users are restricted to read-only operations. Any + * user-initiated tasks running when the vApp enters maintenance mode will + * continue. + * + *
+    * POST /vApp/{id}/action/enterMaintenanceMode
+    * 
+ * + * @since 1.5 + */ + void enterMaintenanceMode(URI vAppURI); + + /** + * Take the vApp out of maintenance mode. + * + *
+    * POST /vApp/{id}/action/exitMaintenanceMode
+    * 
+ * + * @since 1.5 + */ + void exitMaintenanceMode(URI vAppURI); + + /** + * Installs VMware tools to the virtual machine. + * + * It should be running in order for them to be installed. + * + *
+    * POST /vApp/{id}/action/installVMwareTools
+    * 
+ * + * @since 1.5 + */ + Task installVMwareTools(URI vAppURI); + + /** + * Recompose a vApp by removing its own VMs and/or adding new ones from other + * vApps or vApp templates. + * + * To remove VMs you should put their references in elements. The way you add + * VMs is the same as described in compose vApp operation + * {@link VdcClient#composeVApp(URI, org.jclouds.vcloud.director.v1_5.domain.ComposeVAppParams)}. + * The status of vApp will be in {@link org.jclouds.vcloud.director.v1_5.domain.ResourceEntityType.Status#UNRESOLVED} + * until the recompose task is finished. + * + *
+    * POST /vApp/{id}/action/recomposeVApp
+    * 
+ * + * @since 1.0 + */ + Task recomposeVApp(URI vAppURI, RecomposeVAppParams params); + + /** + * Relocates a vm. + * + *
+    * POST /vApp/{id}/action/relocate
+    * 
+ * + * @since 1.5 + */ + Task relocate(URI vAppURI, RelocateParams params); + + /** + * Undeploy a vApp/VM. + * + * Undeployment means deallocation of all resources for a vApp/VM like CPU + * and memory from a vDC resource pool. Undeploying a vApp automatically + * undeploys all of the virtual machines it contains. + * + *
+    * POST /vApp/{id}/action/undeploy
+    * 
+ * + * @since 0.9 + */ + Task undeploy(URI vAppURI, UndeployVAppParams params); + + /** + * Upgrade virtual hardware version of a VM to the highest supported virtual + * hardware version of provider vDC where the VM locates. + * + *
+    * POST /vApp/{id}/action/upgradeHardwareVersion
+    * 
+ * + * @since 1.5 + */ + Task upgradeHardwareVersion(URI vAppURI); + + /** + * Retrieves the control access information for a vApp. + * + * The vApp could be shared to everyone or could be shared to specific user, + * by modifying the control access values. + * + *
+    * GET /vApp/{id}/controlAccess
+    * 
+ * + * @since 0.9 + */ + ControlAccessParams getControlAccess(URI vAppURI); + + /** + * Powers off a vApp/VM. + * + * If the operation is used over a vApp then all VMs are powered off. This operation is allowed only when the vApp/VM is powered on. + * + *
+    * POST /vApp/{id}/power/action/powerOff
+    * 
+ * + * @since 0.9 + */ + Task powerOff(URI vAppURI); + + /** + * Powers on a vApp/VM. + * + * If the operation is used over a vApp then all VMs are powered on. This + * operation is allowed only when the vApp/VM is powered off. + * + *
+    * POST /vApp/{id}/power/action/powerOn
+    * 
+ * + * @since 0.9 + */ + Task powerOn(URI vAppURI); + + /** + * Reboots a vApp/VM. + * + * The vApp/VM should be started in order to reboot it. + * + *
+    * POST /vApp/{id}/power/action/reboot
+    * 
+ * + * @since 0.9 + */ + Task reboot(URI vAppURI); + + /** + * Resets a vApp/VM. + * + * If the operation is used over a vApp then all VMs are reset. This + * operation is allowed only when the vApp/VM is powered on. + * + *
+    * POST /vApp/{id}/power/action/reset
+    * 
+ * + * @since 0.9 + */ + Task reset(URI vAppURI); + + /** + * Shutdowns a vApp/VM. + * + * If the operation is used over a vApp then all VMs are shutdown. This + * operation is allowed only when the vApp/VM is powered on. + * + *
+    * POST /vApp/{id}/power/action/shutdown
+    * 
+ * + * @since 0.9 + */ + Task shutdown(URI vAppURI); + + /** + * Suspends a vApp/VM. + * + * If the operation is used over a vApp then all VMs are suspended. This + * operation is allowed only when the vApp/VM is powered on. + * + *
+    * POST /vApp/{id}/power/action/suspend
+    * 
+ * + * @since 0.9 + */ + Task suspend(URI vAppURI); + + /** + * Retrieves the guest customization section of a VM. + * + *
+    * GET /vApp/{id}/guestCustomizationSection
+    * 
+ * + * @since 1.0 + */ + GuestCustomizationSection getGuestCustomizationSection(URI vAppURI); + + /** + * Modifies the guest customization section of a VM. + * + *
+    * PUT /vApp/{id}/guestCustomizationSection
+    * 
+ * + * @since 1.0 + */ + Task modifyGuestCustomizationSection(URI vAppURI, GuestCustomizationSection section); + + /** + * Retrieves the lease settings section of a VM. + * + *
+    * GET /vApp/{id}/leaseSettingsSection
+    * 
+ * + * @since 0.9 + */ + LeaseSettingsSection getLeaseSettingsSection(URI vAppURI); + + /** + * Modifies the lease settings section of a VM. + * + *
+    * PUT /vApp/{id}/leaseSettingsSection
+    * 
+ * + * @since 0.9 + */ + Task modifyLeaseSettingsSection(URI vAppURI, LeaseSettingsSection section); + + /** + * Ejects a media from a VM. + * + *
+    * PUT /vApp/{id}/media/action/ejectMedia
+    * 
+ * + * @since 0.9 + */ + Task ejectMedia(URI vAppURI, MediaInsertOrEjectParams mediaParams); + + /** + * Inserts a media into a VM. + * + *
+    * PUT /vApp/{id}/media/action/insertMedia
+    * 
+ * + * @since 0.9 + */ + Task insertMedia(URI vAppURI, MediaInsertOrEjectParams mediaParams); + + /** + * @return synchronous access to {@link Metadata.Writeable} features + */ + @Delegate + MetadataClient.Writeable getMetadataClient(); + + /** + * Retrieves the network configuration section of a VM. + * + *
+    * GET /vApp/{id}/networkConfigSection
+    * 
+ * + * @since 0.9 + */ + NetworkConfigSection getNetworkConfigSection(URI vAppURI); + + /** + * Modifies the network configuration section of a VM. + * + *
+    * PUT /vApp/{id}/networkConfigSection
+    * 
+ * + * @since 0.9 + */ + Task modifyNetworkConfigSection(URI vAppURI, NetworkConfigSection section); + + /** + * Retrieves the network connection section of a VM. + * + *
+    * GET /vApp/{id}/networkConnectionSection
+    * 
+ * + * @since 0.9 + */ + NetworkConnectionSection getNetworkConnectionSection(URI vAppURI); + + /** + * Modifies the network connection section of a VM. + * + *
+    * PUT /vApp/{id}/networkConnectionSection
+    * 
+ * + * @since 0.9 + */ + Task modifyNetworkConnectionSection(URI vAppURI, NetworkConnectionSection section); + + /** + * Retrieves the network section of a VM. + * + *
+    * GET /vApp/{id}/networkSection
+    * 
+ * + * @since 0.9 + */ + NetworkSection getNetworkSection(URI vAppURI); + + /** + * Retrieves the operating system section of a VM. + * + *
+    * GET /vApp/{id}/operatingSystemSection
+    * 
+ * + * @since 0.9 + */ + OperatingSystemSection getOperatingSystemSection(URI vAppURI); + + /** + * Modifies the operating system section of a VM. + * + *
+    * PUT /vApp/{id}/operatingSystemSection
+    * 
+ * + * @since 0.9 + */ + Task modifyOperatingSystemSection(URI vAppURI, OperatingSystemSection section); + + /** + * Retrieves the owner of a vApp. + * + *
+    * GET /vApp/{id}/owner
+    * 
+ * + * @since 1.5 + */ + Owner getOwner(URI vAppURI); + + /** + * Changes VApp owner. + * + *
+    * PUT /vApp/{id}/owner
+    * 
+ * + * @since 1.5 + */ + Task modifyOwner(URI vAppURI, Owner owner); + + /** + * Retrieves VAppTemplate/VM product sections. + * + *
+    * GET /vApp/{id}/productSections
+    * 
+ * + * @since 1.5 + */ + ProductSectionList getProductSections(URI vAppURI); + + /** + * Modifies the product section information of a vApp/VM. + * + *
+    * PUT /vApp/{id}/productSections
+    * 
+ * + * @since 1.5 + */ + Task modifyProductSections(URI vAppURI, ProductSectionList sectionList); + + /** + * Retrieves a pending question for a VM. + * + * The user should answer to the question by operation {@link #answerQuestion(URI, VmQuestionAnswer)}. + * Usually questions will be asked when the VM is powering on. + * + *
+    * GET /vApp/{id}/question
+    * 
+ * + * @since 0.9 + */ + VmPendingQuestion getPendingQuestion(URI vAppURI); + + /** + * Answer on a pending question. + * + * The answer IDs of choice and question should match the ones returned from operation {@link #getPendingQuestion(URI)}. + * + *
+    * PUT /vApp/{id}/question/action/answer
+    * 
+ * + * @since 0.9 + */ + void answerQuestion(URI vAppURI, VmQuestionAnswer answer); + + /** + * Retrieves the runtime info section of a VM. + * + *
+    * GET /vApp/{id}/runtimeInfoSection
+    * 
+ * + * @since 1.5 + */ + RuntimeInfoSection getRuntimeInfoSection(URI vAppURI); + + /** + * Retrieves the thumbnail of the screen of a VM. + * + * The content type of the response may vary (e.g. {@code image/png}, {@code image/gif}). + * + *
+    * GET /vApp/{id}/screen
+    * 
+ * + * @since 0.9 + */ + byte[] getScreenImage(URI vAppURI); + + /** + * Retrieve a screen ticket for remote console connection to a VM. + * + * A screen ticket is a string that includes the virtual machine's IP address, its managed object reference, and a string + * that has been encoded as described in RFC 2396. Each VM element in a vApp includes a link where rel="screen:acquireTicket". + * You can use that link to request a screen ticket that you can use with the vmware-vmrc utility to open a VMware Remote + * Console for the virtual machine represented by that VM element. The vApp should be running to get a valid screen ticket. + * + *
+    * GET /vApp/{id}/screen/action/acquireTicket
+    * 
+ * + * @since 0.9 + */ + ScreenTicket getScreenTicket(URI vAppURI); + + /** + * Retrieves the startup section of a VM. + * + *
+    * GET /vApp/{id}/startupSection
+    * 
+ * + * @since 0.9 + */ + StartupSection getStartupSection(URI vAppURI); + + /** + * Modifies the startup section of a VM. + * + *
+    * PUT /vApp/{id}/startupSection
+    * 
+ * + * @since 0.9 + */ + Task modifyStartupSection(URI vAppURI, StartupSection section); + + /** + * Retrieves the virtual hardware section of a VM. + * + *
+    * GET /vApp/{id}/virtualHardwareSection
+    * 
+ * + * @since 0.9 + */ + VirtualHardwareSection getVirtualHardwareSection(URI vAppURI); + + /** + * Modifies the virtual hardware section of a VM. + * + *
+    * PUT /vApp/{id}/virtualHardwareSection
+    * 
+ * + * @since 0.9 + */ + Task modifyVirtualHardwareSection(URI vAppURI, VirtualHardwareSection section); + + /** + * Retrieves the CPU properties in virtual hardware section of a VM. + * + *
+    * GET /vApp/{id}/virtualHardwareSection/cpu
+    * 
+ * + * @since 0.9 + */ + RASD getVirtualHardwareSectionCpu(URI vAppURI); + + /** + * Modifies the CPU properties in virtual hardware section of a VM. + * + *
+    * PUT /vApp/{id}/virtualHardwareSection/cpu
+    * 
+ * + * @since 0.9 + */ + Task modifyVirtualHardwareSectionCpu(URI vAppURI, RASD rasd); + + /** + * Retrieves a list of RASD items for disks from virtual hardware section of a VM. + * + *
+    * GET /vApp/{id}/virtualHardwareSection/disks
+    * 
+ * + * @since 0.9 + */ + RasdItemsList getVirtualHardwareSectionDisks(URI vAppURI); + + /** + * Modifies the disks list in virtual hardware section of a VM. + * + *
+    * PUT /vApp/{id}/virtualHardwareSection/disks
+    * 
+ * + * @since 0.9 + */ + Task modifyVirtualHardwareSectionDisks(URI vAppURI, RasdItemsList rasdItemsList); + + /** + * Retrieves the list of RASD items that represents the floppies and CD/DVD drives in a VM. + * + *
+    * GET /vApp/{id}/virtualHardwareSection/media
+    * 
+ * + * @since 0.9 + */ + RasdItemsList getVirtualHardwareSectionMedia(URI vAppURI); + + /** + * Retrieves the RASD item that contains memory information from virtual hardware section of a VM. + * + *
+    * GET /vApp/{id}/virtualHardwareSection/memory
+    * 
+ * + * @since 0.9 + */ + RASD getVirtualHardwareSectionMemory(URI vAppURI); + + /** + * Modifies the memory properties in virtual hardware section of a VM. + * + *
+    * PUT /vApp/{id}/virtualHardwareSection/memory
+    * 
+ * + * @since 0.9 + */ + Task modifyVirtualHardwareSectionMemory(URI vAppURI, RASD rasd); + + /** + * Retrieves a list of RASD items for network cards from virtual hardware section of a VM. + * + *
+    * GET /vApp/{id}/virtualHardwareSection/networkCards
+    * 
+ * + * @since 0.9 + */ + RasdItemsList getVirtualHardwareSectionNetworkCards(URI vAppURI); + + /** + * Modifies the network cards list in virtual hardware section of a VM. + * + *
+    * PUT /vApp/{id}/virtualHardwareSection/networkCards
+    * 
+ * + * @since 0.9 + */ + Task modifyVirtualHardwareSectionNetworkCards(URI vAppURI, RasdItemsList rasdItemsList); + + /** + * Retrieves a list of RASD items for serial ports from virtual hardware section of a VM. + * + *
+    * GET /vApp/{id}/virtualHardwareSection/serialPorts
+    * 
+ * + * @since 1.5 + */ + RasdItemsList getVirtualHardwareSectionSerialPorts(URI vAppURI); + + /** + * Modifies the serial ports list in virtual hardware section of a VM. + * + *
+    * PUT /vApp/{id}/virtualHardwareSection/serialPorts
+    * 
+ * + * @since 1.5 + */ + Task modifyVirtualHardwareSectionSerialPorts(URI vAppURI, RasdItemsList rasdItemsList); +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VdcAsyncClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VdcAsyncClient.java index 58fbd06bfa..1a085f15f3 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VdcAsyncClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VdcAsyncClient.java @@ -52,7 +52,6 @@ import org.jclouds.vcloud.director.v1_5.functions.ThrowVCloudErrorOn4xx; import com.google.common.util.concurrent.ListenableFuture; /** - * @see VdcClient * @author danikov */ @@ -73,7 +72,7 @@ public interface VdcAsyncClient { */ @POST @Path("/action/captureVApp") - @Consumes(VCloudDirectorMediaType.V_APP_TEMPLATE) + @Consumes(VCloudDirectorMediaType.VAPP_TEMPLATE) @Produces(VCloudDirectorMediaType.CAPTURE_VAPP_PARAMS) @JAXBResponseParser @ExceptionParser(ThrowVCloudErrorOn4xx.class) @@ -97,8 +96,8 @@ public interface VdcAsyncClient { */ @POST @Path("/action/cloneVApp") - @Consumes(VCloudDirectorMediaType.V_APP) - @Produces(VCloudDirectorMediaType.CLONE_V_APP_PARAMS) //TODO fix these etc. + @Consumes(VCloudDirectorMediaType.VAPP) + @Produces(VCloudDirectorMediaType.CLONE_VAPP_PARAMS) //TODO fix these etc. @JAXBResponseParser @ExceptionParser(ThrowVCloudErrorOn4xx.class) ListenableFuture cloneVApp(@EndpointParam URI vdcURI, @@ -109,8 +108,8 @@ public interface VdcAsyncClient { */ @POST @Path("/action/cloneVAppTemplate") - @Consumes(VCloudDirectorMediaType.V_APP_TEMPLATE) - @Produces(VCloudDirectorMediaType.CLONE_V_APP_TEMPLATE_PARAMS) + @Consumes(VCloudDirectorMediaType.VAPP_TEMPLATE) + @Produces(VCloudDirectorMediaType.CLONE_VAPP_TEMPLATE_PARAMS) @JAXBResponseParser @ExceptionParser(ThrowVCloudErrorOn4xx.class) ListenableFuture cloneVAppTemplate(@EndpointParam URI vdcURI, @@ -121,7 +120,7 @@ public interface VdcAsyncClient { */ @POST @Path("/action/composeVApp") - @Consumes(VCloudDirectorMediaType.V_APP) + @Consumes(VCloudDirectorMediaType.VAPP) @Produces(VCloudDirectorMediaType.COMPOSE_VAPP_PARAMS) @JAXBResponseParser @ExceptionParser(ThrowVCloudErrorOn4xx.class) @@ -133,7 +132,7 @@ public interface VdcAsyncClient { */ @POST @Path("/action/instantiateVApp") - @Consumes(VCloudDirectorMediaType.V_APP) + @Consumes(VCloudDirectorMediaType.VAPP) @Produces(VCloudDirectorMediaType.INSTANTIATE_VAPP_TEMPLATE_PARAMS) @JAXBResponseParser @ExceptionParser(ThrowVCloudErrorOn4xx.class) @@ -145,7 +144,7 @@ public interface VdcAsyncClient { */ @POST @Path("/action/uploadVAppTemplate") - @Consumes(VCloudDirectorMediaType.V_APP_TEMPLATE) + @Consumes(VCloudDirectorMediaType.VAPP_TEMPLATE) @Produces(VCloudDirectorMediaType.UPLOAD_VAPP_TEMPLATE_PARAMS) @JAXBResponseParser @ExceptionParser(ThrowVCloudErrorOn4xx.class) diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VdcClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VdcClient.java index 19fed49178..009230e0f4 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VdcClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VdcClient.java @@ -38,7 +38,6 @@ import org.jclouds.vcloud.director.v1_5.domain.Vdc; /** * Provides synchronous access to a vDC. - *

* * @see VdcAsyncClient * @see