diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/VCloudDirectorConstants.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/VCloudDirectorConstants.java new file mode 100644 index 0000000000..fa71a182f3 --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/VCloudDirectorConstants.java @@ -0,0 +1,31 @@ +/** + * 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; + +/** + * Constants used by VCloudDirector clients + * + * @author grkvlt@apache.org + */ +public class VCloudDirectorConstants { + + /** The XML namespace used by the clients. */ + public static final String XMLNS = "http://www.vmware.com/vcloud/v1.5"; + +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/VCloudDirectorMediaType.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/VCloudDirectorMediaType.java index 4d9e4c434f..e103f2413d 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/VCloudDirectorMediaType.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/VCloudDirectorMediaType.java @@ -26,27 +26,24 @@ package org.jclouds.vcloud.director.v1_5; * * @see javax.ws.rs.core.MediaType; */ -public interface VCloudDirectorMediaType { - public final static String NS = "http://www.vmware.com/vcloud/v1.5"; +public enum VCloudDirectorMediaType { + ANY("*/*"), + SESSION("application/vnd.vmware.vcloud.session+xml"), + ERROR("application/vnd.vmware.vcloud.error+xml"), + ORG_LIST("application/vnd.vmware.vcloud.orgList+xml"), + METADATA("application/vnd.vmware.vcloud.metadata+xml"), + METADATA_ENTRY("*/*"), // TODO + ORG("application/vnd.vmware.vcloud.org+xml"), + TASKS_LIST("application/vnd.vmware.vcloud.tasksList+xml"), + TASK("application/vnd.vmware.vcloud.task+xml"); - public final static String ANY = "*/*"; + private final String mediaType; - public final static String SESSION_XML = "application/vnd.vmware.vcloud.session+xml"; - - public final static String ERROR_XML = "application/vnd.vmware.vcloud.error+xml"; - - public final static String ORGLIST_XML = "application/vnd.vmware.vcloud.orgList+xml"; - - public final static String METADATA_XML = "application/vnd.vmware.vcloud.metadata+xml"; - - public static final String METADATAENTRY_XML = "TODO"; // TODO - - public final static String ORG_XML = "application/vnd.vmware.vcloud.org+xml"; - - public static final String ORG_NETWORK_XML = "application/vnd.vmware.vcloud.orgNetwork+xml"; - - public final static String TASK_XML = "application/vnd.vmware.vcloud.task+xml"; - - public static final String TASKSLIST_XML = "application/vnd.vmware.vcloud.tasksList+xml"; + private VCloudDirectorMediaType(String mediaType) { + this.mediaType = mediaType; + } + public String getMediaType() { + return mediaType; + } } diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/EntityType.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/EntityType.java index 16d17fcc0c..af1f468ff6 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/EntityType.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/EntityType.java @@ -18,9 +18,9 @@ */ package org.jclouds.vcloud.director.v1_5.domain; -import static com.google.common.base.Objects.equal; -import static com.google.common.base.Preconditions.checkNotNull; -import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.NS; +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.Set; @@ -30,6 +30,8 @@ import javax.xml.bind.annotation.XmlElement; import com.google.common.base.Objects; import com.google.common.base.Objects.ToStringHelper; +import com.google.common.base.Splitter; +import com.google.common.collect.Iterables; import com.google.common.collect.Sets; /** @@ -143,7 +145,6 @@ public class EntityType> extends ResourceType { /** * {@inheritDoc} */ - @SuppressWarnings("unchecked") @Override public Builder fromResourceType(ResourceType in) { return Builder.class.cast(super.fromResourceType(in)); @@ -156,9 +157,9 @@ public class EntityType> extends ResourceType { } } - @XmlElement(namespace = NS, name = "Description") + @XmlElement(namespace = XMLNS, name = "Description") private String description; - @XmlElement(namespace = NS, name = "TasksInProgress") + @XmlElement(namespace = XMLNS, name = "TasksInProgress") private TasksInProgress tasksInProgress; @XmlAttribute private String id; @@ -211,12 +212,20 @@ public class EntityType> extends ResourceType { } /** - * Contains the name of the the entity. + * Returns the unique UUID string for this entity. * - * The object type, specified as a MIME content type, of the object that the link references. - * This attribute is present only for links to objects. It is not present for links to actions. - * - * @return type definition, type, expressed as an HTTP Content-Type + * Once we have an entity, the {@link #getId()} field is better suited to retrieving the + * id than {@link #getHref()}. + * + * @see ReferenceType#getUuid() + */ + @Override + public String getUuid() { + return Iterables.getLast(Splitter.on(":").split(id)); + } + + /** + * Contains the name of the the entity. */ public String getName() { return name; @@ -231,7 +240,7 @@ public class EntityType> extends ResourceType { EntityType that = EntityType.class.cast(o); return super.equals(that) && equal(this.id, that.id) && equal(this.description, that.description) && - equal(this.tasksInProgress, that.tasksInProgress); + equal(this.tasksInProgress, that.tasksInProgress) && equal(this.name, that.name); } @Override diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Error.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Error.java index 0a337b7a67..7bb5a94d8e 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Error.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Error.java @@ -20,12 +20,7 @@ package org.jclouds.vcloud.director.v1_5.domain; import static com.google.common.base.Objects.*; import static com.google.common.base.Preconditions.*; -import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.*; - -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; -import java.io.PrintWriter; +import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.*; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; @@ -43,7 +38,7 @@ import com.google.common.base.Objects; * * @author grkvlt@apache.org */ -@XmlRootElement(namespace = NS, name = "Error") +@XmlRootElement(namespace = XMLNS, name = "Error") @XmlAccessorType(XmlAccessType.FIELD) public class Error { diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Link.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Link.java index cbbfbf5a5a..ed4d5de848 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Link.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Link.java @@ -18,8 +18,8 @@ */ package org.jclouds.vcloud.director.v1_5.domain; -import static com.google.common.base.Objects.equal; -import static com.google.common.base.Preconditions.checkNotNull; +import static com.google.common.base.Objects.*; +import static com.google.common.base.Preconditions.*; import java.net.URI; import java.util.Map; diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Metadata.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Metadata.java index f8b9213852..913cc8f165 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Metadata.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Metadata.java @@ -18,9 +18,9 @@ */ package org.jclouds.vcloud.director.v1_5.domain; -import static com.google.common.base.Objects.equal; -import static com.google.common.base.Preconditions.checkNotNull; -import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.NS; +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.Set; @@ -42,7 +42,7 @@ import com.google.common.collect.Sets; * * @author danikov */ -@XmlRootElement(namespace = NS, name = "Metadata") +@XmlRootElement(namespace = XMLNS, name = "Metadata") public class Metadata extends ResourceType{ @SuppressWarnings("unchecked") @@ -133,7 +133,7 @@ public class Metadata extends ResourceType{ this.metadata = ImmutableSet.copyOf(metadataEntries); } - @XmlElement(namespace = NS, name = "MetadataEntry") + @XmlElement(namespace = XMLNS, name = "MetadataEntry") private Set metadata = Sets.newLinkedHashSet(); public Set getMetadata() { diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/MetadataEntry.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/MetadataEntry.java index 3353b207d4..3c798eb179 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/MetadataEntry.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/MetadataEntry.java @@ -18,9 +18,9 @@ */ package org.jclouds.vcloud.director.v1_5.domain; -import static com.google.common.base.Objects.equal; -import static com.google.common.base.Preconditions.checkNotNull; -import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.NS; +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.Set; @@ -41,7 +41,7 @@ import com.google.common.collect.Sets; * * @author danikov */ -@XmlRootElement(namespace = NS, name = "TODO") +@XmlRootElement(namespace = XMLNS, name = "MetadataEntry") public class MetadataEntry extends ResourceType { @SuppressWarnings("unchecked") @@ -134,9 +134,9 @@ public class MetadataEntry extends ResourceType { this.value = checkNotNull(value, "value"); } - @XmlElement(namespace = NS, name = "Key") + @XmlElement(namespace = XMLNS, name = "Key") private String key; - @XmlElement(namespace = NS, name = "Value") + @XmlElement(namespace = XMLNS, name = "Value") private String value; /** diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Org.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Org.java index 97dd7c0c41..d86e10a573 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Org.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Org.java @@ -20,7 +20,7 @@ package org.jclouds.vcloud.director.v1_5.domain; import static com.google.common.base.Objects.*; import static com.google.common.base.Preconditions.*; -import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.*; +import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.*; import java.net.URI; import java.util.Set; @@ -43,7 +43,7 @@ import com.google.common.collect.Sets; * * @author Adrian Cole */ -@XmlRootElement(namespace = NS, name = "Org") +@XmlRootElement(namespace = XMLNS, name = "Org") public class Org extends EntityType { @SuppressWarnings("unchecked") @@ -170,7 +170,7 @@ public class Org extends EntityType { this.fullName = fullName; } - @XmlElement(namespace = NS, name = "FullName") + @XmlElement(namespace = XMLNS, name = "FullName") private String fullName; /** diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/OrgList.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/OrgList.java index 5351747da1..bd407f0ebb 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/OrgList.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/OrgList.java @@ -18,9 +18,9 @@ */ package org.jclouds.vcloud.director.v1_5.domain; -import static com.google.common.base.Objects.equal; -import static com.google.common.base.Preconditions.checkNotNull; -import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.NS; +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.util.Set; @@ -36,7 +36,7 @@ import com.google.common.collect.Sets; * * @author Adrian Cole */ -@XmlRootElement(namespace = NS, name = "OrgList") +@XmlRootElement(namespace = XMLNS, name = "OrgList") public class OrgList { public static Builder builder() { @@ -84,7 +84,7 @@ public class OrgList { this.orgs = ImmutableSet.copyOf(orgs); } - @XmlElement(namespace = NS, name = "Org") + @XmlElement(namespace = XMLNS, name = "Org") private Set orgs = Sets.newLinkedHashSet(); public Set getOrgs() { diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ReferenceType.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ReferenceType.java index 24bdc3b47c..b1e59ce4d4 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ReferenceType.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ReferenceType.java @@ -28,7 +28,9 @@ import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import com.google.common.base.Objects; +import com.google.common.base.Splitter; import com.google.common.base.Objects.ToStringHelper; +import com.google.common.collect.Iterables; /** * A reference to a resource. @@ -42,7 +44,7 @@ import com.google.common.base.Objects.ToStringHelper; * @author grkvlt@apache.org */ @XmlAccessorType(XmlAccessType.FIELD) -public class ReferenceType> { +public class ReferenceType> implements URISupplier { public static > Builder builder() { return new Builder(); @@ -156,6 +158,15 @@ public class ReferenceType> { this.id = id; } + /** + * Returns the unique UUID string for this reference. + * + * @see ResourceType#getUuid() + */ + public String getUuid() { + return Iterables.getLast(Splitter.on("/").split(href.getPath())); + } + /** * Contains the name of the the entity. * @@ -189,8 +200,9 @@ public class ReferenceType> { } /** - * @see #getHref() + * @see URISupplier#getURI() */ + @Override public URI getURI() { return getHref(); } diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Resource.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Resource.java index b380e200e0..64fa11e8fe 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Resource.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Resource.java @@ -18,7 +18,7 @@ */ package org.jclouds.vcloud.director.v1_5.domain; -import static com.google.common.base.Preconditions.checkNotNull; +import static com.google.common.base.Preconditions.*; import java.net.URI; import java.util.Set; diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ResourceType.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ResourceType.java index 15df502eb9..67c6a47dcc 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ResourceType.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ResourceType.java @@ -20,7 +20,7 @@ package org.jclouds.vcloud.director.v1_5.domain; import static com.google.common.base.Objects.*; import static com.google.common.base.Preconditions.*; -import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.*; +import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.*; import java.net.URI; import java.util.Set; @@ -31,7 +31,9 @@ import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import com.google.common.base.Objects; +import com.google.common.base.Splitter; import com.google.common.base.Objects.ToStringHelper; +import com.google.common.collect.Iterables; import com.google.common.collect.Sets; /** @@ -46,7 +48,7 @@ import com.google.common.collect.Sets; * @author Adrian Cole */ @XmlAccessorType(XmlAccessType.FIELD) -public class ResourceType> { +public class ResourceType> implements URISupplier { public static > Builder builder() { return new Builder(); @@ -110,7 +112,7 @@ public class ResourceType> { private URI href; @XmlAttribute private String type; - @XmlElement(namespace = NS, name = "Link") + @XmlElement(namespace = XMLNS, name = "Link") private Set links = Sets.newLinkedHashSet(); protected ResourceType(URI href) { @@ -138,6 +140,23 @@ public class ResourceType> { return href; } + /** + * @see URISupplier#getURI() + */ + @Override + public URI getURI() { + return getHref(); + } + + /** + * Returns the unique UUID string for this resource. + * + * @see ReferenceType#getUuid() + */ + public String getUuid() { + return Iterables.getLast(Splitter.on("/").split(href.getPath())); + } + /** * Contains the type of the the entity. * @@ -169,13 +188,6 @@ public class ResourceType> { this.links.add(checkNotNull(link, "link")); } - /** - * @see #getHref() - */ - public URI getURI() { - return getHref(); - } - @Override public boolean equals(Object o) { if (this == o) diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Session.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Session.java index 8778581e99..42dc3ef44f 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Session.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Session.java @@ -20,7 +20,7 @@ package org.jclouds.vcloud.director.v1_5.domain; import static com.google.common.base.Objects.*; import static com.google.common.base.Preconditions.*; -import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.*; +import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.*; import java.net.URI; import java.util.Set; @@ -42,7 +42,7 @@ import com.google.common.collect.Sets; * * @author Adrian Cole */ -@XmlRootElement(namespace = NS, name = "Session") +@XmlRootElement(namespace = XMLNS, name = "Session") @XmlAccessorType(XmlAccessType.FIELD) public class Session { @@ -120,7 +120,7 @@ public class Session { this.links = ImmutableSet.copyOf(links); } - @XmlElement(namespace = NS, name = "Link") + @XmlElement(namespace = XMLNS, name = "Link") private Set links = Sets.newLinkedHashSet(); @XmlAttribute private String user; diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/SessionWithToken.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/SessionWithToken.java index a9575e50ca..aaaf682c6f 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/SessionWithToken.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/SessionWithToken.java @@ -43,7 +43,7 @@ public class SessionWithToken { protected String token; /** - * @see SessionWithToken#getType + * @see SessionWithToken#getSession() */ public Builder session(Session session) { this.session = session; @@ -51,7 +51,7 @@ public class SessionWithToken { } /** - * @see SessionWithToken#getHref + * @see SessionWithToken#getToken() */ public Builder token(String token) { this.token = token; diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Task.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Task.java index 9c880ce9aa..5b4bee8ed8 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Task.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Task.java @@ -7,20 +7,20 @@ * "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 + * http://www.apache.org/licenses/LICEXMLNSE-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 + * "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 static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.NS; +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.Date; @@ -43,7 +43,7 @@ import com.google.common.collect.Sets; * * @author grkvlt@apache.org */ -@XmlRootElement(namespace = NS, name = "Task") +@XmlRootElement(namespace = XMLNS, name = "Task") public class Task extends EntityType { @SuppressWarnings("unchecked") @@ -282,17 +282,17 @@ public class Task extends EntityType { super(href, name); } - @XmlElement(namespace = NS, name = "Error") + @XmlElement(namespace = XMLNS, name = "Error") private Error error; - @XmlElement(namespace = NS, name = "Organization") + @XmlElement(namespace = XMLNS, name = "Organization") private Reference org; - @XmlElement(namespace = NS, name = "Progress") + @XmlElement(namespace = XMLNS, name = "Progress") private Integer progress; - @XmlElement(namespace = NS, name = "Owner") + @XmlElement(namespace = XMLNS, name = "Owner") private Reference owner; - @XmlElement(namespace = NS, name = "User") + @XmlElement(namespace = XMLNS, name = "User") private Reference user; - @XmlElement(namespace = NS, name = "Params") + @XmlElement(namespace = XMLNS, name = "Params") private Object params; @XmlAttribute private String status; diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/TasksInProgress.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/TasksInProgress.java index d220381781..6d21e17952 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/TasksInProgress.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/TasksInProgress.java @@ -7,11 +7,11 @@ * "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 + * http://www.apache.org/licenses/LICEXMLNSE-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 + * "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. @@ -20,7 +20,7 @@ package org.jclouds.vcloud.director.v1_5.domain; import static com.google.common.base.Objects.*; import static com.google.common.base.Preconditions.*; -import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.*; +import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.*; import java.util.Collection; import java.util.Set; @@ -37,7 +37,7 @@ import com.google.common.collect.Sets; /** * @author grkvlt@apache.org */ -@XmlRootElement(namespace = NS, name = "TasksInProgress") +@XmlRootElement(namespace = XMLNS, name = "TasksInProgress") @XmlAccessorType(XmlAccessType.FIELD) public class TasksInProgress { @@ -86,7 +86,7 @@ public class TasksInProgress { this.tasks = ImmutableSet.copyOf(tasks); } - @XmlElement(namespace = NS, name = "Task") + @XmlElement(namespace = XMLNS, name = "Task") private Set tasks = Sets.newLinkedHashSet(); public Set getTasks() { diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/TasksList.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/TasksList.java index c9e13f17df..a34ca958bc 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/TasksList.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/TasksList.java @@ -20,7 +20,7 @@ package org.jclouds.vcloud.director.v1_5.domain; import static com.google.common.base.Objects.*; import static com.google.common.base.Preconditions.*; -import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.*; +import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.*; import java.net.URI; import java.util.Set; @@ -38,7 +38,7 @@ import com.google.common.collect.Sets; * * @author Adrian Cole */ -@XmlRootElement(namespace = NS, name = "TasksList") +@XmlRootElement(namespace = XMLNS, name = "TasksList") public class TasksList extends EntityType { @SuppressWarnings("unchecked") @@ -173,7 +173,7 @@ public class TasksList extends EntityType { this.tasks = ImmutableSet.copyOf(tasks); } - @XmlElement(namespace = NS, name = "Task") + @XmlElement(namespace = XMLNS, name = "Task") private Set tasks = Sets.newLinkedHashSet(); public Set getTasks() {