From 680a202b203f9094b864c08d003d7954ac9b0e60 Mon Sep 17 00:00:00 2001 From: Andrew Donald Kennedy Date: Tue, 27 Mar 2012 13:20:55 +0100 Subject: [PATCH] Issue 830: Tidy up client imports and javadoc --- .../features/AdminCatalogAsyncClient.java | 1 - .../v1_5/features/AdminCatalogClient.java | 4 - .../v1_5/features/AdminOrgAsyncClient.java | 3 +- .../v1_5/features/AdminOrgClient.java | 3 +- .../v1_5/features/AdminVdcAsyncClient.java | 4 +- .../v1_5/features/AdminVdcClient.java | 7 +- .../v1_5/features/CatalogAsyncClient.java | 1 - .../director/v1_5/features/CatalogClient.java | 2 - .../v1_5/features/MediaAsyncClient.java | 1 - .../director/v1_5/features/MediaClient.java | 5 +- .../v1_5/features/MetadataAsyncClient.java | 6 +- .../v1_5/features/MetadataClient.java | 8 +- .../v1_5/features/NetworkAsyncClient.java | 2 - .../director/v1_5/features/NetworkClient.java | 5 +- .../director/v1_5/features/OrgClient.java | 3 +- .../director/v1_5/features/QueryClient.java | 2 +- .../v1_5/features/UploadAsyncClient.java | 2 +- .../director/v1_5/features/UploadClient.java | 3 +- .../v1_5/features/UserAsyncClient.java | 3 +- .../director/v1_5/features/UserClient.java | 2 +- .../features/VAppTemplateAsyncClient.java | 59 ------------- .../v1_5/features/VAppTemplateClient.java | 40 +++++---- .../v1_5/features/VdcAsyncClient.java | 1 - .../director/v1_5/features/VdcClient.java | 84 ++++++++++++------- .../AdminCatalogClientExpectTest.java | 14 +--- 25 files changed, 99 insertions(+), 166 deletions(-) diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminCatalogAsyncClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminCatalogAsyncClient.java index 71e7572a8b..27f84b6090 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminCatalogAsyncClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminCatalogAsyncClient.java @@ -37,7 +37,6 @@ import org.jclouds.rest.annotations.RequestFilters; import org.jclouds.rest.binders.BindToXMLPayload; import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType; import org.jclouds.vcloud.director.v1_5.domain.AdminCatalog; -import org.jclouds.vcloud.director.v1_5.domain.Metadata; import org.jclouds.vcloud.director.v1_5.domain.Owner; import org.jclouds.vcloud.director.v1_5.domain.PublishCatalogParams; import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest; diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminCatalogClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminCatalogClient.java index 6ffa9cde0e..f3e13d4f13 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminCatalogClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminCatalogClient.java @@ -22,13 +22,10 @@ import java.net.URI; import java.util.concurrent.TimeUnit; import org.jclouds.concurrent.Timeout; -import org.jclouds.rest.annotations.RequestFilters; import org.jclouds.rest.annotations.Delegate; import org.jclouds.vcloud.director.v1_5.domain.AdminCatalog; -import org.jclouds.vcloud.director.v1_5.domain.Metadata; import org.jclouds.vcloud.director.v1_5.domain.Owner; import org.jclouds.vcloud.director.v1_5.domain.PublishCatalogParams; -import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest; /** * Provides synchronous access to {@link AdminCatalog} objects. @@ -36,7 +33,6 @@ import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest; * @see AdminCatalogAsyncClient * @author danikov */ -@RequestFilters(AddVCloudAuthorizationToRequest.class) @Timeout(duration = 180, timeUnit = TimeUnit.SECONDS) public interface AdminCatalogClient extends CatalogClient { diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminOrgAsyncClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminOrgAsyncClient.java index f5da05318b..b31dfd9fe2 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminOrgAsyncClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminOrgAsyncClient.java @@ -48,7 +48,7 @@ import org.jclouds.vcloud.director.v1_5.functions.ThrowVCloudErrorOn4xx; import com.google.common.util.concurrent.ListenableFuture; /** - * @see GroupClient + * @see AdminOrgClient * @author danikov */ @RequestFilters(AddVCloudAuthorizationToRequest.class) @@ -57,6 +57,7 @@ public interface AdminOrgAsyncClient extends OrgAsyncClient { /** * @see AdminOrgClient#getOrg(URI) */ + @Override @GET @Consumes @JAXBResponseParser diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminOrgClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminOrgClient.java index 1c300fe022..8c64647aae 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminOrgClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminOrgClient.java @@ -24,7 +24,6 @@ import java.util.concurrent.TimeUnit; import org.jclouds.concurrent.Timeout; import org.jclouds.rest.annotations.Delegate; import org.jclouds.vcloud.director.v1_5.domain.AdminOrg; -import org.jclouds.vcloud.director.v1_5.domain.Group; import org.jclouds.vcloud.director.v1_5.domain.OrgEmailSettings; import org.jclouds.vcloud.director.v1_5.domain.OrgGeneralSettings; import org.jclouds.vcloud.director.v1_5.domain.OrgLdapSettings; @@ -34,7 +33,7 @@ import org.jclouds.vcloud.director.v1_5.domain.OrgSettings; import org.jclouds.vcloud.director.v1_5.domain.OrgVAppTemplateLeaseSettings; /** - * Provides synchronous access to {@link Group} objects. + * Provides synchronous access to {@link Org} objects. * * @see GroupAsyncClient * @author danikov diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminVdcAsyncClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminVdcAsyncClient.java index 4f2126f936..c22adc0ac5 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminVdcAsyncClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminVdcAsyncClient.java @@ -36,7 +36,6 @@ import org.jclouds.rest.annotations.RequestFilters; import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType; import org.jclouds.vcloud.director.v1_5.domain.AdminVdc; import org.jclouds.vcloud.director.v1_5.domain.Task; -import org.jclouds.vcloud.director.v1_5.features.MetadataAsyncClient.Writeable; import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest; import org.jclouds.vcloud.director.v1_5.functions.ThrowVCloudErrorOn4xx; @@ -48,8 +47,6 @@ import com.google.common.util.concurrent.ListenableFuture; */ @RequestFilters(AddVCloudAuthorizationToRequest.class) public interface AdminVdcAsyncClient extends VdcAsyncClient { - - // TODO Should we use MetadataClient? @GET @Consumes @@ -88,6 +85,7 @@ public interface AdminVdcAsyncClient extends VdcAsyncClient { /** * @return asynchronous access to {@link Writeable} features */ + @Override @Delegate MetadataAsyncClient.Writeable getMetadataClient(); } diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminVdcClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminVdcClient.java index 0959d89bd2..bc291c6fbd 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminVdcClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/AdminVdcClient.java @@ -26,14 +26,11 @@ import org.jclouds.rest.annotations.Delegate; import org.jclouds.rest.annotations.EndpointParam; import org.jclouds.vcloud.director.v1_5.domain.AdminVdc; import org.jclouds.vcloud.director.v1_5.domain.Task; -import org.jclouds.vcloud.director.v1_5.features.MetadataAsyncClient.Writeable; /** - * Provides synchronous access to Network. - *

+ * Provides synchronous access to {@link AdminVdc}. * - * @see NetworkAsyncClient - * @see + * @see AdminVdcAsyncClient * @author danikov */ @Timeout(duration = 180, timeUnit = TimeUnit.SECONDS) diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/CatalogAsyncClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/CatalogAsyncClient.java index 4d9353c5fa..e4f456ef11 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/CatalogAsyncClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/CatalogAsyncClient.java @@ -38,7 +38,6 @@ import org.jclouds.rest.binders.BindToXMLPayload; import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType; import org.jclouds.vcloud.director.v1_5.domain.CatalogItem; import org.jclouds.vcloud.director.v1_5.domain.CatalogType; -import org.jclouds.vcloud.director.v1_5.domain.Metadata; import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest; import org.jclouds.vcloud.director.v1_5.functions.ThrowVCloudErrorOn4xx; diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/CatalogClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/CatalogClient.java index d62832ec9d..d5e4e53aad 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/CatalogClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/CatalogClient.java @@ -23,10 +23,8 @@ import java.util.concurrent.TimeUnit; import org.jclouds.concurrent.Timeout; import org.jclouds.rest.annotations.Delegate; -import org.jclouds.vcloud.director.v1_5.domain.Catalog; import org.jclouds.vcloud.director.v1_5.domain.CatalogItem; import org.jclouds.vcloud.director.v1_5.domain.CatalogType; -import org.jclouds.vcloud.director.v1_5.domain.Metadata; /** * Provides synchronous access to {@link Catalog} objects. diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/MediaAsyncClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/MediaAsyncClient.java index adf8306799..f335b2f9c5 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/MediaAsyncClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/MediaAsyncClient.java @@ -38,7 +38,6 @@ import org.jclouds.rest.binders.BindToXMLPayload; import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType; import org.jclouds.vcloud.director.v1_5.domain.CloneMediaParams; import org.jclouds.vcloud.director.v1_5.domain.Media; -import org.jclouds.vcloud.director.v1_5.domain.Metadata; import org.jclouds.vcloud.director.v1_5.domain.Owner; import org.jclouds.vcloud.director.v1_5.domain.Task; import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest; diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/MediaClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/MediaClient.java index b5445757f3..6180e9f33e 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/MediaClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/MediaClient.java @@ -25,16 +25,13 @@ import org.jclouds.concurrent.Timeout; import org.jclouds.rest.annotations.Delegate; import org.jclouds.vcloud.director.v1_5.domain.CloneMediaParams; import org.jclouds.vcloud.director.v1_5.domain.Media; -import org.jclouds.vcloud.director.v1_5.domain.Metadata; import org.jclouds.vcloud.director.v1_5.domain.Owner; import org.jclouds.vcloud.director.v1_5.domain.Task; /** - * Provides synchronous access to Media. - *

+ * Provides synchronous access to {@link Media}. * * @see MediaAsyncClient - * @see * @author danikov */ @Timeout(duration = 180, timeUnit = TimeUnit.SECONDS) diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/MetadataAsyncClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/MetadataAsyncClient.java index f523df49ab..d6bcc422b0 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/MetadataAsyncClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/MetadataAsyncClient.java @@ -45,13 +45,14 @@ import org.jclouds.vcloud.director.v1_5.functions.ThrowVCloudErrorOn4xx; import com.google.common.util.concurrent.ListenableFuture; /** - - * @see NetworkClient + * @see MetadataClient * @author danikov */ public interface MetadataAsyncClient { + @RequestFilters(AddVCloudAuthorizationToRequest.class) public static interface Readable extends MetadataAsyncClient { + /** * @see MetadataClient.Readable#getMetadata(URISupplier) */ @@ -75,6 +76,7 @@ public interface MetadataAsyncClient { @RequestFilters(AddVCloudAuthorizationToRequest.class) public static interface Writeable extends Readable { + /** * @see MetadataClient.Writable#mergeMetadata(URI, Metadata)) */ diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/MetadataClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/MetadataClient.java index 3c6688db8c..71f3b45fda 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/MetadataClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/MetadataClient.java @@ -27,19 +27,16 @@ import org.jclouds.vcloud.director.v1_5.domain.MetadataValue; import org.jclouds.vcloud.director.v1_5.domain.Task; /** - * Provides synchronous access to Upload. - *

+ * Provides synchronous access to {@linkl Metadata}. * * @see MetadataAsyncClient - * @see * @author danikov */ public interface MetadataClient { - // FIXME Correct spelling of Writeable -> Writable - @Timeout(duration = 180, timeUnit = TimeUnit.SECONDS) public static interface Readable extends MetadataClient { + /** * Retrieves an list of metadata * @@ -57,6 +54,7 @@ public interface MetadataClient { @Timeout(duration = 180, timeUnit = TimeUnit.SECONDS) public static interface Writeable extends Readable { + /** * Merges the metadata for a media with the information provided. * diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/NetworkAsyncClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/NetworkAsyncClient.java index 2ad64d8ee7..5615ac6818 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/NetworkAsyncClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/NetworkAsyncClient.java @@ -28,7 +28,6 @@ import org.jclouds.rest.annotations.EndpointParam; import org.jclouds.rest.annotations.ExceptionParser; import org.jclouds.rest.annotations.JAXBResponseParser; import org.jclouds.rest.annotations.RequestFilters; -import org.jclouds.vcloud.director.v1_5.domain.Metadata; import org.jclouds.vcloud.director.v1_5.domain.Network; import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest; import org.jclouds.vcloud.director.v1_5.functions.ThrowVCloudErrorOn4xx; @@ -36,7 +35,6 @@ import org.jclouds.vcloud.director.v1_5.functions.ThrowVCloudErrorOn4xx; import com.google.common.util.concurrent.ListenableFuture; /** - * @see NetworkClient * @author danikov */ diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/NetworkClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/NetworkClient.java index d1570f2470..95131d43d9 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/NetworkClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/NetworkClient.java @@ -23,15 +23,12 @@ import java.util.concurrent.TimeUnit; import org.jclouds.concurrent.Timeout; import org.jclouds.rest.annotations.Delegate; -import org.jclouds.vcloud.director.v1_5.domain.Metadata; import org.jclouds.vcloud.director.v1_5.domain.Network; /** - * Provides synchronous access to Network. - *

+ * Provides synchronous access to {@link Network}. * * @see NetworkAsyncClient - * @see * @author danikov */ @Timeout(duration = 180, timeUnit = TimeUnit.SECONDS) diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/OrgClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/OrgClient.java index 4e937948f9..b2d226cd71 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/OrgClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/OrgClient.java @@ -28,8 +28,7 @@ import org.jclouds.vcloud.director.v1_5.domain.Org; import org.jclouds.vcloud.director.v1_5.domain.OrgList; /** - * Provides synchronous access to Org. - *

+ * Provides synchronous access to {@link Org}. * * @see OrgAsyncClient * @author Adrian Cole diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/QueryClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/QueryClient.java index f4a6097ece..106ebf6100 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/QueryClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/QueryClient.java @@ -28,7 +28,7 @@ import org.jclouds.vcloud.director.v1_5.domain.query.QueryResultRecords; import org.jclouds.vcloud.director.v1_5.domain.query.VAppReferences; /** - * Provides synchronous access to The REST API query interface. + * Provides synchronous access to the REST API query interface. * * @see QueryAsyncClient * @author grkvlt@apache.org diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/UploadAsyncClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/UploadAsyncClient.java index fecd69710e..28f0cc9dd0 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/UploadAsyncClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/UploadAsyncClient.java @@ -30,12 +30,12 @@ import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest; import com.google.common.util.concurrent.ListenableFuture; /** - * * @see UploadClient * @author danikov */ @RequestFilters(AddVCloudAuthorizationToRequest.class) public interface UploadAsyncClient { + /** * @see UploadClient#put */ diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/UploadClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/UploadClient.java index 4311cda021..4ce8fb4285 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/UploadClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/UploadClient.java @@ -25,8 +25,7 @@ import org.jclouds.concurrent.Timeout; import org.jclouds.io.Payload; /** - * Provides synchronous access to Upload. - *

+ * Provides synchronous access to upload. * * @see UploadAsyncClient * @author danikov diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/UserAsyncClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/UserAsyncClient.java index 82c41560b3..426109f69a 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/UserAsyncClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/UserAsyncClient.java @@ -42,11 +42,12 @@ import org.jclouds.vcloud.director.v1_5.functions.ThrowVCloudErrorOn4xx; import com.google.common.util.concurrent.ListenableFuture; /** - * @see GroupClient + * @see UserClient * @author danikov */ @RequestFilters(AddVCloudAuthorizationToRequest.class) public interface UserAsyncClient { + /** * @see UserClient#createUser(URI, User) */ diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/UserClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/UserClient.java index 350e03af21..0c2392a165 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/UserClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/UserClient.java @@ -22,7 +22,6 @@ import java.net.URI; import java.util.concurrent.TimeUnit; import org.jclouds.concurrent.Timeout; -import org.jclouds.vcloud.director.v1_5.domain.Group; import org.jclouds.vcloud.director.v1_5.domain.User; /** @@ -33,6 +32,7 @@ import org.jclouds.vcloud.director.v1_5.domain.User; */ @Timeout(duration = 180, timeUnit = TimeUnit.SECONDS) public interface UserClient { + /** * Creates or imports a user in an organization. The user could be enabled or disabled. * diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VAppTemplateAsyncClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VAppTemplateAsyncClient.java index d2c400c474..1874c2686a 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VAppTemplateAsyncClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VAppTemplateAsyncClient.java @@ -21,8 +21,6 @@ package org.jclouds.vcloud.director.v1_5.features; import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.CUSTOMIZATION_SECTION; import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.GUEST_CUSTOMIZATION_SECTION; import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.LEASE_SETTINGS_SECTION; -import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.METADATA; -import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.METADATA_ENTRY; import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.NETWORK_CONFIG_SECTION; import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.NETWORK_CONNECTION_SECTION; import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.NETWORK_SECTION; @@ -40,7 +38,6 @@ import javax.ws.rs.GET; import javax.ws.rs.POST; import javax.ws.rs.PUT; import javax.ws.rs.Path; -import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import org.jclouds.rest.annotations.BinderParam; @@ -53,8 +50,6 @@ import org.jclouds.rest.binders.BindToXMLPayload; import org.jclouds.vcloud.director.v1_5.domain.CustomizationSection; import org.jclouds.vcloud.director.v1_5.domain.GuestCustomizationSection; import org.jclouds.vcloud.director.v1_5.domain.LeaseSettingsSection; -import org.jclouds.vcloud.director.v1_5.domain.Metadata; -import org.jclouds.vcloud.director.v1_5.domain.MetadataValue; import org.jclouds.vcloud.director.v1_5.domain.NetworkConfigSection; import org.jclouds.vcloud.director.v1_5.domain.NetworkConnectionSection; import org.jclouds.vcloud.director.v1_5.domain.Owner; @@ -214,60 +209,6 @@ public interface VAppTemplateAsyncClient { ListenableFuture editVappTemplateLeaseSettingsSection(@EndpointParam URI templateURI, @BinderParam(BindToXMLPayload.class) LeaseSettingsSection settingsSection); - /** - * @see VAppTemplateClient#getVAppTemplateMetadata(URI) - */ - @GET - @Consumes(METADATA) - @Path("/metadata") - @JAXBResponseParser - @ExceptionParser(ThrowVCloudErrorOn4xx.class) - ListenableFuture getVAppTemplateMetadata(@EndpointParam URI templateURI); - - @POST - @Produces(METADATA) - @Consumes(TASK) - @Path("/metadata") - @JAXBResponseParser - @ExceptionParser(ThrowVCloudErrorOn4xx.class) - ListenableFuture editVAppTemplateMetadata(@EndpointParam URI templateURI, - @BinderParam(BindToXMLPayload.class) Metadata metadata); - - /** - * @see VAppTemplateClient#getVAppTemplateMetadataValue(URI, String) - */ - @GET - @Consumes(METADATA_ENTRY) - @Path("/metadata/{key}") - @JAXBResponseParser - @ExceptionParser(ThrowVCloudErrorOn4xx.class) - ListenableFuture getVAppTemplateMetadataValue(@EndpointParam URI templateURI, - @PathParam("key") String key); - - /** - * @see VAppTemplateClient#editVAppTemplateMetadataValue(URI, String, org.jclouds.vcloud.director.v1_5.domain.MetadataValue) - */ - @PUT - @Produces(METADATA_ENTRY) - @Consumes(TASK) - @Path("/metadata/{key}") - @JAXBResponseParser - @ExceptionParser(ThrowVCloudErrorOn4xx.class) - ListenableFuture editVAppTemplateMetadataValue(@EndpointParam URI templateURI, - @PathParam("key") String key, - @BinderParam(BindToXMLPayload.class) MetadataValue value); - - /** - * @see VAppTemplateClient#deleteVAppTemplateMetadataValue(URI, String) - */ - @DELETE - @Consumes(TASK) - @Path("/metadata/{key}") - @JAXBResponseParser - @ExceptionParser(ThrowVCloudErrorOn4xx.class) - ListenableFuture deleteVAppTemplateMetadataValue(@EndpointParam URI templateURI, - @PathParam("key") String key); - /** * @see VAppTemplateClient#getVAppTemplateNetworkConfigSection(URI) */ diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VAppTemplateClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VAppTemplateClient.java index 68bb19dd3d..7e6d72949d 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VAppTemplateClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VAppTemplateClient.java @@ -26,7 +26,6 @@ import org.jclouds.rest.annotations.Delegate; import org.jclouds.vcloud.director.v1_5.domain.CustomizationSection; import org.jclouds.vcloud.director.v1_5.domain.GuestCustomizationSection; import org.jclouds.vcloud.director.v1_5.domain.LeaseSettingsSection; -import org.jclouds.vcloud.director.v1_5.domain.Metadata; import org.jclouds.vcloud.director.v1_5.domain.NetworkConfigSection; import org.jclouds.vcloud.director.v1_5.domain.NetworkConnectionSection; import org.jclouds.vcloud.director.v1_5.domain.Owner; @@ -39,7 +38,7 @@ import org.jclouds.vcloud.director.v1_5.domain.ovf.Envelope; import org.jclouds.vcloud.director.v1_5.domain.ovf.NetworkSection; /** - * Provides synchronous access to {@link org.jclouds.vcloud.director.v1_5.domain.VAppTemplate} objects. + * Provides synchronous access to {@link VAppTemplate} objects. * * @author Adam Lowe * @see org.jclouds.vcloud.director.v1_5.features.VAppTemplateAsyncClient @@ -49,15 +48,24 @@ public interface VAppTemplateClient { /** * Retrieves a vApp template (can be used also to retrieve a VM from a vApp Template). - * The vApp could be in one of these statues: FAILED_CREATION(-1) - Transient entity state, - * e.g., model object is created but the corresponding VC backing does not exist yet. This - * is further sub-categorized in the respective entities. UNRESOLVED(0) - Entity is whole, - * e.g., VM creation is complete and all the required model objects and VC backings are created. - * RESOLVED(1) - Entity is resolved. UNKNOWN(6) - Entity state could not be retrieved from - * the inventory, e.g., VM power state is null. POWERED_OFF(8) - All VMs of the vApp template - * are powered off. MIXED(10) - vApp template status is set to MIXED when the VMs in the - * vApp are in different power states. * + * The vApp could be in one of these statues: + *

*
     * GET /vAppTemplate/{id}
     * 
@@ -236,17 +244,7 @@ public interface VAppTemplateClient { NetworkConfigSection getVAppTemplateNetworkConfigSection(URI templateUri); /** - * Modifies the network config section of a vApp. There are three general types of vApp - * networks which could be configured from this section. They are specified by the element - * value in /. isolated - this is a vApp network which is not connected to any external - * organization network and is used only to connect VMs internally in a vApp. In this - * network you could configure only its element of /. bridged - this is a vApp network - * which is directly connected to an external organization network. In this network you - * should configure only the element of /. In this case the element is inherit from the - * parent network. natRouted - this is a vApp network which is NAT routed to an external - * organization network. In this network you could configure the and also you should - * specify and the element of /. When the network is NAT routed you could specify DHCP, - * firewall rules and NAT rules, for fine-grained configuration of your network. + * Modifies the network config section of a vApp. * *
     * PUT /vAppTemplate/{id}/networkConfigSection
diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VdcAsyncClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VdcAsyncClient.java
index 0fb42dc06b..7883701d11 100644
--- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VdcAsyncClient.java
+++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VdcAsyncClient.java
@@ -41,7 +41,6 @@ import org.jclouds.vcloud.director.v1_5.domain.CloneVAppTemplateParams;
 import org.jclouds.vcloud.director.v1_5.domain.ComposeVAppParams;
 import org.jclouds.vcloud.director.v1_5.domain.InstantiateVAppParamsType;
 import org.jclouds.vcloud.director.v1_5.domain.Media;
-import org.jclouds.vcloud.director.v1_5.domain.Metadata;
 import org.jclouds.vcloud.director.v1_5.domain.UploadVAppTemplateParams;
 import org.jclouds.vcloud.director.v1_5.domain.VApp;
 import org.jclouds.vcloud.director.v1_5.domain.VAppTemplate;
diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VdcClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VdcClient.java
index 1370411731..787e0b06e2 100644
--- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VdcClient.java
+++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VdcClient.java
@@ -54,8 +54,11 @@ public interface VdcClient {
    Vdc getVdc(URI vdcUri);
    
    /**
-    * Captures a vApp into vApp template. 
-    * The status of vApp template will be in UNRESOLVED(0) until the capture task is finished.
+    * Captures a vApp into vApp template.
+    *
+    * The status of vApp template will be in
+    * {@link org.jclouds.vcloud.director.v1_5.domain.ResourceEntityType.Status#UNRESOLVED UNRESOLVED(0)}
+    * until the capture task is finished.
     * 
     * @return a VApp resource which will contain a task. 
     * The user should should wait for this task to finish to be able to use the vApp.
@@ -64,7 +67,9 @@ public interface VdcClient {
    
    /**
     * Clones a media into new one. 
-    * The status of the returned media is UNRESOLVED(0) until the task for cloning finish.
+    * The status of the returned media is
+    * {@link org.jclouds.vcloud.director.v1_5.domain.ResourceEntityType.Status#UNRESOLVED UNRESOLVED(0)}
+    * until the task for cloning finish.
     * 
     * @return a Media resource which will contain a task. 
     * The user should monitor the contained task status in order to check when it is completed.
@@ -80,8 +85,11 @@ public interface VdcClient {
    VApp cloneVApp(URI vdcUri, CloneVAppParams params);
    
    /**
-    * Clones a vApp template into new one. 
-    * The status of vApp template will be in UNRESOLVED(0) until the clone task is finished.
+    * Clones a vApp template into new one.
+    *
+    * The status of vApp template will be in
+    * {@link org.jclouds.vcloud.director.v1_5.domain.ResourceEntityType.Status#UNRESOLVED UNRESOLVED(0)}
+    * until the clone task is finished.
     * 
     * @return a VAppTemplate resource which will contain a task. 
     * The user should should wait for this task to finish to be able to use the VAppTemplate.
@@ -89,23 +97,32 @@ public interface VdcClient {
    VAppTemplate cloneVAppTemplate(URI vdcUri, CloneVAppTemplateParams params);
    
    /**
-    * Composes a new vApp using VMs from other vApps or vApp templates. The vCloud API supports 
-    * composing a vApp from any combination of vApp templates, vApps, or virtual machines. 
-    * When you compose a vApp, all children of each composition source become peers in the 
-    * Children collection of the composed vApp. To compose a vApp, a client makes a compose 
-    * vApp request whose body is a ComposeVAppParams element, includes the following information: 
-    * - An InstantiationParams element that applies to the composed vApp itself and any vApp 
-    * templates referenced in Item elements. - A SourcedItem element for each virtual machine, 
-    * vApp, or vAppTemplate to include in the composition. Each SourcedItem can contain the 
-    * following elements: - A required Source element whose href attribute value is a reference 
-    * to a vApp template, vApp, or VM to include in the composition. If the Source element 
-    * references a VM, the Item must also include an InstantiationParams element specific to 
-    * that VM. - An optional NetworkAssignment element that specifies how the network connections 
-    * of child VM elements are mapped to vApp networks in the parent. - If any of the composition 
-    * items is subject to a EULA, the ComposeVAppParams element must include an AllEULAsAccepted 
-    * element that has a value of true, indicating that you accept the EULA. Otherwise, composition 
-    * fails. The composed vApp must be deployed and powered on before it can be used. The status 
-    * of vApp will be UNRESOLVED(0) until the compose task is finished.
+    * Composes a new vApp using VMs from other vApps or vApp templates.
+    *
+    * The vCloud API supports composing a vApp from any combination of vApp templates, vApps,
+    * or virtual machines. When you compose a vApp, all children of each composition source
+    * become peers in the Children collection of the composed vApp. To compose a vApp, a client
+    * makes a compose vApp request whose body is a ComposeVAppParams element, includes the
+    * following information: 
+    * 
    + *
  • An InstantiationParams element that applies to the composed vApp itself and any vApp + * templates referenced in Item elements. + *
  • A SourcedItem element for each virtual machine, vApp, or vAppTemplate to include in + * the composition. Each SourcedItem can contain the following elements: + *
      + *
    • A required Source element whose href attribute value is a reference + * to a vApp template, vApp, or VM to include in the composition. If the Source element + * references a VM, the Item must also include an InstantiationParams element specific to + * that VM. + *
    • An optional NetworkAssignment element that specifies how the network connections + * of child VM elements are mapped to vApp networks in the parent. + *
    + *
  • If any of the composition items is subject to a EULA, the ComposeVAppParams element + * must include an AllEULAsAccepted element that has a value of true, indicating that you + * accept the EULA. Otherwise, composition fails. The composed vApp must be deployed and + * powered on before it can be used. The status of vApp will be + * {@link org.jclouds.vcloud.director.v1_5.domain.ResourceEntityType.Status#UNRESOLVED UNRESOLVED(0)} + * until the compose task is finished. * * @return a VApp resource which will contain a task. * The user should should wait for this task to finish to be able to use the vApp. @@ -114,7 +131,10 @@ public interface VdcClient { /** * Instantiate a vApp template into a new vApp. - * The status of vApp will be in UNRESOLVED(0) until the instantiate task is finished. + * + * The status of vApp will be in + * {@link org.jclouds.vcloud.director.v1_5.domain.ResourceEntityType.Status#UNRESOLVED UNRESOLVED(0)} + * until the instantiate task is finished. * *
         * POST /vdc/{id}/action/instantiateVAppTemplate
    @@ -126,13 +146,17 @@ public interface VdcClient {
        VApp instantiateVApp(URI vdcUri, InstantiateVAppParamsType params);
        
        /**
    -    * Uploading vApp template to a vDC. The operation is separate on several steps: 
    -    * 1. creating empty vApp template entity 
    -    * 2. uploading an OVF of vApp template 
    -    * 3. uploading disks described from the OVF 
    -    * 4. finishing task for uploading 
    -    * The status of vApp template will be NOT_READY(0) until the ovf and all disks are uploaded 
    -    * to the transfer site. After this a task will run on the vApp template uploading.
    +    * Uploading vApp template to a vDC.
    +    *
    +    * The operation is separate on several steps:
    +    * 
      + *
    1. creating empty vApp template entity + *
    2. uploading an OVF of vApp template + *
    3. uploading disks described from the OVF + *
    4. finishing task for uploading + *
    + * The status of vApp template will be {@link org.jclouds.vcloud.director.v1_5.domain.ResourceEntityType.Status#NOT_READY NOT_READY(0)} + * until the ovf and all disks are uploaded to the transfer site. After this a task will run on the vApp template uploading. * * Note that the empty vApp template's getFiles() returns a file of size -1 after step one above, * because the descriptor.ovf does not yet exist. diff --git a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/AdminCatalogClientExpectTest.java b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/AdminCatalogClientExpectTest.java index 3ce56c12fc..d14f1c6a9c 100644 --- a/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/AdminCatalogClientExpectTest.java +++ b/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/AdminCatalogClientExpectTest.java @@ -46,7 +46,7 @@ public class AdminCatalogClientExpectTest extends BaseVCloudDirectorRestClientEx private Reference orgRef = Reference.builder() .type("application/vnd.vmware.vcloud.catalog+xml") .name("QunyingTestCatalog") - .href(URI.create(endpoint + "/admin/catalog/7212e451-76e1-4631-b2de-ba1dfd8080e4")) + .href(URI.create(endpoint + "/admin/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0")) .build(); private Reference catalogRef = Reference.builder() @@ -59,7 +59,7 @@ public class AdminCatalogClientExpectTest extends BaseVCloudDirectorRestClientEx public void testCreateCatalog() { VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse, new VcloudHttpRequestPrimer() - .apiCommand("POST", "/admin/org/???/catalogs") + .apiCommand("POST", "/admin/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0/catalogs") .xmlFilePayload("/catalog/admin/createCatalogSource.xml", VCloudDirectorMediaType.ADMIN_CATALOG) .acceptMedia(VCloudDirectorMediaType.ADMIN_CATALOG) .httpRequestBuilder().build(), @@ -70,16 +70,10 @@ public class AdminCatalogClientExpectTest extends BaseVCloudDirectorRestClientEx AdminCatalog source = createCatalogSource(); AdminCatalog expected = createCatalog(); - assertEquals(client.getAdminCatalogClient().createCatalog(catalogRef.getHref(), source), expected); + assertEquals(client.getAdminCatalogClient().createCatalog(orgRef.getHref(), source), expected); } - // FIXME temporarily disabling this test due to JAXB error: - // javax.xml.bind.UnmarshalException: unexpected element (uri:"http://www.vmware.com/vcloud/v1.5", local:"AdminCatalog"). - // Expected elements are <{http://www.vmware.com/vcloud/v1.5}Catalog>,<{http://www.vmware.com/vcloud/v1.5}CatalogItems>, - // <{http://www.vmware.com/vcloud/v1.5}CatalogReference>,<{http://www.vmware.com/vcloud/v1.5}Error>, - // <{http://www.vmware.com/vcloud/v1.5}Link>,<{http://www.vmware.com/vcloud/v1.5}Owner>, - // <{http://www.vmware.com/vcloud/v1.5}Task> - @Test(enabled = false) + @Test public void testGetCatalog() { VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse, new VcloudHttpRequestPrimer()