mirror of https://github.com/apache/jclouds.git
Updates to query client and more domain objects and tests
This commit is contained in:
parent
e764785219
commit
97f4d09778
|
@ -75,10 +75,15 @@ public class VCloudDirectorMediaType {
|
||||||
|
|
||||||
public static final String QUERY_RESULT_RECORDS = "application/vnd.vmware.vcloud.query.records+xml";
|
public static final String QUERY_RESULT_RECORDS = "application/vnd.vmware.vcloud.query.records+xml";
|
||||||
|
|
||||||
|
public static final String QUERY_RESULT_REFERENCES = "application/vnd.vmware.vcloud.query.references+xml";
|
||||||
|
|
||||||
|
public static final String QUERY_RESULT_ID_RECORDS = "application/vnd.vmware.vcloud.query.idrecords+xml";
|
||||||
|
|
||||||
public static final List<String> ALL = Arrays.asList(
|
public static final List<String> ALL = Arrays.asList(
|
||||||
SESSION, ERROR, ORG_LIST, METADATA, METADATA_ENTRY,
|
SESSION, ERROR, ORG_LIST, METADATA, METADATA_ENTRY,
|
||||||
METADATA_VALUE, ORG, TASKS_LIST, TASK, ORG_NETWORK,
|
METADATA_VALUE, ORG, TASKS_LIST, TASK, ORG_NETWORK,
|
||||||
CATALOG, CATALOG_ITEM, CATALOG_ITEMS, CATALOGS_LIST, PROPERTY,
|
CATALOG, CATALOG_ITEM, CATALOG_ITEMS, CATALOGS_LIST, PROPERTY,
|
||||||
MEDIA, OWNER, VDC, ADMIN_USER, QUERY_RESULT_RECORDS
|
MEDIA, OWNER, VDC, ADMIN_USER, QUERY_RESULT_RECORDS,
|
||||||
);
|
QUERY_RESULT_REFERENCES, QUERY_RESULT_ID_RECORDS
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,97 @@
|
||||||
|
package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
|
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.*;
|
||||||
|
|
||||||
|
import java.net.URI;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
|
||||||
|
@XmlRootElement(namespace = VCLOUD_1_5_NS, name = "catalogReference")
|
||||||
|
public class CatalogReference extends ReferenceType<CatalogReference> {
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
public static Builder builder() {
|
||||||
|
return new Builder();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Builder toBuilder() {
|
||||||
|
return new Builder().fromCatalogReference(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Builder extends ReferenceType.Builder<CatalogReference> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CatalogReference build() {
|
||||||
|
CatalogReference reference = new CatalogReference(href);
|
||||||
|
reference.setId(id);
|
||||||
|
reference.setName(name);
|
||||||
|
reference.setType(type);
|
||||||
|
return reference;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see ReferenceType#getHref()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Builder href(URI href) {
|
||||||
|
this.href = href;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see ReferenceType#getId()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Builder id(String id) {
|
||||||
|
this.id = id;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see ReferenceType#getType()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Builder type(String type) {
|
||||||
|
this.type = type;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see ReferenceType#getName()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Builder name(String name) {
|
||||||
|
this.name = name;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Builder fromReferenceType(ReferenceType<CatalogReference> in) {
|
||||||
|
return Builder.class.cast(super.fromReferenceType(in));
|
||||||
|
}
|
||||||
|
|
||||||
|
protected Builder fromCatalogReference(CatalogReference in) {
|
||||||
|
return fromReferenceType(in);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected CatalogReference(URI href) {
|
||||||
|
super(href);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected CatalogReference() {
|
||||||
|
// For JAXB
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o)
|
||||||
|
return true;
|
||||||
|
if (o == null || getClass() != o.getClass())
|
||||||
|
return false;
|
||||||
|
Reference that = Reference.class.cast(o);
|
||||||
|
return super.equals(that);
|
||||||
|
}
|
||||||
|
}
|
|
@ -51,9 +51,15 @@ public class Link extends ReferenceType<Link> {
|
||||||
public static final String REMOVE = "remove";
|
public static final String REMOVE = "remove";
|
||||||
public static final String CATALOG_ITEM = "catalogItem";
|
public static final String CATALOG_ITEM = "catalogItem";
|
||||||
public static final String TASK_CANCEL = "task:cancel";
|
public static final String TASK_CANCEL = "task:cancel";
|
||||||
|
public static final String ALTERNATE = "alternate";
|
||||||
|
public static final String NEXT_PAGE = "nextPage";
|
||||||
|
public static final String PREVIOUS_PAGE = "previousPage";
|
||||||
|
public static final String LAST_PAGE = "lastPage";
|
||||||
|
public static final String FIRST_PAGE = "firstPage";
|
||||||
|
|
||||||
public static final List<String> ALL = Arrays.asList(
|
public static final List<String> ALL = Arrays.asList(
|
||||||
UP, DOWN, EDIT, DELETE, ADD, REMOVE, CATALOG_ITEM, TASK_CANCEL
|
UP, DOWN, EDIT, DELETE, ADD, REMOVE, CATALOG_ITEM, TASK_CANCEL,
|
||||||
|
ALTERNATE, NEXT_PAGE, PREVIOUS_PAGE, LAST_PAGE, FIRST_PAGE
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/**
|
/*
|
||||||
* Licensed to jclouds, Inc. (jclouds) under one or more
|
* Licensed to jclouds, Inc. (jclouds) under one or more
|
||||||
* contributor license agreements. See the NOTICE file
|
* contributor license agreements. See the NOTICE file
|
||||||
* distributed with this work for additional information
|
* distributed with this work for additional information
|
||||||
|
@ -16,16 +16,22 @@
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.jclouds.vcloud.director.v1_5.domain;
|
package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
|
import static com.google.common.base.Objects.*;
|
||||||
|
import static com.google.common.base.Preconditions.*;
|
||||||
|
|
||||||
|
import java.net.URI;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlSeeAlso;
|
|
||||||
import javax.xml.bind.annotation.XmlType;
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
|
||||||
|
import com.google.common.base.Objects;
|
||||||
|
import com.google.common.collect.Sets;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -57,16 +63,8 @@ import javax.xml.bind.annotation.XmlType;
|
||||||
@XmlType(name = "ResourceEntity", propOrder = {
|
@XmlType(name = "ResourceEntity", propOrder = {
|
||||||
"files"
|
"files"
|
||||||
})
|
})
|
||||||
@XmlSeeAlso({
|
public class ResourceEntity extends EntityType<ResourceEntity> {
|
||||||
MediaType.class,
|
|
||||||
VAppTemplateType.class,
|
|
||||||
AbstractVAppType.class,
|
|
||||||
NetworkPoolType.class
|
|
||||||
})
|
|
||||||
public class ResourceEntity
|
|
||||||
extends EntityType<ResourceEntity>
|
|
||||||
|
|
||||||
{
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public static Builder builder() {
|
public static Builder builder() {
|
||||||
return new Builder();
|
return new Builder();
|
||||||
|
@ -78,13 +76,13 @@ public class ResourceEntity
|
||||||
|
|
||||||
public static class Builder extends EntityType.Builder<ResourceEntity> {
|
public static class Builder extends EntityType.Builder<ResourceEntity> {
|
||||||
|
|
||||||
private FilesList files;
|
private Object /* FilesList */ files;
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ResourceEntity#getFiles()
|
* @see ResourceEntity#getFiles()
|
||||||
*/
|
*/
|
||||||
public Builder files(FilesList files) {
|
public Builder files(Object /* FilesList */ files) {
|
||||||
this.files = files;
|
this.files = files;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
@ -172,14 +170,14 @@ public class ResourceEntity
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private ResourceEntity() {
|
protected ResourceEntity() {
|
||||||
// For JAXB and builder use
|
// For JAXB and builder use
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@XmlElement(name = "Files")
|
@XmlElement(name = "Files")
|
||||||
protected FilesList files;
|
protected Object /* FilesList */ files;
|
||||||
@XmlAttribute
|
@XmlAttribute
|
||||||
protected Integer status;
|
protected Integer status;
|
||||||
|
|
||||||
|
@ -191,7 +189,7 @@ public class ResourceEntity
|
||||||
* {@link FilesList }
|
* {@link FilesList }
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public FilesList getFiles() {
|
public Object /* FilesList */ getFiles() {
|
||||||
return files;
|
return files;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -203,7 +201,7 @@ public class ResourceEntity
|
||||||
* {@link FilesList }
|
* {@link FilesList }
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public void setFiles(FilesList value) {
|
public void setFiles(Object /* FilesList */ value) {
|
||||||
this.files = value;
|
this.files = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/**
|
/*
|
||||||
* Licensed to jclouds, Inc. (jclouds) under one or more
|
* Licensed to jclouds, Inc. (jclouds) under one or more
|
||||||
* contributor license agreements. See the NOTICE file
|
* contributor license agreements. See the NOTICE file
|
||||||
* distributed with this work for additional information
|
* distributed with this work for additional information
|
||||||
|
@ -16,14 +16,21 @@
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.jclouds.vcloud.director.v1_5.domain;
|
package org.jclouds.vcloud.director.v1_5.domain;
|
||||||
|
|
||||||
|
import static com.google.common.base.Objects.*;
|
||||||
|
import static com.google.common.base.Preconditions.*;
|
||||||
|
|
||||||
|
import java.net.URI;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.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.XmlType;
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
|
||||||
|
import com.google.common.base.Objects;
|
||||||
|
import com.google.common.collect.Sets;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -119,7 +126,7 @@ public class User
|
||||||
private Integer deployedVmQuota;
|
private Integer deployedVmQuota;
|
||||||
private Reference role;
|
private Reference role;
|
||||||
private String password;
|
private String password;
|
||||||
private GroupsList groupReferences;
|
private Object /* GroupsList */ groupReferences;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see User#getFullName()
|
* @see User#getFullName()
|
||||||
|
@ -260,7 +267,7 @@ public class User
|
||||||
/**
|
/**
|
||||||
* @see User#getGroupReferences()
|
* @see User#getGroupReferences()
|
||||||
*/
|
*/
|
||||||
public Builder groupReferences(GroupsList groupReferences) {
|
public Builder groupReferences(Object /* GroupsList */ groupReferences) {
|
||||||
this.groupReferences = groupReferences;
|
this.groupReferences = groupReferences;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
@ -353,16 +360,16 @@ public class User
|
||||||
.fullName(in.getFullName())
|
.fullName(in.getFullName())
|
||||||
.emailAddress(in.getEmailAddress())
|
.emailAddress(in.getEmailAddress())
|
||||||
.telephone(in.getTelephone())
|
.telephone(in.getTelephone())
|
||||||
.isEnabled(in.getIsEnabled())
|
.isEnabled(in.isEnabled())
|
||||||
.isLocked(in.getIsLocked())
|
.isLocked(in.isLocked())
|
||||||
.im(in.getIm())
|
.im(in.getIM())
|
||||||
.nameInSource(in.getNameInSource())
|
.nameInSource(in.getNameInSource())
|
||||||
.isAlertEnabled(in.getIsAlertEnabled())
|
.isAlertEnabled(in.isAlertEnabled())
|
||||||
.alertEmailPrefix(in.getAlertEmailPrefix())
|
.alertEmailPrefix(in.getAlertEmailPrefix())
|
||||||
.alertEmail(in.getAlertEmail())
|
.alertEmail(in.getAlertEmail())
|
||||||
.isExternal(in.getIsExternal())
|
.isExternal(in.isExternal())
|
||||||
.isDefaultCached(in.getIsDefaultCached())
|
.isDefaultCached(in.isDefaultCached())
|
||||||
.isGroupRole(in.getIsGroupRole())
|
.isGroupRole(in.isGroupRole())
|
||||||
.storedVmQuota(in.getStoredVmQuota())
|
.storedVmQuota(in.getStoredVmQuota())
|
||||||
.deployedVmQuota(in.getDeployedVmQuota())
|
.deployedVmQuota(in.getDeployedVmQuota())
|
||||||
.role(in.getRole())
|
.role(in.getRole())
|
||||||
|
@ -415,7 +422,7 @@ public class User
|
||||||
@XmlElement(name = "Password")
|
@XmlElement(name = "Password")
|
||||||
protected String password;
|
protected String password;
|
||||||
@XmlElement(name = "GroupReferences")
|
@XmlElement(name = "GroupReferences")
|
||||||
protected GroupsList groupReferences;
|
protected Object /* GroupsList */ groupReferences;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the fullName property.
|
* Gets the value of the fullName property.
|
||||||
|
@ -497,7 +504,7 @@ public class User
|
||||||
* {@link Boolean }
|
* {@link Boolean }
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public Boolean isIsEnabled() {
|
public Boolean isEnabled() {
|
||||||
return isEnabled;
|
return isEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -521,7 +528,7 @@ public class User
|
||||||
* {@link Boolean }
|
* {@link Boolean }
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public Boolean isIsLocked() {
|
public Boolean isLocked() {
|
||||||
return isLocked;
|
return isLocked;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -593,7 +600,7 @@ public class User
|
||||||
* {@link Boolean }
|
* {@link Boolean }
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public Boolean isIsAlertEnabled() {
|
public Boolean isAlertEnabled() {
|
||||||
return isAlertEnabled;
|
return isAlertEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -665,7 +672,7 @@ public class User
|
||||||
* {@link Boolean }
|
* {@link Boolean }
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public Boolean isIsExternal() {
|
public Boolean isExternal() {
|
||||||
return isExternal;
|
return isExternal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -689,7 +696,7 @@ public class User
|
||||||
* {@link Boolean }
|
* {@link Boolean }
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public Boolean isIsDefaultCached() {
|
public Boolean isDefaultCached() {
|
||||||
return isDefaultCached;
|
return isDefaultCached;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -713,7 +720,7 @@ public class User
|
||||||
* {@link Boolean }
|
* {@link Boolean }
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public Boolean isIsGroupRole() {
|
public Boolean isGroupRole() {
|
||||||
return isGroupRole;
|
return isGroupRole;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -833,7 +840,7 @@ public class User
|
||||||
* {@link GroupsList }
|
* {@link GroupsList }
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public GroupsList getGroupReferences() {
|
public Object /* GroupsList */ getGroupReferences() {
|
||||||
return groupReferences;
|
return groupReferences;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -845,7 +852,7 @@ public class User
|
||||||
* {@link GroupsList }
|
* {@link GroupsList }
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public void setGroupReferences(GroupsList value) {
|
public void setGroupReferences(Object /* GroupsList */ value) {
|
||||||
this.groupReferences = value;
|
this.groupReferences = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,152 @@
|
||||||
|
/**
|
||||||
|
* 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.query;
|
||||||
|
|
||||||
|
import static com.google.common.base.Preconditions.*;
|
||||||
|
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.*;
|
||||||
|
|
||||||
|
import java.net.URI;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
import org.jclouds.vcloud.director.v1_5.domain.CatalogReference;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.domain.Link;
|
||||||
|
|
||||||
|
import com.google.common.collect.Sets;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents the results from a vCloud query as references.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* <complexType name="QueryResultReferences" />
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* @author grkvlt@apache.org
|
||||||
|
*/
|
||||||
|
@XmlRootElement(namespace = VCLOUD_1_5_NS, name = "CatalogReferences")
|
||||||
|
public class CatalogReferences extends QueryResultReferences<CatalogReference> {
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
public static Builder builder() {
|
||||||
|
return new Builder();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Builder toBuilder() {
|
||||||
|
return new Builder().fromQueryResultReferences(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Builder extends QueryResultReferences.Builder<CatalogReference> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CatalogReferences build() {
|
||||||
|
CatalogReferences queryResultReferences = new CatalogReferences(href);
|
||||||
|
queryResultReferences.setReferences(references);
|
||||||
|
queryResultReferences.setName(name);
|
||||||
|
queryResultReferences.setPage(page);
|
||||||
|
queryResultReferences.setPageSize(pageSize);
|
||||||
|
queryResultReferences.setTotal(total);
|
||||||
|
queryResultReferences.setType(type);
|
||||||
|
queryResultReferences.setLinks(links);
|
||||||
|
return queryResultReferences;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see Container#getName()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Builder name(String name) {
|
||||||
|
this.name = name;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see Container#getPage()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Builder page(Integer page) {
|
||||||
|
this.page = page;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see Container#getPageSize()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Builder pageSize(Integer pageSize) {
|
||||||
|
this.pageSize = pageSize;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see ResourceType#getHref()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Builder href(URI href) {
|
||||||
|
super.href(href);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see ResourceType#getType()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Builder type(String type) {
|
||||||
|
super.type(type);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see ResourceType#getLinks()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Builder links(Set<Link> links) {
|
||||||
|
super.links(Sets.newLinkedHashSet(checkNotNull(links, "links")));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see ResourceType#getLinks()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Builder link(Link link) {
|
||||||
|
super.link(link);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Builder fromQueryResultReferences(QueryResultReferences<CatalogReference> in) {
|
||||||
|
return Builder.class.cast(super.fromContainerType(in));
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder fromCatalogReferences(CatalogReferences in) {
|
||||||
|
return Builder.class.cast(fromQueryResultReferences(in).references(in.getReferences()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected CatalogReferences() {
|
||||||
|
// For JAXB and builder use
|
||||||
|
}
|
||||||
|
|
||||||
|
protected CatalogReferences(URI href) {
|
||||||
|
super(href);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,98 @@
|
||||||
|
/*
|
||||||
|
* 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.query;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
|
||||||
|
import com.google.common.base.Objects.ToStringHelper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Container for the list of typed queries available to the
|
||||||
|
* requesting user.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* <p>Java class for QueryList complex type.
|
||||||
|
*
|
||||||
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* <complexType name="QueryList">
|
||||||
|
* <complexContent>
|
||||||
|
* <extension base="{http://www.vmware.com/vcloud/v1.5}ContainerType">
|
||||||
|
* <anyAttribute processContents='lax' namespace='##other'/>
|
||||||
|
* </extension>
|
||||||
|
* </complexContent>
|
||||||
|
* </complexType>
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@XmlType(name = "QueryList")
|
||||||
|
public class QueryList extends ContainerType<QueryList> {
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
public static Builder builder() {
|
||||||
|
return new Builder();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder toBuilder() {
|
||||||
|
return new Builder().fromQueryList(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Builder extends ContainerType.Builder<QueryList> {
|
||||||
|
|
||||||
|
public QueryList build() {
|
||||||
|
QueryList queryList = new QueryList();
|
||||||
|
return queryList;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Builder fromContainerType(ContainerType<QueryList> in) {
|
||||||
|
return Builder.class.cast(super.fromContainerType(in));
|
||||||
|
}
|
||||||
|
public Builder fromQueryList(QueryList in) {
|
||||||
|
return fromContainerType(in);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private QueryList() {
|
||||||
|
// For JAXB and builder use
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o)
|
||||||
|
return true;
|
||||||
|
if (o == null || getClass() != o.getClass())
|
||||||
|
return false;
|
||||||
|
QueryList that = QueryList.class.cast(o);
|
||||||
|
return super.equals(that) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return super.hashCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ToStringHelper string() {
|
||||||
|
return super.string();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -21,12 +21,14 @@ package org.jclouds.vcloud.director.v1_5.domain.query;
|
||||||
|
|
||||||
import static com.google.common.base.Objects.*;
|
import static com.google.common.base.Objects.*;
|
||||||
import static com.google.common.base.Preconditions.*;
|
import static com.google.common.base.Preconditions.*;
|
||||||
|
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.*;
|
||||||
|
|
||||||
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.XmlSchemaType;
|
import javax.xml.bind.annotation.XmlSchemaType;
|
||||||
|
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Link;
|
import org.jclouds.vcloud.director.v1_5.domain.Link;
|
||||||
|
@ -44,6 +46,7 @@ import com.google.common.collect.Sets;
|
||||||
*
|
*
|
||||||
* @author grkvlt@apache.org
|
* @author grkvlt@apache.org
|
||||||
*/
|
*/
|
||||||
|
@XmlRootElement(name = "CatalogRecord", namespace = VCLOUD_1_5_NS)
|
||||||
public class QueryResultCatalogRecord extends QueryResultRecordType<QueryResultCatalogRecord> {
|
public class QueryResultCatalogRecord extends QueryResultRecordType<QueryResultCatalogRecord> {
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
|
@ -66,7 +69,7 @@ public class QueryResultCatalogRecord extends QueryResultRecordType<QueryResultC
|
||||||
private String ownerName;
|
private String ownerName;
|
||||||
private Integer numberOfVAppTemplates;
|
private Integer numberOfVAppTemplates;
|
||||||
private Integer numberOfMedia;
|
private Integer numberOfMedia;
|
||||||
private String owner;
|
private URI owner;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see QueryResultCatalogRecord#getName()
|
* @see QueryResultCatalogRecord#getName()
|
||||||
|
@ -167,7 +170,7 @@ public class QueryResultCatalogRecord extends QueryResultRecordType<QueryResultC
|
||||||
/**
|
/**
|
||||||
* @see QueryResultCatalogRecord#getOwner()
|
* @see QueryResultCatalogRecord#getOwner()
|
||||||
*/
|
*/
|
||||||
public Builder owner(String owner) {
|
public Builder owner(URI owner) {
|
||||||
this.owner = owner;
|
this.owner = owner;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
@ -272,7 +275,7 @@ public class QueryResultCatalogRecord extends QueryResultRecordType<QueryResultC
|
||||||
@XmlAttribute
|
@XmlAttribute
|
||||||
protected Integer numberOfMedia;
|
protected Integer numberOfMedia;
|
||||||
@XmlAttribute
|
@XmlAttribute
|
||||||
protected String owner;
|
protected URI owner;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the name property.
|
* Gets the value of the name property.
|
||||||
|
@ -365,11 +368,11 @@ public class QueryResultCatalogRecord extends QueryResultRecordType<QueryResultC
|
||||||
/**
|
/**
|
||||||
* Gets the value of the owner property.
|
* Gets the value of the owner property.
|
||||||
*/
|
*/
|
||||||
public String getOwner() {
|
public URI getOwner() {
|
||||||
return owner;
|
return owner;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setOwner(String value) {
|
public void setOwner(URI value) {
|
||||||
this.owner = value;
|
this.owner = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,7 @@ import javax.xml.bind.annotation.XmlAnyAttribute;
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlSchemaType;
|
import javax.xml.bind.annotation.XmlSchemaType;
|
||||||
|
import javax.xml.bind.annotation.XmlSeeAlso;
|
||||||
import javax.xml.namespace.QName;
|
import javax.xml.namespace.QName;
|
||||||
|
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Link;
|
import org.jclouds.vcloud.director.v1_5.domain.Link;
|
||||||
|
@ -51,6 +52,10 @@ import com.google.common.collect.Sets;
|
||||||
* @author grkvlt@apache.org
|
* @author grkvlt@apache.org
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
|
@XmlSeeAlso({
|
||||||
|
QueryResultCatalogRecord.class,
|
||||||
|
QueryResultNetworkRecord.class,
|
||||||
|
})
|
||||||
public class QueryResultRecordType<T extends QueryResultRecordType<T>> {
|
public class QueryResultRecordType<T extends QueryResultRecordType<T>> {
|
||||||
|
|
||||||
public static <T extends QueryResultRecordType<T>> Builder<T> builder() {
|
public static <T extends QueryResultRecordType<T>> Builder<T> builder() {
|
||||||
|
|
|
@ -28,10 +28,10 @@ import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlElementRef;
|
import javax.xml.bind.annotation.XmlElementRef;
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
|
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
|
||||||
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.query.ContainerType.Builder;
|
|
||||||
|
|
||||||
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;
|
||||||
|
@ -47,28 +47,28 @@ import com.google.common.collect.Sets;
|
||||||
*
|
*
|
||||||
* @author grkvlt@apache.org
|
* @author grkvlt@apache.org
|
||||||
*/
|
*/
|
||||||
public class QueryResultRecords extends ContainerType<QueryResultRecords> {
|
@XmlRootElement(namespace = VCLOUD_1_5_NS, name = "QueryResultRecords")
|
||||||
|
public class QueryResultRecords<T extends QueryResultRecordType<T>> extends ContainerType<QueryResultRecords<T>> {
|
||||||
|
|
||||||
public static final String MEDIA_TYPE = VCloudDirectorMediaType.QUERY_RESULT_RECORDS;
|
public static final String MEDIA_TYPE = VCloudDirectorMediaType.QUERY_RESULT_RECORDS;
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
public static <T extends QueryResultRecordType<T>> Builder<T> builder() {
|
||||||
public static Builder builder() {
|
return new Builder<T>();
|
||||||
return new Builder();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Builder toBuilder() {
|
public Builder<T> toBuilder() {
|
||||||
return new Builder().fromQueryResultRecords(this);
|
return new Builder<T>().fromQueryResultRecords(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Builder extends ContainerType.Builder<QueryResultRecords> {
|
public static class Builder<T extends QueryResultRecordType<T>> extends ContainerType.Builder<QueryResultRecords<T>> {
|
||||||
|
|
||||||
private List<QueryResultRecordType<?>> records = Lists.newArrayList();
|
private List<T> records = Lists.newArrayList();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see QueryResultRecords#getRecords()
|
* @see QueryResultRecords#getRecords()
|
||||||
*/
|
*/
|
||||||
public Builder records(List<QueryResultRecordType<?>> records) {
|
public Builder<T> records(List<T> records) {
|
||||||
this.records = records;
|
this.records = records;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
@ -76,14 +76,14 @@ public class QueryResultRecords extends ContainerType<QueryResultRecords> {
|
||||||
/**
|
/**
|
||||||
* @see QueryResultRecords#getRecords()
|
* @see QueryResultRecords#getRecords()
|
||||||
*/
|
*/
|
||||||
public Builder record(QueryResultRecordType<?> record) {
|
public Builder<T> record(T record) {
|
||||||
this.records.add(record);
|
this.records.add(record);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryResultRecords build() {
|
public QueryResultRecords<T> build() {
|
||||||
QueryResultRecords queryResultRecords = new QueryResultRecords(href);
|
QueryResultRecords<T> queryResultRecords = new QueryResultRecords<T>(href);
|
||||||
queryResultRecords.setRecords(records);
|
queryResultRecords.setRecords(records);
|
||||||
queryResultRecords.setName(name);
|
queryResultRecords.setName(name);
|
||||||
queryResultRecords.setPage(page);
|
queryResultRecords.setPage(page);
|
||||||
|
@ -95,37 +95,46 @@ public class QueryResultRecords extends ContainerType<QueryResultRecords> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see Container#getName()
|
* @see ContainerType#getName()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder name(String name) {
|
public Builder<T> name(String name) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see Container#getPage()
|
* @see ContainerType#getPage()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder page(Integer page) {
|
public Builder<T> page(Integer page) {
|
||||||
this.page = page;
|
this.page = page;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see Container#getPageSize()
|
* @see ContainerType#getPageSize()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder pageSize(Integer pageSize) {
|
public Builder<T> pageSize(Integer pageSize) {
|
||||||
this.pageSize = pageSize;
|
this.pageSize = pageSize;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see ContainerType#getTotal()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Builder<T> total(Long total) {
|
||||||
|
this.total = total;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ResourceType#getHref()
|
* @see ResourceType#getHref()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder href(URI href) {
|
public Builder<T> href(URI href) {
|
||||||
super.href(href);
|
super.href(href);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
@ -134,7 +143,7 @@ public class QueryResultRecords extends ContainerType<QueryResultRecords> {
|
||||||
* @see ResourceType#getType()
|
* @see ResourceType#getType()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder type(String type) {
|
public Builder<T> type(String type) {
|
||||||
super.type(type);
|
super.type(type);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
@ -143,7 +152,7 @@ public class QueryResultRecords extends ContainerType<QueryResultRecords> {
|
||||||
* @see ResourceType#getLinks()
|
* @see ResourceType#getLinks()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder links(Set<Link> links) {
|
public Builder<T> links(Set<Link> links) {
|
||||||
super.links(Sets.newLinkedHashSet(checkNotNull(links, "links")));
|
super.links(Sets.newLinkedHashSet(checkNotNull(links, "links")));
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
@ -152,40 +161,44 @@ public class QueryResultRecords extends ContainerType<QueryResultRecords> {
|
||||||
* @see ResourceType#getLinks()
|
* @see ResourceType#getLinks()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Builder link(Link link) {
|
public Builder<T> link(Link link) {
|
||||||
super.link(link);
|
super.link(link);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Builder fromContainerType(ContainerType<QueryResultRecords> in) {
|
public Builder<T> fromContainerType(ContainerType<QueryResultRecords<T>> in) {
|
||||||
return Builder.class.cast(super.fromContainerType(in));
|
return Builder.class.cast(super.fromContainerType(in));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder fromQueryResultRecords(QueryResultRecords in) {
|
public Builder<T> fromQueryResultRecords(QueryResultRecords<T> in) {
|
||||||
return fromContainerType(in).records(in.getRecords());
|
return fromContainerType(in).records(in.getRecords());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private QueryResultRecords() {
|
protected QueryResultRecords() {
|
||||||
// For JAXB and builder use
|
// For JAXB and builder use
|
||||||
}
|
}
|
||||||
|
|
||||||
@XmlElementRef(name = "Record", namespace = VCLOUD_1_5_NS)
|
protected QueryResultRecords(URI href) {
|
||||||
protected List<QueryResultRecordType<?>> records;
|
super(href);
|
||||||
|
}
|
||||||
|
|
||||||
|
@XmlElementRef
|
||||||
|
protected List<T> records;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set of records representing query results.
|
* Set of records representing query results.
|
||||||
*/
|
*/
|
||||||
public List<QueryResultRecordType<?>> getRecords() {
|
public List<T> getRecords() {
|
||||||
return records;
|
return records;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRecords(List<QueryResultRecordType<?>> links) {
|
public void setRecords(List<T> records) {
|
||||||
this.records = Lists.newArrayList(checkNotNull(links, "links"));
|
this.records = Lists.newArrayList(checkNotNull(records, "records"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addRecords(QueryResultRecordType<?> record) {
|
public void addRecords(T record) {
|
||||||
this.records.add(checkNotNull(record, "record"));
|
this.records.add(checkNotNull(record, "record"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -195,7 +208,7 @@ public class QueryResultRecords extends ContainerType<QueryResultRecords> {
|
||||||
return true;
|
return true;
|
||||||
if (o == null || getClass() != o.getClass())
|
if (o == null || getClass() != o.getClass())
|
||||||
return false;
|
return false;
|
||||||
QueryResultRecords that = QueryResultRecords.class.cast(o);
|
QueryResultRecords<T> that = QueryResultRecords.class.cast(o);
|
||||||
return super.equals(that) && equal(this.records, that.records);
|
return super.equals(that) && equal(this.records, that.records);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,215 @@
|
||||||
|
/**
|
||||||
|
* 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.query;
|
||||||
|
|
||||||
|
import static com.google.common.base.Objects.*;
|
||||||
|
import static com.google.common.base.Preconditions.*;
|
||||||
|
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.*;
|
||||||
|
|
||||||
|
import java.net.URI;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlElementRef;
|
||||||
|
|
||||||
|
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.domain.Link;
|
||||||
|
import org.jclouds.vcloud.director.v1_5.domain.ReferenceType;
|
||||||
|
|
||||||
|
import com.google.common.base.Objects;
|
||||||
|
import com.google.common.base.Objects.ToStringHelper;
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
|
import com.google.common.collect.Sets;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents the results from a vCloud query as references.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* <complexType name="QueryResultReferences" />
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* @author grkvlt@apache.org
|
||||||
|
*/
|
||||||
|
public class QueryResultReferences<T extends ReferenceType<T>> extends ContainerType<QueryResultReferences<T>> {
|
||||||
|
|
||||||
|
public static final String MEDIA_TYPE = VCloudDirectorMediaType.QUERY_RESULT_REFERENCES;
|
||||||
|
|
||||||
|
public static <T extends ReferenceType<T>> Builder<T> builder() {
|
||||||
|
return new Builder<T>();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Builder<T> toBuilder() {
|
||||||
|
return new Builder<T>().fromQueryResultReferences(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Builder<T extends ReferenceType<T>> extends ContainerType.Builder<QueryResultReferences<T>> {
|
||||||
|
|
||||||
|
protected List<T> references = Lists.newArrayList();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see QueryResultReferences#getReferences()
|
||||||
|
*/
|
||||||
|
public Builder<T> references(List<T> references) {
|
||||||
|
this.references = references;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see QueryResultReferences#getReferences()
|
||||||
|
*/
|
||||||
|
public Builder<T> reference(T reference) {
|
||||||
|
this.references.add(reference);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public QueryResultReferences<T> build() {
|
||||||
|
QueryResultReferences<T> queryResultReferences = new QueryResultReferences<T>(href);
|
||||||
|
queryResultReferences.setReferences(references);
|
||||||
|
queryResultReferences.setName(name);
|
||||||
|
queryResultReferences.setPage(page);
|
||||||
|
queryResultReferences.setPageSize(pageSize);
|
||||||
|
queryResultReferences.setTotal(total);
|
||||||
|
queryResultReferences.setType(type);
|
||||||
|
queryResultReferences.setLinks(links);
|
||||||
|
return queryResultReferences;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see Container#getName()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Builder<T> name(String name) {
|
||||||
|
this.name = name;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see Container#getPage()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Builder<T> page(Integer page) {
|
||||||
|
this.page = page;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see Container#getPageSize()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Builder<T> pageSize(Integer pageSize) {
|
||||||
|
this.pageSize = pageSize;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see ResourceType#getHref()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Builder<T> href(URI href) {
|
||||||
|
super.href(href);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see ResourceType#getType()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Builder<T> type(String type) {
|
||||||
|
super.type(type);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see ResourceType#getLinks()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Builder<T> links(Set<Link> links) {
|
||||||
|
super.links(Sets.newLinkedHashSet(checkNotNull(links, "links")));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see ResourceType#getLinks()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Builder<T> link(Link link) {
|
||||||
|
super.link(link);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Builder<T> fromContainerType(ContainerType<QueryResultReferences<T>> in) {
|
||||||
|
return Builder.class.cast(super.fromContainerType(in));
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder<T> fromQueryResultReferences(QueryResultReferences<T> in) {
|
||||||
|
return fromContainerType(in).references(in.getReferences());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected QueryResultReferences() {
|
||||||
|
// For JAXB and builder use
|
||||||
|
}
|
||||||
|
|
||||||
|
protected QueryResultReferences(URI href) {
|
||||||
|
super(href);
|
||||||
|
}
|
||||||
|
|
||||||
|
@XmlElementRef(name = "Reference", namespace = VCLOUD_1_5_NS)
|
||||||
|
protected List<T> references;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set of references representing query results.
|
||||||
|
*/
|
||||||
|
public List<T> getReferences() {
|
||||||
|
return references;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setReferences(List<T> references) {
|
||||||
|
this.references = Lists.newArrayList(checkNotNull(references, "references"));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addReference(T reference) {
|
||||||
|
this.references.add(checkNotNull(reference, "reference"));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o)
|
||||||
|
return true;
|
||||||
|
if (o == null || getClass() != o.getClass())
|
||||||
|
return false;
|
||||||
|
QueryResultReferences<T> that = QueryResultReferences.class.cast(o);
|
||||||
|
return super.equals(that) && equal(this.references, that.references);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return super.hashCode() + Objects.hashCode(references);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ToStringHelper string() {
|
||||||
|
return super.string().add("references", references);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -1,15 +1,26 @@
|
||||||
//
|
/*
|
||||||
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
|
* Licensed to jclouds, Inc. (jclouds) under one or more
|
||||||
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
|
* contributor license agreements. See the NOTICE file
|
||||||
// Any modifications to this file will be lost upon recompilation of the source schema.
|
* distributed with this work for additional information
|
||||||
// Generated on: 2012.02.08 at 02:47:44 PM GMT
|
* regarding copyright ownership. jclouds licenses this file
|
||||||
//
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
package org.jclouds.vcloud.director.v1_5.domain.vapp;
|
package org.jclouds.vcloud.director.v1_5.domain.vapp;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.xml.bind.JAXBElement;
|
import javax.xml.bind.JAXBElement;
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
|
@ -18,18 +29,9 @@ import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlElementRef;
|
import javax.xml.bind.annotation.XmlElementRef;
|
||||||
import javax.xml.bind.annotation.XmlSeeAlso;
|
import javax.xml.bind.annotation.XmlSeeAlso;
|
||||||
import javax.xml.bind.annotation.XmlType;
|
import javax.xml.bind.annotation.XmlType;
|
||||||
import com.vmware.vcloud.api.rest.schema.ovf.AnnotationSectionType;
|
|
||||||
import com.vmware.vcloud.api.rest.schema.ovf.DeploymentOptionSectionType;
|
import org.jclouds.vcloud.director.v1_5.domain.ReferenceType;
|
||||||
import com.vmware.vcloud.api.rest.schema.ovf.DiskSectionType;
|
import org.jclouds.vcloud.director.v1_5.domain.ResourceEntity;
|
||||||
import com.vmware.vcloud.api.rest.schema.ovf.EulaSectionType;
|
|
||||||
import com.vmware.vcloud.api.rest.schema.ovf.InstallSectionType;
|
|
||||||
import com.vmware.vcloud.api.rest.schema.ovf.NetworkSectionType;
|
|
||||||
import com.vmware.vcloud.api.rest.schema.ovf.OperatingSystemSectionType;
|
|
||||||
import com.vmware.vcloud.api.rest.schema.ovf.ProductSectionType;
|
|
||||||
import com.vmware.vcloud.api.rest.schema.ovf.ResourceAllocationSectionType;
|
|
||||||
import com.vmware.vcloud.api.rest.schema.ovf.SectionType;
|
|
||||||
import com.vmware.vcloud.api.rest.schema.ovf.StartupSectionType;
|
|
||||||
import com.vmware.vcloud.api.rest.schema.ovf.VirtualHardwareSectionType;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -63,115 +65,109 @@ import com.vmware.vcloud.api.rest.schema.ovf.VirtualHardwareSectionType;
|
||||||
"vAppParent",
|
"vAppParent",
|
||||||
"section"
|
"section"
|
||||||
})
|
})
|
||||||
@XmlSeeAlso({
|
public abstract class AbstractVAppType extends ResourceEntity {
|
||||||
VmType.class,
|
|
||||||
VAppType.class
|
|
||||||
})
|
|
||||||
public abstract class AbstractVAppType
|
|
||||||
extends ResourceEntityType
|
|
||||||
{
|
|
||||||
|
|
||||||
@XmlElement(name = "VAppParent")
|
// @XmlElement(name = "VAppParent")
|
||||||
protected ReferenceType vAppParent;
|
// protected ReferenceType vAppParent;
|
||||||
@XmlElementRef(name = "Section", namespace = "http://schemas.dmtf.org/ovf/envelope/1", type = JAXBElement.class)
|
// @XmlElementRef(name = "Section", namespace = "http://schemas.dmtf.org/ovf/envelope/1", type = JAXBElement.class)
|
||||||
protected List<JAXBElement<? extends SectionType>> section;
|
// protected List<JAXBElement<? extends SectionType>> section;
|
||||||
@XmlAttribute
|
// @XmlAttribute
|
||||||
protected Boolean deployed;
|
// protected Boolean deployed;
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* Gets the value of the vAppParent property.
|
// * Gets the value of the vAppParent property.
|
||||||
*
|
// *
|
||||||
* @return
|
// * @return
|
||||||
* possible object is
|
// * possible object is
|
||||||
* {@link ReferenceType }
|
// * {@link ReferenceType }
|
||||||
*
|
// *
|
||||||
*/
|
// */
|
||||||
public ReferenceType getVAppParent() {
|
// public ReferenceType getVAppParent() {
|
||||||
return vAppParent;
|
// return vAppParent;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* Sets the value of the vAppParent property.
|
// * Sets the value of the vAppParent property.
|
||||||
*
|
// *
|
||||||
* @param value
|
// * @param value
|
||||||
* allowed object is
|
// * allowed object is
|
||||||
* {@link ReferenceType }
|
// * {@link ReferenceType }
|
||||||
*
|
// *
|
||||||
*/
|
// */
|
||||||
public void setVAppParent(ReferenceType value) {
|
// public void setVAppParent(ReferenceType value) {
|
||||||
this.vAppParent = value;
|
// this.vAppParent = value;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
*
|
// *
|
||||||
* Specific ovf:Section with additional information for the vApp.
|
// * Specific ovf:Section with additional information for the vApp.
|
||||||
* Gets the value of the section property.
|
// * Gets the value of the section property.
|
||||||
*
|
// *
|
||||||
* <p>
|
// * <p>
|
||||||
* This accessor method returns a reference to the live list,
|
// * This accessor method returns a reference to the live list,
|
||||||
* not a snapshot. Therefore any modification you make to the
|
// * not a snapshot. Therefore any modification you make to the
|
||||||
* returned list will be present inside the JAXB object.
|
// * returned list will be present inside the JAXB object.
|
||||||
* This is why there is not a <CODE>set</CODE> method for the section property.
|
// * This is why there is not a <CODE>set</CODE> method for the section property.
|
||||||
*
|
// *
|
||||||
* <p>
|
// * <p>
|
||||||
* For example, to add a new item, do as follows:
|
// * For example, to add a new item, do as follows:
|
||||||
* <pre>
|
// * <pre>
|
||||||
* getSection().add(newItem);
|
// * getSection().add(newItem);
|
||||||
* </pre>
|
// * </pre>
|
||||||
*
|
// *
|
||||||
*
|
// *
|
||||||
* <p>
|
// * <p>
|
||||||
* Objects of the following type(s) are allowed in the list
|
// * Objects of the following type(s) are allowed in the list
|
||||||
* {@link JAXBElement }{@code <}{@link SectionType }{@code >}
|
// * {@link JAXBElement }{@code <}{@link SectionType }{@code >}
|
||||||
* {@link JAXBElement }{@code <}{@link VirtualHardwareSectionType }{@code >}
|
// * {@link JAXBElement }{@code <}{@link VirtualHardwareSectionType }{@code >}
|
||||||
* {@link JAXBElement }{@code <}{@link LeaseSettingsSectionType }{@code >}
|
// * {@link JAXBElement }{@code <}{@link LeaseSettingsSectionType }{@code >}
|
||||||
* {@link JAXBElement }{@code <}{@link EulaSectionType }{@code >}
|
// * {@link JAXBElement }{@code <}{@link EulaSectionType }{@code >}
|
||||||
* {@link JAXBElement }{@code <}{@link RuntimeInfoSectionType }{@code >}
|
// * {@link JAXBElement }{@code <}{@link RuntimeInfoSectionType }{@code >}
|
||||||
* {@link JAXBElement }{@code <}{@link AnnotationSectionType }{@code >}
|
// * {@link JAXBElement }{@code <}{@link AnnotationSectionType }{@code >}
|
||||||
* {@link JAXBElement }{@code <}{@link DeploymentOptionSectionType }{@code >}
|
// * {@link JAXBElement }{@code <}{@link DeploymentOptionSectionType }{@code >}
|
||||||
* {@link JAXBElement }{@code <}{@link StartupSectionType }{@code >}
|
// * {@link JAXBElement }{@code <}{@link StartupSectionType }{@code >}
|
||||||
* {@link JAXBElement }{@code <}{@link ResourceAllocationSectionType }{@code >}
|
// * {@link JAXBElement }{@code <}{@link ResourceAllocationSectionType }{@code >}
|
||||||
* {@link JAXBElement }{@code <}{@link NetworkConnectionSectionType }{@code >}
|
// * {@link JAXBElement }{@code <}{@link NetworkConnectionSectionType }{@code >}
|
||||||
* {@link JAXBElement }{@code <}{@link CustomizationSectionType }{@code >}
|
// * {@link JAXBElement }{@code <}{@link CustomizationSectionType }{@code >}
|
||||||
* {@link JAXBElement }{@code <}{@link ProductSectionType }{@code >}
|
// * {@link JAXBElement }{@code <}{@link ProductSectionType }{@code >}
|
||||||
* {@link JAXBElement }{@code <}{@link GuestCustomizationSectionType }{@code >}
|
// * {@link JAXBElement }{@code <}{@link GuestCustomizationSectionType }{@code >}
|
||||||
* {@link JAXBElement }{@code <}{@link OperatingSystemSectionType }{@code >}
|
// * {@link JAXBElement }{@code <}{@link OperatingSystemSectionType }{@code >}
|
||||||
* {@link JAXBElement }{@code <}{@link NetworkConfigSectionType }{@code >}
|
// * {@link JAXBElement }{@code <}{@link NetworkConfigSectionType }{@code >}
|
||||||
* {@link JAXBElement }{@code <}{@link NetworkSectionType }{@code >}
|
// * {@link JAXBElement }{@code <}{@link NetworkSectionType }{@code >}
|
||||||
* {@link JAXBElement }{@code <}{@link DiskSectionType }{@code >}
|
// * {@link JAXBElement }{@code <}{@link DiskSectionType }{@code >}
|
||||||
* {@link JAXBElement }{@code <}{@link InstallSectionType }{@code >}
|
// * {@link JAXBElement }{@code <}{@link InstallSectionType }{@code >}
|
||||||
*
|
// *
|
||||||
*
|
// *
|
||||||
*/
|
// */
|
||||||
public List<JAXBElement<? extends SectionType>> getSection() {
|
// public List<JAXBElement<? extends SectionType>> getSection() {
|
||||||
if (section == null) {
|
// if (section == null) {
|
||||||
section = new ArrayList<JAXBElement<? extends SectionType>>();
|
// section = new ArrayList<JAXBElement<? extends SectionType>>();
|
||||||
}
|
// }
|
||||||
return this.section;
|
// return this.section;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* Gets the value of the deployed property.
|
// * Gets the value of the deployed property.
|
||||||
*
|
// *
|
||||||
* @return
|
// * @return
|
||||||
* possible object is
|
// * possible object is
|
||||||
* {@link Boolean }
|
// * {@link Boolean }
|
||||||
*
|
// *
|
||||||
*/
|
// */
|
||||||
public Boolean isDeployed() {
|
// public Boolean isDeployed() {
|
||||||
return deployed;
|
// return deployed;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* Sets the value of the deployed property.
|
// * Sets the value of the deployed property.
|
||||||
*
|
// *
|
||||||
* @param value
|
// * @param value
|
||||||
* allowed object is
|
// * allowed object is
|
||||||
* {@link Boolean }
|
// * {@link Boolean }
|
||||||
*
|
// *
|
||||||
*/
|
// */
|
||||||
public void setDeployed(Boolean value) {
|
// public void setDeployed(Boolean value) {
|
||||||
this.deployed = value;
|
// this.deployed = value;
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/**
|
/*
|
||||||
* Licensed to jclouds, Inc. (jclouds) under one or more
|
* Licensed to jclouds, Inc. (jclouds) under one or more
|
||||||
* contributor license agreements. See the NOTICE file
|
* contributor license agreements. See the NOTICE file
|
||||||
* distributed with this work for additional information
|
* distributed with this work for additional information
|
||||||
|
@ -16,15 +16,19 @@
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.jclouds.vcloud.director.v1_5.domain.vapp;
|
package org.jclouds.vcloud.director.v1_5.domain.vapp;
|
||||||
|
|
||||||
|
import static com.google.common.base.Objects.*;
|
||||||
|
|
||||||
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.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlType;
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
|
||||||
|
import org.jclouds.vcloud.director.v1_5.domain.Owner;
|
||||||
|
|
||||||
|
import com.google.common.base.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -59,221 +63,219 @@ import javax.xml.bind.annotation.XmlType;
|
||||||
"inMaintenanceMode",
|
"inMaintenanceMode",
|
||||||
"children"
|
"children"
|
||||||
})
|
})
|
||||||
public class VApp
|
public class VApp extends AbstractVAppType {
|
||||||
extends AbstractVAppType<VApp>
|
//
|
||||||
|
// @SuppressWarnings("unchecked")
|
||||||
{
|
// public static Builder builder() {
|
||||||
@SuppressWarnings("unchecked")
|
// return new Builder();
|
||||||
public static Builder builder() {
|
// }
|
||||||
return new Builder();
|
//
|
||||||
}
|
// public Builder toBuilder() {
|
||||||
|
// return new Builder().fromVApp(this);
|
||||||
public Builder toBuilder() {
|
// }
|
||||||
return new Builder().fromVApp(this);
|
//
|
||||||
}
|
// public static class Builder extends AbstractVAppType.Builder<VApp> {
|
||||||
|
//
|
||||||
public static class Builder extends AbstractVAppType.Builder<VApp> {
|
// private Owner owner;
|
||||||
|
// private Boolean inMaintenanceMode;
|
||||||
private Owner owner;
|
// private VAppChildren children;
|
||||||
private Boolean inMaintenanceMode;
|
// private Boolean ovfDescriptorUploaded;
|
||||||
private VAppChildren children;
|
//
|
||||||
private Boolean ovfDescriptorUploaded;
|
// /**
|
||||||
|
// * @see VApp#getOwner()
|
||||||
/**
|
// */
|
||||||
* @see VApp#getOwner()
|
// public Builder owner(Owner owner) {
|
||||||
*/
|
// this.owner = owner;
|
||||||
public Builder owner(Owner owner) {
|
// return this;
|
||||||
this.owner = owner;
|
// }
|
||||||
return this;
|
//
|
||||||
}
|
// /**
|
||||||
|
// * @see VApp#getInMaintenanceMode()
|
||||||
/**
|
// */
|
||||||
* @see VApp#getInMaintenanceMode()
|
// public Builder inMaintenanceMode(Boolean inMaintenanceMode) {
|
||||||
*/
|
// this.inMaintenanceMode = inMaintenanceMode;
|
||||||
public Builder inMaintenanceMode(Boolean inMaintenanceMode) {
|
// return this;
|
||||||
this.inMaintenanceMode = inMaintenanceMode;
|
// }
|
||||||
return this;
|
//
|
||||||
}
|
// /**
|
||||||
|
// * @see VApp#getChildren()
|
||||||
/**
|
// */
|
||||||
* @see VApp#getChildren()
|
// public Builder children(VAppChildren children) {
|
||||||
*/
|
// this.children = children;
|
||||||
public Builder children(VAppChildren children) {
|
// return this;
|
||||||
this.children = children;
|
// }
|
||||||
return this;
|
//
|
||||||
}
|
// /**
|
||||||
|
// * @see VApp#getOvfDescriptorUploaded()
|
||||||
/**
|
// */
|
||||||
* @see VApp#getOvfDescriptorUploaded()
|
// public Builder ovfDescriptorUploaded(Boolean ovfDescriptorUploaded) {
|
||||||
*/
|
// this.ovfDescriptorUploaded = ovfDescriptorUploaded;
|
||||||
public Builder ovfDescriptorUploaded(Boolean ovfDescriptorUploaded) {
|
// return this;
|
||||||
this.ovfDescriptorUploaded = ovfDescriptorUploaded;
|
// }
|
||||||
return this;
|
//
|
||||||
}
|
//
|
||||||
|
// public VApp build() {
|
||||||
|
// VApp vApp = new VApp();
|
||||||
public VApp build() {
|
// vApp.setOwner(owner);
|
||||||
VApp vApp = new VApp();
|
// vApp.setInMaintenanceMode(inMaintenanceMode);
|
||||||
vApp.setOwner(owner);
|
// vApp.setChildren(children);
|
||||||
vApp.setInMaintenanceMode(inMaintenanceMode);
|
// vApp.setOvfDescriptorUploaded(ovfDescriptorUploaded);
|
||||||
vApp.setChildren(children);
|
// return vApp;
|
||||||
vApp.setOvfDescriptorUploaded(ovfDescriptorUploaded);
|
// }
|
||||||
return vApp;
|
//
|
||||||
}
|
//
|
||||||
|
// @Override
|
||||||
|
// public Builder fromAbstractVAppType(AbstractVAppType<VApp> in) {
|
||||||
@Override
|
// return Builder.class.cast(super.fromAbstractVAppType(in));
|
||||||
public Builder fromAbstractVAppType(AbstractVAppType<VApp> in) {
|
// }
|
||||||
return Builder.class.cast(super.fromAbstractVAppType(in));
|
// public Builder fromVApp(VApp in) {
|
||||||
}
|
// return fromAbstractVAppType(in)
|
||||||
public Builder fromVApp(VApp in) {
|
// .owner(in.getOwner())
|
||||||
return fromAbstractVAppType(in)
|
// .inMaintenanceMode(in.getInMaintenanceMode())
|
||||||
.owner(in.getOwner())
|
// .children(in.getChildren())
|
||||||
.inMaintenanceMode(in.getInMaintenanceMode())
|
// .ovfDescriptorUploaded(in.getOvfDescriptorUploaded());
|
||||||
.children(in.getChildren())
|
// }
|
||||||
.ovfDescriptorUploaded(in.getOvfDescriptorUploaded());
|
// }
|
||||||
}
|
//
|
||||||
}
|
// private VApp() {
|
||||||
|
// // For JAXB and builder use
|
||||||
private VApp() {
|
// }
|
||||||
// For JAXB and builder use
|
//
|
||||||
}
|
//
|
||||||
|
//
|
||||||
|
// @XmlElement(name = "Owner")
|
||||||
|
// protected Owner owner;
|
||||||
@XmlElement(name = "Owner")
|
// @XmlElement(name = "InMaintenanceMode")
|
||||||
protected Owner owner;
|
// protected Boolean inMaintenanceMode;
|
||||||
@XmlElement(name = "InMaintenanceMode")
|
// @XmlElement(name = "Children")
|
||||||
protected Boolean inMaintenanceMode;
|
// protected VAppChildren children;
|
||||||
@XmlElement(name = "Children")
|
// @XmlAttribute
|
||||||
protected VAppChildren children;
|
// protected Boolean ovfDescriptorUploaded;
|
||||||
@XmlAttribute
|
//
|
||||||
protected Boolean ovfDescriptorUploaded;
|
// /**
|
||||||
|
// * Gets the value of the owner property.
|
||||||
/**
|
// *
|
||||||
* Gets the value of the owner property.
|
// * @return
|
||||||
*
|
// * possible object is
|
||||||
* @return
|
// * {@link Owner }
|
||||||
* possible object is
|
// *
|
||||||
* {@link Owner }
|
// */
|
||||||
*
|
// public Owner getOwner() {
|
||||||
*/
|
// return owner;
|
||||||
public Owner getOwner() {
|
// }
|
||||||
return owner;
|
//
|
||||||
}
|
// /**
|
||||||
|
// * Sets the value of the owner property.
|
||||||
/**
|
// *
|
||||||
* Sets the value of the owner property.
|
// * @param value
|
||||||
*
|
// * allowed object is
|
||||||
* @param value
|
// * {@link Owner }
|
||||||
* allowed object is
|
// *
|
||||||
* {@link Owner }
|
// */
|
||||||
*
|
// public void setOwner(Owner value) {
|
||||||
*/
|
// this.owner = value;
|
||||||
public void setOwner(Owner value) {
|
// }
|
||||||
this.owner = value;
|
//
|
||||||
}
|
// /**
|
||||||
|
// * Gets the value of the inMaintenanceMode property.
|
||||||
/**
|
// *
|
||||||
* Gets the value of the inMaintenanceMode property.
|
// * @return
|
||||||
*
|
// * possible object is
|
||||||
* @return
|
// * {@link Boolean }
|
||||||
* possible object is
|
// *
|
||||||
* {@link Boolean }
|
// */
|
||||||
*
|
// public Boolean isInMaintenanceMode() {
|
||||||
*/
|
// return inMaintenanceMode;
|
||||||
public Boolean isInMaintenanceMode() {
|
// }
|
||||||
return inMaintenanceMode;
|
//
|
||||||
}
|
// /**
|
||||||
|
// * Sets the value of the inMaintenanceMode property.
|
||||||
/**
|
// *
|
||||||
* Sets the value of the inMaintenanceMode property.
|
// * @param value
|
||||||
*
|
// * allowed object is
|
||||||
* @param value
|
// * {@link Boolean }
|
||||||
* allowed object is
|
// *
|
||||||
* {@link Boolean }
|
// */
|
||||||
*
|
// public void setInMaintenanceMode(Boolean value) {
|
||||||
*/
|
// this.inMaintenanceMode = value;
|
||||||
public void setInMaintenanceMode(Boolean value) {
|
// }
|
||||||
this.inMaintenanceMode = value;
|
//
|
||||||
}
|
// /**
|
||||||
|
// * Gets the value of the children property.
|
||||||
/**
|
// *
|
||||||
* Gets the value of the children property.
|
// * @return
|
||||||
*
|
// * possible object is
|
||||||
* @return
|
// * {@link VAppChildren }
|
||||||
* possible object is
|
// *
|
||||||
* {@link VAppChildren }
|
// */
|
||||||
*
|
// public VAppChildren getChildren() {
|
||||||
*/
|
// return children;
|
||||||
public VAppChildren getChildren() {
|
// }
|
||||||
return children;
|
//
|
||||||
}
|
// /**
|
||||||
|
// * Sets the value of the children property.
|
||||||
/**
|
// *
|
||||||
* Sets the value of the children property.
|
// * @param value
|
||||||
*
|
// * allowed object is
|
||||||
* @param value
|
// * {@link VAppChildren }
|
||||||
* allowed object is
|
// *
|
||||||
* {@link VAppChildren }
|
// */
|
||||||
*
|
// public void setChildren(VAppChildren value) {
|
||||||
*/
|
// this.children = value;
|
||||||
public void setChildren(VAppChildren value) {
|
// }
|
||||||
this.children = value;
|
//
|
||||||
}
|
// /**
|
||||||
|
// * Gets the value of the ovfDescriptorUploaded property.
|
||||||
/**
|
// *
|
||||||
* Gets the value of the ovfDescriptorUploaded property.
|
// * @return
|
||||||
*
|
// * possible object is
|
||||||
* @return
|
// * {@link Boolean }
|
||||||
* possible object is
|
// *
|
||||||
* {@link Boolean }
|
// */
|
||||||
*
|
// public Boolean isOvfDescriptorUploaded() {
|
||||||
*/
|
// return ovfDescriptorUploaded;
|
||||||
public Boolean isOvfDescriptorUploaded() {
|
// }
|
||||||
return ovfDescriptorUploaded;
|
//
|
||||||
}
|
// /**
|
||||||
|
// * Sets the value of the ovfDescriptorUploaded property.
|
||||||
/**
|
// *
|
||||||
* Sets the value of the ovfDescriptorUploaded property.
|
// * @param value
|
||||||
*
|
// * allowed object is
|
||||||
* @param value
|
// * {@link Boolean }
|
||||||
* allowed object is
|
// *
|
||||||
* {@link Boolean }
|
// */
|
||||||
*
|
// public void setOvfDescriptorUploaded(Boolean value) {
|
||||||
*/
|
// this.ovfDescriptorUploaded = value;
|
||||||
public void setOvfDescriptorUploaded(Boolean value) {
|
// }
|
||||||
this.ovfDescriptorUploaded = value;
|
//
|
||||||
}
|
// @Override
|
||||||
|
// public boolean equals(Object o) {
|
||||||
@Override
|
// if (this == o)
|
||||||
public boolean equals(Object o) {
|
// return true;
|
||||||
if (this == o)
|
// if (o == null || getClass() != o.getClass())
|
||||||
return true;
|
// return false;
|
||||||
if (o == null || getClass() != o.getClass())
|
// VApp that = VApp.class.cast(o);
|
||||||
return false;
|
// return equal(owner, that.owner) &&
|
||||||
VApp that = VApp.class.cast(o);
|
// equal(inMaintenanceMode, that.inMaintenanceMode) &&
|
||||||
return equal(owner, that.owner) &&
|
// equal(children, that.children) &&
|
||||||
equal(inMaintenanceMode, that.inMaintenanceMode) &&
|
// equal(ovfDescriptorUploaded, that.ovfDescriptorUploaded);
|
||||||
equal(children, that.children) &&
|
// }
|
||||||
equal(ovfDescriptorUploaded, that.ovfDescriptorUploaded);
|
//
|
||||||
}
|
// @Override
|
||||||
|
// public int hashCode() {
|
||||||
@Override
|
// return Objects.hashCode(owner,
|
||||||
public int hashCode() {
|
// inMaintenanceMode,
|
||||||
return Objects.hashCode(owner,
|
// children,
|
||||||
inMaintenanceMode,
|
// ovfDescriptorUploaded);
|
||||||
children,
|
// }
|
||||||
ovfDescriptorUploaded);
|
//
|
||||||
}
|
// @Override
|
||||||
|
// public String toString() {
|
||||||
@Override
|
// return Objects.toStringHelper("")
|
||||||
public String toString() {
|
// .add("owner", owner)
|
||||||
return Objects.toStringHelper("")
|
// .add("inMaintenanceMode", inMaintenanceMode)
|
||||||
.add("owner", owner)
|
// .add("children", children)
|
||||||
.add("inMaintenanceMode", inMaintenanceMode)
|
// .add("ovfDescriptorUploaded", ovfDescriptorUploaded).toString();
|
||||||
.add("children", children)
|
// }
|
||||||
.add("ovfDescriptorUploaded", ovfDescriptorUploaded).toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,59 +18,81 @@
|
||||||
*/
|
*/
|
||||||
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.Consumes;
|
||||||
|
import javax.ws.rs.DefaultValue;
|
||||||
import javax.ws.rs.GET;
|
import javax.ws.rs.GET;
|
||||||
import javax.ws.rs.POST;
|
|
||||||
import javax.ws.rs.Path;
|
import javax.ws.rs.Path;
|
||||||
|
import javax.ws.rs.QueryParam;
|
||||||
|
|
||||||
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.ReferenceType;
|
import org.jclouds.vcloud.director.v1_5.domain.query.CatalogReferences;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Task;
|
import org.jclouds.vcloud.director.v1_5.domain.query.QueryResultRecords;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.TasksList;
|
|
||||||
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.ReferenceToEndpoint;
|
|
||||||
import org.jclouds.vcloud.director.v1_5.functions.ThrowVCloudErrorOn4xx;
|
import org.jclouds.vcloud.director.v1_5.functions.ThrowVCloudErrorOn4xx;
|
||||||
|
|
||||||
import com.google.common.util.concurrent.ListenableFuture;
|
import com.google.common.util.concurrent.ListenableFuture;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see TaskClient
|
* @see QueryClient
|
||||||
* @author grkvlt@apache.org
|
* @author grkvlt@apache.org
|
||||||
*/
|
*/
|
||||||
@RequestFilters(AddVCloudAuthorizationToRequest.class)
|
@RequestFilters(AddVCloudAuthorizationToRequest.class)
|
||||||
public interface QueryAsyncClient {
|
public interface QueryAsyncClient {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see TaskClient#getTaskList(ReferenceType<?>)
|
* REST API General queries handler.
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
|
@Path("/query")
|
||||||
@Consumes
|
@Consumes
|
||||||
@JAXBResponseParser
|
@JAXBResponseParser
|
||||||
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
|
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
|
||||||
ListenableFuture<TasksList> getTaskList(@EndpointParam(parser = OrgReferenceToTaskListEndpoint.class) ReferenceType<?> orgRef);
|
ListenableFuture<QueryResultRecords> query(@QueryParam("type") String type, @QueryParam("filter") String filter);
|
||||||
|
|
||||||
|
@GET
|
||||||
|
@Path("/query")
|
||||||
|
@Consumes
|
||||||
|
@JAXBResponseParser
|
||||||
|
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
|
||||||
|
ListenableFuture<QueryResultRecords> query(@QueryParam("page") Integer page, @QueryParam("pageSize") Integer pageSize,
|
||||||
|
@QueryParam("format") String format, @QueryParam("type") String type, @QueryParam("filter") String filter);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see TaskClient#getTask(URI)
|
* Retrieves a list of Catalogs by using REST API general QueryHandler.
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
|
@Path("/catalogs/query")
|
||||||
@Consumes
|
@Consumes
|
||||||
@JAXBResponseParser
|
@JAXBResponseParser
|
||||||
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
|
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
|
||||||
ListenableFuture<Task> getTask(@EndpointParam URI taskUri);
|
ListenableFuture<QueryResultRecords> catalogsQuery(@QueryParam("filter") String filter);
|
||||||
|
|
||||||
/**
|
@GET
|
||||||
* @see TaskClient#cancelTask(URI)
|
@Path("/catalogs/query")
|
||||||
*/
|
|
||||||
@POST
|
|
||||||
@Path("/action/cancel")
|
|
||||||
@Consumes
|
@Consumes
|
||||||
@JAXBResponseParser
|
@JAXBResponseParser
|
||||||
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
|
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
|
||||||
ListenableFuture<Void> cancelTask(@EndpointParam URI taskUri);
|
ListenableFuture<QueryResultRecords> catalogsQuery(@QueryParam("page") Integer page, @QueryParam("pageSize") Integer pageSize,
|
||||||
|
@QueryParam("format") String format, @QueryParam("filter") String filter);
|
||||||
|
|
||||||
|
@GET
|
||||||
|
@Path("/catalogs/query")
|
||||||
|
@Consumes
|
||||||
|
@DefaultValue("references")
|
||||||
|
@QueryParam("format")
|
||||||
|
@JAXBResponseParser
|
||||||
|
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
|
||||||
|
ListenableFuture<CatalogReferences> catalogReferencesQuery(@QueryParam("filter") String filter);
|
||||||
|
|
||||||
|
@GET
|
||||||
|
@Path("/catalogs/query")
|
||||||
|
@Consumes
|
||||||
|
@DefaultValue("references")
|
||||||
|
@QueryParam("format")
|
||||||
|
@JAXBResponseParser
|
||||||
|
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
|
||||||
|
ListenableFuture<CatalogReferences> catalogReferencesQuery(@QueryParam("page") Integer page, @QueryParam("pageSize") Integer pageSize,
|
||||||
|
@QueryParam("filter") String filter);
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,13 +18,11 @@
|
||||||
*/
|
*/
|
||||||
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.ReferenceType;
|
import org.jclouds.vcloud.director.v1_5.domain.query.CatalogReferences;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Task;
|
import org.jclouds.vcloud.director.v1_5.domain.query.QueryResultRecords;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.TasksList;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides synchronous access to The REST API query interface.
|
* Provides synchronous access to The REST API query interface.
|
||||||
|
@ -39,10 +37,12 @@ public interface QueryClient {
|
||||||
* REST API General queries handler.
|
* REST API General queries handler.
|
||||||
*
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
* GET /query/
|
* GET /query
|
||||||
* </pre>
|
* </pre>
|
||||||
*/
|
*/
|
||||||
ContainerType query(String queryParams);
|
QueryResultRecords query(String type, String filter);
|
||||||
|
|
||||||
|
QueryResultRecords query(Integer page, Integer pageSize, String format, String type, String filter);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves a list of Catalogs by using REST API general QueryHandler.
|
* Retrieves a list of Catalogs by using REST API general QueryHandler.
|
||||||
|
@ -52,11 +52,15 @@ public interface QueryClient {
|
||||||
* Default format is references.
|
* Default format is references.
|
||||||
*
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
* GET /catalogs/query/
|
* GET /catalogs/query
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
|
||||||
* @param orgId the unique id for the organization
|
|
||||||
* @return a list of tasks
|
|
||||||
*/
|
*/
|
||||||
ContainerType catalogsQuery(ReferenceType<?> orgRef);
|
QueryResultRecords catalogsQuery(String filter);
|
||||||
|
|
||||||
|
QueryResultRecords catalogsQuery(Integer page, Integer pageSize, String format, String filter);
|
||||||
|
|
||||||
|
CatalogReferences catalogReferencesQuery(String filter);
|
||||||
|
|
||||||
|
CatalogReferences catalogReferencesQuery(Integer page, Integer pageSize, String filter);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,12 +25,10 @@ import java.net.URI;
|
||||||
import org.jclouds.http.HttpRequest;
|
import org.jclouds.http.HttpRequest;
|
||||||
import org.jclouds.http.HttpResponse;
|
import org.jclouds.http.HttpResponse;
|
||||||
import org.jclouds.vcloud.director.v1_5.VCloudDirectorClient;
|
import org.jclouds.vcloud.director.v1_5.VCloudDirectorClient;
|
||||||
import org.jclouds.vcloud.director.v1_5.VCloudDirectorException;
|
|
||||||
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
|
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Error;
|
import org.jclouds.vcloud.director.v1_5.domain.Link;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Reference;
|
import org.jclouds.vcloud.director.v1_5.domain.query.QueryResultCatalogRecord;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Task;
|
import org.jclouds.vcloud.director.v1_5.domain.query.QueryResultRecords;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.TasksList;
|
|
||||||
import org.jclouds.vcloud.director.v1_5.internal.BaseVCloudDirectorRestClientExpectTest;
|
import org.jclouds.vcloud.director.v1_5.internal.BaseVCloudDirectorRestClientExpectTest;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
|
@ -46,7 +44,78 @@ public class QueryClientExpectTest extends BaseVCloudDirectorRestClientExpectTes
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testQueryCatalogNoParam() {
|
public void testQueryCatalogNoParam() {
|
||||||
assertTrue(true);
|
HttpRequest queryRequest = HttpRequest.builder()
|
||||||
|
.method("GET")
|
||||||
|
.endpoint(URI.create(endpoint + "/catalogs/query?filter="))
|
||||||
|
.headers(ImmutableMultimap.<String, String> builder()
|
||||||
|
.put("Accept", "*/*")
|
||||||
|
.put("x-vcloud-authorization", token)
|
||||||
|
.build())
|
||||||
|
.build();
|
||||||
|
|
||||||
|
HttpResponse queryResponse= HttpResponse.builder()
|
||||||
|
.statusCode(200)
|
||||||
|
.payload(payloadFromResourceWithContentType("/query/allCatalogs.xml", VCloudDirectorMediaType.QUERY_RESULT_RECORDS + ";version=1.5"))
|
||||||
|
.build();
|
||||||
|
|
||||||
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse, queryRequest, queryResponse);
|
||||||
|
|
||||||
|
QueryResultRecords<QueryResultCatalogRecord> expected = QueryResultRecords.<QueryResultCatalogRecord>builder()
|
||||||
|
.href(URI.create("https://vcloudbeta.bluelock.com/api/catalogs/query?page=1&pageSize=25&format=records"))
|
||||||
|
.type("application/vnd.vmware.vcloud.query.records+xml")
|
||||||
|
.name("catalog")
|
||||||
|
.page(1)
|
||||||
|
.pageSize(25)
|
||||||
|
.total(3L)
|
||||||
|
.link(Link.builder()
|
||||||
|
.rel("alternate")
|
||||||
|
.type("application/vnd.vmware.vcloud.query.references+xml")
|
||||||
|
.href(URI.create("https://vcloudbeta.bluelock.com/api/catalogs/query?page=1&pageSize=25&format=references"))
|
||||||
|
.build())
|
||||||
|
.link(Link.builder()
|
||||||
|
.rel("alternate")
|
||||||
|
.type("application/vnd.vmware.vcloud.query.idrecords+xml")
|
||||||
|
.href(URI.create("https://vcloudbeta.bluelock.com/api/catalogs/query?page=1&pageSize=25&format=idrecords"))
|
||||||
|
.build())
|
||||||
|
.record(QueryResultCatalogRecord.builder()
|
||||||
|
.ownerName("qunying.huang@enstratus.com")
|
||||||
|
.owner(URI.create("https://vcloudbeta.bluelock.com/api/admin/user/967d317c-4273-4a95-b8a4-bf63b78e9c69"))
|
||||||
|
.orgName("JClouds")
|
||||||
|
.numberOfVAppTemplates(0)
|
||||||
|
.numberOfMedia(0)
|
||||||
|
.name("QunyingTestCatalog")
|
||||||
|
.shared()
|
||||||
|
.notPublished()
|
||||||
|
.creationDate(dateService.iso8601DateParse("2012-02-07T00:16:28.323-05:00"))
|
||||||
|
.href(URI.create("https://vcloudbeta.bluelock.com/api/catalog/7212e451-76e1-4631-b2de-ba1dfd8080e4"))
|
||||||
|
.build())
|
||||||
|
.record(QueryResultCatalogRecord.builder()
|
||||||
|
.ownerName("system")
|
||||||
|
.owner(URI.create("https://vcloudbeta.bluelock.com/api/admin/user/0ebf2453-5e95-48ab-b223-02671965ee91"))
|
||||||
|
.orgName("Bluelock")
|
||||||
|
.numberOfVAppTemplates(0)
|
||||||
|
.numberOfMedia(0)
|
||||||
|
.name("Public")
|
||||||
|
.notShared()
|
||||||
|
.published()
|
||||||
|
.creationDate(dateService.iso8601DateParse("2011-09-28T13:45:44.207-04:00"))
|
||||||
|
.href(URI.create("https://vcloudbeta.bluelock.com/api/catalog/9e08c2f6-077a-42ce-bece-d5332e2ebb5c"))
|
||||||
|
.build())
|
||||||
|
.record(QueryResultCatalogRecord.builder()
|
||||||
|
.ownerName("adk@cloudsoftcorp.com")
|
||||||
|
.owner(URI.create("https://vcloudbeta.bluelock.com/api/admin/user/e9eb1b29-0404-4c5e-8ef7-e584acc51da9"))
|
||||||
|
.orgName("JClouds")
|
||||||
|
.numberOfVAppTemplates(0)
|
||||||
|
.numberOfMedia(0)
|
||||||
|
.name("test")
|
||||||
|
.shared()
|
||||||
|
.notPublished()
|
||||||
|
.creationDate(dateService.iso8601DateParse("2012-02-09T12:32:17.723-05:00"))
|
||||||
|
.href(URI.create("https://vcloudbeta.bluelock.com/api/catalog/b7289d54-4ca4-497f-9a93-2d4afc97e3da"))
|
||||||
|
.build())
|
||||||
|
.build();
|
||||||
|
|
||||||
|
assertEquals(client.getQueryClient().catalogsQuery(""), expected);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue