From 5bb34f4599b8f76f82cfa2dd4f9c482101492183 Mon Sep 17 00:00:00 2001 From: Andrew Donald Kennedy Date: Thu, 15 Mar 2012 17:06:42 +0000 Subject: [PATCH] Refactor clients to be more consistent --- .../director/v1_5/domain/CustomizationSection.java | 2 +- .../director/v1_5/features/AdminOrgClient.java | 1 + .../director/v1_5/features/AdminVdcAsyncClient.java | 1 + .../director/v1_5/features/AdminVdcClient.java | 1 + .../director/v1_5/features/QueryAsyncClient.java | 12 ++++++------ .../vcloud/director/v1_5/features/QueryClient.java | 12 ++++++------ .../director/v1_5/features/VAppAsyncClient.java | 2 +- .../vcloud/director/v1_5/features/VAppClient.java | 2 +- 8 files changed, 18 insertions(+), 15 deletions(-) diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/CustomizationSection.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/CustomizationSection.java index 7982c4c05a..c57961bea0 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/CustomizationSection.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/CustomizationSection.java @@ -135,7 +135,7 @@ public class CustomizationSection extends SectionType { // For JAXB } - @XmlElement(name = "CustomizeOnInstantiate") + @XmlElement(name = "CustomizeOnInstantiate", required = true) protected boolean customizeOnInstantiate; @XmlElement(name = "Link") protected Set links = Sets.newLinkedHashSet(); 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 471572b512..9fec488165 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 @@ -53,6 +53,7 @@ public interface AdminOrgClient extends OrgClient { * @param orgRef the reference for the admin org * @return the admin org */ + @Override AdminOrg getOrg(URI orgRef); /** 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 c2b70be3e7..1131a083d6 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 @@ -47,5 +47,6 @@ public interface AdminVdcAsyncClient extends VdcAsyncClient { @Consumes @JAXBResponseParser @ExceptionParser(ThrowVCloudErrorOn4xx.class) + @Override ListenableFuture getVdc(@EndpointParam URI vdcRef); } 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 e0e4ea75a3..1254b2fcd6 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 @@ -44,5 +44,6 @@ public interface AdminVdcClient extends VdcClient { * * @return the admin vDC or null if not found */ + @Override AdminVdc getVdc(URI vdcRef); } diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/QueryAsyncClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/QueryAsyncClient.java index cebd6eac94..b9f25392b8 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/QueryAsyncClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/QueryAsyncClient.java @@ -60,21 +60,21 @@ public interface QueryAsyncClient { @Consumes @JAXBResponseParser @ExceptionParser(ThrowVCloudErrorOn4xx.class) - ListenableFuture queryAll(@QueryParam("type") String type); + ListenableFuture> queryAll(@QueryParam("type") String type); @GET @Path("/query") @Consumes @JAXBResponseParser @ExceptionParser(ThrowVCloudErrorOn4xx.class) - ListenableFuture query(@QueryParam("type") String type, @QueryParam("filter") String filter); + ListenableFuture> query(@QueryParam("type") String type, @QueryParam("filter") String filter); @GET @Path("/query") @Consumes @JAXBResponseParser @ExceptionParser(ThrowVCloudErrorOn4xx.class) - ListenableFuture query(@QueryParam("page") Integer page, @QueryParam("pageSize") Integer pageSize, + ListenableFuture> query(@QueryParam("page") Integer page, @QueryParam("pageSize") Integer pageSize, @QueryParam("format") String format, @QueryParam("type") String type, @QueryParam("filter") String filter); /** @@ -85,21 +85,21 @@ public interface QueryAsyncClient { @Consumes @JAXBResponseParser @ExceptionParser(ThrowVCloudErrorOn4xx.class) - ListenableFuture catalogsQueryAll(); + ListenableFuture> catalogsQueryAll(); @GET @Path("/catalogs/query") @Consumes @JAXBResponseParser @ExceptionParser(ThrowVCloudErrorOn4xx.class) - ListenableFuture catalogsQuery(@QueryParam("filter") String filter); + ListenableFuture> catalogsQuery(@QueryParam("filter") String filter); @GET @Path("/catalogs/query") @Consumes @JAXBResponseParser @ExceptionParser(ThrowVCloudErrorOn4xx.class) - ListenableFuture catalogsQuery(@QueryParam("page") Integer page, @QueryParam("pageSize") Integer pageSize, + ListenableFuture> catalogsQuery(@QueryParam("page") Integer page, @QueryParam("pageSize") Integer pageSize, @QueryParam("filter") String filter); @GET 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 9df4ffa54a..a48d361b9d 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 @@ -43,11 +43,11 @@ public interface QueryClient { */ QueryList queryList(); - QueryResultRecords queryAll(String type); + QueryResultRecords queryAll(String type); - QueryResultRecords query(String type, String filter); + QueryResultRecords query(String type, String filter); - QueryResultRecords query(Integer page, Integer pageSize, String format, 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. @@ -60,11 +60,11 @@ public interface QueryClient { * GET /catalogs/query * */ - QueryResultRecords catalogsQueryAll(); + QueryResultRecords catalogsQueryAll(); - QueryResultRecords catalogsQuery(String filter); + QueryResultRecords catalogsQuery(String filter); - QueryResultRecords catalogsQuery(Integer page, Integer pageSize, String filter); + QueryResultRecords catalogsQuery(Integer page, Integer pageSize, String filter); CatalogReferences catalogReferencesQueryAll(); diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VAppAsyncClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VAppAsyncClient.java index 9c108a739f..e6df71aa84 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VAppAsyncClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VAppAsyncClient.java @@ -361,7 +361,7 @@ public interface VAppAsyncClient { @BinderParam(BindToXMLPayload.class) MediaInsertOrEjectParams mediaParams); /** - * @return asynchronous access to {@link Writable} features + * @return asynchronous access to {@link Metadata} features */ @Delegate MetadataAsyncClient.Writable getMetadataClient(); diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VAppClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VAppClient.java index bac7eaa5d3..c1e5be9ca6 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VAppClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VAppClient.java @@ -434,7 +434,7 @@ public interface VAppClient { Task insertMedia(URI vAppURI, MediaInsertOrEjectParams mediaParams); /** - * @return synchronous access to {@link Metadata.Writeable} features + * @return synchronous access to {@link Metadata} features */ @Delegate MetadataClient.Writeable getMetadataClient();