From d3f741c132bd800ec9a8fdd2bdb384dc4d9e1c7a Mon Sep 17 00:00:00 2001 From: danikov Date: Tue, 6 Mar 2012 14:02:51 +0000 Subject: [PATCH] implement updateCatalog in clients --- .../features/AdminCatalogAsyncClient.java | 19 +++++++++++++++++-- .../v1_5/features/AdminCatalogClient.java | 12 ++++++++++++ 2 files changed, 29 insertions(+), 2 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 b212d8c74a..d52f34f6ab 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 @@ -22,11 +22,16 @@ import java.net.URI; import javax.ws.rs.Consumes; import javax.ws.rs.GET; +import javax.ws.rs.PUT; +import javax.ws.rs.Produces; +import org.jclouds.rest.annotations.BinderParam; import org.jclouds.rest.annotations.EndpointParam; import org.jclouds.rest.annotations.ExceptionParser; import org.jclouds.rest.annotations.JAXBResponseParser; import org.jclouds.rest.annotations.RequestFilters; +import org.jclouds.rest.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.filters.AddVCloudAuthorizationToRequest; import org.jclouds.vcloud.director.v1_5.functions.ThrowVCloudErrorOn4xx; @@ -41,7 +46,7 @@ import com.google.common.util.concurrent.ListenableFuture; public interface AdminCatalogAsyncClient { /** - * Retrieves an admin catalog. + * @see AdminClient#getCatalog(URI) */ @GET @Consumes @@ -49,7 +54,17 @@ public interface AdminCatalogAsyncClient { @ExceptionParser(ThrowVCloudErrorOn4xx.class) ListenableFuture getCatalog(@EndpointParam URI catalogRef); -// PUT /admin/catalog/{id} + /** + * @see AdminClient#getCatalog(URI) + */ + @PUT + @Consumes(VCloudDirectorMediaType.ADMIN_CATALOG) + @Produces(VCloudDirectorMediaType.ADMIN_CATALOG) + @JAXBResponseParser + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture updateCatalog(@EndpointParam URI catalogRef, + @BinderParam(BindToXMLPayload.class) AdminCatalog catalog); + // DELETE /admin/catalog/{id} // POST /admin/catalog/{id}/action/publish // GET /admin/catalog/{id}/owner 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 cc84b2200a..872c9978b6 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 @@ -44,4 +44,16 @@ public interface AdminCatalogClient { * @return a catalog */ AdminCatalog getCatalog(URI catalogRef); + + /** + * Modifies a catalog. A catalog could be published or unpublished. The IsPublished property is treated as a + * read only value by the server. In order to control publishing settings use the 'publish' action must be used. + * + *
+    * PUT /admin/catalog/{id}
+    * 
+ * + * @return the updated catalog + */ + AdminCatalog updateCatalog(URI catalogRef, AdminCatalog catalog); }