mirror of https://github.com/apache/jclouds.git
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
f3167442c9
|
@ -19,6 +19,7 @@
|
||||||
package org.jclouds.vcloud.director.v1_5;
|
package org.jclouds.vcloud.director.v1_5;
|
||||||
|
|
||||||
import org.jclouds.rest.annotations.Delegate;
|
import org.jclouds.rest.annotations.Delegate;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.domain.AdminOrg;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Catalog;
|
import org.jclouds.vcloud.director.v1_5.domain.Catalog;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Group;
|
import org.jclouds.vcloud.director.v1_5.domain.Group;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Media;
|
import org.jclouds.vcloud.director.v1_5.domain.Media;
|
||||||
|
|
|
@ -22,6 +22,7 @@ import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import org.jclouds.concurrent.Timeout;
|
import org.jclouds.concurrent.Timeout;
|
||||||
import org.jclouds.rest.annotations.Delegate;
|
import org.jclouds.rest.annotations.Delegate;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.domain.AdminOrg;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Catalog;
|
import org.jclouds.vcloud.director.v1_5.domain.Catalog;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Group;
|
import org.jclouds.vcloud.director.v1_5.domain.Group;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Media;
|
import org.jclouds.vcloud.director.v1_5.domain.Media;
|
||||||
|
|
|
@ -129,14 +129,31 @@ public class VCloudDirectorMediaType {
|
||||||
|
|
||||||
public static final String ADMIN_CATALOG = "application/vnd.vmware.admin.catalog+xml";
|
public static final String ADMIN_CATALOG = "application/vnd.vmware.admin.catalog+xml";
|
||||||
|
|
||||||
public static final String ADMIN_ORGANIZATION = "application/vnd.vmware.admin.organization+xml";
|
public static final String ADMIN_ORG = "application/vnd.vmware.admin.organization+xml";
|
||||||
|
|
||||||
public static final String PUBLISH_CATALOG_PARAMS = "application/vnd.vmware.admin.publishCatalogParams+xml";
|
public static final String PUBLISH_CATALOG_PARAMS = "application/vnd.vmware.admin.publishCatalogParams+xml";
|
||||||
|
|
||||||
public static final String GROUP = "application/vnd.vmware.admin.group+xml";
|
public static final String GROUP = "application/vnd.vmware.admin.group+xml";
|
||||||
|
|
||||||
|
public static final String ORG_VAPP_TEMPLATE_LEASE_SETTINGS = "application/vnd.vmware.admin.vAppTemplateLeaseSettings+xml";
|
||||||
|
|
||||||
|
public static final String ORG_LEASE_SETTINGS = "application/vnd.vmware.admin.vAppLeaseSettings+xml";
|
||||||
|
|
||||||
|
public static final String ORG_PASSWORD_POLICY_SETTINGS = "application/vnd.vmware.admin.organizationPasswordPolicySettings+xml";
|
||||||
|
|
||||||
|
public static final String ORG_LDAP_SETTINGS = "application/vnd.vmware.admin.organizationLdapSettings+xml";
|
||||||
|
|
||||||
|
public static final String ORG_GENERAL_SETTINGS = "application/vnd.vmware.admin.organizationGeneralSettings+xml";
|
||||||
|
|
||||||
|
public static final String ORG_EMAIL_SETTINGS = "application/vnd.vmware.admin.organizationEmailSettings+xml";
|
||||||
|
|
||||||
|
public static final String ORG_SETTINGS = "application/vnd.vmware.admin.orgSettings+xml";
|
||||||
|
|
||||||
|
public static final String ADMIN_NETWORK = "application/vnd.vmware.admin.network+xml";
|
||||||
|
|
||||||
|
public static final String ADMIN_ORG_NETWORK = "application/vnd.vmware.admin.orgNetwork+xml";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* All acceptable media types.
|
* All acceptable media types.
|
||||||
*
|
*
|
||||||
* This list must be updated whenever a new media type constant is added.
|
* This list must be updated whenever a new media type constant is added.
|
||||||
|
@ -148,11 +165,14 @@ public class VCloudDirectorMediaType {
|
||||||
MEDIA, OWNER, VDC, ADMIN_USER, V_APP, V_APP_TEMPLATE,
|
MEDIA, OWNER, VDC, ADMIN_USER, V_APP, V_APP_TEMPLATE,
|
||||||
CAPTURE_VAPP_PARAMS, CLONE_V_APP_PARAMS, CLONE_V_APP_TEMPLATE_PARAMS,
|
CAPTURE_VAPP_PARAMS, CLONE_V_APP_PARAMS, CLONE_V_APP_TEMPLATE_PARAMS,
|
||||||
COMPOSE_VAPP_PARAMS, INSTANTIATE_VAPP_TEMPLATE_PARAMS,
|
COMPOSE_VAPP_PARAMS, INSTANTIATE_VAPP_TEMPLATE_PARAMS,
|
||||||
UPLOAD_VAPP_TEMPLATE_PARAMS, ADMIN_CATALOG, ADMIN_ORGANIZATION,
|
UPLOAD_VAPP_TEMPLATE_PARAMS, ADMIN_CATALOG, ADMIN_ORG,
|
||||||
QUERY_RESULT_RECORDS, QUERY_RESULT_REFERENCES, QUERY_RESULT_ID_RECORDS,
|
QUERY_RESULT_RECORDS, QUERY_RESULT_REFERENCES, QUERY_RESULT_ID_RECORDS,
|
||||||
CONTROL_ACCESS, VAPP_TEMPLATE, CUSTOMIZATION_SECTION, GUEST_CUSTOMIZATION_SECTION,
|
CONTROL_ACCESS, VAPP_TEMPLATE, CUSTOMIZATION_SECTION, GUEST_CUSTOMIZATION_SECTION,
|
||||||
NETWORK_SECTION, NETWORK_CONFIG_SECTION, NETWORK_CONNECTION_SECTION,
|
NETWORK_SECTION, NETWORK_CONFIG_SECTION, NETWORK_CONNECTION_SECTION,
|
||||||
CLONE_MEDIA_PARAMS, LEASE_SETTINGS_SECTION, RELOCATE_TEMPLATE, ENVELOPE,
|
CLONE_MEDIA_PARAMS, LEASE_SETTINGS_SECTION, RELOCATE_TEMPLATE, ENVELOPE,
|
||||||
PUBLISH_CATALOG_PARAMS, GROUP
|
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
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,11 +42,32 @@ import org.jclouds.vcloud.director.v1_5.VCloudDirectorClient;
|
||||||
import org.jclouds.vcloud.director.v1_5.annotations.Login;
|
import org.jclouds.vcloud.director.v1_5.annotations.Login;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Session;
|
import org.jclouds.vcloud.director.v1_5.domain.Session;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.SessionWithToken;
|
import org.jclouds.vcloud.director.v1_5.domain.SessionWithToken;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.*;
|
import org.jclouds.vcloud.director.v1_5.features.AdminCatalogAsyncClient;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.features.AdminCatalogClient;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.features.AdminOrgAsyncClient;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.features.AdminOrgClient;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.features.CatalogAsyncClient;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.features.CatalogClient;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.features.GroupAsyncClient;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.features.GroupClient;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.features.MediaAsyncClient;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.features.MediaClient;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.MetadataAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.features.MetadataAsyncClient;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.MetadataClient;
|
import org.jclouds.vcloud.director.v1_5.features.MetadataClient;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.features.NetworkAsyncClient;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.features.NetworkClient;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.features.OrgAsyncClient;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.features.OrgClient;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.features.QueryAsyncClient;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.features.QueryClient;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.features.TaskAsyncClient;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.features.TaskClient;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.UploadAsyncClient;
|
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.UploadClient;
|
||||||
|
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;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.features.VdcClient;
|
||||||
import org.jclouds.vcloud.director.v1_5.functions.LoginUserInOrgWithPassword;
|
import org.jclouds.vcloud.director.v1_5.functions.LoginUserInOrgWithPassword;
|
||||||
import org.jclouds.vcloud.director.v1_5.handlers.InvalidateSessionAndRetryOn401AndLogoutOnClose;
|
import org.jclouds.vcloud.director.v1_5.handlers.InvalidateSessionAndRetryOn401AndLogoutOnClose;
|
||||||
import org.jclouds.vcloud.director.v1_5.handlers.VCloudDirectorErrorHandler;
|
import org.jclouds.vcloud.director.v1_5.handlers.VCloudDirectorErrorHandler;
|
||||||
|
@ -86,6 +107,7 @@ public class VCloudDirectorRestClientModule extends RestClientModule<VCloudDirec
|
||||||
.put(MetadataClient.Readable.class, MetadataAsyncClient.Readable.class)
|
.put(MetadataClient.Readable.class, MetadataAsyncClient.Readable.class)
|
||||||
.put(MetadataClient.Writeable.class, MetadataAsyncClient.Writable.class)
|
.put(MetadataClient.Writeable.class, MetadataAsyncClient.Writable.class)
|
||||||
.put(AdminCatalogClient.class, AdminCatalogAsyncClient.class)
|
.put(AdminCatalogClient.class, AdminCatalogAsyncClient.class)
|
||||||
|
.put(AdminOrgClient.class, AdminOrgAsyncClient.class)
|
||||||
.put(GroupClient.class, GroupAsyncClient.class)
|
.put(GroupClient.class, GroupAsyncClient.class)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,6 @@
|
||||||
|
|
||||||
package org.jclouds.vcloud.director.v1_5.domain;
|
package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
@ -28,8 +26,6 @@ import javax.xml.bind.annotation.XmlAccessType;
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
import com.google.common.collect.Sets;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -69,7 +65,7 @@ public class AdminCatalog extends CatalogType<AdminCatalog> {
|
||||||
public static class Builder extends CatalogType.Builder<AdminCatalog> {
|
public static class Builder extends CatalogType.Builder<AdminCatalog> {
|
||||||
|
|
||||||
public AdminCatalog build() {
|
public AdminCatalog build() {
|
||||||
return new AdminCatalog(href, type, links, description, tasksInProgress, id, name, owner, catalogItems, isPublished);
|
return new AdminCatalog(href, type, links, description, tasks, id, name, owner, catalogItems, isPublished);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -132,14 +128,14 @@ public class AdminCatalog extends CatalogType<AdminCatalog> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see EntityType#getTasksInProgress()
|
* @see EntityType#getTasks()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder tasksInProgress(TasksInProgress tasksInProgress) {
|
public Builder tasks(Set<Task> tasks) {
|
||||||
this.tasksInProgress = tasksInProgress;
|
super.tasks(tasks);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ReferenceType#getHref()
|
* @see ReferenceType#getHref()
|
||||||
*/
|
*/
|
||||||
|
@ -157,25 +153,24 @@ public class AdminCatalog extends CatalogType<AdminCatalog> {
|
||||||
this.type = type;
|
this.type = type;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see EntityType#getLinks()
|
* @see ResourceType#getLinks()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder links(Set<Link> links) {
|
public Builder links(Set<Link> links) {
|
||||||
this.links = Sets.newLinkedHashSet(checkNotNull(links, "links"));
|
return Builder.class.cast(super.links(links));
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see EntityType#getLinks()
|
* @see ResourceType#getLinks()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder link(Link link) {
|
public Builder link(Link link) {
|
||||||
this.links.add(checkNotNull(link, "link"));
|
return Builder.class.cast(super.link(link));
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Builder fromCatalogType(CatalogType<AdminCatalog> in) {
|
public Builder fromCatalogType(CatalogType<AdminCatalog> in) {
|
||||||
return Builder.class.cast(super.fromCatalogType(in));
|
return Builder.class.cast(super.fromCatalogType(in));
|
||||||
|
@ -190,8 +185,8 @@ public class AdminCatalog extends CatalogType<AdminCatalog> {
|
||||||
// For JAXB
|
// For JAXB
|
||||||
}
|
}
|
||||||
|
|
||||||
public AdminCatalog(URI href, String type, Set<Link> links, String description, TasksInProgress tasksInProgress, String id,
|
public AdminCatalog(URI href, String type, Set<Link> links, String description, Set<Task> tasks, String id,
|
||||||
String name, Owner owner, CatalogItems catalogItems, Boolean published) {
|
String name, Owner owner, CatalogItems catalogItems, Boolean published) {
|
||||||
super(href, type, links, description, tasksInProgress, id, name, owner, catalogItems, published);
|
super(href, type, links, description, tasks, id, name, owner, catalogItems, published);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,9 @@ package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
|
|
||||||
|
import java.net.URI;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
|
@ -145,7 +148,8 @@ public class AdminOrg extends Org {
|
||||||
}
|
}
|
||||||
|
|
||||||
public AdminOrg build() {
|
public AdminOrg build() {
|
||||||
return new AdminOrg(settings, users, groups, catalogs, vdcs, networks);
|
return new AdminOrg(href, type, links, description, tasks, id,
|
||||||
|
name, fullName, isEnabled, settings, users, groups, catalogs, vdcs, networks);
|
||||||
}
|
}
|
||||||
|
|
||||||
public T fromAdminOrg(AdminOrg in) {
|
public T fromAdminOrg(AdminOrg in) {
|
||||||
|
@ -175,8 +179,11 @@ public class AdminOrg extends Org {
|
||||||
// For JAXB
|
// For JAXB
|
||||||
}
|
}
|
||||||
|
|
||||||
protected AdminOrg(OrgSettings settings, UsersList users, GroupsList groups,
|
protected AdminOrg(URI href, String type, Set<Link> links, String description,
|
||||||
|
Set<Task> tasks, String id, String name, String fullName,
|
||||||
|
Boolean enabled, OrgSettings settings, UsersList users, GroupsList groups,
|
||||||
CatalogsList catalogs, Vdcs vdcs, Networks networks) {
|
CatalogsList catalogs, Vdcs vdcs, Networks networks) {
|
||||||
|
super(href, type, links, description, tasks, id, name, fullName, enabled);
|
||||||
this.settings = settings;
|
this.settings = settings;
|
||||||
this.users = users;
|
this.users = users;
|
||||||
this.groups = groups;
|
this.groups = groups;
|
||||||
|
|
|
@ -25,6 +25,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlType;
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,7 @@ public class Catalog extends CatalogType<Catalog> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Catalog build() {
|
public Catalog build() {
|
||||||
return new Catalog(href, type, links, description, tasksInProgress, id, name, owner, catalogItems, isPublished);
|
return new Catalog(href, type, links, description, tasks, id, name, owner, catalogItems, isPublished);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -120,11 +120,11 @@ public class Catalog extends CatalogType<Catalog> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see EntityType#getTasksInProgress()
|
* @see EntityType#getTasks()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder tasksInProgress(TasksInProgress tasksInProgress) {
|
public Builder tasks(Set<Task> tasks) {
|
||||||
this.tasksInProgress = tasksInProgress;
|
super.tasks(tasks);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -174,9 +174,9 @@ public class Catalog extends CatalogType<Catalog> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Catalog(URI href, String type, Set<Link> links, String description, TasksInProgress tasksInProgress, String id,
|
public Catalog(URI href, String type, Set<Link> links, String description, Set<Task> tasks, String id,
|
||||||
String name, Owner owner, CatalogItems catalogItems, Boolean published) {
|
String name, Owner owner, CatalogItems catalogItems, Boolean published) {
|
||||||
super(href, type, links, description, tasksInProgress, id, name, owner, catalogItems, published);
|
super(href, type, links, description, tasks, id, name, owner, catalogItems, published);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
|
|
|
@ -23,6 +23,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@ -45,7 +46,6 @@ public class CatalogItem extends EntityType<CatalogItem> {
|
||||||
|
|
||||||
public static final String MEDIA_TYPE = VCloudDirectorMediaType.CATALOG_ITEM;
|
public static final String MEDIA_TYPE = VCloudDirectorMediaType.CATALOG_ITEM;
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public static Builder builder() {
|
public static Builder builder() {
|
||||||
return new Builder();
|
return new Builder();
|
||||||
}
|
}
|
||||||
|
@ -86,7 +86,7 @@ public class CatalogItem extends EntityType<CatalogItem> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CatalogItem build() {
|
public CatalogItem build() {
|
||||||
return new CatalogItem(href, type, links, description, tasksInProgress, id, name, entity, properties);
|
return new CatalogItem(href, type, links, description, tasks, id, name, entity, properties);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -115,13 +115,13 @@ public class CatalogItem extends EntityType<CatalogItem> {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see EntityType#getTasksInProgress()
|
* @see EntityType#getTasks()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder tasksInProgress(TasksInProgress tasksInProgress) {
|
public Builder tasks(Set<Task> tasks) {
|
||||||
this.tasksInProgress = tasksInProgress;
|
super.tasks(tasks);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -144,21 +144,19 @@ public class CatalogItem extends EntityType<CatalogItem> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see EntityType#getLinks()
|
* @see ResourceType#getLinks()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder links(Set<Link> links) {
|
public Builder links(Set<Link> links) {
|
||||||
this.links = Sets.newLinkedHashSet(checkNotNull(links, "links"));
|
return Builder.class.cast(super.links(links));
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see EntityType#getLinks()
|
* @see ResourceType#getLinks()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder link(Link link) {
|
public Builder link(Link link) {
|
||||||
this.links.add(checkNotNull(link, "link"));
|
return Builder.class.cast(super.link(link));
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -171,8 +169,8 @@ public class CatalogItem extends EntityType<CatalogItem> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private CatalogItem(URI href, String type, Set<Link> links, String description, TasksInProgress tasksInProgress, String id, String name, Reference entity, Set<Property> properties) {
|
private CatalogItem(URI href, String type, Set<Link> links, String description, Set<Task> tasks, String id, String name, Reference entity, Set<Property> properties) {
|
||||||
super(href, type, links, description, tasksInProgress, id, name);
|
super(href, type, links, description, tasks, id, name);
|
||||||
this.entity = entity;
|
this.entity = entity;
|
||||||
this.properties = ImmutableSet.copyOf(properties);
|
this.properties = ImmutableSet.copyOf(properties);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package org.jclouds.vcloud.director.v1_5.domain;
|
package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
@XmlRootElement(name = "CatalogReference")
|
@XmlRootElement(name = "CatalogReference")
|
||||||
|
|
|
@ -90,7 +90,7 @@ public class CatalogType<T extends CatalogType<T>> extends EntityType<T> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CatalogType<T> build() {
|
public CatalogType<T> build() {
|
||||||
return new CatalogType<T>(href, type, links, description, tasksInProgress, id, name, owner, catalogItems, isPublished);
|
return new CatalogType<T>(href, type, links, description, tasks, id, name, owner, catalogItems, isPublished);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -121,11 +121,11 @@ public class CatalogType<T extends CatalogType<T>> extends EntityType<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see EntityType#getTasksInProgress()
|
* @see EntityType#getTasks()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder<T> tasksInProgress(TasksInProgress tasksInProgress) {
|
public Builder<T> tasks(Set<Task> tasks) {
|
||||||
super.tasksInProgress(tasksInProgress);
|
super.tasks(tasks);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -176,9 +176,9 @@ public class CatalogType<T extends CatalogType<T>> extends EntityType<T> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public CatalogType(URI href, String type, Set<Link> links, String description, TasksInProgress tasksInProgress, String id,
|
public CatalogType(URI href, String type, Set<Link> links, String description, Set<Task> tasks, String id,
|
||||||
String name, Owner owner, CatalogItems catalogItems, Boolean published) {
|
String name, Owner owner, CatalogItems catalogItems, Boolean published) {
|
||||||
super(href, type, links, description, tasksInProgress, id, name);
|
super(href, type, links, description, tasks, id, name);
|
||||||
this.owner = owner;
|
this.owner = owner;
|
||||||
this.catalogItems = catalogItems;
|
this.catalogItems = catalogItems;
|
||||||
this.isPublished = published;
|
this.isPublished = published;
|
||||||
|
|
|
@ -21,9 +21,9 @@ package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@ -67,6 +67,14 @@ public class CatalogsList {
|
||||||
this.catalogReferences = checkNotNull(catalogReferences, "catalogReferences");
|
this.catalogReferences = checkNotNull(catalogReferences, "catalogReferences");
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see CatalogsList#getCatalogItems()
|
||||||
|
*/
|
||||||
|
public Builder catalog(Reference catalog) {
|
||||||
|
this.catalogReferences.add(checkNotNull(catalog, "catalog"));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public CatalogsList build() {
|
public CatalogsList build() {
|
||||||
return new CatalogsList(catalogReferences);
|
return new CatalogsList(catalogReferences);
|
||||||
|
@ -81,7 +89,7 @@ public class CatalogsList {
|
||||||
// for JAXB
|
// for JAXB
|
||||||
}
|
}
|
||||||
|
|
||||||
private CatalogsList(Set<Reference> tasks) {
|
private CatalogsList(Set<Reference> catalogReferences) {
|
||||||
this.catalogReferences = ImmutableSet.copyOf(checkNotNull(catalogReferences, "catalogReferences"));
|
this.catalogReferences = ImmutableSet.copyOf(checkNotNull(catalogReferences, "catalogReferences"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,8 +21,6 @@ package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlType;
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
|
||||||
import com.google.common.base.Objects;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents parameters for copying a vApp and optionally deleting the source.
|
* Represents parameters for copying a vApp and optionally deleting the source.
|
||||||
|
|
|
@ -24,6 +24,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlSeeAlso;
|
import javax.xml.bind.annotation.XmlSeeAlso;
|
||||||
|
|
|
@ -21,6 +21,9 @@ package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
|
@ -86,6 +89,36 @@ import com.google.common.base.Objects.ToStringHelper;
|
||||||
"groupAttributes"
|
"groupAttributes"
|
||||||
})
|
})
|
||||||
public class CustomOrgLdapSettings {
|
public class CustomOrgLdapSettings {
|
||||||
|
public static final class AuthenticationMechanism {
|
||||||
|
public static final String SIMPLE = "simple";
|
||||||
|
public static final String KERBEROS = "kerberos";
|
||||||
|
public static final String MD5DIGEST = "md5digest";
|
||||||
|
public static final String NTLM = "ntlm";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* All acceptable {@link CustomOrgLdapSettings#getAuthenticationMechanism()} values.
|
||||||
|
* <p/>
|
||||||
|
* This list must be updated whenever a new authentication mechanism is added.
|
||||||
|
*/
|
||||||
|
public static final List<String> ALL = Arrays.asList(
|
||||||
|
SIMPLE, KERBEROS, MD5DIGEST, NTLM
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final class ConnectorType {
|
||||||
|
public static final String ACTIVE_DIRECTORY = "ACTIVE_DIRECTORY";
|
||||||
|
public static final String OPEN_LDAP = "OPEN_LDAP";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* All acceptable {@link OrgLdapSettings#getLdapMode()} values.
|
||||||
|
* <p/>
|
||||||
|
* This list must be updated whenever a new mode is added.
|
||||||
|
*/
|
||||||
|
public static final List<String> ALL = Arrays.asList(
|
||||||
|
ACTIVE_DIRECTORY, OPEN_LDAP
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
public static Builder<?> builder() {
|
public static Builder<?> builder() {
|
||||||
return new ConcreteBuilder();
|
return new ConcreteBuilder();
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
|
@ -46,7 +46,7 @@ public class Entity extends EntityType<Entity> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Entity build() {
|
public Entity build() {
|
||||||
return new Entity(href, type, links, description, tasksInProgress, id, name);
|
return new Entity(href, type, links, description, tasks, id, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -77,11 +77,11 @@ public class Entity extends EntityType<Entity> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see EntityType#getTasksInProgress()
|
* @see EntityType#getTasks()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder tasksInProgress(TasksInProgress tasksInProgress) {
|
public Builder tasks(Set<Task> tasks) {
|
||||||
this.tasksInProgress = tasksInProgress;
|
super.tasks(tasks);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,8 +131,8 @@ public class Entity extends EntityType<Entity> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Entity(URI href, String type, Set<Link> links, String description, TasksInProgress tasksInProgress, String id, String name) {
|
private Entity(URI href, String type, Set<Link> links, String description, Set<Task> tasks, String id, String name) {
|
||||||
super(href, type, links, description, tasksInProgress, id, name);
|
super(href, type, links, description, tasks, id, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Entity() {
|
private Entity() {
|
||||||
|
|
|
@ -22,13 +22,18 @@ import static com.google.common.base.Objects.equal;
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
|
import javax.xml.bind.annotation.XmlElementWrapper;
|
||||||
|
|
||||||
|
import org.jclouds.javax.annotation.Nullable;
|
||||||
|
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
import com.google.common.base.Objects.ToStringHelper;
|
import com.google.common.base.Objects.ToStringHelper;
|
||||||
|
import com.google.common.collect.ImmutableSet;
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -48,7 +53,7 @@ public abstract class EntityType<T extends EntityType<T>> extends ResourceType<T
|
||||||
public static abstract class NewBuilder<T extends NewBuilder<T>> extends ResourceType.NewBuilder<T> {
|
public static abstract class NewBuilder<T extends NewBuilder<T>> extends ResourceType.NewBuilder<T> {
|
||||||
|
|
||||||
protected String description;
|
protected String description;
|
||||||
protected TasksInProgress tasksInProgress;
|
protected Set<Task> tasks;
|
||||||
protected String name;
|
protected String name;
|
||||||
protected String id;
|
protected String id;
|
||||||
|
|
||||||
|
@ -77,16 +82,16 @@ public abstract class EntityType<T extends EntityType<T>> extends ResourceType<T
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see EntityType#getTasksInProgress()
|
* @see EntityType#getTasks()
|
||||||
*/
|
*/
|
||||||
public T tasksInProgress(TasksInProgress tasksInProgress) {
|
public T tasks(Set<Task> tasks) {
|
||||||
this.tasksInProgress = tasksInProgress;
|
this.tasks = tasks;
|
||||||
return self();
|
return self();
|
||||||
}
|
}
|
||||||
|
|
||||||
public T fromEntityType(EntityType<?> in) {
|
public T fromEntityType(EntityType<?> in) {
|
||||||
return fromResourceType(in)
|
return fromResourceType(in)
|
||||||
.description(in.getDescription()).tasksInProgress(in.getTasksInProgress())
|
.description(in.getDescription()).tasks(in.getTasks())
|
||||||
.id(in.getId()).name(in.getName());
|
.id(in.getId()).name(in.getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -94,7 +99,7 @@ public abstract class EntityType<T extends EntityType<T>> extends ResourceType<T
|
||||||
public static abstract class Builder<T extends EntityType<T>> extends ResourceType.Builder<T> {
|
public static abstract class Builder<T extends EntityType<T>> extends ResourceType.Builder<T> {
|
||||||
|
|
||||||
protected String description;
|
protected String description;
|
||||||
protected TasksInProgress tasksInProgress;
|
protected Set<Task> tasks;
|
||||||
protected String name;
|
protected String name;
|
||||||
protected String id;
|
protected String id;
|
||||||
|
|
||||||
|
@ -121,12 +126,23 @@ public abstract class EntityType<T extends EntityType<T>> extends ResourceType<T
|
||||||
this.id = id;
|
this.id = id;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see EntityType#getTasks()
|
||||||
|
*/
|
||||||
|
public Builder<T> tasks(Set<Task> tasks) {
|
||||||
|
if (checkNotNull(tasks, "tasks").size() > 0)
|
||||||
|
this.tasks = Sets.newLinkedHashSet(tasks);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see EntityType#getTasksInProgress()
|
* @see EntityType#getTasks()
|
||||||
*/
|
*/
|
||||||
public Builder<T> tasksInProgress(TasksInProgress tasksInProgress) {
|
public Builder<T> task(Task task) {
|
||||||
this.tasksInProgress = tasksInProgress;
|
if (tasks == null)
|
||||||
|
tasks = Sets.newLinkedHashSet();
|
||||||
|
this.tasks.add(checkNotNull(task, "task"));
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -151,19 +167,19 @@ public abstract class EntityType<T extends EntityType<T>> extends ResourceType<T
|
||||||
/**
|
/**
|
||||||
* @see ResourceType#getLinks()
|
* @see ResourceType#getLinks()
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
public Builder<T> links(Set<Link> links) {
|
public Builder<T> links(Set<Link> links) {
|
||||||
this.links = Sets.newLinkedHashSet(checkNotNull(links, "links"));
|
return Builder.class.cast(super.links(links));
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ResourceType#getLinks()
|
* @see ResourceType#getLinks()
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
public Builder<T> link(Link link) {
|
public Builder<T> link(Link link) {
|
||||||
this.links.add(checkNotNull(link, "link"));
|
return Builder.class.cast(super.link(link));
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -177,24 +193,26 @@ public abstract class EntityType<T extends EntityType<T>> extends ResourceType<T
|
||||||
|
|
||||||
public Builder<T> fromEntityType(EntityType<T> in) {
|
public Builder<T> fromEntityType(EntityType<T> in) {
|
||||||
return fromResourceType(in)
|
return fromResourceType(in)
|
||||||
.description(in.getDescription()).tasksInProgress(in.getTasksInProgress())
|
.description(in.getDescription()).tasks(in.getTasks())
|
||||||
.id(in.getId()).name(in.getName());
|
.id(in.getId()).name(in.getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@XmlElement(name = "Description")
|
@XmlElement(name = "Description")
|
||||||
private String description;
|
private String description;
|
||||||
@XmlElement(name = "Tasks")
|
@XmlElementWrapper(name = "Tasks")
|
||||||
private TasksInProgress tasksInProgress;
|
@XmlElement(name = "Task")
|
||||||
|
private Set<Task> tasks;
|
||||||
@XmlAttribute
|
@XmlAttribute
|
||||||
private String id;
|
private String id;
|
||||||
@XmlAttribute(required = true)
|
@XmlAttribute(required = true)
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
public EntityType(URI href, String type, Set<Link> links, String description, TasksInProgress tasksInProgress, String id, String name) {
|
public EntityType(URI href, String type, @Nullable Set<Link> links, String description, @Nullable Set<Task> tasks, String id, String name) {
|
||||||
super(href, type, links);
|
super(href, type, links);
|
||||||
this.description = description;
|
this.description = description;
|
||||||
this.tasksInProgress = tasksInProgress;
|
// nullable so that jaxb wont persist empty collections
|
||||||
|
this.tasks = tasks != null && tasks.size() == 0 ? null : tasks;
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
@ -213,8 +231,8 @@ public abstract class EntityType<T extends EntityType<T>> extends ResourceType<T
|
||||||
/**
|
/**
|
||||||
* A list of queued, running, or recently completed tasks associated with this entity.
|
* A list of queued, running, or recently completed tasks associated with this entity.
|
||||||
*/
|
*/
|
||||||
public TasksInProgress getTasksInProgress() {
|
public Set<Task> getTasks() {
|
||||||
return tasksInProgress;
|
return tasks == null ? ImmutableSet.<Task>of() : Collections.unmodifiableSet(tasks);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -243,7 +261,7 @@ public abstract class EntityType<T extends EntityType<T>> extends ResourceType<T
|
||||||
EntityType<?> that = EntityType.class.cast(o);
|
EntityType<?> that = EntityType.class.cast(o);
|
||||||
return super.equals(that) &&
|
return super.equals(that) &&
|
||||||
equal(this.id, that.id) && equal(this.description, that.description) &&
|
equal(this.id, that.id) && equal(this.description, that.description) &&
|
||||||
equal(this.tasksInProgress, that.tasksInProgress) && equal(this.name, that.name);
|
equal(this.tasks, that.tasks) && equal(this.name, that.name);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -258,11 +276,11 @@ public abstract class EntityType<T extends EntityType<T>> extends ResourceType<T
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return super.hashCode() + Objects.hashCode(description, tasksInProgress, id, name);
|
return super.hashCode() + Objects.hashCode(description, tasks, id, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ToStringHelper string() {
|
public ToStringHelper string() {
|
||||||
return super.string().add("description", description).add("tasksInProgress", tasksInProgress).add("id", id).add("name", name);
|
return super.string().add("description", description).add("tasks", tasks).add("id", id).add("name", name);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -20,10 +20,10 @@
|
||||||
package org.jclouds.vcloud.director.v1_5.domain;
|
package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import javax.xml.bind.annotation.XmlSchemaType;
|
import javax.xml.bind.annotation.XmlSchemaType;
|
||||||
import javax.xml.bind.annotation.XmlType;
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
@ -32,7 +32,6 @@ import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
|
||||||
|
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
import com.google.common.base.Objects.ToStringHelper;
|
import com.google.common.base.Objects.ToStringHelper;
|
||||||
import com.google.common.collect.Sets;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -98,7 +97,7 @@ public class File extends EntityType<File> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public File build() {
|
public File build() {
|
||||||
return new File(href, type, links, description, tasksInProgress, id, name, size, bytesTransferred, checksum);
|
return new File(href, type, links, description, tasks, id, name, size, bytesTransferred, checksum);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -127,11 +126,11 @@ public class File extends EntityType<File> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see EntityType#getTasksInProgress()
|
* @see EntityType#getTasks()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder tasksInProgress(TasksInProgress tasksInProgress) {
|
public Builder tasks(Set<Task> tasks) {
|
||||||
super.tasksInProgress (tasksInProgress);
|
super.tasks (tasks);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -158,7 +157,7 @@ public class File extends EntityType<File> {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder links(Set<Link> links) {
|
public Builder links(Set<Link> links) {
|
||||||
this.links = Sets.newLinkedHashSet(checkNotNull(links, "links"));
|
super.links(links);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -167,7 +166,7 @@ public class File extends EntityType<File> {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder link(Link link) {
|
public Builder link(Link link) {
|
||||||
this.links.add(checkNotNull(link, "link"));
|
super.link(link);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -185,9 +184,9 @@ public class File extends EntityType<File> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public File(URI href, String type, Set<Link> links, String description, TasksInProgress tasksInProgress, String id,
|
public File(URI href, String type, Set<Link> links, String description, Set<Task> tasks, String id,
|
||||||
String name, Long size, Long bytesTransferred, String checksum) {
|
String name, Long size, Long bytesTransferred, String checksum) {
|
||||||
super(href, type, links, description, tasksInProgress, id, name);
|
super(href, type, links, description, tasks, id, name);
|
||||||
this.size = size;
|
this.size = size;
|
||||||
this.bytesTransferred = bytesTransferred;
|
this.bytesTransferred = bytesTransferred;
|
||||||
this.checksum = checksum;
|
this.checksum = checksum;
|
||||||
|
|
|
@ -21,8 +21,6 @@ package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlType;
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,6 @@ package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlSeeAlso;
|
|
||||||
import javax.xml.bind.annotation.XmlType;
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
|
|
|
@ -106,7 +106,7 @@ public class Group extends EntityType<Group> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Group build() {
|
public Group build() {
|
||||||
return new Group(href, type, links, description, tasksInProgress, id, name,
|
return new Group(href, type, links, description, tasks, id, name,
|
||||||
nameInSource, usersList, role);
|
nameInSource, usersList, role);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -138,11 +138,11 @@ public class Group extends EntityType<Group> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see EntityType#getTasksInProgress()
|
* @see EntityType#getTasks()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder tasksInProgress(TasksInProgress tasksInProgress) {
|
public Builder tasks(Set<Task> tasks) {
|
||||||
super.tasksInProgress(tasksInProgress);
|
super.tasks(tasks);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -200,9 +200,9 @@ public class Group extends EntityType<Group> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Group(URI href, String type, Set<Link> links, String description,
|
public Group(URI href, String type, Set<Link> links, String description,
|
||||||
TasksInProgress tasksInProgress, String id, String name, String nameInSource,
|
Set<Task> tasks, String id, String name, String nameInSource,
|
||||||
UsersList usersList, Reference role) {
|
UsersList usersList, Reference role) {
|
||||||
super(href, type, links, description, tasksInProgress, id, name);
|
super(href, type, links, description, tasks, id, name);
|
||||||
this.nameInSource = nameInSource;
|
this.nameInSource = nameInSource;
|
||||||
this.usersList = usersList;
|
this.usersList = usersList;
|
||||||
this.role = role;
|
this.role = role;
|
||||||
|
|
|
@ -62,7 +62,7 @@ import com.google.common.collect.ImmutableList;
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
@XmlRootElement(name = "GroupsList")
|
@XmlRootElement(name = "GroupsList")
|
||||||
@XmlType(propOrder = {
|
@XmlType(propOrder = {
|
||||||
"groupReference"
|
"groups"
|
||||||
})
|
})
|
||||||
public class GroupsList {
|
public class GroupsList {
|
||||||
public static Builder builder() {
|
public static Builder builder() {
|
||||||
|
|
|
@ -25,6 +25,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
|
@ -23,6 +23,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
package org.jclouds.vcloud.director.v1_5.domain;
|
package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
import javax.xml.bind.annotation.XmlType;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -25,6 +25,7 @@ import java.net.URI;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,7 @@ import java.net.URI;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
@ -89,7 +90,7 @@ public class Media extends ResourceEntityType<Media> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Media build() {
|
public Media build() {
|
||||||
return new Media(href, type, links, description, tasksInProgress, id, name, files, status, owner, imageType, size);
|
return new Media(href, type, links, description, tasks, id, name, files, status, owner, imageType, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -138,11 +139,11 @@ public class Media extends ResourceEntityType<Media> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see EntityType#getTasksInProgress()
|
* @see EntityType#getTasks()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder tasksInProgress(TasksInProgress tasksInProgress) {
|
public Builder tasks(Set<Task> tasks) {
|
||||||
super.tasksInProgress(tasksInProgress);
|
super.tasks(tasks);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -193,9 +194,9 @@ public class Media extends ResourceEntityType<Media> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Media(URI href, String type, Set<Link> links, String description, TasksInProgress tasksInProgress, String id,
|
public Media(URI href, String type, Set<Link> links, String description, Set<Task> tasks, String id,
|
||||||
String name, FilesList files, Integer status, Owner owner, String imageType, long size) {
|
String name, FilesList files, Integer status, Owner owner, String imageType, long size) {
|
||||||
super(href, type, links, description, tasksInProgress, id, name, files, status);
|
super(href, type, links, description, tasks, id, name, files, status);
|
||||||
this.owner = owner;
|
this.owner = owner;
|
||||||
this.imageType = imageType;
|
this.imageType = imageType;
|
||||||
this.size = size;
|
this.size = size;
|
||||||
|
|
|
@ -24,6 +24,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
|
|
@ -22,9 +22,7 @@ package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
|
|
|
@ -25,6 +25,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
|
@ -25,6 +25,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
|
@ -19,16 +19,15 @@
|
||||||
package org.jclouds.vcloud.director.v1_5.domain;
|
package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
import com.google.common.base.Objects.ToStringHelper;
|
import com.google.common.base.Objects.ToStringHelper;
|
||||||
import com.google.common.collect.Sets;
|
|
||||||
|
|
||||||
@XmlRootElement(name = "NetworkType")
|
@XmlRootElement(name = "NetworkType")
|
||||||
public class NetworkType<T extends NetworkType<T>> extends EntityType<T> {
|
public class NetworkType<T extends NetworkType<T>> extends EntityType<T> {
|
||||||
|
@ -56,7 +55,7 @@ public class NetworkType<T extends NetworkType<T>> extends EntityType<T> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public NetworkType<T> build() {
|
public NetworkType<T> build() {
|
||||||
return new NetworkType<T>(href, type, links, description, tasksInProgress, id, name, networkConfiguration);
|
return new NetworkType<T>(href, type, links, description, tasks, id, name, networkConfiguration);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -85,13 +84,13 @@ public class NetworkType<T extends NetworkType<T>> extends EntityType<T> {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see EntityType#getTasksInProgress()
|
* @see EntityType#getTasks()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder<T> tasksInProgress(TasksInProgress tasksInProgress) {
|
public Builder<T> tasks(Set<Task> tasks) {
|
||||||
this.tasksInProgress = tasksInProgress;
|
super.tasks(tasks);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -118,7 +117,7 @@ public class NetworkType<T extends NetworkType<T>> extends EntityType<T> {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder<T> links(Set<Link> links) {
|
public Builder<T> links(Set<Link> links) {
|
||||||
this.links = Sets.newLinkedHashSet(checkNotNull(links, "links"));
|
super.links(links);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -127,7 +126,7 @@ public class NetworkType<T extends NetworkType<T>> extends EntityType<T> {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder<T> link(Link link) {
|
public Builder<T> link(Link link) {
|
||||||
this.links.add(checkNotNull(link, "link"));
|
super.link(link);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -145,9 +144,9 @@ public class NetworkType<T extends NetworkType<T>> extends EntityType<T> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public NetworkType(URI href, String type, Set<Link> links, String description, TasksInProgress tasksInProgress,
|
public NetworkType(URI href, String type, Set<Link> links, String description, Set<Task> tasks,
|
||||||
String id, String name, NetworkConfiguration networkConfiguration) {
|
String id, String name, NetworkConfiguration networkConfiguration) {
|
||||||
super(href, type, links, description, tasksInProgress, id, name);
|
super(href, type, links, description, tasks, id, name);
|
||||||
this.networkConfiguration = networkConfiguration;
|
this.networkConfiguration = networkConfiguration;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,7 @@ import javax.xml.bind.annotation.XmlType;
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
import com.google.common.base.Objects.ToStringHelper;
|
import com.google.common.base.Objects.ToStringHelper;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -62,7 +63,7 @@ import com.google.common.collect.ImmutableList;
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
@XmlType(name = "Networks", propOrder = {
|
@XmlType(name = "Networks", propOrder = {
|
||||||
"network"
|
"networks"
|
||||||
})
|
})
|
||||||
public class Networks {
|
public class Networks {
|
||||||
public static Builder builder() {
|
public static Builder builder() {
|
||||||
|
@ -75,7 +76,7 @@ public class Networks {
|
||||||
|
|
||||||
public static class Builder {
|
public static class Builder {
|
||||||
|
|
||||||
private List<Reference> networks;
|
private List<Reference> networks = Lists.newArrayList();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see Networks#getNetwork()
|
* @see Networks#getNetwork()
|
||||||
|
|
|
@ -59,8 +59,8 @@ public class Org extends EntityType<Org> {
|
||||||
|
|
||||||
public static abstract class NewBuilder<T extends NewBuilder<T>> extends EntityType.NewBuilder<T> {
|
public static abstract class NewBuilder<T extends NewBuilder<T>> extends EntityType.NewBuilder<T> {
|
||||||
|
|
||||||
private String fullName;
|
protected String fullName;
|
||||||
private Boolean isEnabled;
|
protected Boolean isEnabled;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see Org#getFullName()
|
* @see Org#getFullName()
|
||||||
|
@ -80,7 +80,7 @@ public class Org extends EntityType<Org> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Org build() {
|
public Org build() {
|
||||||
return new Org(href, type, links, description, tasksInProgress, id, name, fullName, isEnabled);
|
return new Org(href, type, links, description, tasks, id, name, fullName, isEnabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
public T fromOrg(Org in) {
|
public T fromOrg(Org in) {
|
||||||
|
@ -143,7 +143,7 @@ public class Org extends EntityType<Org> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Org build() {
|
public Org build() {
|
||||||
return new Org(href, type, links, description, tasksInProgress, id, name, fullName, isEnabled);
|
return new Org(href, type, links, description, tasks, id, name, fullName, isEnabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -174,11 +174,11 @@ public class Org extends EntityType<Org> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see EntityType#getTasksInProgress()
|
* @see EntityType#getTasks()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder tasksInProgress(TasksInProgress tasksInProgress) {
|
public Builder tasks(Set<Task> tasks) {
|
||||||
this.tasksInProgress = tasksInProgress;
|
super.tasks(tasks);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -232,7 +232,9 @@ public class Org extends EntityType<Org> {
|
||||||
// for JAXB
|
// for JAXB
|
||||||
}
|
}
|
||||||
|
|
||||||
public Org(URI href, String type, Set<Link> links, String description, TasksInProgress tasksInProgress, String id, String name, String fullName, Boolean enabled) {
|
public Org(URI href, String type, Set<Link> links, String description,
|
||||||
|
Set<Task> tasksInProgress, String id, String name,
|
||||||
|
String fullName, Boolean enabled) {
|
||||||
super(href, type, links, description, tasksInProgress, id, name);
|
super(href, type, links, description, tasksInProgress, id, name);
|
||||||
this.fullName = fullName;
|
this.fullName = fullName;
|
||||||
isEnabled = enabled;
|
isEnabled = enabled;
|
||||||
|
|
|
@ -76,7 +76,7 @@ import com.google.common.collect.ImmutableList;
|
||||||
"fromEmailAddress",
|
"fromEmailAddress",
|
||||||
"defaultSubjectPrefix",
|
"defaultSubjectPrefix",
|
||||||
"isAlertEmailToAllAdmins",
|
"isAlertEmailToAllAdmins",
|
||||||
"alertEmailTo",
|
"alertEmailsTo",
|
||||||
"smtpServerSettings"
|
"smtpServerSettings"
|
||||||
})
|
})
|
||||||
public class OrgEmailSettings extends ResourceType<OrgEmailSettings> {
|
public class OrgEmailSettings extends ResourceType<OrgEmailSettings> {
|
||||||
|
@ -142,7 +142,7 @@ public class OrgEmailSettings extends ResourceType<OrgEmailSettings> {
|
||||||
* @see OrgEmailSettings#getAlertEmailTo()
|
* @see OrgEmailSettings#getAlertEmailTo()
|
||||||
*/
|
*/
|
||||||
public Builder alertEmailsTo(List<String> alertEmailsTo) {
|
public Builder alertEmailsTo(List<String> alertEmailsTo) {
|
||||||
this.alertEmailTo = ImmutableList.copyOf(alertEmailsTo);
|
this.alertEmailTo = alertEmailsTo == null ? null : ImmutableList.copyOf(alertEmailsTo);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -163,7 +163,8 @@ public class OrgEmailSettings extends ResourceType<OrgEmailSettings> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public OrgEmailSettings build() {
|
public OrgEmailSettings build() {
|
||||||
return new OrgEmailSettings(isDefaultSmtpServer, isDefaultOrgEmail, fromEmailAddress, defaultSubjectPrefix,
|
return new OrgEmailSettings(href, type, links, isDefaultSmtpServer,
|
||||||
|
isDefaultOrgEmail, fromEmailAddress, defaultSubjectPrefix,
|
||||||
isAlertEmailToAllAdmins, alertEmailTo, smtpServerSettings);
|
isAlertEmailToAllAdmins, alertEmailTo, smtpServerSettings);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -225,9 +226,11 @@ public class OrgEmailSettings extends ResourceType<OrgEmailSettings> {
|
||||||
// For JAXB
|
// For JAXB
|
||||||
}
|
}
|
||||||
|
|
||||||
private OrgEmailSettings(boolean isDefaultSmtpServer, boolean isDefaultOrgEmail,
|
private OrgEmailSettings(URI href, String type, Set<Link> links,
|
||||||
|
boolean isDefaultSmtpServer, boolean isDefaultOrgEmail,
|
||||||
String fromEmailAddress, String defaultSubjectPrefix, boolean isAlertEmailToAllAdmins,
|
String fromEmailAddress, String defaultSubjectPrefix, boolean isAlertEmailToAllAdmins,
|
||||||
List<String> alertEmailTo, SmtpServerSettings smtpServerSettings) {
|
List<String> alertEmailTo, SmtpServerSettings smtpServerSettings) {
|
||||||
|
super(href, type, links);
|
||||||
this.isDefaultSmtpServer = isDefaultSmtpServer;
|
this.isDefaultSmtpServer = isDefaultSmtpServer;
|
||||||
this.isDefaultOrgEmail = isDefaultOrgEmail;
|
this.isDefaultOrgEmail = isDefaultOrgEmail;
|
||||||
this.fromEmailAddress = fromEmailAddress;
|
this.fromEmailAddress = fromEmailAddress;
|
||||||
|
@ -323,9 +326,6 @@ public class OrgEmailSettings extends ResourceType<OrgEmailSettings> {
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public List<String> getAlertEmailsTo() {
|
public List<String> getAlertEmailsTo() {
|
||||||
if (alertEmailsTo == null) {
|
|
||||||
alertEmailsTo = new ArrayList<String>();
|
|
||||||
}
|
|
||||||
return this.alertEmailsTo;
|
return this.alertEmailsTo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,7 @@ import com.google.common.base.Objects.ToStringHelper;
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
@XmlRootElement(name = "OrgGeneralSettings")
|
@XmlRootElement(name = "GeneralOrgSettings")
|
||||||
@XmlType(propOrder = {
|
@XmlType(propOrder = {
|
||||||
"canPublishCatalogs",
|
"canPublishCatalogs",
|
||||||
"deployedVMQuota",
|
"deployedVMQuota",
|
||||||
|
|
|
@ -22,11 +22,14 @@ package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
import javax.xml.bind.annotation.XmlType;
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
|
@ -60,12 +63,28 @@ import com.google.common.base.Objects.ToStringHelper;
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
@XmlType(name = "OrgLdapSettings", propOrder = {
|
@XmlRootElement(name = "OrgLdapSettings")
|
||||||
"orgLdapMode",
|
@XmlType(propOrder = {
|
||||||
|
"ldapMode",
|
||||||
"customUsersOu",
|
"customUsersOu",
|
||||||
"customOrgLdapSettings"
|
"customOrgLdapSettings"
|
||||||
})
|
})
|
||||||
public class OrgLdapSettings extends ResourceType<OrgLdapSettings> {
|
public class OrgLdapSettings extends ResourceType<OrgLdapSettings> {
|
||||||
|
public static final class LdapMode {
|
||||||
|
public static final String NONE = "NONE";
|
||||||
|
public static final String SYSTEM = "SYSTEM";
|
||||||
|
public static final String CUSTOM = "CUSTOM";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* All acceptable {@link OrgLdapSettings#getLdapMode()} values.
|
||||||
|
* <p/>
|
||||||
|
* This list must be updated whenever a new mode is added.
|
||||||
|
*/
|
||||||
|
public static final List<String> ALL = Arrays.asList(
|
||||||
|
NONE, SYSTEM, CUSTOM
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
public static Builder builder() {
|
public static Builder builder() {
|
||||||
return new Builder();
|
return new Builder();
|
||||||
}
|
}
|
||||||
|
@ -76,15 +95,15 @@ public class OrgLdapSettings extends ResourceType<OrgLdapSettings> {
|
||||||
|
|
||||||
public static class Builder extends ResourceType.Builder<OrgLdapSettings> {
|
public static class Builder extends ResourceType.Builder<OrgLdapSettings> {
|
||||||
|
|
||||||
private String orgLdapMode;
|
private String ldapMode;
|
||||||
private String customUsersOu;
|
private String customUsersOu;
|
||||||
private CustomOrgLdapSettings customOrgLdapSettings;
|
private CustomOrgLdapSettings customOrgLdapSettings;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see OrgLdapSettings#getOrgLdapMode()
|
* @see OrgLdapSettings#getLdapMode()
|
||||||
*/
|
*/
|
||||||
public Builder orgLdapMode(String orgLdapMode) {
|
public Builder ldapMode(String ldapMode) {
|
||||||
this.orgLdapMode = orgLdapMode;
|
this.ldapMode = ldapMode;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,7 +125,7 @@ public class OrgLdapSettings extends ResourceType<OrgLdapSettings> {
|
||||||
|
|
||||||
public OrgLdapSettings build() {
|
public OrgLdapSettings build() {
|
||||||
OrgLdapSettings orgLdapSettings = new OrgLdapSettings(href, type, links,
|
OrgLdapSettings orgLdapSettings = new OrgLdapSettings(href, type, links,
|
||||||
orgLdapMode, customUsersOu, customOrgLdapSettings);
|
ldapMode, customUsersOu, customOrgLdapSettings);
|
||||||
return orgLdapSettings;
|
return orgLdapSettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -154,7 +173,7 @@ public class OrgLdapSettings extends ResourceType<OrgLdapSettings> {
|
||||||
}
|
}
|
||||||
public Builder fromOrgLdapSettings(OrgLdapSettings in) {
|
public Builder fromOrgLdapSettings(OrgLdapSettings in) {
|
||||||
return fromResourceType(in)
|
return fromResourceType(in)
|
||||||
.orgLdapMode(in.getOrgLdapMode())
|
.ldapMode(in.getLdapMode())
|
||||||
.customUsersOu(in.getCustomUsersOu())
|
.customUsersOu(in.getCustomUsersOu())
|
||||||
.customOrgLdapSettings(in.getCustomOrgLdapSettings());
|
.customOrgLdapSettings(in.getCustomOrgLdapSettings());
|
||||||
}
|
}
|
||||||
|
@ -166,9 +185,9 @@ public class OrgLdapSettings extends ResourceType<OrgLdapSettings> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public OrgLdapSettings(URI href, String type, Set<Link> links,
|
public OrgLdapSettings(URI href, String type, Set<Link> links,
|
||||||
String orgLdapMode, String customUsersOu, CustomOrgLdapSettings customOrgLdapSettings) {
|
String ldapMode, String customUsersOu, CustomOrgLdapSettings customOrgLdapSettings) {
|
||||||
super(href, type, links);
|
super(href, type, links);
|
||||||
this.orgLdapMode = orgLdapMode;
|
this.ldapMode = ldapMode;
|
||||||
this.customUsersOu = customUsersOu;
|
this.customUsersOu = customUsersOu;
|
||||||
this.customOrgLdapSettings = customOrgLdapSettings;
|
this.customOrgLdapSettings = customOrgLdapSettings;
|
||||||
}
|
}
|
||||||
|
@ -176,7 +195,7 @@ public class OrgLdapSettings extends ResourceType<OrgLdapSettings> {
|
||||||
|
|
||||||
|
|
||||||
@XmlElement(name = "OrgLdapMode")
|
@XmlElement(name = "OrgLdapMode")
|
||||||
protected String orgLdapMode;
|
protected String ldapMode;
|
||||||
@XmlElement(name = "CustomUsersOu")
|
@XmlElement(name = "CustomUsersOu")
|
||||||
protected String customUsersOu;
|
protected String customUsersOu;
|
||||||
@XmlElement(name = "CustomOrgLdapSettings")
|
@XmlElement(name = "CustomOrgLdapSettings")
|
||||||
|
@ -190,8 +209,8 @@ public class OrgLdapSettings extends ResourceType<OrgLdapSettings> {
|
||||||
* {@link String }
|
* {@link String }
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public String getOrgLdapMode() {
|
public String getLdapMode() {
|
||||||
return orgLdapMode;
|
return ldapMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -226,7 +245,7 @@ public class OrgLdapSettings extends ResourceType<OrgLdapSettings> {
|
||||||
return false;
|
return false;
|
||||||
OrgLdapSettings that = OrgLdapSettings.class.cast(o);
|
OrgLdapSettings that = OrgLdapSettings.class.cast(o);
|
||||||
return super.equals(that) &&
|
return super.equals(that) &&
|
||||||
equal(orgLdapMode, that.orgLdapMode) &&
|
equal(ldapMode, that.ldapMode) &&
|
||||||
equal(customUsersOu, that.customUsersOu) &&
|
equal(customUsersOu, that.customUsersOu) &&
|
||||||
equal(customOrgLdapSettings, that.customOrgLdapSettings);
|
equal(customOrgLdapSettings, that.customOrgLdapSettings);
|
||||||
}
|
}
|
||||||
|
@ -234,7 +253,7 @@ public class OrgLdapSettings extends ResourceType<OrgLdapSettings> {
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hashCode(super.hashCode(),
|
return Objects.hashCode(super.hashCode(),
|
||||||
orgLdapMode,
|
ldapMode,
|
||||||
customUsersOu,
|
customUsersOu,
|
||||||
customOrgLdapSettings);
|
customOrgLdapSettings);
|
||||||
}
|
}
|
||||||
|
@ -242,7 +261,7 @@ public class OrgLdapSettings extends ResourceType<OrgLdapSettings> {
|
||||||
@Override
|
@Override
|
||||||
public ToStringHelper string() {
|
public ToStringHelper string() {
|
||||||
return super.string()
|
return super.string()
|
||||||
.add("orgLdapMode", orgLdapMode)
|
.add("orgLdapMode", ldapMode)
|
||||||
.add("customUsersOu", customUsersOu)
|
.add("customUsersOu", customUsersOu)
|
||||||
.add("customOrgLdapSettings", customOrgLdapSettings);
|
.add("customOrgLdapSettings", customOrgLdapSettings);
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,7 @@ import java.util.Set;
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
import javax.xml.bind.annotation.XmlType;
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
|
@ -60,7 +61,8 @@ import com.google.common.base.Objects.ToStringHelper;
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
@XmlType(name = "OrgLeaseSettings", propOrder = {
|
@XmlRootElement(name = "VAppLeaseSettings")
|
||||||
|
@XmlType(propOrder = {
|
||||||
"deleteOnStorageLeaseExpiration",
|
"deleteOnStorageLeaseExpiration",
|
||||||
"deploymentLeaseSeconds",
|
"deploymentLeaseSeconds",
|
||||||
"storageLeaseSeconds"
|
"storageLeaseSeconds"
|
||||||
|
|
|
@ -23,6 +23,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
|
|
@ -19,16 +19,15 @@
|
||||||
package org.jclouds.vcloud.director.v1_5.domain;
|
package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
import com.google.common.base.Objects.ToStringHelper;
|
import com.google.common.base.Objects.ToStringHelper;
|
||||||
import com.google.common.collect.Sets;
|
|
||||||
|
|
||||||
@XmlRootElement(name = "OrgNetwork")
|
@XmlRootElement(name = "OrgNetwork")
|
||||||
public class OrgNetwork extends NetworkType<OrgNetwork> {
|
public class OrgNetwork extends NetworkType<OrgNetwork> {
|
||||||
|
@ -66,7 +65,7 @@ public class OrgNetwork extends NetworkType<OrgNetwork> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public OrgNetwork build() {
|
public OrgNetwork build() {
|
||||||
return new OrgNetwork(href, type, links, description, tasksInProgress, id, name, networkConfiguration,
|
return new OrgNetwork(href, type, links, description, tasks, id, name, networkConfiguration,
|
||||||
networkPool, allowedExternalIpAddresses);
|
networkPool, allowedExternalIpAddresses);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,13 +103,13 @@ public class OrgNetwork extends NetworkType<OrgNetwork> {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see EntityType#getTasksInProgress()
|
* @see EntityType#getTasks()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder tasksInProgress(TasksInProgress tasksInProgress) {
|
public Builder tasks(Set<Task> tasks) {
|
||||||
this.tasksInProgress = tasksInProgress;
|
super.tasks(tasks);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -137,7 +136,7 @@ public class OrgNetwork extends NetworkType<OrgNetwork> {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder links(Set<Link> links) {
|
public Builder links(Set<Link> links) {
|
||||||
this.links = Sets.newLinkedHashSet(checkNotNull(links, "links"));
|
super.links(links);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -146,7 +145,7 @@ public class OrgNetwork extends NetworkType<OrgNetwork> {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder link(Link link) {
|
public Builder link(Link link) {
|
||||||
this.links.add(checkNotNull(link, "link"));
|
super.link(link);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -166,9 +165,9 @@ public class OrgNetwork extends NetworkType<OrgNetwork> {
|
||||||
// For JAXB
|
// For JAXB
|
||||||
}
|
}
|
||||||
|
|
||||||
private OrgNetwork(URI href, String type, Set<Link> links, String description, TasksInProgress tasksInProgress,
|
private OrgNetwork(URI href, String type, Set<Link> links, String description, Set<Task> tasks,
|
||||||
String id, String name, NetworkConfiguration networkConfiguration, ReferenceType<?> networkPool, IpAddresses allowedExternalIpAddresses) {
|
String id, String name, NetworkConfiguration networkConfiguration, ReferenceType<?> networkPool, IpAddresses allowedExternalIpAddresses) {
|
||||||
super(href, type, links, description, tasksInProgress, id, name, networkConfiguration);
|
super(href, type, links, description, tasks, id, name, networkConfiguration);
|
||||||
this.networkPool = networkPool;
|
this.networkPool = networkPool;
|
||||||
this.allowedExternalIpAddresses = allowedExternalIpAddresses;
|
this.allowedExternalIpAddresses = allowedExternalIpAddresses;
|
||||||
}
|
}
|
||||||
|
|
|
@ -193,7 +193,7 @@ public class OrgPasswordPolicySettings extends ResourceType<OrgPasswordPolicySet
|
||||||
* Gets the value of the invalidLoginsBeforeLockout property.
|
* Gets the value of the invalidLoginsBeforeLockout property.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public int getInvalidLoginsBeforeLockout() {
|
public Integer getInvalidLoginsBeforeLockout() {
|
||||||
return invalidLoginsBeforeLockout;
|
return invalidLoginsBeforeLockout;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -201,7 +201,7 @@ public class OrgPasswordPolicySettings extends ResourceType<OrgPasswordPolicySet
|
||||||
* Gets the value of the accountLockoutIntervalMinutes property.
|
* Gets the value of the accountLockoutIntervalMinutes property.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public int getAccountLockoutIntervalMinutes() {
|
public Integer getAccountLockoutIntervalMinutes() {
|
||||||
return accountLockoutIntervalMinutes;
|
return accountLockoutIntervalMinutes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -69,12 +69,12 @@ import com.google.common.base.Objects.ToStringHelper;
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
@XmlRootElement(name = "OrgSettings")
|
@XmlRootElement(name = "OrgSettings")
|
||||||
@XmlType(propOrder = {
|
@XmlType(propOrder = {
|
||||||
"orgGeneralSettings",
|
"generalSettings",
|
||||||
"vAppLeaseSettings",
|
"vAppLeaseSettings",
|
||||||
"vAppTemplateLeaseSettings",
|
"vAppTemplateLeaseSettings",
|
||||||
"orgLdapSettings",
|
"ldapSettings",
|
||||||
"orgEmailSettings",
|
"emailSettings",
|
||||||
"orgPasswordPolicySettings"
|
"passwordPolicy"
|
||||||
})
|
})
|
||||||
public class OrgSettings extends ResourceType<OrgSettings> {
|
public class OrgSettings extends ResourceType<OrgSettings> {
|
||||||
public static Builder builder() {
|
public static Builder builder() {
|
||||||
|
@ -87,18 +87,18 @@ public class OrgSettings extends ResourceType<OrgSettings> {
|
||||||
|
|
||||||
public static class Builder extends ResourceType.Builder<OrgSettings> {
|
public static class Builder extends ResourceType.Builder<OrgSettings> {
|
||||||
|
|
||||||
private OrgGeneralSettings orgGeneralSettings;
|
private OrgGeneralSettings generalSettings;
|
||||||
private OrgLeaseSettings vAppLeaseSettings;
|
private OrgLeaseSettings vAppLeaseSettings;
|
||||||
private OrgVAppTemplateLeaseSettings vAppTemplateLeaseSettings;
|
private OrgVAppTemplateLeaseSettings vAppTemplateLeaseSettings;
|
||||||
private OrgLdapSettings orgLdapSettings;
|
private OrgLdapSettings ldapSettings;
|
||||||
private OrgEmailSettings orgEmailSettings;
|
private OrgEmailSettings emailSettings;
|
||||||
private OrgPasswordPolicySettings orgPasswordPolicySettings;
|
private OrgPasswordPolicySettings passwordPolicy;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see OrgSettings#getOrgGeneralSettings()
|
* @see OrgSettings#getGeneralSettings()
|
||||||
*/
|
*/
|
||||||
public Builder orgGeneralSettings(OrgGeneralSettings orgGeneralSettings) {
|
public Builder generalSettings(OrgGeneralSettings generalSettings) {
|
||||||
this.orgGeneralSettings = orgGeneralSettings;
|
this.generalSettings = generalSettings;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -119,32 +119,32 @@ public class OrgSettings extends ResourceType<OrgSettings> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see OrgSettings#getOrgLdapSettings()
|
* @see OrgSettings#getLdapSettings()
|
||||||
*/
|
*/
|
||||||
public Builder orgLdapSettings(OrgLdapSettings orgLdapSettings) {
|
public Builder ldapSettings(OrgLdapSettings ldapSettings) {
|
||||||
this.orgLdapSettings = orgLdapSettings;
|
this.ldapSettings = ldapSettings;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see OrgSettings#getOrgEmailSettings()
|
* @see OrgSettings#getEmailSettings()
|
||||||
*/
|
*/
|
||||||
public Builder orgEmailSettings(OrgEmailSettings orgEmailSettings) {
|
public Builder emailSettings(OrgEmailSettings emailSettings) {
|
||||||
this.orgEmailSettings = orgEmailSettings;
|
this.emailSettings = emailSettings;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see OrgSettings#getOrgPasswordPolicySettings()
|
* @see OrgSettings#getPasswordPolicy()
|
||||||
*/
|
*/
|
||||||
public Builder orgPasswordPolicySettings(OrgPasswordPolicySettings orgPasswordPolicySettings) {
|
public Builder passwordPolicy(OrgPasswordPolicySettings passwordPolicy) {
|
||||||
this.orgPasswordPolicySettings = orgPasswordPolicySettings;
|
this.passwordPolicy = passwordPolicy;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public OrgSettings build() {
|
public OrgSettings build() {
|
||||||
return new OrgSettings(href, type, links, orgGeneralSettings, vAppLeaseSettings,
|
return new OrgSettings(href, type, links, generalSettings, vAppLeaseSettings,
|
||||||
vAppTemplateLeaseSettings, orgLdapSettings, orgEmailSettings, orgPasswordPolicySettings);
|
vAppTemplateLeaseSettings, ldapSettings, emailSettings, passwordPolicy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -191,12 +191,12 @@ public class OrgSettings extends ResourceType<OrgSettings> {
|
||||||
}
|
}
|
||||||
public Builder fromOrgSettings(OrgSettings in) {
|
public Builder fromOrgSettings(OrgSettings in) {
|
||||||
return fromResourceType(in)
|
return fromResourceType(in)
|
||||||
.orgGeneralSettings(in.getOrgGeneralSettings())
|
.generalSettings(in.getGeneralSettings())
|
||||||
.vAppLeaseSettings(in.getVAppLeaseSettings())
|
.vAppLeaseSettings(in.getVAppLeaseSettings())
|
||||||
.vAppTemplateLeaseSettings(in.getVAppTemplateLeaseSettings())
|
.vAppTemplateLeaseSettings(in.getVAppTemplateLeaseSettings())
|
||||||
.orgLdapSettings(in.getOrgLdapSettings())
|
.ldapSettings(in.getLdapSettings())
|
||||||
.orgEmailSettings(in.getOrgEmailSettings())
|
.emailSettings(in.getEmailSettings())
|
||||||
.orgPasswordPolicySettings(in.getOrgPasswordPolicySettings());
|
.passwordPolicy(in.getPasswordPolicy());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -205,32 +205,33 @@ public class OrgSettings extends ResourceType<OrgSettings> {
|
||||||
// For JAXB
|
// For JAXB
|
||||||
}
|
}
|
||||||
|
|
||||||
public OrgSettings(URI href, String type, Set<Link> links,
|
public OrgSettings(URI href, String type, Set<Link> links,
|
||||||
OrgGeneralSettings orgGeneralSettings,
|
OrgGeneralSettings generalSettings,
|
||||||
OrgLeaseSettings vAppLeaseSettings,
|
OrgLeaseSettings vAppLeaseSettings,
|
||||||
OrgVAppTemplateLeaseSettings vAppTemplateLeaseSettings,
|
OrgVAppTemplateLeaseSettings vAppTemplateLeaseSettings,
|
||||||
OrgLdapSettings orgLdapSettings, OrgEmailSettings orgEmailSettings,
|
OrgLdapSettings ldapSettings, OrgEmailSettings emailSettings,
|
||||||
OrgPasswordPolicySettings orgPasswordPolicySettings) {
|
OrgPasswordPolicySettings passwordPolicy) {
|
||||||
super(href, type, links);
|
super(href, type, links);
|
||||||
this.orgGeneralSettings = orgGeneralSettings;
|
this.generalSettings = generalSettings;
|
||||||
this.vAppLeaseSettings = vAppLeaseSettings;
|
this.vAppLeaseSettings = vAppLeaseSettings;
|
||||||
this.vAppTemplateLeaseSettings = vAppTemplateLeaseSettings;
|
this.vAppTemplateLeaseSettings = vAppTemplateLeaseSettings;
|
||||||
this.orgLdapSettings = orgLdapSettings;
|
this.ldapSettings = ldapSettings;
|
||||||
this.orgPasswordPolicySettings = orgPasswordPolicySettings;
|
this.emailSettings = emailSettings;
|
||||||
|
this.passwordPolicy = passwordPolicy;
|
||||||
}
|
}
|
||||||
|
|
||||||
@XmlElement(name = "OrgGeneralSettings")
|
@XmlElement(name = "OrgGeneralSettings")
|
||||||
protected OrgGeneralSettings orgGeneralSettings;
|
protected OrgGeneralSettings generalSettings;
|
||||||
@XmlElement(name = "VAppLeaseSettings")
|
@XmlElement(name = "VAppLeaseSettings")
|
||||||
protected OrgLeaseSettings vAppLeaseSettings;
|
protected OrgLeaseSettings vAppLeaseSettings;
|
||||||
@XmlElement(name = "VAppTemplateLeaseSettings")
|
@XmlElement(name = "VAppTemplateLeaseSettings")
|
||||||
protected OrgVAppTemplateLeaseSettings vAppTemplateLeaseSettings;
|
protected OrgVAppTemplateLeaseSettings vAppTemplateLeaseSettings;
|
||||||
@XmlElement(name = "OrgLdapSettings")
|
@XmlElement(name = "OrgLdapSettings")
|
||||||
protected OrgLdapSettings orgLdapSettings;
|
protected OrgLdapSettings ldapSettings;
|
||||||
@XmlElement(name = "OrgEmailSettings")
|
@XmlElement(name = "OrgEmailSettings")
|
||||||
protected OrgEmailSettings orgEmailSettings;
|
protected OrgEmailSettings emailSettings;
|
||||||
@XmlElement(name = "OrgPasswordPolicySettings")
|
@XmlElement(name = "OrgPasswordPolicySettings")
|
||||||
protected OrgPasswordPolicySettings orgPasswordPolicySettings;
|
protected OrgPasswordPolicySettings passwordPolicy;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the orgGeneralSettings property.
|
* Gets the value of the orgGeneralSettings property.
|
||||||
|
@ -240,8 +241,8 @@ public class OrgSettings extends ResourceType<OrgSettings> {
|
||||||
* {@link OrgGeneralSettings }
|
* {@link OrgGeneralSettings }
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public OrgGeneralSettings getOrgGeneralSettings() {
|
public OrgGeneralSettings getGeneralSettings() {
|
||||||
return orgGeneralSettings;
|
return generalSettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -276,8 +277,8 @@ public class OrgSettings extends ResourceType<OrgSettings> {
|
||||||
* {@link OrgLdapSettings }
|
* {@link OrgLdapSettings }
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public OrgLdapSettings getOrgLdapSettings() {
|
public OrgLdapSettings getLdapSettings() {
|
||||||
return orgLdapSettings;
|
return ldapSettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -288,8 +289,8 @@ public class OrgSettings extends ResourceType<OrgSettings> {
|
||||||
* {@link OrgEmailSettings }
|
* {@link OrgEmailSettings }
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public OrgEmailSettings getOrgEmailSettings() {
|
public OrgEmailSettings getEmailSettings() {
|
||||||
return orgEmailSettings;
|
return emailSettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -300,8 +301,8 @@ public class OrgSettings extends ResourceType<OrgSettings> {
|
||||||
* {@link OrgPasswordPolicySettings }
|
* {@link OrgPasswordPolicySettings }
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public OrgPasswordPolicySettings getOrgPasswordPolicySettings() {
|
public OrgPasswordPolicySettings getPasswordPolicy() {
|
||||||
return orgPasswordPolicySettings;
|
return passwordPolicy;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -312,34 +313,34 @@ public class OrgSettings extends ResourceType<OrgSettings> {
|
||||||
return false;
|
return false;
|
||||||
OrgSettings that = OrgSettings.class.cast(o);
|
OrgSettings that = OrgSettings.class.cast(o);
|
||||||
return super.equals(that) &&
|
return super.equals(that) &&
|
||||||
equal(orgGeneralSettings, that.orgGeneralSettings) &&
|
equal(generalSettings, that.generalSettings) &&
|
||||||
equal(vAppLeaseSettings, that.vAppLeaseSettings) &&
|
equal(vAppLeaseSettings, that.vAppLeaseSettings) &&
|
||||||
equal(vAppTemplateLeaseSettings, that.vAppTemplateLeaseSettings) &&
|
equal(vAppTemplateLeaseSettings, that.vAppTemplateLeaseSettings) &&
|
||||||
equal(orgLdapSettings, that.orgLdapSettings) &&
|
equal(ldapSettings, that.ldapSettings) &&
|
||||||
equal(orgEmailSettings, that.orgEmailSettings) &&
|
equal(emailSettings, that.emailSettings) &&
|
||||||
equal(orgPasswordPolicySettings, that.orgPasswordPolicySettings);
|
equal(passwordPolicy, that.passwordPolicy);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hashCode(super.hashCode(),
|
return Objects.hashCode(super.hashCode(),
|
||||||
orgGeneralSettings,
|
generalSettings,
|
||||||
vAppLeaseSettings,
|
vAppLeaseSettings,
|
||||||
vAppTemplateLeaseSettings,
|
vAppTemplateLeaseSettings,
|
||||||
orgLdapSettings,
|
ldapSettings,
|
||||||
orgEmailSettings,
|
emailSettings,
|
||||||
orgPasswordPolicySettings);
|
passwordPolicy);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ToStringHelper string() {
|
public ToStringHelper string() {
|
||||||
return super.string()
|
return super.string()
|
||||||
.add("orgGeneralSettings", orgGeneralSettings)
|
.add("generalSettings", generalSettings)
|
||||||
.add("vAppLeaseSettings", vAppLeaseSettings)
|
.add("vAppLeaseSettings", vAppLeaseSettings)
|
||||||
.add("vAppTemplateLeaseSettings", vAppTemplateLeaseSettings)
|
.add("vAppTemplateLeaseSettings", vAppTemplateLeaseSettings)
|
||||||
.add("orgLdapSettings", orgLdapSettings)
|
.add("ldapSettings", ldapSettings)
|
||||||
.add("orgEmailSettings", orgEmailSettings)
|
.add("emailSettings", emailSettings)
|
||||||
.add("orgPasswordPolicySettings", orgPasswordPolicySettings);
|
.add("passwordPolicy", passwordPolicy);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,17 +19,18 @@
|
||||||
|
|
||||||
package org.jclouds.vcloud.director.v1_5.domain;
|
package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import com.google.common.base.Objects;
|
import static com.google.common.base.Objects.equal;
|
||||||
import com.google.common.collect.Sets;
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
|
import java.net.URI;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
import javax.xml.bind.annotation.XmlType;
|
import javax.xml.bind.annotation.XmlType;
|
||||||
import java.net.URI;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import com.google.common.base.Objects;
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
import com.google.common.collect.Sets;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -25,6 +25,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlType;
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
|
||||||
|
|
|
@ -111,4 +111,11 @@ public class Reference extends ReferenceType<Reference> {
|
||||||
Reference that = Reference.class.cast(o);
|
Reference that = Reference.class.cast(o);
|
||||||
return super.equals(that);
|
return super.equals(that);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
public ReferenceType<?> toAdminReference(String endpoint) {
|
||||||
|
return toBuilder()
|
||||||
|
.type(null)
|
||||||
|
.href(URI.create(getHref().toASCIIString().replace(endpoint, endpoint+"/admin")))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -22,6 +22,7 @@ import static com.google.common.base.Objects.equal;
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import javax.xml.bind.annotation.XmlSeeAlso;
|
import javax.xml.bind.annotation.XmlSeeAlso;
|
||||||
|
|
||||||
|
@ -43,7 +44,7 @@ import com.google.common.base.Objects.ToStringHelper;
|
||||||
CatalogReference.class,
|
CatalogReference.class,
|
||||||
Reference.class
|
Reference.class
|
||||||
})
|
})
|
||||||
public class ReferenceType<T extends ReferenceType<T>> implements URISupplier {
|
public class ReferenceType<T extends ReferenceType<T>> {
|
||||||
|
|
||||||
public static <T extends ReferenceType<T>> Builder<T> builder() {
|
public static <T extends ReferenceType<T>> Builder<T> builder() {
|
||||||
return new Builder<T>();
|
return new Builder<T>();
|
||||||
|
@ -176,14 +177,6 @@ public class ReferenceType<T extends ReferenceType<T>> implements URISupplier {
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @see URISupplier#getURI()
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public URI getURI() {
|
|
||||||
return getHref();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o)
|
if (this == o)
|
||||||
|
|
|
@ -24,6 +24,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlType;
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
|
||||||
|
|
|
@ -20,16 +20,15 @@
|
||||||
package org.jclouds.vcloud.director.v1_5.domain;
|
package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
|
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
import com.google.common.base.Objects.ToStringHelper;
|
import com.google.common.base.Objects.ToStringHelper;
|
||||||
import com.google.common.collect.Sets;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base type that represents a resource entity such as a vApp template or virtual media.
|
* Base type that represents a resource entity such as a vApp template or virtual media.
|
||||||
|
@ -71,13 +70,13 @@ public abstract class ResourceEntityType<T extends ResourceEntityType<T>> extend
|
||||||
this.id = id;
|
this.id = id;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see EntityType#getTasksInProgress()
|
* @see EntityType#getTasks()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder<T> tasksInProgress(TasksInProgress tasksInProgress) {
|
public Builder<T> tasks(Set<Task> tasks) {
|
||||||
this.tasksInProgress = tasksInProgress;
|
super.tasks(tasks);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,20 +99,18 @@ public abstract class ResourceEntityType<T extends ResourceEntityType<T>> extend
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see EntityType#getLinks()
|
* @see ResourceEntityType#getLinks()
|
||||||
*/
|
*/
|
||||||
@Override
|
|
||||||
public Builder<T> links(Set<Link> links) {
|
public Builder<T> links(Set<Link> links) {
|
||||||
this.links = Sets.newLinkedHashSet(checkNotNull(links, "links"));
|
super.links(links);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see EntityType#getLinks()
|
* @see ResourceEntityType#getLinks()
|
||||||
*/
|
*/
|
||||||
@Override
|
|
||||||
public Builder<T> link(Link link) {
|
public Builder<T> link(Link link) {
|
||||||
this.links.add(checkNotNull(link, "link"));
|
super.link(link);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,8 +130,8 @@ public abstract class ResourceEntityType<T extends ResourceEntityType<T>> extend
|
||||||
@XmlAttribute
|
@XmlAttribute
|
||||||
protected Integer status;
|
protected Integer status;
|
||||||
|
|
||||||
public ResourceEntityType(URI href, String type, Set<Link> links, String description, TasksInProgress tasksInProgress, String id, String name, FilesList files, Integer status) {
|
public ResourceEntityType(URI href, String type, Set<Link> links, String description, Set<Task> tasks, String id, String name, FilesList files, Integer status) {
|
||||||
super(href, type, links, description, tasksInProgress, id, name);
|
super(href, type, links, description, tasks, id, name);
|
||||||
this.files = files;
|
this.files = files;
|
||||||
this.status = status;
|
this.status = status;
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ import java.util.Set;
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
|
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.EntityType.NewBuilder;
|
import org.jclouds.javax.annotation.Nullable;
|
||||||
|
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
import com.google.common.base.Objects.ToStringHelper;
|
import com.google.common.base.Objects.ToStringHelper;
|
||||||
|
@ -46,7 +46,7 @@ import com.google.common.collect.Sets;
|
||||||
*
|
*
|
||||||
* @author Adrian Cole
|
* @author Adrian Cole
|
||||||
*/
|
*/
|
||||||
public abstract class ResourceType<T extends ResourceType<T>> implements URISupplier {
|
public abstract class ResourceType<T extends ResourceType<T>> {
|
||||||
|
|
||||||
public NewBuilder<?> toNewBuilder() {
|
public NewBuilder<?> toNewBuilder() {
|
||||||
throw new UnsupportedOperationException("New builder not yet implemented for this class");
|
throw new UnsupportedOperationException("New builder not yet implemented for this class");
|
||||||
|
@ -57,7 +57,7 @@ public abstract class ResourceType<T extends ResourceType<T>> implements URISupp
|
||||||
|
|
||||||
protected URI href;
|
protected URI href;
|
||||||
protected String type;
|
protected String type;
|
||||||
protected Set<Link> links = Sets.newLinkedHashSet();
|
protected Set<Link> links;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ResourceType#getHref()
|
* @see ResourceType#getHref()
|
||||||
|
@ -87,6 +87,8 @@ public abstract class ResourceType<T extends ResourceType<T>> implements URISupp
|
||||||
* @see ResourceType#getLinks()
|
* @see ResourceType#getLinks()
|
||||||
*/
|
*/
|
||||||
public T link(Link link) {
|
public T link(Link link) {
|
||||||
|
if (links == null)
|
||||||
|
links = Sets.newLinkedHashSet();
|
||||||
this.links.add(checkNotNull(link, "link"));
|
this.links.add(checkNotNull(link, "link"));
|
||||||
return self();
|
return self();
|
||||||
}
|
}
|
||||||
|
@ -104,7 +106,7 @@ public abstract class ResourceType<T extends ResourceType<T>> implements URISupp
|
||||||
|
|
||||||
protected URI href;
|
protected URI href;
|
||||||
protected String type;
|
protected String type;
|
||||||
protected Set<Link> links = Sets.newLinkedHashSet();
|
protected Set<Link> links;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ResourceType#getHref()
|
* @see ResourceType#getHref()
|
||||||
|
@ -134,6 +136,8 @@ public abstract class ResourceType<T extends ResourceType<T>> implements URISupp
|
||||||
* @see ResourceType#getLinks()
|
* @see ResourceType#getLinks()
|
||||||
*/
|
*/
|
||||||
public Builder<T> link(Link link) {
|
public Builder<T> link(Link link) {
|
||||||
|
if (links == null)
|
||||||
|
links = Sets.newLinkedHashSet();
|
||||||
this.links.add(checkNotNull(link, "link"));
|
this.links.add(checkNotNull(link, "link"));
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
@ -150,12 +154,13 @@ public abstract class ResourceType<T extends ResourceType<T>> implements URISupp
|
||||||
@XmlAttribute
|
@XmlAttribute
|
||||||
private String type;
|
private String type;
|
||||||
@XmlElement(name = "Link")
|
@XmlElement(name = "Link")
|
||||||
private Set<Link> links = Sets.newLinkedHashSet();
|
private Set<Link> links;
|
||||||
|
|
||||||
protected ResourceType(URI href, String type, Set<Link> links) {
|
protected ResourceType(URI href, String type, @Nullable Set<Link> links) {
|
||||||
this.href = href;
|
this.href = href;
|
||||||
this.type = type;
|
this.type = type;
|
||||||
this.links = ImmutableSet.copyOf(links);
|
// nullable so that jaxb wont persist empty collections
|
||||||
|
this.links = links != null && links.size() == 0 ? null : links;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected ResourceType() {
|
protected ResourceType() {
|
||||||
|
@ -179,14 +184,6 @@ public abstract class ResourceType<T extends ResourceType<T>> implements URISupp
|
||||||
return href;
|
return href;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @see URISupplier#getURI()
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public URI getURI() {
|
|
||||||
return getHref();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Contains the type of the the entity.
|
* Contains the type of the the entity.
|
||||||
* <p/>
|
* <p/>
|
||||||
|
@ -203,7 +200,7 @@ public abstract class ResourceType<T extends ResourceType<T>> implements URISupp
|
||||||
* Set of optional links to an entity or operation associated with this object.
|
* Set of optional links to an entity or operation associated with this object.
|
||||||
*/
|
*/
|
||||||
public Set<Link> getLinks() {
|
public Set<Link> getLinks() {
|
||||||
return Collections.unmodifiableSet(links);
|
return links == null ? ImmutableSet.<Link>of() : Collections.unmodifiableSet(links);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -24,6 +24,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
|
@ -61,7 +61,7 @@ import com.google.common.base.Objects.ToStringHelper;
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
@XmlType(name = "SmtpServerSettings", propOrder = {
|
@XmlType(name = "SmtpServerSettings", propOrder = {
|
||||||
"isUseAuthentication",
|
"useAuthentication",
|
||||||
"host",
|
"host",
|
||||||
"username",
|
"username",
|
||||||
"password"
|
"password"
|
||||||
|
@ -200,8 +200,7 @@ public class SmtpServerSettings {
|
||||||
if (o == null || getClass() != o.getClass())
|
if (o == null || getClass() != o.getClass())
|
||||||
return false;
|
return false;
|
||||||
SmtpServerSettings that = SmtpServerSettings.class.cast(o);
|
SmtpServerSettings that = SmtpServerSettings.class.cast(o);
|
||||||
return super.equals(that) &&
|
return equal(useAuthentication, that.useAuthentication) &&
|
||||||
equal(useAuthentication, that.useAuthentication) &&
|
|
||||||
equal(host, that.host) &&
|
equal(host, that.host) &&
|
||||||
equal(username, that.username) &&
|
equal(username, that.username) &&
|
||||||
equal(password, that.password);
|
equal(password, that.password);
|
||||||
|
@ -209,8 +208,7 @@ public class SmtpServerSettings {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hashCode(super.hashCode(),
|
return Objects.hashCode(useAuthentication,
|
||||||
useAuthentication,
|
|
||||||
host,
|
host,
|
||||||
username,
|
username,
|
||||||
password);
|
password);
|
||||||
|
|
|
@ -24,6 +24,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlType;
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
|
|
@ -24,6 +24,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlType;
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
|
||||||
|
|
|
@ -19,13 +19,13 @@
|
||||||
package org.jclouds.vcloud.director.v1_5.domain;
|
package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
@ -34,7 +34,6 @@ import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
|
||||||
|
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
import com.google.common.base.Objects.ToStringHelper;
|
import com.google.common.base.Objects.ToStringHelper;
|
||||||
import com.google.common.collect.Sets;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents an asynchronous or long-running task in the vCloud environment.
|
* Represents an asynchronous or long-running task in the vCloud environment.
|
||||||
|
@ -43,6 +42,8 @@ import com.google.common.collect.Sets;
|
||||||
* <xs:complexType name="TaskType">
|
* <xs:complexType name="TaskType">
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
* TODO: this object and the hierarchy is wrong. it is literally a Task with a Task container. please review class diagram
|
||||||
|
*
|
||||||
* @author grkvlt@apache.org
|
* @author grkvlt@apache.org
|
||||||
*/
|
*/
|
||||||
@XmlRootElement(name = "Task")
|
@XmlRootElement(name = "Task")
|
||||||
|
@ -187,7 +188,7 @@ public class Task extends EntityType<Task> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Task build() {
|
public Task build() {
|
||||||
return new Task(href, type, links, description, tasksInProgress, id, name,
|
return new Task(href, type, links, description, tasks, id, name,
|
||||||
error, org, progress, owner, user, params, status, operation, operationName, startTime, endTime, expiryTime);
|
error, org, progress, owner, user, params, status, operation, operationName, startTime, endTime, expiryTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -217,13 +218,13 @@ public class Task extends EntityType<Task> {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see EntityType#getTasksInProgress()
|
* @see EntityType#getTasks()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder tasksInProgress(TasksInProgress tasksInProgress) {
|
public Builder tasks(Set<Task> tasks) {
|
||||||
this.tasksInProgress = tasksInProgress;
|
super.tasks(tasks);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -246,23 +247,22 @@ public class Task extends EntityType<Task> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see EntityType#getLinks()
|
* @see ResourceType#getLinks()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder links(Set<Link> links) {
|
public Builder links(Set<Link> links) {
|
||||||
this.links = Sets.newLinkedHashSet(checkNotNull(links, "links"));
|
return Builder.class.cast(super.links(links));
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see EntityType#getLinks()
|
* @see ResourceType#getLinks()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder link(Link link) {
|
public Builder link(Link link) {
|
||||||
this.links.add(checkNotNull(link, "link"));
|
return Builder.class.cast(super.link(link));
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Builder fromEntityType(EntityType<Task> in) {
|
public Builder fromEntityType(EntityType<Task> in) {
|
||||||
return Builder.class.cast(super.fromEntityType(in));
|
return Builder.class.cast(super.fromEntityType(in));
|
||||||
|
@ -275,11 +275,11 @@ public class Task extends EntityType<Task> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Task(URI href, String type, Set<Link> links, String description, TasksInProgress tasksInProgress,
|
public Task(URI href, String type, Set<Link> links, String description, Set<Task> tasks,
|
||||||
String id, String name, Error error, Reference org, Integer progress, Reference owner,
|
String id, String name, Error error, Reference org, Integer progress, Reference owner,
|
||||||
Reference user, Object params, String status, String operation, String operationName,
|
Reference user, Object params, String status, String operation, String operationName,
|
||||||
Date startTime, Date endTime, Date expiryTime) {
|
Date startTime, Date endTime, Date expiryTime) {
|
||||||
super(href, type, links, description, tasksInProgress, id, name);
|
super(href, type, links, description, tasks, id, name);
|
||||||
this.error = error;
|
this.error = error;
|
||||||
this.org = org;
|
this.org = org;
|
||||||
this.progress = progress;
|
this.progress = progress;
|
||||||
|
@ -383,6 +383,7 @@ public class Task extends EntityType<Task> {
|
||||||
* <li>aborted - The task was aborted by an administrative action.
|
* <li>aborted - The task was aborted by an administrative action.
|
||||||
* </ul>
|
* </ul>
|
||||||
*/
|
*/
|
||||||
|
// TODO: enum!!!
|
||||||
public String getStatus() {
|
public String getStatus() {
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,112 +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 CONDITIOXMLNS OF ANY
|
|
||||||
* KIND, either express or implied. See the License for the
|
|
||||||
* specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*/
|
|
||||||
package org.jclouds.vcloud.director.v1_5.domain;
|
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
|
||||||
|
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.Set;
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
|
||||||
|
|
||||||
import com.google.common.base.Objects;
|
|
||||||
import com.google.common.collect.ImmutableSet;
|
|
||||||
import com.google.common.collect.Sets;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author grkvlt@apache.org
|
|
||||||
*/
|
|
||||||
@XmlRootElement(name = "TasksInProgress")
|
|
||||||
public class TasksInProgress {
|
|
||||||
|
|
||||||
public static Builder builder() {
|
|
||||||
return new Builder();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Builder toBuilder() {
|
|
||||||
return new Builder();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class Builder {
|
|
||||||
|
|
||||||
protected Set<Task> tasks = Sets.newLinkedHashSet();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @see TasksInProgress#getTasks()
|
|
||||||
*/
|
|
||||||
public Builder tasks(Set<Task> tasks) {
|
|
||||||
this.tasks = ImmutableSet.copyOf(checkNotNull(tasks, "tasks"));
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @see TasksInProgress#getTasks()
|
|
||||||
*/
|
|
||||||
public Builder task(Task task) {
|
|
||||||
this.tasks.add(checkNotNull(task, "task"));
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public TasksInProgress build() {
|
|
||||||
return new TasksInProgress(tasks);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Builder fromTasksInProgress(TasksInProgress in) {
|
|
||||||
return tasks(in.getTasks());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private TasksInProgress() {
|
|
||||||
// for JAXB
|
|
||||||
}
|
|
||||||
|
|
||||||
private TasksInProgress(Collection<Task> tasks) {
|
|
||||||
this.tasks = ImmutableSet.copyOf(tasks);
|
|
||||||
}
|
|
||||||
|
|
||||||
@XmlElement(name = "Task")
|
|
||||||
private Set<Task> tasks = Sets.newLinkedHashSet();
|
|
||||||
|
|
||||||
public Set<Task> getTasks() {
|
|
||||||
return Collections.unmodifiableSet(tasks);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean equals(Object o) {
|
|
||||||
if (this == o)
|
|
||||||
return true;
|
|
||||||
if (o == null || getClass() != o.getClass())
|
|
||||||
return false;
|
|
||||||
TasksInProgress that = TasksInProgress.class.cast(o);
|
|
||||||
return equal(this.tasks, that.tasks);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int hashCode() {
|
|
||||||
return Objects.hashCode(tasks);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return Objects.toStringHelper("").add("tasks", tasks).toString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -22,12 +22,16 @@ import static com.google.common.base.Objects.equal;
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
import java.util.Iterator;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
|
import org.jclouds.javax.annotation.Nullable;
|
||||||
|
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
import com.google.common.base.Objects.ToStringHelper;
|
import com.google.common.base.Objects.ToStringHelper;
|
||||||
|
@ -35,33 +39,36 @@ import com.google.common.collect.ImmutableSet;
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A list of tasks.
|
* Task List
|
||||||
*
|
*
|
||||||
|
*
|
||||||
* @author Adrian Cole
|
* @author Adrian Cole
|
||||||
*/
|
*/
|
||||||
@XmlRootElement(name = "TasksList")
|
@XmlRootElement(name = "TasksList")
|
||||||
public class TasksList extends EntityType<TasksList> {
|
public class TasksList extends ResourceType<TasksList> implements Set<Task> {
|
||||||
|
|
||||||
public static final String MEDIA_TYPE = VCloudDirectorMediaType.TASKS_LIST;
|
|
||||||
|
|
||||||
public static Builder builder() {
|
public static Builder builder() {
|
||||||
return new Builder();
|
return new Builder();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public static class Builder extends ResourceType.Builder<TasksList> {
|
||||||
public Builder toBuilder() {
|
protected String name;
|
||||||
return new Builder();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class Builder extends EntityType.Builder<TasksList> {
|
private Set<Task> tasks;
|
||||||
|
|
||||||
protected Set<Task> tasks = Sets.newLinkedHashSet();
|
/**
|
||||||
|
* @see TasksList#getName()
|
||||||
|
*/
|
||||||
|
public Builder name(String name) {
|
||||||
|
this.name = name;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see TasksList#getTasks()
|
* @see TasksList#getTasks()
|
||||||
*/
|
*/
|
||||||
public Builder tasks(Set<Task> tasks) {
|
public Builder tasks(Set<Task> tasks) {
|
||||||
this.tasks = Sets.newLinkedHashSet(checkNotNull(tasks, "tasks"));
|
if (checkNotNull(tasks, "tasks").size() > 0)
|
||||||
|
this.tasks = Sets.newLinkedHashSet(tasks);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,111 +76,86 @@ public class TasksList extends EntityType<TasksList> {
|
||||||
* @see TasksList#getTasks()
|
* @see TasksList#getTasks()
|
||||||
*/
|
*/
|
||||||
public Builder task(Task task) {
|
public Builder task(Task task) {
|
||||||
|
if (tasks == null)
|
||||||
|
tasks = Sets.newLinkedHashSet();
|
||||||
this.tasks.add(checkNotNull(task, "task"));
|
this.tasks.add(checkNotNull(task, "task"));
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TasksList build() {
|
public TasksList build() {
|
||||||
return new TasksList(href, type, links, description, tasksInProgress, id, name, tasks);
|
return new TasksList(href, type, links, name, tasks);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see EntityType#getName()
|
* @see ResourceType#getHref()
|
||||||
*/
|
|
||||||
@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#getTasksInProgress()
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public Builder tasksInProgress(TasksInProgress tasksInProgress) {
|
|
||||||
this.tasksInProgress = tasksInProgress;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @see ReferenceType#getHref()
|
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder href(URI href) {
|
public Builder href(URI href) {
|
||||||
this.href = href;
|
super.href(href);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ReferenceType#getType()
|
* @see ResourceType#getType()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder type(String type) {
|
public Builder type(String type) {
|
||||||
this.type = type;
|
super.type(type);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see EntityType#getLinks()
|
* @see ResourceType#getLinks()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder links(Set<Link> links) {
|
public Builder links(Set<Link> links) {
|
||||||
this.links = Sets.newLinkedHashSet(checkNotNull(links, "links"));
|
return Builder.class.cast(super.links(links));
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see EntityType#getLinks()
|
* @see ResourceType#getLinks()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder link(Link link) {
|
public Builder link(Link link) {
|
||||||
this.links.add(checkNotNull(link, "link"));
|
super.link(link);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public Builder fromTasksList(TasksList in) {
|
||||||
public Builder fromEntityType(EntityType<TasksList> in) {
|
return fromResourceType(in).tasks(in);
|
||||||
return Builder.class.cast(super.fromEntityType(in));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder fromTasksList(TasksList in) {
|
/**
|
||||||
return fromEntityType(in).tasks(in.getTasks());
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Builder fromResourceType(ResourceType<TasksList> in) {
|
||||||
|
return Builder.class.cast(super.fromResourceType(in));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@XmlAttribute(required = true)
|
||||||
|
private String name;
|
||||||
|
@XmlElement(name = "Task")
|
||||||
|
private Set<Task> tasks;
|
||||||
|
|
||||||
|
public TasksList(URI href, String type, @Nullable Set<Link> links, String name, @Nullable Set<Task> tasks) {
|
||||||
|
super(href, type, links);
|
||||||
|
this.tasks = tasks;
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
protected TasksList() {
|
protected TasksList() {
|
||||||
// for JAXB
|
// For JAXB
|
||||||
}
|
}
|
||||||
|
|
||||||
public TasksList(URI href, String type, Set<Link> links, String description, TasksInProgress tasksInProgress, String id, String name, Set<Task> tasks) {
|
|
||||||
super(href, type, links, description, tasksInProgress, id, name);
|
|
||||||
this.tasks = ImmutableSet.copyOf(tasks);
|
|
||||||
}
|
|
||||||
|
|
||||||
@XmlElement(name = "Task")
|
/**
|
||||||
private Set<Task> tasks = Sets.newLinkedHashSet();
|
* Contains the name of the the entity.
|
||||||
|
*/
|
||||||
public Set<Task> getTasks() {
|
public String getName() {
|
||||||
return Collections.unmodifiableSet(tasks);
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -183,16 +165,91 @@ public class TasksList extends EntityType<TasksList> {
|
||||||
if (o == null || getClass() != o.getClass())
|
if (o == null || getClass() != o.getClass())
|
||||||
return false;
|
return false;
|
||||||
TasksList that = TasksList.class.cast(o);
|
TasksList that = TasksList.class.cast(o);
|
||||||
return super.equals(that) && equal(this.tasks, that.tasks);
|
return super.equals(that) && equal(this.delegate(), that.delegate()) && equal(this.name, that.name);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return super.hashCode() + Objects.hashCode(tasks);
|
return super.hashCode() + Objects.hashCode(delegate(), name);
|
||||||
|
}
|
||||||
|
|
||||||
|
private Set<Task> delegate() {
|
||||||
|
return tasks == null ? ImmutableSet.<Task>of() : Collections.unmodifiableSet(tasks);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ToStringHelper string() {
|
public ToStringHelper string() {
|
||||||
return super.string().add("tasks", tasks);
|
return super.string().add("name", name).add("tasks", delegate());
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@Override
|
||||||
|
public Builder toBuilder() {
|
||||||
|
return new Builder().fromTasksList(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Iterator<Task> iterator() {
|
||||||
|
return delegate().iterator();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int size() {
|
||||||
|
return delegate().size();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean removeAll(Collection<?> collection) {
|
||||||
|
return delegate().removeAll(collection);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isEmpty() {
|
||||||
|
return delegate().isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean contains(Object object) {
|
||||||
|
return delegate().contains(object);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean add(Task element) {
|
||||||
|
return delegate().add(element);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean remove(Object object) {
|
||||||
|
return delegate().remove(object);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean containsAll(Collection<?> collection) {
|
||||||
|
return delegate().containsAll(collection);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean addAll(Collection<? extends Task> collection) {
|
||||||
|
return delegate().addAll(collection);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean retainAll(Collection<?> collection) {
|
||||||
|
return delegate().retainAll(collection);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void clear() {
|
||||||
|
delegate().clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object[] toArray() {
|
||||||
|
return delegate().toArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public <T> T[] toArray(T[] array) {
|
||||||
|
return delegate().toArray(array);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -1,47 +0,0 @@
|
||||||
/**
|
|
||||||
* Licensed to jclouds, Inc. (jclouds) under one or more
|
|
||||||
* contributor license agreements. See the NOTICE file
|
|
||||||
* distributed with this work for additional information
|
|
||||||
* regarding copyright ownership. jclouds licenses this file
|
|
||||||
* to you under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance
|
|
||||||
* with the License. You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing,
|
|
||||||
* software distributed under the License is distributed on an
|
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
||||||
* KIND, either express or implied. See the License for the
|
|
||||||
* specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*/
|
|
||||||
package org.jclouds.vcloud.director.v1_5.domain;
|
|
||||||
|
|
||||||
import java.net.URI;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author grkvlt@apache.org
|
|
||||||
*/
|
|
||||||
public interface URISupplier {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This returns the {@link URI} for a particular {@link ReferenceType} or {@link ResourceType} object.
|
|
||||||
*
|
|
||||||
* @see ResourceType#getHref()
|
|
||||||
* @see ReferenceType#getHref()
|
|
||||||
*/
|
|
||||||
public URI getURI();
|
|
||||||
|
|
||||||
public static class SingleURI {
|
|
||||||
public static URISupplier fromURI(final URI uri) {
|
|
||||||
return new URISupplier(){
|
|
||||||
@Override
|
|
||||||
public URI getURI() {
|
|
||||||
return uri;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -23,6 +23,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
import javax.xml.bind.annotation.XmlType;
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
@ -269,7 +270,7 @@ public class User
|
||||||
|
|
||||||
|
|
||||||
public User build() {
|
public User build() {
|
||||||
return new User(href, type, links, description, tasksInProgress, id,
|
return new User(href, type, links, description, tasks, id,
|
||||||
name, fullName, emailAddress, telephone, isEnabled, isLocked,
|
name, fullName, emailAddress, telephone, isEnabled, isLocked,
|
||||||
im, nameInSource, isAlertEnabled, alertEmailPrefix, alertEmail,
|
im, nameInSource, isAlertEnabled, alertEmailPrefix, alertEmail,
|
||||||
isExternal, isDefaultCached, isGroupRole, storedVmQuota, deployedVmQuota,
|
isExternal, isDefaultCached, isGroupRole, storedVmQuota, deployedVmQuota,
|
||||||
|
@ -285,13 +286,13 @@ public class User
|
||||||
this.id = id;
|
this.id = id;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see EntityType#getTasksInProgress()
|
* @see EntityType#getTasks()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder tasksInProgress(TasksInProgress tasksInProgress) {
|
public Builder tasks(Set<Task> tasks) {
|
||||||
this.tasksInProgress = tasksInProgress;
|
super.tasks(tasks);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -397,12 +398,12 @@ public class User
|
||||||
@XmlElement(name = "GroupReferences")
|
@XmlElement(name = "GroupReferences")
|
||||||
protected Object /* GroupsList */ groupReferences;
|
protected Object /* GroupsList */ groupReferences;
|
||||||
|
|
||||||
public User(URI href, String type, Set<Link> links, String description, TasksInProgress tasksInProgress, String id,
|
public User(URI href, String type, Set<Link> links, String description, Set<Task> tasks, String id,
|
||||||
String name, String fullName, String emailAddress, String telephone, Boolean enabled, Boolean locked,
|
String name, String fullName, String emailAddress, String telephone, Boolean enabled, Boolean locked,
|
||||||
String im, String nameInSource, Boolean alertEnabled, String alertEmailPrefix, String alertEmail,
|
String im, String nameInSource, Boolean alertEnabled, String alertEmailPrefix, String alertEmail,
|
||||||
Boolean external, Boolean defaultCached, Boolean groupRole, Integer storedVmQuota, Integer deployedVmQuota,
|
Boolean external, Boolean defaultCached, Boolean groupRole, Integer storedVmQuota, Integer deployedVmQuota,
|
||||||
Reference role, String password, Object groupReferences) {
|
Reference role, String password, Object groupReferences) {
|
||||||
super(href, type, links, description, tasksInProgress, id, name);
|
super(href, type, links, description, tasks, id, name);
|
||||||
this.fullName = fullName;
|
this.fullName = fullName;
|
||||||
this.emailAddress = emailAddress;
|
this.emailAddress = emailAddress;
|
||||||
this.telephone = telephone;
|
this.telephone = telephone;
|
||||||
|
|
|
@ -33,6 +33,7 @@ import javax.xml.bind.annotation.XmlType;
|
||||||
|
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -62,7 +63,7 @@ import com.google.common.collect.ImmutableList;
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
@XmlRootElement(name = "UsersList")
|
@XmlRootElement(name = "UsersList")
|
||||||
@XmlType(propOrder = {
|
@XmlType(propOrder = {
|
||||||
"userReference"
|
"users"
|
||||||
})
|
})
|
||||||
public class UsersList {
|
public class UsersList {
|
||||||
public static Builder builder() {
|
public static Builder builder() {
|
||||||
|
@ -74,7 +75,7 @@ public class UsersList {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Builder {
|
public static class Builder {
|
||||||
private List<Reference> users;
|
private List<Reference> users = Lists.newArrayList();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see UsersList#getUsers()
|
* @see UsersList#getUsers()
|
||||||
|
|
|
@ -24,6 +24,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlType;
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
|
|
@ -25,6 +25,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlElementRef;
|
import javax.xml.bind.annotation.XmlElementRef;
|
||||||
|
@ -144,7 +145,7 @@ public class VAppTemplate extends ResourceEntityType<VAppTemplate> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public VAppTemplate build() {
|
public VAppTemplate build() {
|
||||||
return new VAppTemplate(href, type, links, description, tasksInProgress, id, name, files, status, owner, children, sections, vAppScopedLocalId, ovfDescriptorUploaded, goldMaster);
|
return new VAppTemplate(href, type, links, description, tasks, id, name, files, status, owner, children, sections, vAppScopedLocalId, ovfDescriptorUploaded, goldMaster);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -209,11 +210,11 @@ public class VAppTemplate extends ResourceEntityType<VAppTemplate> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see EntityType#getTasksInProgress()
|
* @see EntityType#getTasks()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder tasksInProgress(TasksInProgress tasksInProgress) {
|
public Builder tasks(Set<Task> tasks) {
|
||||||
super.tasksInProgress(tasksInProgress);
|
super.tasks(tasks);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -267,10 +268,10 @@ public class VAppTemplate extends ResourceEntityType<VAppTemplate> {
|
||||||
@XmlAttribute
|
@XmlAttribute
|
||||||
protected Boolean goldMaster;
|
protected Boolean goldMaster;
|
||||||
|
|
||||||
private VAppTemplate(URI href, String type, Set<Link> links, String description, TasksInProgress tasksInProgress,
|
private VAppTemplate(URI href, String type, Set<Link> links, String description, Set<Task> tasks,
|
||||||
String id, String name, FilesList files, Integer status, Owner owner, Set<VAppTemplate> children,
|
String id, String name, FilesList files, Integer status, Owner owner, Set<VAppTemplate> children,
|
||||||
Set<? extends SectionType<?>> sections, String vAppScopedLocalId, Boolean ovfDescriptorUploaded, Boolean goldMaster) {
|
Set<? extends SectionType<?>> sections, String vAppScopedLocalId, Boolean ovfDescriptorUploaded, Boolean goldMaster) {
|
||||||
super(href, type, links, description, tasksInProgress, id, name, files, status);
|
super(href, type, links, description, tasks, id, name, files, status);
|
||||||
this.owner = owner;
|
this.owner = owner;
|
||||||
this.children = VAppTemplateChildren.builder().vms(children).build();
|
this.children = VAppTemplateChildren.builder().vms(children).build();
|
||||||
this.sections = ImmutableSet.copyOf(sections);
|
this.sections = ImmutableSet.copyOf(sections);
|
||||||
|
|
|
@ -24,6 +24,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
import javax.xml.bind.annotation.XmlType;
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
|
|
@ -20,10 +20,10 @@
|
||||||
package org.jclouds.vcloud.director.v1_5.domain;
|
package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.equal;
|
import static com.google.common.base.Objects.equal;
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
@ -31,7 +31,6 @@ import javax.xml.bind.annotation.XmlSeeAlso;
|
||||||
import javax.xml.bind.annotation.XmlType;
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
import com.google.common.collect.Sets;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -198,7 +197,7 @@ public class Vdc
|
||||||
|
|
||||||
public Vdc build() {
|
public Vdc build() {
|
||||||
return new Vdc(
|
return new Vdc(
|
||||||
href, type, links, description, tasksInProgress, id, name, allocationModel, storageCapacity,
|
href, type, links, description, tasks, id, name, allocationModel, storageCapacity,
|
||||||
computeCapacity, resourceEntities, availableNetworks, capabilities, nicQuota, networkQuota,
|
computeCapacity, resourceEntities, availableNetworks, capabilities, nicQuota, networkQuota,
|
||||||
vmQuota, isEnabled, status);
|
vmQuota, isEnabled, status);
|
||||||
}
|
}
|
||||||
|
@ -227,13 +226,13 @@ public class Vdc
|
||||||
this.id = id;
|
this.id = id;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see EntityType#getTasksInProgress()
|
* @see EntityType#getTasks()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder tasksInProgress(TasksInProgress tasksInProgress) {
|
public Builder tasks(Set<Task> tasks) {
|
||||||
this.tasksInProgress = tasksInProgress;
|
super.tasks(tasks);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -254,13 +253,13 @@ public class Vdc
|
||||||
this.type = type;
|
this.type = type;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see EntityType#getLinks()
|
* @see EntityType#getLinks()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder links(Set<Link> links) {
|
public Builder links(Set<Link> links) {
|
||||||
this.links = Sets.newLinkedHashSet(checkNotNull(links, "links"));
|
super.links(links);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -269,11 +268,10 @@ public class Vdc
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder link(Link link) {
|
public Builder link(Link link) {
|
||||||
this.links.add(checkNotNull(link, "link"));
|
super.link(link);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Builder fromEntityType(EntityType<Vdc> in) {
|
public Builder fromEntityType(EntityType<Vdc> in) {
|
||||||
return Builder.class.cast(super.fromEntityType(in));
|
return Builder.class.cast(super.fromEntityType(in));
|
||||||
|
@ -295,8 +293,8 @@ public class Vdc
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Vdc(URI href, String type, Set<Link> links, String description, TasksInProgress tasksInProgress, String id, String name, String allocationModel, CapacityWithUsage storageCapacity, ComputeCapacity computeCapacity, ResourceEntities resourceEntities, AvailableNetworks availableNetworks, Capabilities capabilities, int nicQuota, int networkQuota, Integer vmQuota, Boolean enabled, Integer status) {
|
public Vdc(URI href, String type, Set<Link> links, String description, Set<Task> tasks, String id, String name, String allocationModel, CapacityWithUsage storageCapacity, ComputeCapacity computeCapacity, ResourceEntities resourceEntities, AvailableNetworks availableNetworks, Capabilities capabilities, int nicQuota, int networkQuota, Integer vmQuota, Boolean enabled, Integer status) {
|
||||||
super(href, type, links, description, tasksInProgress, id, name);
|
super(href, type, links, description, tasks, id, name);
|
||||||
this.allocationModel = allocationModel;
|
this.allocationModel = allocationModel;
|
||||||
this.storageCapacity = storageCapacity;
|
this.storageCapacity = storageCapacity;
|
||||||
this.computeCapacity = computeCapacity;
|
this.computeCapacity = computeCapacity;
|
||||||
|
|
|
@ -24,6 +24,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
|
@ -33,6 +34,7 @@ import javax.xml.bind.annotation.XmlType;
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
import com.google.common.base.Objects.ToStringHelper;
|
import com.google.common.base.Objects.ToStringHelper;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -75,7 +77,7 @@ public class Vdcs {
|
||||||
|
|
||||||
public static class Builder {
|
public static class Builder {
|
||||||
|
|
||||||
private List<Reference> vdcs;
|
private List<Reference> vdcs = Lists.newArrayList();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see Vdcs#getVdc()
|
* @see Vdcs#getVdc()
|
||||||
|
|
|
@ -25,7 +25,10 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import com.google.common.base.Function;
|
import com.google.common.base.Function;
|
||||||
import com.google.common.collect.*;
|
import com.google.common.collect.ImmutableList;
|
||||||
|
import com.google.common.collect.ImmutableSet;
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
|
import com.google.common.collect.Maps;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
|
@ -22,4 +22,5 @@ package org.jclouds.vcloud.director.v1_5.domain.cim;
|
||||||
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_CIM_NS;
|
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_CIM_NS;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlNsForm;
|
import javax.xml.bind.annotation.XmlNsForm;
|
||||||
import javax.xml.bind.annotation.XmlSchema;
|
import javax.xml.bind.annotation.XmlSchema;
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
package org.jclouds.vcloud.director.v1_5.domain.ovf;
|
package org.jclouds.vcloud.director.v1_5.domain.ovf;
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
import javax.xml.bind.annotation.XmlType;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Adrian Cole
|
* @author Adrian Cole
|
||||||
|
|
|
@ -21,6 +21,7 @@ package org.jclouds.vcloud.director.v1_5.domain.ovf;
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
import org.jclouds.javax.annotation.Nullable;
|
import org.jclouds.javax.annotation.Nullable;
|
||||||
|
|
|
@ -22,6 +22,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_OVF_NS;
|
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_OVF_NS;
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
import org.jclouds.javax.annotation.Nullable;
|
import org.jclouds.javax.annotation.Nullable;
|
||||||
|
|
|
@ -22,6 +22,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_OVF_NS;
|
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_OVF_NS;
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
import org.jclouds.javax.annotation.Nullable;
|
import org.jclouds.javax.annotation.Nullable;
|
||||||
|
|
|
@ -29,4 +29,5 @@ import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_OV
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlNs;
|
import javax.xml.bind.annotation.XmlNs;
|
||||||
import javax.xml.bind.annotation.XmlNsForm;
|
import javax.xml.bind.annotation.XmlNsForm;
|
||||||
import javax.xml.bind.annotation.XmlSchema;
|
import javax.xml.bind.annotation.XmlSchema;
|
||||||
|
|
||||||
|
|
|
@ -29,4 +29,5 @@ import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_OV
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlNs;
|
import javax.xml.bind.annotation.XmlNs;
|
||||||
import javax.xml.bind.annotation.XmlNsForm;
|
import javax.xml.bind.annotation.XmlNsForm;
|
||||||
import javax.xml.bind.annotation.XmlSchema;
|
import javax.xml.bind.annotation.XmlSchema;
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.CatalogReference;
|
import org.jclouds.vcloud.director.v1_5.domain.CatalogReference;
|
||||||
|
|
|
@ -24,6 +24,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
|
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Link;
|
import org.jclouds.vcloud.director.v1_5.domain.Link;
|
||||||
|
|
|
@ -25,6 +25,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
import javax.xml.bind.annotation.XmlSchemaType;
|
import javax.xml.bind.annotation.XmlSchemaType;
|
||||||
|
|
|
@ -24,6 +24,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
|
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Link;
|
import org.jclouds.vcloud.director.v1_5.domain.Link;
|
||||||
|
|
|
@ -23,6 +23,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlSchemaType;
|
import javax.xml.bind.annotation.XmlSchemaType;
|
||||||
|
|
|
@ -24,6 +24,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlElementRef;
|
import javax.xml.bind.annotation.XmlElementRef;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
|
|
@ -24,11 +24,10 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlElementRef;
|
import javax.xml.bind.annotation.XmlElementRef;
|
||||||
import javax.xml.bind.annotation.XmlElementRefs;
|
|
||||||
|
|
||||||
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
|
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.CatalogReference;
|
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Link;
|
import org.jclouds.vcloud.director.v1_5.domain.Link;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.ReferenceType;
|
import org.jclouds.vcloud.director.v1_5.domain.ReferenceType;
|
||||||
|
|
||||||
|
|
|
@ -25,8 +25,8 @@ package org.jclouds.vcloud.director.v1_5.domain.query;
|
||||||
|
|
||||||
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_1_5_NS;
|
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_1_5_NS;
|
||||||
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_CIM_NS;
|
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_CIM_NS;
|
||||||
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_OVF_NS;
|
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlNs;
|
import javax.xml.bind.annotation.XmlNs;
|
||||||
import javax.xml.bind.annotation.XmlNsForm;
|
import javax.xml.bind.annotation.XmlNsForm;
|
||||||
import javax.xml.bind.annotation.XmlSchema;
|
import javax.xml.bind.annotation.XmlSchema;
|
||||||
|
|
||||||
|
|
|
@ -30,4 +30,5 @@ import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_OV
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlNs;
|
import javax.xml.bind.annotation.XmlNs;
|
||||||
import javax.xml.bind.annotation.XmlNsForm;
|
import javax.xml.bind.annotation.XmlNsForm;
|
||||||
import javax.xml.bind.annotation.XmlSchema;
|
import javax.xml.bind.annotation.XmlSchema;
|
||||||
|
|
||||||
|
|
|
@ -49,6 +49,18 @@ import com.google.common.util.concurrent.ListenableFuture;
|
||||||
*/
|
*/
|
||||||
@RequestFilters(AddVCloudAuthorizationToRequest.class)
|
@RequestFilters(AddVCloudAuthorizationToRequest.class)
|
||||||
public interface AdminCatalogAsyncClient extends CatalogAsyncClient {
|
public interface AdminCatalogAsyncClient extends CatalogAsyncClient {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see AdminClient#createCatalog(URI, AdminCatalog)
|
||||||
|
*/
|
||||||
|
@POST
|
||||||
|
@Path("/catalogs")
|
||||||
|
@Consumes(VCloudDirectorMediaType.ADMIN_CATALOG)
|
||||||
|
@Produces(VCloudDirectorMediaType.ADMIN_CATALOG)
|
||||||
|
@JAXBResponseParser
|
||||||
|
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
|
||||||
|
ListenableFuture<AdminCatalog> createCatalog(@EndpointParam URI orgRef,
|
||||||
|
@BinderParam(BindToXMLPayload.class) AdminCatalog catalog);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see AdminClient#getCatalog(URI)
|
* @see AdminClient#getCatalog(URI)
|
||||||
|
|
|
@ -34,6 +34,19 @@ import org.jclouds.vcloud.director.v1_5.domain.PublishCatalogParams;
|
||||||
*/
|
*/
|
||||||
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)
|
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)
|
||||||
public interface AdminCatalogClient extends CatalogClient {
|
public interface AdminCatalogClient extends CatalogClient {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a catalog in an organization. The catalog will always be created in unpublished state.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* POST /admin/org/{id}/catalogs
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* @param orgRef the reference for the org
|
||||||
|
* @return contains a , which will point to the running asynchronous creation operation.
|
||||||
|
*/
|
||||||
|
AdminCatalog createCatalog(URI orgRef, AdminCatalog catalog);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves a catalog.
|
* Retrieves a catalog.
|
||||||
|
|
|
@ -18,46 +18,203 @@
|
||||||
*/
|
*/
|
||||||
package org.jclouds.vcloud.director.v1_5.features;
|
package org.jclouds.vcloud.director.v1_5.features;
|
||||||
|
|
||||||
|
import java.net.URI;
|
||||||
|
|
||||||
|
import javax.ws.rs.Consumes;
|
||||||
|
import javax.ws.rs.GET;
|
||||||
|
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.EndpointParam;
|
||||||
|
import org.jclouds.rest.annotations.ExceptionParser;
|
||||||
|
import org.jclouds.rest.annotations.JAXBResponseParser;
|
||||||
import org.jclouds.rest.annotations.RequestFilters;
|
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.AdminOrg;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.domain.OrgEmailSettings;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.domain.OrgGeneralSettings;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.domain.OrgLdapSettings;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.domain.OrgLeaseSettings;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.domain.OrgPasswordPolicySettings;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.domain.OrgSettings;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.domain.OrgVAppTemplateLeaseSettings;
|
||||||
import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest;
|
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;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see GroupClient
|
* @see GroupClient
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
@RequestFilters(AddVCloudAuthorizationToRequest.class)
|
@RequestFilters(AddVCloudAuthorizationToRequest.class)
|
||||||
public interface AdminOrgAsyncClient {
|
public interface AdminOrgAsyncClient extends OrgAsyncClient {
|
||||||
|
|
||||||
// GET /admin/org/{id}
|
/**
|
||||||
|
* @see AdminOrgClient#getOrg(URI)
|
||||||
|
*/
|
||||||
|
@GET
|
||||||
|
@Consumes
|
||||||
|
@JAXBResponseParser
|
||||||
|
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
|
||||||
|
ListenableFuture<AdminOrg> getOrg(
|
||||||
|
@EndpointParam URI orgRef);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see AdminOrgClient#getSettings(URI)
|
||||||
|
*/
|
||||||
|
@GET
|
||||||
|
@Path("/settings")
|
||||||
|
@Consumes
|
||||||
|
@JAXBResponseParser
|
||||||
|
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
|
||||||
|
ListenableFuture<OrgSettings> getSettings(
|
||||||
|
@EndpointParam URI orgRef);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see AdminOrgClient#updateSettings(URI, OrgSettings)
|
||||||
|
*/
|
||||||
|
@PUT
|
||||||
|
@Path("/settings")
|
||||||
|
@Consumes(VCloudDirectorMediaType.ORG_SETTINGS)
|
||||||
|
@Produces(VCloudDirectorMediaType.ORG_SETTINGS)
|
||||||
|
@JAXBResponseParser
|
||||||
|
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
|
||||||
|
ListenableFuture<OrgSettings> updateSettings(
|
||||||
|
@EndpointParam URI orgRef,
|
||||||
|
@BinderParam(BindToXMLPayload.class) OrgSettings settings);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see AdminOrgClient#getEmailSettings(URI)
|
||||||
|
*/
|
||||||
|
@GET
|
||||||
|
@Path("/settings/email")
|
||||||
|
@Consumes
|
||||||
|
@JAXBResponseParser
|
||||||
|
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
|
||||||
|
ListenableFuture<OrgEmailSettings> getEmailSettings(
|
||||||
|
@EndpointParam URI orgRef);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see AdminOrgClient#updateEmailSettings(URI, OrgEmailSettings)
|
||||||
|
*/
|
||||||
|
@PUT
|
||||||
|
@Path("/settings/email")
|
||||||
|
@Consumes(VCloudDirectorMediaType.ORG_EMAIL_SETTINGS)
|
||||||
|
@Produces(VCloudDirectorMediaType.ORG_EMAIL_SETTINGS)
|
||||||
|
@JAXBResponseParser
|
||||||
|
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
|
||||||
|
ListenableFuture<OrgEmailSettings> updateEmailSettings(
|
||||||
|
@EndpointParam URI orgRef,
|
||||||
|
@BinderParam(BindToXMLPayload.class) OrgEmailSettings settings);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see AdminOrgClient#getGeneralSettings(URI)
|
||||||
|
*/
|
||||||
|
@GET
|
||||||
|
@Path("/settings/general")
|
||||||
|
@Consumes
|
||||||
|
@JAXBResponseParser
|
||||||
|
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
|
||||||
|
ListenableFuture<OrgGeneralSettings> getGeneralSettings(
|
||||||
|
@EndpointParam URI orgRef);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see AdminOrgClient#updateGeneralSettings(URI, OrgGeneralSettings)
|
||||||
|
*/
|
||||||
|
@PUT
|
||||||
|
@Path("/settings/general")
|
||||||
|
@Consumes(VCloudDirectorMediaType.ORG_GENERAL_SETTINGS)
|
||||||
|
@Produces(VCloudDirectorMediaType.ORG_GENERAL_SETTINGS)
|
||||||
|
@JAXBResponseParser
|
||||||
|
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
|
||||||
|
ListenableFuture<OrgGeneralSettings> updateGeneralSettings(
|
||||||
|
@EndpointParam URI orgRef,
|
||||||
|
@BinderParam(BindToXMLPayload.class) OrgGeneralSettings settings);
|
||||||
|
|
||||||
// POST /admin/org/{id}/catalogs
|
/**
|
||||||
|
* @see AdminOrgClient#getPasswordPolicy(URI)
|
||||||
|
*/
|
||||||
|
@GET
|
||||||
|
@Path("/settings/ldap")
|
||||||
|
@Consumes
|
||||||
|
@JAXBResponseParser
|
||||||
|
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
|
||||||
|
ListenableFuture<OrgLdapSettings> getLdapSettings(@EndpointParam URI orgRef);
|
||||||
|
|
||||||
// POST /admin/org/{id}/groups
|
/**
|
||||||
|
* @see AdminOrgClient#getPasswordPolicy(URI)
|
||||||
// GET /admin/org/{id}/settings
|
*/
|
||||||
|
@GET
|
||||||
// PUT /admin/org/{id}/settings
|
@Path("/settings/passwordPolicy")
|
||||||
|
@Consumes
|
||||||
// GET /admin/org/{id}/settings/email
|
@JAXBResponseParser
|
||||||
|
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
|
||||||
// PUT /admin/org/{id}/settings/email
|
ListenableFuture<OrgPasswordPolicySettings> getPasswordPolicy(
|
||||||
|
@EndpointParam URI orgRef);
|
||||||
// GET /admin/org/{id}/settings/general
|
|
||||||
|
/**
|
||||||
// PUT /admin/org/{id}/settings/general
|
* @see AdminOrgClient#updatePasswordPolicy(URI, OrgPasswordPolicySettings)
|
||||||
|
*/
|
||||||
// GET /admin/org/{id}/settings/ldap
|
@PUT
|
||||||
|
@Path("/settings/passwordPolicy")
|
||||||
// GET /admin/org/{id}/settings/passwordPolicy
|
@Consumes(VCloudDirectorMediaType.ORG_PASSWORD_POLICY_SETTINGS)
|
||||||
|
@Produces(VCloudDirectorMediaType.ORG_PASSWORD_POLICY_SETTINGS)
|
||||||
// PUT /admin/org/{id}/settings/passwordPolicy
|
@JAXBResponseParser
|
||||||
|
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
|
||||||
// GET /admin/org/{id}/settings/vAppLeaseSettings
|
ListenableFuture<OrgPasswordPolicySettings> updatePasswordPolicy(
|
||||||
|
@EndpointParam URI orgRef,
|
||||||
// PUT /admin/org/{id}/settings/vAppLeaseSettings
|
@BinderParam(BindToXMLPayload.class) OrgPasswordPolicySettings settings);
|
||||||
|
|
||||||
// GET /admin/org/{id}/settings/vAppTemplateLeaseSettings
|
|
||||||
|
|
||||||
// PUT /admin/org/{id}/settings/vAppTemplateLeaseSettings
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see AdminOrgClient#getVAppLeaseSettings(URI)
|
||||||
|
*/
|
||||||
|
@GET
|
||||||
|
@Path("/settings/vAppLeaseSettings")
|
||||||
|
@Consumes
|
||||||
|
@JAXBResponseParser
|
||||||
|
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
|
||||||
|
ListenableFuture<OrgLeaseSettings> getVAppLeaseSettings(
|
||||||
|
@EndpointParam URI orgRef);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see AdminOrgClient#updateVAppLeaseSettings(URI, OrgVAppLeaseSettings)
|
||||||
|
*/
|
||||||
|
@PUT
|
||||||
|
@Path("/settings/vAppLeaseSettings")
|
||||||
|
@Consumes(VCloudDirectorMediaType.ORG_LEASE_SETTINGS)
|
||||||
|
@Produces(VCloudDirectorMediaType.ORG_LEASE_SETTINGS)
|
||||||
|
@JAXBResponseParser
|
||||||
|
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
|
||||||
|
ListenableFuture<OrgLeaseSettings> updateVAppLeaseSettings(
|
||||||
|
@EndpointParam URI orgRef,
|
||||||
|
@BinderParam(BindToXMLPayload.class) OrgLeaseSettings settings);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see AdminOrgClient#getVAppTemplateLeaseSettings(URI)
|
||||||
|
*/
|
||||||
|
@GET
|
||||||
|
@Path("/settings/vAppTemplateLeaseSettings")
|
||||||
|
@Consumes
|
||||||
|
@JAXBResponseParser
|
||||||
|
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
|
||||||
|
ListenableFuture<OrgVAppTemplateLeaseSettings> getVAppTemplateLeaseSettings(
|
||||||
|
@EndpointParam URI orgRef);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see AdminOrgClient#updateVAppTemplateLeaseSettings(URI, OrgVAppTemplateLeaseSettings)
|
||||||
|
*/
|
||||||
|
@PUT
|
||||||
|
@Path("/settings/vAppTemplateLeaseSettings")
|
||||||
|
@Consumes(VCloudDirectorMediaType.ORG_VAPP_TEMPLATE_LEASE_SETTINGS)
|
||||||
|
@Produces(VCloudDirectorMediaType.ORG_VAPP_TEMPLATE_LEASE_SETTINGS)
|
||||||
|
@JAXBResponseParser
|
||||||
|
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
|
||||||
|
ListenableFuture<OrgVAppTemplateLeaseSettings> updateVAppTemplateLeaseSettings(
|
||||||
|
@EndpointParam URI orgRef,
|
||||||
|
@BinderParam(BindToXMLPayload.class) OrgVAppTemplateLeaseSettings settings);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,9 +18,19 @@
|
||||||
*/
|
*/
|
||||||
package org.jclouds.vcloud.director.v1_5.features;
|
package org.jclouds.vcloud.director.v1_5.features;
|
||||||
|
|
||||||
|
import java.net.URI;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import org.jclouds.concurrent.Timeout;
|
import org.jclouds.concurrent.Timeout;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.domain.AdminOrg;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.domain.Group;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.domain.OrgEmailSettings;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.domain.OrgGeneralSettings;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.domain.OrgLdapSettings;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.domain.OrgLeaseSettings;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.domain.OrgPasswordPolicySettings;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.domain.OrgSettings;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.domain.OrgVAppTemplateLeaseSettings;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides synchronous access to {@link Group} objects.
|
* Provides synchronous access to {@link Group} objects.
|
||||||
|
@ -29,38 +39,181 @@ import org.jclouds.concurrent.Timeout;
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)
|
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)
|
||||||
public interface AdminOrgClient {
|
public interface AdminOrgClient extends OrgClient {
|
||||||
|
|
||||||
// GET /admin/org/{id}
|
/**
|
||||||
|
* Retrieves an admin view of an organization.
|
||||||
|
* The organization might be enabled or disabled.
|
||||||
|
* If enabled, the organization allows login and all other operations.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* GET /admin/org/{id}
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* @param orgRef the reference for the admin org
|
||||||
|
* @return the admin org
|
||||||
|
*/
|
||||||
|
AdminOrg getOrg(URI orgRef);
|
||||||
|
|
||||||
// POST /admin/org/{id}/catalogs
|
/**
|
||||||
|
* Gets organizational settings for this organization.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* GET /admin/org/{id}/settings
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* @param orgRef the reference for the admin org
|
||||||
|
* @return the settings
|
||||||
|
*/
|
||||||
|
OrgSettings getSettings(URI orgRef);
|
||||||
|
|
||||||
// POST /admin/org/{id}/groups
|
/**
|
||||||
|
* Updates organizational settings for this organization.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* PUT /admin/org/{id}/settings
|
||||||
|
* </pre>
|
||||||
|
* @param orgRef the reference for the admin org
|
||||||
|
* @param newSettings the requested updated settings
|
||||||
|
* @return the resultant settings
|
||||||
|
*/
|
||||||
|
OrgSettings updateSettings(URI orgRef, OrgSettings newSettings);
|
||||||
|
|
||||||
// GET /admin/org/{id}/settings
|
/**
|
||||||
|
* Retrieves email settings for an organization.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* GET /admin/org/{id}/settings/email
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* @param orgRef the reference for the admin org
|
||||||
|
* @return the email settings
|
||||||
|
*/
|
||||||
|
OrgEmailSettings getEmailSettings(URI orgRef);
|
||||||
|
|
||||||
// PUT /admin/org/{id}/settings
|
/**
|
||||||
|
* Updates email policy settings for organization.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* PUT /admin/org/{id}/settings/email
|
||||||
|
* </pre>
|
||||||
|
* @param orgRef the reference for the admin org
|
||||||
|
* @param newSettings the requested updated settings
|
||||||
|
* @return the resultant settings
|
||||||
|
*/
|
||||||
|
OrgEmailSettings updateEmailSettings(URI orgRef,
|
||||||
|
OrgEmailSettings newSettings);
|
||||||
|
|
||||||
// GET /admin/org/{id}/settings/email
|
/**
|
||||||
|
* Gets general organization settings.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* GET /admin/org/{id}/settings/general
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* @param orgRef the reference for the admin org
|
||||||
|
* @return the lease settings
|
||||||
|
*/
|
||||||
|
OrgGeneralSettings getGeneralSettings(URI orgRef);
|
||||||
|
|
||||||
// PUT /admin/org/{id}/settings/email
|
/**
|
||||||
|
* Updates general organization settings.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* PUT /admin/org/{id}/settings/general
|
||||||
|
* </pre>
|
||||||
|
* @param orgRef the reference for the admin org
|
||||||
|
* @param newSettings the requested updated settings
|
||||||
|
* @return the resultant settings
|
||||||
|
*/
|
||||||
|
OrgGeneralSettings updateGeneralSettings(URI orgRef,
|
||||||
|
OrgGeneralSettings newSettings);
|
||||||
|
|
||||||
// GET /admin/org/{id}/settings/general
|
/**
|
||||||
|
* Retrieves LDAP settings for an organization.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* GET /admin/org/{id}/settings/ldap
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* @param orgRef the reference for the admin org
|
||||||
|
* @return the ldap settings
|
||||||
|
*/
|
||||||
|
OrgLdapSettings getLdapSettings(URI orgRef);
|
||||||
|
|
||||||
// PUT /admin/org/{id}/settings/general
|
/**
|
||||||
|
* Retrieves password policy settings for an organization.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* GET /admin/org/{id}/settings/passwordPolicy
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* @param orgRef the reference for the admin org
|
||||||
|
* @return the lease settings
|
||||||
|
*/
|
||||||
|
OrgPasswordPolicySettings getPasswordPolicy(URI orgRef);
|
||||||
|
|
||||||
// GET /admin/org/{id}/settings/ldap
|
/**
|
||||||
|
* Updates password policy settings for organization.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* PUT /admin/org/{id}/settings/passwordPolicy
|
||||||
|
* </pre>
|
||||||
|
* @param orgRef the reference for the admin org
|
||||||
|
* @param newSettings the requested updated settings
|
||||||
|
* @return the resultant settings
|
||||||
|
*/
|
||||||
|
OrgPasswordPolicySettings updatePasswordPolicy(URI orgRef,
|
||||||
|
OrgPasswordPolicySettings newSettings);
|
||||||
|
|
||||||
// GET /admin/org/{id}/settings/passwordPolicy
|
/**
|
||||||
|
* Gets organization resource cleanup settings on the level of vApp.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* GET /admin/org/{id}/settings/vAppLeaseSettings
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* @param orgRef the reference for the admin org
|
||||||
|
* @return the lease settings
|
||||||
|
*/
|
||||||
|
OrgLeaseSettings getVAppLeaseSettings(URI orgRef);
|
||||||
|
|
||||||
// PUT /admin/org/{id}/settings/passwordPolicy
|
/**
|
||||||
|
* Updates organization resource cleanup settings on the level of vApp.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* PUT /admin/org/{id}/settings/vAppLeaseSettings
|
||||||
|
* </pre>
|
||||||
|
* @param orgRef the reference for the admin org
|
||||||
|
* @param newSettings the requested updated settings
|
||||||
|
* @return the resultant settings
|
||||||
|
*/
|
||||||
|
OrgLeaseSettings updateVAppLeaseSettings(URI orgRef,
|
||||||
|
OrgLeaseSettings newSettings);
|
||||||
|
|
||||||
// GET /admin/org/{id}/settings/vAppLeaseSettings
|
/**
|
||||||
|
* Retrieves expiration and storage policy for vApp templates in an organization.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* GET /admin/org/{id}/settings/vAppTemplateLeaseSettings
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* @param orgRef the reference for the admin org
|
||||||
|
* @return the lease settings
|
||||||
|
*/
|
||||||
|
OrgVAppTemplateLeaseSettings getVAppTemplateLeaseSettings(URI orgRef);
|
||||||
|
|
||||||
// PUT /admin/org/{id}/settings/vAppLeaseSettings
|
/**
|
||||||
|
* Updates vApp template policy settings for organization.
|
||||||
// GET /admin/org/{id}/settings/vAppTemplateLeaseSettings
|
*
|
||||||
|
* <pre>
|
||||||
// PUT /admin/org/{id}/settings/vAppTemplateLeaseSettings
|
* PUT /admin/org/{id}/settings/vAppTemplateLeaseSettings
|
||||||
|
* </pre>
|
||||||
|
* @param orgRef the reference for the admin org
|
||||||
|
* @param newSettings the requested updated settings
|
||||||
|
* @return the resultant settings
|
||||||
|
*/
|
||||||
|
OrgVAppTemplateLeaseSettings updateVAppTemplateLeaseSettings(URI orgRef,
|
||||||
|
OrgVAppTemplateLeaseSettings newSettings);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,10 +23,6 @@ import java.net.URI;
|
||||||
import javax.ws.rs.Consumes;
|
import javax.ws.rs.Consumes;
|
||||||
import javax.ws.rs.DELETE;
|
import javax.ws.rs.DELETE;
|
||||||
import javax.ws.rs.GET;
|
import javax.ws.rs.GET;
|
||||||
|
|
||||||
import org.jclouds.rest.annotations.EndpointParam;
|
|
||||||
import org.jclouds.rest.annotations.ExceptionParser;
|
|
||||||
import org.jclouds.rest.annotations.JAXBResponseParser;
|
|
||||||
import javax.ws.rs.PUT;
|
import javax.ws.rs.PUT;
|
||||||
import javax.ws.rs.Produces;
|
import javax.ws.rs.Produces;
|
||||||
|
|
||||||
|
@ -35,7 +31,6 @@ import org.jclouds.rest.annotations.EndpointParam;
|
||||||
import org.jclouds.rest.annotations.ExceptionParser;
|
import org.jclouds.rest.annotations.ExceptionParser;
|
||||||
import org.jclouds.rest.annotations.JAXBResponseParser;
|
import org.jclouds.rest.annotations.JAXBResponseParser;
|
||||||
import org.jclouds.rest.annotations.RequestFilters;
|
import org.jclouds.rest.annotations.RequestFilters;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Group;
|
|
||||||
import org.jclouds.rest.binders.BindToXMLPayload;
|
import org.jclouds.rest.binders.BindToXMLPayload;
|
||||||
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
|
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Group;
|
import org.jclouds.vcloud.director.v1_5.domain.Group;
|
||||||
|
@ -68,7 +63,7 @@ public interface GroupAsyncClient {
|
||||||
@Produces(VCloudDirectorMediaType.GROUP)
|
@Produces(VCloudDirectorMediaType.GROUP)
|
||||||
@JAXBResponseParser
|
@JAXBResponseParser
|
||||||
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
|
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
|
||||||
ListenableFuture<Group> updateCatalog(@EndpointParam URI groupRef,
|
ListenableFuture<Group> updateGroup(@EndpointParam URI groupRef,
|
||||||
@BinderParam(BindToXMLPayload.class) Group group);
|
@BinderParam(BindToXMLPayload.class) Group group);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -23,6 +23,7 @@ import java.net.URI;
|
||||||
import javax.ws.rs.Consumes;
|
import javax.ws.rs.Consumes;
|
||||||
import javax.ws.rs.DELETE;
|
import javax.ws.rs.DELETE;
|
||||||
import javax.ws.rs.GET;
|
import javax.ws.rs.GET;
|
||||||
|
import javax.ws.rs.POST;
|
||||||
import javax.ws.rs.PUT;
|
import javax.ws.rs.PUT;
|
||||||
import javax.ws.rs.Path;
|
import javax.ws.rs.Path;
|
||||||
import javax.ws.rs.Produces;
|
import javax.ws.rs.Produces;
|
||||||
|
@ -35,6 +36,7 @@ import org.jclouds.rest.annotations.JAXBResponseParser;
|
||||||
import org.jclouds.rest.annotations.RequestFilters;
|
import org.jclouds.rest.annotations.RequestFilters;
|
||||||
import org.jclouds.rest.binders.BindToXMLPayload;
|
import org.jclouds.rest.binders.BindToXMLPayload;
|
||||||
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
|
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.domain.CloneMediaParams;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Media;
|
import org.jclouds.vcloud.director.v1_5.domain.Media;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Metadata;
|
import org.jclouds.vcloud.director.v1_5.domain.Metadata;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Owner;
|
import org.jclouds.vcloud.director.v1_5.domain.Owner;
|
||||||
|
@ -60,6 +62,29 @@ public interface MediaAsyncClient {
|
||||||
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
|
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
|
||||||
ListenableFuture<Media> getMedia(@EndpointParam URI uri);
|
ListenableFuture<Media> getMedia(@EndpointParam URI uri);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see MediaClient#createMedia(URI, Media)
|
||||||
|
*/
|
||||||
|
@POST
|
||||||
|
@Consumes(VCloudDirectorMediaType.MEDIA)
|
||||||
|
@Produces(VCloudDirectorMediaType.MEDIA)
|
||||||
|
@JAXBResponseParser
|
||||||
|
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
|
||||||
|
ListenableFuture<Media> createMedia(@EndpointParam URI link,
|
||||||
|
@BinderParam(BindToXMLPayload.class) Media media);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see MediaClient#cloneMedia(URI, CloneMediaParams)
|
||||||
|
*/
|
||||||
|
@POST
|
||||||
|
@Consumes(VCloudDirectorMediaType.MEDIA)
|
||||||
|
@Produces(VCloudDirectorMediaType.CLONE_MEDIA_PARAMS)
|
||||||
|
@JAXBResponseParser
|
||||||
|
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
|
||||||
|
ListenableFuture<Media> cloneMedia(@EndpointParam URI cloneLink,
|
||||||
|
@BinderParam(BindToXMLPayload.class) CloneMediaParams params);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see MediaClient#updateMedia(URI, Media))
|
* @see MediaClient#updateMedia(URI, Media))
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -23,6 +23,7 @@ import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import org.jclouds.concurrent.Timeout;
|
import org.jclouds.concurrent.Timeout;
|
||||||
import org.jclouds.rest.annotations.Delegate;
|
import org.jclouds.rest.annotations.Delegate;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.domain.CloneMediaParams;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Media;
|
import org.jclouds.vcloud.director.v1_5.domain.Media;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Metadata;
|
import org.jclouds.vcloud.director.v1_5.domain.Metadata;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Owner;
|
import org.jclouds.vcloud.director.v1_5.domain.Owner;
|
||||||
|
@ -46,6 +47,22 @@ public interface MediaClient {
|
||||||
*/
|
*/
|
||||||
Media getMedia(URI mediaUri);
|
Media getMedia(URI mediaUri);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a media (and present upload link for the floppy/iso file).
|
||||||
|
*
|
||||||
|
* @return The response will return a link to transfer site to be able to continue with uploading the media.
|
||||||
|
*/
|
||||||
|
Media createMedia(URI uploadLink, Media media);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clones a media into new one.
|
||||||
|
* The status of the returned media is UNRESOLVED(0) until the task for cloning finish.
|
||||||
|
*
|
||||||
|
* @return a Media resource which will contain a task.
|
||||||
|
* The user should monitor the contained task status in order to check when it is completed.
|
||||||
|
*/
|
||||||
|
Media cloneMedia(URI cloneLink, CloneMediaParams params);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates the name/description of a media.
|
* Updates the name/description of a media.
|
||||||
*
|
*
|
||||||
|
|
|
@ -39,7 +39,6 @@ import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Metadata;
|
import org.jclouds.vcloud.director.v1_5.domain.Metadata;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.MetadataValue;
|
import org.jclouds.vcloud.director.v1_5.domain.MetadataValue;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Task;
|
import org.jclouds.vcloud.director.v1_5.domain.Task;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.URISupplier;
|
|
||||||
import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest;
|
import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest;
|
||||||
import org.jclouds.vcloud.director.v1_5.functions.ThrowVCloudErrorOn4xx;
|
import org.jclouds.vcloud.director.v1_5.functions.ThrowVCloudErrorOn4xx;
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,7 @@ public interface OrgAsyncClient {
|
||||||
@Consumes
|
@Consumes
|
||||||
@JAXBResponseParser
|
@JAXBResponseParser
|
||||||
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
|
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
|
||||||
ListenableFuture<Org> getOrg(@EndpointParam URI orgUri);
|
ListenableFuture<? extends Org> getOrg(@EndpointParam URI orgUri);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return asynchronous access to {@link Metadata.Readable} features
|
* @return asynchronous access to {@link Metadata.Readable} features
|
||||||
|
|
|
@ -31,7 +31,6 @@ import org.jclouds.rest.annotations.JAXBResponseParser;
|
||||||
import org.jclouds.rest.annotations.RequestFilters;
|
import org.jclouds.rest.annotations.RequestFilters;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Task;
|
import org.jclouds.vcloud.director.v1_5.domain.Task;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.TasksList;
|
import org.jclouds.vcloud.director.v1_5.domain.TasksList;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.URISupplier;
|
|
||||||
import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest;
|
import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest;
|
||||||
import org.jclouds.vcloud.director.v1_5.functions.OrgReferenceToTaskListEndpoint;
|
import org.jclouds.vcloud.director.v1_5.functions.OrgReferenceToTaskListEndpoint;
|
||||||
import org.jclouds.vcloud.director.v1_5.functions.ThrowVCloudErrorOn4xx;
|
import org.jclouds.vcloud.director.v1_5.functions.ThrowVCloudErrorOn4xx;
|
||||||
|
|
|
@ -18,38 +18,27 @@
|
||||||
*/
|
*/
|
||||||
package org.jclouds.vcloud.director.v1_5.features;
|
package org.jclouds.vcloud.director.v1_5.features;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
|
|
||||||
import javax.ws.rs.PUT;
|
import javax.ws.rs.PUT;
|
||||||
|
|
||||||
import org.jclouds.rest.annotations.ExceptionParser;
|
import org.jclouds.io.Payload;
|
||||||
|
import org.jclouds.rest.annotations.EndpointParam;
|
||||||
import org.jclouds.rest.annotations.RequestFilters;
|
import org.jclouds.rest.annotations.RequestFilters;
|
||||||
import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest;
|
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;
|
import com.google.common.util.concurrent.ListenableFuture;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
* @see UploadClient
|
* @see UploadClient
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
@RequestFilters(AddVCloudAuthorizationToRequest.class)
|
@RequestFilters(AddVCloudAuthorizationToRequest.class)
|
||||||
public interface UploadAsyncClient { // TODO: implement these operations correctly
|
public interface UploadAsyncClient {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see UploadClient#uploadFile(URI, File)
|
* @see UploadClient#put
|
||||||
*/
|
*/
|
||||||
@PUT
|
@PUT
|
||||||
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
|
ListenableFuture<Void> upload(@EndpointParam URI location, Payload payload);
|
||||||
ListenableFuture<Object> uploadFile(URI uri, File file);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @see UploadClient#uploadBigFile(URI, File)
|
|
||||||
*/
|
|
||||||
@PUT
|
|
||||||
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
|
|
||||||
ListenableFuture<Object> uploadBigFile(URI target, File file);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,31 +18,25 @@
|
||||||
*/
|
*/
|
||||||
package org.jclouds.vcloud.director.v1_5.features;
|
package org.jclouds.vcloud.director.v1_5.features;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import org.jclouds.concurrent.Timeout;
|
import org.jclouds.concurrent.Timeout;
|
||||||
|
import org.jclouds.io.Payload;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides synchronous access to Upload.
|
* Provides synchronous access to Upload.
|
||||||
* <p/>
|
* <p/>
|
||||||
*
|
*
|
||||||
* @see UploadAsyncClient
|
* @see UploadAsyncClient
|
||||||
* @see <a href= "http://support.theenterprisecloud.com/kb/default.asp?id=984&Lang=1&SID=" />
|
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)
|
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)
|
||||||
public interface UploadClient {
|
public interface UploadClient {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Uploads a file.
|
* @return eTag
|
||||||
*/
|
*/
|
||||||
void uploadFile(URI uri, File file);
|
void upload(URI location, Payload payload);
|
||||||
|
|
||||||
/**
|
|
||||||
* Uploads a file using ranged PUTs.
|
|
||||||
*/
|
|
||||||
void uploadBigFile(URI uri, File file);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,20 @@
|
||||||
*/
|
*/
|
||||||
package org.jclouds.vcloud.director.v1_5.features;
|
package org.jclouds.vcloud.director.v1_5.features;
|
||||||
|
|
||||||
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.*;
|
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.CUSTOMIZATION_SECTION;
|
||||||
|
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.ENVELOPE;
|
||||||
|
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.GUEST_CUSTOMIZATION_SECTION;
|
||||||
|
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.LEASE_SETTINGS_SECTION;
|
||||||
|
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.METADATA;
|
||||||
|
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.METADATA_ENTRY;
|
||||||
|
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.NETWORK_CONFIG_SECTION;
|
||||||
|
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.NETWORK_CONNECTION_SECTION;
|
||||||
|
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.NETWORK_SECTION;
|
||||||
|
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.OWNER;
|
||||||
|
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.PRODUCT_SECTION_LIST;
|
||||||
|
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.RELOCATE_TEMPLATE;
|
||||||
|
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.TASK;
|
||||||
|
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.VAPP_TEMPLATE;
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
|
|
||||||
|
@ -39,7 +52,18 @@ import org.jclouds.rest.annotations.ExceptionParser;
|
||||||
import org.jclouds.rest.annotations.JAXBResponseParser;
|
import org.jclouds.rest.annotations.JAXBResponseParser;
|
||||||
import org.jclouds.rest.annotations.RequestFilters;
|
import org.jclouds.rest.annotations.RequestFilters;
|
||||||
import org.jclouds.rest.binders.BindToXMLPayload;
|
import org.jclouds.rest.binders.BindToXMLPayload;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.*;
|
import org.jclouds.vcloud.director.v1_5.domain.CustomizationSection;
|
||||||
|
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.Metadata;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.domain.MetadataValue;
|
||||||
|
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.RelocateParams;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.domain.Task;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.domain.VAppTemplate;
|
||||||
import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest;
|
import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest;
|
||||||
import org.jclouds.vcloud.director.v1_5.functions.ThrowVCloudErrorOn4xx;
|
import org.jclouds.vcloud.director.v1_5.functions.ThrowVCloudErrorOn4xx;
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,18 @@ import java.util.concurrent.TimeUnit;
|
||||||
import org.jclouds.concurrent.Timeout;
|
import org.jclouds.concurrent.Timeout;
|
||||||
import org.jclouds.ovf.Envelope;
|
import org.jclouds.ovf.Envelope;
|
||||||
import org.jclouds.ovf.NetworkSection;
|
import org.jclouds.ovf.NetworkSection;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.*;
|
import org.jclouds.vcloud.director.v1_5.domain.CustomizationSection;
|
||||||
|
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.Metadata;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.domain.MetadataValue;
|
||||||
|
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.RelocateParams;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.domain.Task;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.domain.VAppTemplate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides synchronous access to {@link org.jclouds.vcloud.director.v1_5.domain.VAppTemplate} objects.
|
* Provides synchronous access to {@link org.jclouds.vcloud.director.v1_5.domain.VAppTemplate} objects.
|
||||||
|
|
|
@ -34,7 +34,18 @@ import org.jclouds.rest.annotations.JAXBResponseParser;
|
||||||
import org.jclouds.rest.annotations.RequestFilters;
|
import org.jclouds.rest.annotations.RequestFilters;
|
||||||
import org.jclouds.rest.binders.BindToXMLPayload;
|
import org.jclouds.rest.binders.BindToXMLPayload;
|
||||||
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
|
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.*;
|
import org.jclouds.vcloud.director.v1_5.domain.CaptureVAppParams;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.domain.CloneMediaParams;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.domain.CloneVAppParams;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.domain.CloneVAppTemplateParams;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.domain.ComposeVAppParams;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.domain.InstantiateVAppParamsType;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.domain.Media;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.domain.Metadata;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.domain.UploadVAppTemplateParams;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.domain.VApp;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.domain.VAppTemplate;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.domain.Vdc;
|
||||||
import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest;
|
import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest;
|
||||||
import org.jclouds.vcloud.director.v1_5.functions.ThrowVCloudErrorOn4xx;
|
import org.jclouds.vcloud.director.v1_5.functions.ThrowVCloudErrorOn4xx;
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue