implemented get/set owner methods on client

This commit is contained in:
danikov 2012-03-06 14:58:24 +00:00
parent 61def9d707
commit d85e8ca587
2 changed files with 45 additions and 2 deletions

View File

@ -23,6 +23,7 @@ import java.net.URI;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import org.jclouds.rest.annotations.BinderParam;
@ -33,6 +34,7 @@ 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.Owner;
import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest;
import org.jclouds.vcloud.director.v1_5.functions.ThrowVCloudErrorOn4xx;
@ -65,8 +67,28 @@ public interface AdminCatalogAsyncClient {
ListenableFuture<AdminCatalog> updateCatalog(@EndpointParam URI catalogRef,
@BinderParam(BindToXMLPayload.class) AdminCatalog catalog);
/**
* @see AdminClient#getOwner(URI)
*/
@GET
@Path("/owner")
@Consumes
@JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Owner> getOwner(@EndpointParam URI catalogRef);
/**
* @see AdminClient#setOwner(URI, Owner)
*/
@PUT
@Path("/owner")
@Consumes
@Produces(VCloudDirectorMediaType.OWNER)
@JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Void> setOwner(@EndpointParam URI catalogRef,
@BinderParam(BindToXMLPayload.class) Owner newOwner);
// DELETE /admin/catalog/{id}
// POST /admin/catalog/{id}/action/publish
// GET /admin/catalog/{id}/owner
// PUT /admin/catalog/{id}/owner
}

View File

@ -23,6 +23,7 @@ import java.util.concurrent.TimeUnit;
import org.jclouds.concurrent.Timeout;
import org.jclouds.vcloud.director.v1_5.domain.AdminCatalog;
import org.jclouds.vcloud.director.v1_5.domain.Owner;
/**
* Provides synchronous access to {@link AdminCatalog} objects.
@ -56,4 +57,24 @@ public interface AdminCatalogClient {
* @return the updated catalog
*/
AdminCatalog updateCatalog(URI catalogRef, AdminCatalog catalog);
/**
* Retrieves the owner of a catalog.
*
* <pre>
* GET /admin/catalog/{id}/owner
* </pre>
*
* @return the owner or null if not found
*/
Owner getOwner(URI catalogRef);
/**
* Changes owner for catalog.
*
* <pre>
* PUT /admin/catalog/{id}/owner
* </pre>
*/
void setOwner(URI catalogRef, Owner newOwner);
}