Issue 830: Update client get methods to use new error handler

This commit is contained in:
Andrew Donald Kennedy 2012-03-29 11:53:40 +01:00
parent 0cb175d9f2
commit 2a60e1aedb
33 changed files with 151 additions and 432 deletions

View File

@ -35,12 +35,12 @@ import org.jclouds.rest.annotations.ExceptionParser;
import org.jclouds.rest.annotations.JAXBResponseParser; import org.jclouds.rest.annotations.JAXBResponseParser;
import org.jclouds.rest.annotations.RequestFilters; import org.jclouds.rest.annotations.RequestFilters;
import org.jclouds.rest.binders.BindToXMLPayload; import org.jclouds.rest.binders.BindToXMLPayload;
import org.jclouds.rest.functions.ReturnNullOnNotFoundOr404;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType; 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.AdminCatalog;
import org.jclouds.vcloud.director.v1_5.domain.Owner; 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.domain.PublishCatalogParams;
import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest; import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest;
import org.jclouds.vcloud.director.v1_5.functions.ThrowVCloudErrorOn4xx;
import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.ListenableFuture;
@ -59,18 +59,17 @@ public interface AdminCatalogAsyncClient extends CatalogAsyncClient {
@Consumes(VCloudDirectorMediaType.ADMIN_CATALOG) @Consumes(VCloudDirectorMediaType.ADMIN_CATALOG)
@Produces(VCloudDirectorMediaType.ADMIN_CATALOG) @Produces(VCloudDirectorMediaType.ADMIN_CATALOG)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<AdminCatalog> createCatalog(@EndpointParam URI orgRef, ListenableFuture<AdminCatalog> createCatalog(@EndpointParam URI orgRef,
@BinderParam(BindToXMLPayload.class) AdminCatalog catalog); @BinderParam(BindToXMLPayload.class) AdminCatalog catalog);
/** /**
* @see AdminClient#getCatalog(URI) * @see AdminClient#getCatalog(URI)
*/ */
@Override
@GET @GET
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
@Override
ListenableFuture<AdminCatalog> getCatalog(@EndpointParam URI catalogRef); ListenableFuture<AdminCatalog> getCatalog(@EndpointParam URI catalogRef);
/** /**
@ -80,7 +79,6 @@ public interface AdminCatalogAsyncClient extends CatalogAsyncClient {
@Consumes(VCloudDirectorMediaType.ADMIN_CATALOG) @Consumes(VCloudDirectorMediaType.ADMIN_CATALOG)
@Produces(VCloudDirectorMediaType.ADMIN_CATALOG) @Produces(VCloudDirectorMediaType.ADMIN_CATALOG)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<AdminCatalog> updateCatalog(@EndpointParam URI catalogRef, ListenableFuture<AdminCatalog> updateCatalog(@EndpointParam URI catalogRef,
@BinderParam(BindToXMLPayload.class) AdminCatalog catalog); @BinderParam(BindToXMLPayload.class) AdminCatalog catalog);
@ -90,7 +88,6 @@ public interface AdminCatalogAsyncClient extends CatalogAsyncClient {
@DELETE @DELETE
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Void> deleteCatalog(@EndpointParam URI catalogRef); ListenableFuture<Void> deleteCatalog(@EndpointParam URI catalogRef);
/** /**
@ -100,7 +97,7 @@ public interface AdminCatalogAsyncClient extends CatalogAsyncClient {
@Path("/owner") @Path("/owner")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture<Owner> getOwner(@EndpointParam URI catalogRef); ListenableFuture<Owner> getOwner(@EndpointParam URI catalogRef);
/** /**
@ -111,7 +108,6 @@ public interface AdminCatalogAsyncClient extends CatalogAsyncClient {
@Consumes @Consumes
@Produces(VCloudDirectorMediaType.OWNER) @Produces(VCloudDirectorMediaType.OWNER)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Void> setOwner(@EndpointParam URI catalogRef, ListenableFuture<Void> setOwner(@EndpointParam URI catalogRef,
@BinderParam(BindToXMLPayload.class) Owner newOwner); @BinderParam(BindToXMLPayload.class) Owner newOwner);
@ -123,7 +119,6 @@ public interface AdminCatalogAsyncClient extends CatalogAsyncClient {
@Consumes @Consumes
@Produces(VCloudDirectorMediaType.PUBLISH_CATALOG_PARAMS) @Produces(VCloudDirectorMediaType.PUBLISH_CATALOG_PARAMS)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Void> publishCatalog(@EndpointParam URI catalogRef, ListenableFuture<Void> publishCatalog(@EndpointParam URI catalogRef,
@BinderParam(BindToXMLPayload.class) PublishCatalogParams params); @BinderParam(BindToXMLPayload.class) PublishCatalogParams params);

View File

@ -34,12 +34,12 @@ import org.jclouds.rest.annotations.ExceptionParser;
import org.jclouds.rest.annotations.JAXBResponseParser; import org.jclouds.rest.annotations.JAXBResponseParser;
import org.jclouds.rest.annotations.RequestFilters; import org.jclouds.rest.annotations.RequestFilters;
import org.jclouds.rest.binders.BindToXMLPayload; import org.jclouds.rest.binders.BindToXMLPayload;
import org.jclouds.rest.functions.ReturnNullOnNotFoundOr404;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType; import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
import org.jclouds.vcloud.director.v1_5.domain.ExternalNetwork; import org.jclouds.vcloud.director.v1_5.domain.ExternalNetwork;
import org.jclouds.vcloud.director.v1_5.domain.OrgNetwork; import org.jclouds.vcloud.director.v1_5.domain.OrgNetwork;
import org.jclouds.vcloud.director.v1_5.domain.Task; import org.jclouds.vcloud.director.v1_5.domain.Task;
import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest; import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest;
import org.jclouds.vcloud.director.v1_5.functions.ThrowVCloudErrorOn4xx;
import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.ListenableFuture;
@ -53,11 +53,11 @@ public interface AdminNetworkAsyncClient extends NetworkAsyncClient {
/** /**
* @see AdminNetworkClient#getNetwork(URI) * @see AdminNetworkClient#getNetwork(URI)
*/ */
@Override
@GET @GET
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
@Override
ListenableFuture<ExternalNetwork> getNetwork(@EndpointParam URI networkRef); ListenableFuture<ExternalNetwork> getNetwork(@EndpointParam URI networkRef);
/** /**
@ -67,7 +67,6 @@ public interface AdminNetworkAsyncClient extends NetworkAsyncClient {
@Consumes(VCloudDirectorMediaType.TASK) @Consumes(VCloudDirectorMediaType.TASK)
@Produces(VCloudDirectorMediaType.ADMIN_ORG_NETWORK) @Produces(VCloudDirectorMediaType.ADMIN_ORG_NETWORK)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Task> updateNetwork(@EndpointParam URI networkRef, ListenableFuture<Task> updateNetwork(@EndpointParam URI networkRef,
@BinderParam(BindToXMLPayload.class) OrgNetwork network); @BinderParam(BindToXMLPayload.class) OrgNetwork network);
@ -78,7 +77,6 @@ public interface AdminNetworkAsyncClient extends NetworkAsyncClient {
@Path("/action/reset") @Path("/action/reset")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Task> resetNetwork(@EndpointParam URI networkRef); ListenableFuture<Task> resetNetwork(@EndpointParam URI networkRef);
/** /**

View File

@ -33,6 +33,7 @@ import org.jclouds.rest.annotations.ExceptionParser;
import org.jclouds.rest.annotations.JAXBResponseParser; import org.jclouds.rest.annotations.JAXBResponseParser;
import org.jclouds.rest.annotations.RequestFilters; import org.jclouds.rest.annotations.RequestFilters;
import org.jclouds.rest.binders.BindToXMLPayload; import org.jclouds.rest.binders.BindToXMLPayload;
import org.jclouds.rest.functions.ReturnNullOnNotFoundOr404;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType; import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
import org.jclouds.vcloud.director.v1_5.domain.AdminOrg; import org.jclouds.vcloud.director.v1_5.domain.AdminOrg;
import org.jclouds.vcloud.director.v1_5.domain.OrgEmailSettings; import org.jclouds.vcloud.director.v1_5.domain.OrgEmailSettings;
@ -43,7 +44,6 @@ import org.jclouds.vcloud.director.v1_5.domain.OrgPasswordPolicySettings;
import org.jclouds.vcloud.director.v1_5.domain.OrgSettings; import org.jclouds.vcloud.director.v1_5.domain.OrgSettings;
import org.jclouds.vcloud.director.v1_5.domain.OrgVAppTemplateLeaseSettings; import org.jclouds.vcloud.director.v1_5.domain.OrgVAppTemplateLeaseSettings;
import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest; import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest;
import org.jclouds.vcloud.director.v1_5.functions.ThrowVCloudErrorOn4xx;
import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.ListenableFuture;
@ -61,9 +61,8 @@ public interface AdminOrgAsyncClient extends OrgAsyncClient {
@GET @GET
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture<AdminOrg> getOrg( ListenableFuture<AdminOrg> getOrg(@EndpointParam URI orgRef);
@EndpointParam URI orgRef);
/** /**
* @see AdminOrgClient#getSettings(URI) * @see AdminOrgClient#getSettings(URI)
@ -72,9 +71,8 @@ public interface AdminOrgAsyncClient extends OrgAsyncClient {
@Path("/settings") @Path("/settings")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture<OrgSettings> getSettings( ListenableFuture<OrgSettings> getSettings(@EndpointParam URI orgRef);
@EndpointParam URI orgRef);
/** /**
* @see AdminOrgClient#updateSettings(URI, OrgSettings) * @see AdminOrgClient#updateSettings(URI, OrgSettings)
@ -84,9 +82,7 @@ public interface AdminOrgAsyncClient extends OrgAsyncClient {
@Consumes(VCloudDirectorMediaType.ORG_SETTINGS) @Consumes(VCloudDirectorMediaType.ORG_SETTINGS)
@Produces(VCloudDirectorMediaType.ORG_SETTINGS) @Produces(VCloudDirectorMediaType.ORG_SETTINGS)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) ListenableFuture<OrgSettings> updateSettings(@EndpointParam URI orgRef,
ListenableFuture<OrgSettings> updateSettings(
@EndpointParam URI orgRef,
@BinderParam(BindToXMLPayload.class) OrgSettings settings); @BinderParam(BindToXMLPayload.class) OrgSettings settings);
/** /**
@ -96,9 +92,8 @@ public interface AdminOrgAsyncClient extends OrgAsyncClient {
@Path("/settings/email") @Path("/settings/email")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture<OrgEmailSettings> getEmailSettings( ListenableFuture<OrgEmailSettings> getEmailSettings(@EndpointParam URI orgRef);
@EndpointParam URI orgRef);
/** /**
* @see AdminOrgClient#updateEmailSettings(URI, OrgEmailSettings) * @see AdminOrgClient#updateEmailSettings(URI, OrgEmailSettings)
@ -108,9 +103,7 @@ public interface AdminOrgAsyncClient extends OrgAsyncClient {
@Consumes(VCloudDirectorMediaType.ORG_EMAIL_SETTINGS) @Consumes(VCloudDirectorMediaType.ORG_EMAIL_SETTINGS)
@Produces(VCloudDirectorMediaType.ORG_EMAIL_SETTINGS) @Produces(VCloudDirectorMediaType.ORG_EMAIL_SETTINGS)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) ListenableFuture<OrgEmailSettings> updateEmailSettings(@EndpointParam URI orgRef,
ListenableFuture<OrgEmailSettings> updateEmailSettings(
@EndpointParam URI orgRef,
@BinderParam(BindToXMLPayload.class) OrgEmailSettings settings); @BinderParam(BindToXMLPayload.class) OrgEmailSettings settings);
/** /**
@ -120,9 +113,8 @@ public interface AdminOrgAsyncClient extends OrgAsyncClient {
@Path("/settings/general") @Path("/settings/general")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture<OrgGeneralSettings> getGeneralSettings( ListenableFuture<OrgGeneralSettings> getGeneralSettings(@EndpointParam URI orgRef);
@EndpointParam URI orgRef);
/** /**
* @see AdminOrgClient#updateGeneralSettings(URI, OrgGeneralSettings) * @see AdminOrgClient#updateGeneralSettings(URI, OrgGeneralSettings)
@ -132,7 +124,6 @@ public interface AdminOrgAsyncClient extends OrgAsyncClient {
@Consumes(VCloudDirectorMediaType.ORG_GENERAL_SETTINGS) @Consumes(VCloudDirectorMediaType.ORG_GENERAL_SETTINGS)
@Produces(VCloudDirectorMediaType.ORG_GENERAL_SETTINGS) @Produces(VCloudDirectorMediaType.ORG_GENERAL_SETTINGS)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<OrgGeneralSettings> updateGeneralSettings( ListenableFuture<OrgGeneralSettings> updateGeneralSettings(
@EndpointParam URI orgRef, @EndpointParam URI orgRef,
@BinderParam(BindToXMLPayload.class) OrgGeneralSettings settings); @BinderParam(BindToXMLPayload.class) OrgGeneralSettings settings);
@ -144,7 +135,7 @@ public interface AdminOrgAsyncClient extends OrgAsyncClient {
@Path("/settings/ldap") @Path("/settings/ldap")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture<OrgLdapSettings> getLdapSettings(@EndpointParam URI orgRef); ListenableFuture<OrgLdapSettings> getLdapSettings(@EndpointParam URI orgRef);
/** /**
@ -154,9 +145,8 @@ public interface AdminOrgAsyncClient extends OrgAsyncClient {
@Path("/settings/passwordPolicy") @Path("/settings/passwordPolicy")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture<OrgPasswordPolicySettings> getPasswordPolicy( ListenableFuture<OrgPasswordPolicySettings> getPasswordPolicy(@EndpointParam URI orgRef);
@EndpointParam URI orgRef);
/** /**
* @see AdminOrgClient#updatePasswordPolicy(URI, OrgPasswordPolicySettings) * @see AdminOrgClient#updatePasswordPolicy(URI, OrgPasswordPolicySettings)
@ -166,9 +156,7 @@ public interface AdminOrgAsyncClient extends OrgAsyncClient {
@Consumes(VCloudDirectorMediaType.ORG_PASSWORD_POLICY_SETTINGS) @Consumes(VCloudDirectorMediaType.ORG_PASSWORD_POLICY_SETTINGS)
@Produces(VCloudDirectorMediaType.ORG_PASSWORD_POLICY_SETTINGS) @Produces(VCloudDirectorMediaType.ORG_PASSWORD_POLICY_SETTINGS)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) ListenableFuture<OrgPasswordPolicySettings> updatePasswordPolicy(@EndpointParam URI orgRef,
ListenableFuture<OrgPasswordPolicySettings> updatePasswordPolicy(
@EndpointParam URI orgRef,
@BinderParam(BindToXMLPayload.class) OrgPasswordPolicySettings settings); @BinderParam(BindToXMLPayload.class) OrgPasswordPolicySettings settings);
/** /**
@ -178,9 +166,8 @@ public interface AdminOrgAsyncClient extends OrgAsyncClient {
@Path("/settings/vAppLeaseSettings") @Path("/settings/vAppLeaseSettings")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture<OrgLeaseSettings> getVAppLeaseSettings( ListenableFuture<OrgLeaseSettings> getVAppLeaseSettings(@EndpointParam URI orgRef);
@EndpointParam URI orgRef);
/** /**
* @see AdminOrgClient#updateVAppLeaseSettings(URI, OrgVAppLeaseSettings) * @see AdminOrgClient#updateVAppLeaseSettings(URI, OrgVAppLeaseSettings)
@ -190,9 +177,7 @@ public interface AdminOrgAsyncClient extends OrgAsyncClient {
@Consumes(VCloudDirectorMediaType.ORG_LEASE_SETTINGS) @Consumes(VCloudDirectorMediaType.ORG_LEASE_SETTINGS)
@Produces(VCloudDirectorMediaType.ORG_LEASE_SETTINGS) @Produces(VCloudDirectorMediaType.ORG_LEASE_SETTINGS)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) ListenableFuture<OrgLeaseSettings> updateVAppLeaseSettings(@EndpointParam URI orgRef,
ListenableFuture<OrgLeaseSettings> updateVAppLeaseSettings(
@EndpointParam URI orgRef,
@BinderParam(BindToXMLPayload.class) OrgLeaseSettings settings); @BinderParam(BindToXMLPayload.class) OrgLeaseSettings settings);
/** /**
@ -202,9 +187,8 @@ public interface AdminOrgAsyncClient extends OrgAsyncClient {
@Path("/settings/vAppTemplateLeaseSettings") @Path("/settings/vAppTemplateLeaseSettings")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture<OrgVAppTemplateLeaseSettings> getVAppTemplateLeaseSettings( ListenableFuture<OrgVAppTemplateLeaseSettings> getVAppTemplateLeaseSettings(@EndpointParam URI orgRef);
@EndpointParam URI orgRef);
/** /**
* @see AdminOrgClient#updateVAppTemplateLeaseSettings(URI, OrgVAppTemplateLeaseSettings) * @see AdminOrgClient#updateVAppTemplateLeaseSettings(URI, OrgVAppTemplateLeaseSettings)
@ -214,9 +198,7 @@ public interface AdminOrgAsyncClient extends OrgAsyncClient {
@Consumes(VCloudDirectorMediaType.ORG_VAPP_TEMPLATE_LEASE_SETTINGS) @Consumes(VCloudDirectorMediaType.ORG_VAPP_TEMPLATE_LEASE_SETTINGS)
@Produces(VCloudDirectorMediaType.ORG_VAPP_TEMPLATE_LEASE_SETTINGS) @Produces(VCloudDirectorMediaType.ORG_VAPP_TEMPLATE_LEASE_SETTINGS)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) ListenableFuture<OrgVAppTemplateLeaseSettings> updateVAppTemplateLeaseSettings(@EndpointParam URI orgRef,
ListenableFuture<OrgVAppTemplateLeaseSettings> updateVAppTemplateLeaseSettings(
@EndpointParam URI orgRef,
@BinderParam(BindToXMLPayload.class) OrgVAppTemplateLeaseSettings settings); @BinderParam(BindToXMLPayload.class) OrgVAppTemplateLeaseSettings settings);
/** /**

View File

@ -24,7 +24,6 @@ import java.util.concurrent.TimeUnit;
import org.jclouds.concurrent.Timeout; import org.jclouds.concurrent.Timeout;
import org.jclouds.rest.annotations.Delegate; import org.jclouds.rest.annotations.Delegate;
import org.jclouds.vcloud.director.v1_5.domain.AdminOrg; import org.jclouds.vcloud.director.v1_5.domain.AdminOrg;
import org.jclouds.vcloud.director.v1_5.domain.Org;
import org.jclouds.vcloud.director.v1_5.domain.OrgEmailSettings; 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.OrgGeneralSettings;
import org.jclouds.vcloud.director.v1_5.domain.OrgLdapSettings; import org.jclouds.vcloud.director.v1_5.domain.OrgLdapSettings;

View File

@ -26,14 +26,12 @@ import javax.ws.rs.Path;
import javax.ws.rs.QueryParam; import javax.ws.rs.QueryParam;
import org.jclouds.concurrent.Timeout; import org.jclouds.concurrent.Timeout;
import org.jclouds.rest.annotations.ExceptionParser;
import org.jclouds.rest.annotations.JAXBResponseParser; import org.jclouds.rest.annotations.JAXBResponseParser;
import org.jclouds.rest.annotations.QueryParams; import org.jclouds.rest.annotations.QueryParams;
import org.jclouds.rest.annotations.RequestFilters; import org.jclouds.rest.annotations.RequestFilters;
import org.jclouds.vcloud.director.v1_5.domain.RoleReferences; import org.jclouds.vcloud.director.v1_5.domain.RoleReferences;
import org.jclouds.vcloud.director.v1_5.domain.query.QueryResultRecords; import org.jclouds.vcloud.director.v1_5.domain.query.QueryResultRecords;
import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest; import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest;
import org.jclouds.vcloud.director.v1_5.functions.ThrowVCloudErrorOn4xx;
import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.ListenableFuture;
@ -51,56 +49,48 @@ public interface AdminQueryAsyncClient extends QueryAsyncClient {
@Path("/admin/groups/query") @Path("/admin/groups/query")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<QueryResultRecords> groupsQueryAll(); ListenableFuture<QueryResultRecords> groupsQueryAll();
@GET @GET
@Path("/admin/groups/query") @Path("/admin/groups/query")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<QueryResultRecords> groupsQuery(@QueryParam("filter") String filter); ListenableFuture<QueryResultRecords> groupsQuery(@QueryParam("filter") String filter);
@GET @GET
@Path("/admin/orgs/query") @Path("/admin/orgs/query")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<QueryResultRecords> orgsQueryAll(); ListenableFuture<QueryResultRecords> orgsQueryAll();
@GET @GET
@Path("/admin/orgs/query") @Path("/admin/orgs/query")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<QueryResultRecords> orgsQuery(@QueryParam("filter") String filter); ListenableFuture<QueryResultRecords> orgsQuery(@QueryParam("filter") String filter);
@GET @GET
@Path("/admin/rights/query") @Path("/admin/rights/query")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<QueryResultRecords> rightsQueryAll(); ListenableFuture<QueryResultRecords> rightsQueryAll();
@GET @GET
@Path("/admin/rights/query") @Path("/admin/rights/query")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<QueryResultRecords> rightsQuery(@QueryParam("filter") String filter); ListenableFuture<QueryResultRecords> rightsQuery(@QueryParam("filter") String filter);
@GET @GET
@Path("/admin/roles/query") @Path("/admin/roles/query")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<QueryResultRecords> rolesQueryAll(); ListenableFuture<QueryResultRecords> rolesQueryAll();
@GET @GET
@Path("/admin/roles/query") @Path("/admin/roles/query")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<QueryResultRecords> rolesQuery(@QueryParam("filter") String filter); ListenableFuture<QueryResultRecords> rolesQuery(@QueryParam("filter") String filter);
@GET @GET
@ -108,48 +98,41 @@ public interface AdminQueryAsyncClient extends QueryAsyncClient {
@Consumes @Consumes
@QueryParams(keys = { "format" }, values = { "references" }) @QueryParams(keys = { "format" }, values = { "references" })
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<RoleReferences> roleReferencesQueryAll(); ListenableFuture<RoleReferences> roleReferencesQueryAll();
@GET @GET
@Path("/admin/strandedUsers/query") @Path("/admin/strandedUsers/query")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<QueryResultRecords> strandedUsersQueryAll(); ListenableFuture<QueryResultRecords> strandedUsersQueryAll();
@GET @GET
@Path("/admin/strandedUsers/query") @Path("/admin/strandedUsers/query")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<QueryResultRecords> strandedUsersQuery(@QueryParam("filter") String filter); ListenableFuture<QueryResultRecords> strandedUsersQuery(@QueryParam("filter") String filter);
@GET @GET
@Path("/admin/users/query") @Path("/admin/users/query")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<QueryResultRecords> usersQueryAll(); ListenableFuture<QueryResultRecords> usersQueryAll();
@GET @GET
@Path("/admin/users/query") @Path("/admin/users/query")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<QueryResultRecords> usersQuery(@QueryParam("filter") String filter); ListenableFuture<QueryResultRecords> usersQuery(@QueryParam("filter") String filter);
@GET @GET
@Path("/admin/vdcs/query") @Path("/admin/vdcs/query")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<QueryResultRecords> vdcsQueryAll(); ListenableFuture<QueryResultRecords> vdcsQueryAll();
@GET @GET
@Path("/admin/vdcs/query") @Path("/admin/vdcs/query")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<QueryResultRecords> vdcsQuery(@QueryParam("filter") String filter); ListenableFuture<QueryResultRecords> vdcsQuery(@QueryParam("filter") String filter);
} }

View File

@ -20,15 +20,8 @@ package org.jclouds.vcloud.director.v1_5.features;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import javax.management.relation.Role;
import org.jclouds.concurrent.Timeout; import org.jclouds.concurrent.Timeout;
import org.jclouds.vcloud.director.v1_5.domain.Group;
import org.jclouds.vcloud.director.v1_5.domain.Org;
import org.jclouds.vcloud.director.v1_5.domain.RoleReference;
import org.jclouds.vcloud.director.v1_5.domain.RoleReferences; import org.jclouds.vcloud.director.v1_5.domain.RoleReferences;
import org.jclouds.vcloud.director.v1_5.domain.User;
import org.jclouds.vcloud.director.v1_5.domain.Vdc;
import org.jclouds.vcloud.director.v1_5.domain.query.QueryResultRecords; import org.jclouds.vcloud.director.v1_5.domain.query.QueryResultRecords;
/** /**

View File

@ -33,11 +33,11 @@ import org.jclouds.rest.annotations.EndpointParam;
import org.jclouds.rest.annotations.ExceptionParser; import org.jclouds.rest.annotations.ExceptionParser;
import org.jclouds.rest.annotations.JAXBResponseParser; import org.jclouds.rest.annotations.JAXBResponseParser;
import org.jclouds.rest.annotations.RequestFilters; import org.jclouds.rest.annotations.RequestFilters;
import org.jclouds.rest.functions.ReturnNullOnNotFoundOr404;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType; 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.AdminVdc;
import org.jclouds.vcloud.director.v1_5.domain.Task; import org.jclouds.vcloud.director.v1_5.domain.Task;
import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest; import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest;
import org.jclouds.vcloud.director.v1_5.functions.ThrowVCloudErrorOn4xx;
import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.ListenableFuture;
@ -48,38 +48,34 @@ import com.google.common.util.concurrent.ListenableFuture;
@RequestFilters(AddVCloudAuthorizationToRequest.class) @RequestFilters(AddVCloudAuthorizationToRequest.class)
public interface AdminVdcAsyncClient extends VdcAsyncClient { public interface AdminVdcAsyncClient extends VdcAsyncClient {
@Override
@GET @GET
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
@Override
ListenableFuture<AdminVdc> getVdc(@EndpointParam URI vdcRef); ListenableFuture<AdminVdc> getVdc(@EndpointParam URI vdcRef);
@PUT @PUT
@Consumes @Consumes
@Produces(VCloudDirectorMediaType.ADMIN_VDC) @Produces(VCloudDirectorMediaType.ADMIN_VDC)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Task> editVdc(@EndpointParam URI vdcRef, AdminVdc vdc); ListenableFuture<Task> editVdc(@EndpointParam URI vdcRef, AdminVdc vdc);
@DELETE @DELETE
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Task> deleteVdc(@EndpointParam URI vdcRef); ListenableFuture<Task> deleteVdc(@EndpointParam URI vdcRef);
@POST @POST
@Consumes @Consumes
@Path("/action/enable") @Path("/action/enable")
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Void> enableVdc(@EndpointParam URI vdcRef); ListenableFuture<Void> enableVdc(@EndpointParam URI vdcRef);
@POST @POST
@Consumes @Consumes
@Path("/action/disable") @Path("/action/disable")
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Void> disableVdc(@EndpointParam URI vdcRef); ListenableFuture<Void> disableVdc(@EndpointParam URI vdcRef);
/** /**

View File

@ -35,11 +35,11 @@ import org.jclouds.rest.annotations.ExceptionParser;
import org.jclouds.rest.annotations.JAXBResponseParser; import org.jclouds.rest.annotations.JAXBResponseParser;
import org.jclouds.rest.annotations.RequestFilters; import org.jclouds.rest.annotations.RequestFilters;
import org.jclouds.rest.binders.BindToXMLPayload; import org.jclouds.rest.binders.BindToXMLPayload;
import org.jclouds.rest.functions.ReturnNullOnNotFoundOr404;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType; 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.CatalogItem;
import org.jclouds.vcloud.director.v1_5.domain.CatalogType; import org.jclouds.vcloud.director.v1_5.domain.CatalogType;
import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest; import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest;
import org.jclouds.vcloud.director.v1_5.functions.ThrowVCloudErrorOn4xx;
import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.ListenableFuture;
@ -56,7 +56,7 @@ public interface CatalogAsyncClient {
@GET @GET
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture<? extends CatalogType> getCatalog(@EndpointParam URI catalogUri); ListenableFuture<? extends CatalogType> getCatalog(@EndpointParam URI catalogUri);
/** /**
@ -67,7 +67,6 @@ public interface CatalogAsyncClient {
@Consumes(VCloudDirectorMediaType.CATALOG_ITEM) @Consumes(VCloudDirectorMediaType.CATALOG_ITEM)
@Produces(VCloudDirectorMediaType.CATALOG_ITEM) @Produces(VCloudDirectorMediaType.CATALOG_ITEM)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<CatalogItem> addCatalogItem(@EndpointParam URI catalogUri, ListenableFuture<CatalogItem> addCatalogItem(@EndpointParam URI catalogUri,
@BinderParam(BindToXMLPayload.class) CatalogItem catalogItem); @BinderParam(BindToXMLPayload.class) CatalogItem catalogItem);
@ -77,7 +76,7 @@ public interface CatalogAsyncClient {
@GET @GET
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture<CatalogItem> getCatalogItem(@EndpointParam URI catalogItemUri); ListenableFuture<CatalogItem> getCatalogItem(@EndpointParam URI catalogItemUri);
/** /**
@ -87,7 +86,6 @@ public interface CatalogAsyncClient {
@Consumes(VCloudDirectorMediaType.CATALOG_ITEM) @Consumes(VCloudDirectorMediaType.CATALOG_ITEM)
@Produces(VCloudDirectorMediaType.CATALOG_ITEM) @Produces(VCloudDirectorMediaType.CATALOG_ITEM)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<CatalogItem> updateCatalogItem(@EndpointParam URI catalogItemUri, ListenableFuture<CatalogItem> updateCatalogItem(@EndpointParam URI catalogItemUri,
@BinderParam(BindToXMLPayload.class) CatalogItem catalogItem); @BinderParam(BindToXMLPayload.class) CatalogItem catalogItem);
@ -97,7 +95,6 @@ public interface CatalogAsyncClient {
@DELETE @DELETE
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Void> deleteCatalogItem(@EndpointParam URI catalogItemUri); ListenableFuture<Void> deleteCatalogItem(@EndpointParam URI catalogItemUri);
/** /**

View File

@ -34,10 +34,10 @@ import org.jclouds.rest.annotations.ExceptionParser;
import org.jclouds.rest.annotations.JAXBResponseParser; import org.jclouds.rest.annotations.JAXBResponseParser;
import org.jclouds.rest.annotations.RequestFilters; import org.jclouds.rest.annotations.RequestFilters;
import org.jclouds.rest.binders.BindToXMLPayload; import org.jclouds.rest.binders.BindToXMLPayload;
import org.jclouds.rest.functions.ReturnNullOnNotFoundOr404;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType; import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
import org.jclouds.vcloud.director.v1_5.domain.Group; import org.jclouds.vcloud.director.v1_5.domain.Group;
import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest; import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest;
import org.jclouds.vcloud.director.v1_5.functions.ThrowVCloudErrorOn4xx;
import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.ListenableFuture;
@ -53,7 +53,6 @@ public interface GroupAsyncClient {
@Consumes(VCloudDirectorMediaType.GROUP) @Consumes(VCloudDirectorMediaType.GROUP)
@Produces(VCloudDirectorMediaType.GROUP) @Produces(VCloudDirectorMediaType.GROUP)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Group> createGroup(@EndpointParam URI adminOrgUri, ListenableFuture<Group> createGroup(@EndpointParam URI adminOrgUri,
@BinderParam(BindToXMLPayload.class) Group group); @BinderParam(BindToXMLPayload.class) Group group);
@ -63,7 +62,7 @@ public interface GroupAsyncClient {
@GET @GET
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture<Group> getGroup(@EndpointParam URI groupUri); ListenableFuture<Group> getGroup(@EndpointParam URI groupUri);
/** /**
@ -73,7 +72,6 @@ public interface GroupAsyncClient {
@Consumes(VCloudDirectorMediaType.GROUP) @Consumes(VCloudDirectorMediaType.GROUP)
@Produces(VCloudDirectorMediaType.GROUP) @Produces(VCloudDirectorMediaType.GROUP)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Group> updateGroup(@EndpointParam URI groupRef, ListenableFuture<Group> updateGroup(@EndpointParam URI groupRef,
@BinderParam(BindToXMLPayload.class) Group group); @BinderParam(BindToXMLPayload.class) Group group);
@ -83,6 +81,5 @@ public interface GroupAsyncClient {
@DELETE @DELETE
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Void> deleteGroup(@EndpointParam URI groupRef); ListenableFuture<Void> deleteGroup(@EndpointParam URI groupRef);
} }

View File

@ -35,13 +35,13 @@ import org.jclouds.rest.annotations.ExceptionParser;
import org.jclouds.rest.annotations.JAXBResponseParser; import org.jclouds.rest.annotations.JAXBResponseParser;
import org.jclouds.rest.annotations.RequestFilters; import org.jclouds.rest.annotations.RequestFilters;
import org.jclouds.rest.binders.BindToXMLPayload; import org.jclouds.rest.binders.BindToXMLPayload;
import org.jclouds.rest.functions.ReturnNullOnNotFoundOr404;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType; 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.CloneMediaParams;
import org.jclouds.vcloud.director.v1_5.domain.Media; import org.jclouds.vcloud.director.v1_5.domain.Media;
import org.jclouds.vcloud.director.v1_5.domain.Owner; 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.domain.Task;
import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest; import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest;
import org.jclouds.vcloud.director.v1_5.functions.ThrowVCloudErrorOn4xx;
import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.ListenableFuture;
@ -58,7 +58,7 @@ public interface MediaAsyncClient {
@GET @GET
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture<Media> getMedia(@EndpointParam URI uri); ListenableFuture<Media> getMedia(@EndpointParam URI uri);
/** /**
@ -68,7 +68,6 @@ public interface MediaAsyncClient {
@Consumes(VCloudDirectorMediaType.MEDIA) @Consumes(VCloudDirectorMediaType.MEDIA)
@Produces(VCloudDirectorMediaType.MEDIA) @Produces(VCloudDirectorMediaType.MEDIA)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Media> createMedia(@EndpointParam URI link, ListenableFuture<Media> createMedia(@EndpointParam URI link,
@BinderParam(BindToXMLPayload.class) Media media); @BinderParam(BindToXMLPayload.class) Media media);
@ -81,7 +80,6 @@ public interface MediaAsyncClient {
@Consumes(VCloudDirectorMediaType.MEDIA) @Consumes(VCloudDirectorMediaType.MEDIA)
@Produces(VCloudDirectorMediaType.CLONE_MEDIA_PARAMS) @Produces(VCloudDirectorMediaType.CLONE_MEDIA_PARAMS)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Media> cloneMedia(@EndpointParam URI vdcRef, ListenableFuture<Media> cloneMedia(@EndpointParam URI vdcRef,
@BinderParam(BindToXMLPayload.class) CloneMediaParams params); @BinderParam(BindToXMLPayload.class) CloneMediaParams params);
@ -92,7 +90,6 @@ public interface MediaAsyncClient {
@Consumes(VCloudDirectorMediaType.TASK) @Consumes(VCloudDirectorMediaType.TASK)
@Produces(VCloudDirectorMediaType.MEDIA) @Produces(VCloudDirectorMediaType.MEDIA)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Task> updateMedia(@EndpointParam URI uri, @BinderParam(BindToXMLPayload.class) Media media); ListenableFuture<Task> updateMedia(@EndpointParam URI uri, @BinderParam(BindToXMLPayload.class) Media media);
/** /**
@ -101,7 +98,6 @@ public interface MediaAsyncClient {
@DELETE @DELETE
@Consumes(VCloudDirectorMediaType.TASK) @Consumes(VCloudDirectorMediaType.TASK)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Task> deleteMedia(@EndpointParam URI uri); ListenableFuture<Task> deleteMedia(@EndpointParam URI uri);
/** /**
@ -111,7 +107,7 @@ public interface MediaAsyncClient {
@Path("/owner") @Path("/owner")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture<Owner> getOwner(@EndpointParam URI uri); ListenableFuture<Owner> getOwner(@EndpointParam URI uri);
/** /**

View File

@ -35,12 +35,12 @@ import org.jclouds.rest.annotations.ExceptionParser;
import org.jclouds.rest.annotations.JAXBResponseParser; import org.jclouds.rest.annotations.JAXBResponseParser;
import org.jclouds.rest.annotations.RequestFilters; import org.jclouds.rest.annotations.RequestFilters;
import org.jclouds.rest.binders.BindToXMLPayload; import org.jclouds.rest.binders.BindToXMLPayload;
import org.jclouds.rest.functions.ReturnNullOnNotFoundOr404;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType; import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
import org.jclouds.vcloud.director.v1_5.domain.Metadata; 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.MetadataValue;
import org.jclouds.vcloud.director.v1_5.domain.Task; import org.jclouds.vcloud.director.v1_5.domain.Task;
import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest; import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest;
import org.jclouds.vcloud.director.v1_5.functions.ThrowVCloudErrorOn4xx;
import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.ListenableFuture;
@ -60,7 +60,7 @@ public interface MetadataAsyncClient {
@Path("/metadata") @Path("/metadata")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture<Metadata> getMetadata(@EndpointParam URI metaDataUri); ListenableFuture<Metadata> getMetadata(@EndpointParam URI metaDataUri);
/** /**
@ -70,7 +70,7 @@ public interface MetadataAsyncClient {
@Path("/metadata/{key}") @Path("/metadata/{key}")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture<MetadataValue> getMetadataValue(@EndpointParam URI metaDataUri, @PathParam("key") String key); ListenableFuture<MetadataValue> getMetadataValue(@EndpointParam URI metaDataUri, @PathParam("key") String key);
} }
@ -85,7 +85,6 @@ public interface MetadataAsyncClient {
@Consumes(VCloudDirectorMediaType.TASK) @Consumes(VCloudDirectorMediaType.TASK)
@Produces(VCloudDirectorMediaType.METADATA) @Produces(VCloudDirectorMediaType.METADATA)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Task> mergeMetadata(@EndpointParam URI metaDataUri, @BinderParam(BindToXMLPayload.class) Metadata metadata); ListenableFuture<Task> mergeMetadata(@EndpointParam URI metaDataUri, @BinderParam(BindToXMLPayload.class) Metadata metadata);
/** /**
@ -96,7 +95,6 @@ public interface MetadataAsyncClient {
@Consumes(VCloudDirectorMediaType.TASK) @Consumes(VCloudDirectorMediaType.TASK)
@Produces(VCloudDirectorMediaType.METADATA_VALUE) @Produces(VCloudDirectorMediaType.METADATA_VALUE)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Task> setMetadata(@EndpointParam URI metaDataUri, ListenableFuture<Task> setMetadata(@EndpointParam URI metaDataUri,
@PathParam("key") String key, @PathParam("key") String key,
@BinderParam(BindToXMLPayload.class) MetadataValue metadataValue); @BinderParam(BindToXMLPayload.class) MetadataValue metadataValue);
@ -108,7 +106,6 @@ public interface MetadataAsyncClient {
@Path("/metadata/{key}") @Path("/metadata/{key}")
@Consumes(VCloudDirectorMediaType.TASK) @Consumes(VCloudDirectorMediaType.TASK)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Task> deleteMetadataEntry(@EndpointParam URI metaDataUri, @PathParam("key") String key); ListenableFuture<Task> deleteMetadataEntry(@EndpointParam URI metaDataUri, @PathParam("key") String key);
} }
} }

View File

@ -28,9 +28,9 @@ import org.jclouds.rest.annotations.EndpointParam;
import org.jclouds.rest.annotations.ExceptionParser; import org.jclouds.rest.annotations.ExceptionParser;
import org.jclouds.rest.annotations.JAXBResponseParser; import org.jclouds.rest.annotations.JAXBResponseParser;
import org.jclouds.rest.annotations.RequestFilters; import org.jclouds.rest.annotations.RequestFilters;
import org.jclouds.rest.functions.ReturnNullOnNotFoundOr404;
import org.jclouds.vcloud.director.v1_5.domain.Network; 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.filters.AddVCloudAuthorizationToRequest;
import org.jclouds.vcloud.director.v1_5.functions.ThrowVCloudErrorOn4xx;
import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.ListenableFuture;
@ -47,7 +47,7 @@ public interface NetworkAsyncClient {
@GET @GET
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture<? extends Network> getNetwork(@EndpointParam URI networkUri); ListenableFuture<? extends Network> getNetwork(@EndpointParam URI networkUri);
/** /**

View File

@ -36,11 +36,11 @@ import org.jclouds.rest.annotations.ExceptionParser;
import org.jclouds.rest.annotations.JAXBResponseParser; import org.jclouds.rest.annotations.JAXBResponseParser;
import org.jclouds.rest.annotations.RequestFilters; import org.jclouds.rest.annotations.RequestFilters;
import org.jclouds.rest.binders.BindToXMLPayload; import org.jclouds.rest.binders.BindToXMLPayload;
import org.jclouds.rest.functions.ReturnNullOnNotFoundOr404;
import org.jclouds.vcloud.director.v1_5.domain.ControlAccessParams; import org.jclouds.vcloud.director.v1_5.domain.ControlAccessParams;
import org.jclouds.vcloud.director.v1_5.domain.Org; import org.jclouds.vcloud.director.v1_5.domain.Org;
import org.jclouds.vcloud.director.v1_5.domain.OrgList; import org.jclouds.vcloud.director.v1_5.domain.OrgList;
import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest; import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest;
import org.jclouds.vcloud.director.v1_5.functions.ThrowVCloudErrorOn4xx;
import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.ListenableFuture;
@ -66,7 +66,7 @@ public interface OrgAsyncClient {
@GET @GET
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture<? extends Org> getOrg(@EndpointParam URI orgUri); ListenableFuture<? extends Org> getOrg(@EndpointParam URI orgUri);
/** /**
@ -77,7 +77,6 @@ public interface OrgAsyncClient {
@Produces(CONTROL_ACCESS) @Produces(CONTROL_ACCESS)
@Consumes(CONTROL_ACCESS) @Consumes(CONTROL_ACCESS)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<ControlAccessParams> modifyControlAccess(@EndpointParam URI orgRef, ListenableFuture<ControlAccessParams> modifyControlAccess(@EndpointParam URI orgRef,
@PathParam("catalogId") String catalogId, @PathParam("catalogId") String catalogId,
@BinderParam(BindToXMLPayload.class) ControlAccessParams params); @BinderParam(BindToXMLPayload.class) ControlAccessParams params);
@ -89,7 +88,7 @@ public interface OrgAsyncClient {
@Path("/catalog/{catalogId}/controlAccess") @Path("/catalog/{catalogId}/controlAccess")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture<ControlAccessParams> getControlAccess(@EndpointParam URI orgRef, ListenableFuture<ControlAccessParams> getControlAccess(@EndpointParam URI orgRef,
@PathParam("catalogId") String catalogId); @PathParam("catalogId") String catalogId);

View File

@ -29,14 +29,13 @@ import org.jclouds.rest.annotations.JAXBResponseParser;
import org.jclouds.rest.annotations.QueryParams; import org.jclouds.rest.annotations.QueryParams;
import org.jclouds.rest.annotations.RequestFilters; import org.jclouds.rest.annotations.RequestFilters;
import org.jclouds.rest.annotations.SkipEncoding; import org.jclouds.rest.annotations.SkipEncoding;
import org.jclouds.rest.functions.ReturnNullOnNotFoundOr404;
import org.jclouds.vcloud.director.v1_5.domain.Entity; import org.jclouds.vcloud.director.v1_5.domain.Entity;
import org.jclouds.vcloud.director.v1_5.domain.VApp;
import org.jclouds.vcloud.director.v1_5.domain.query.CatalogReferences; import org.jclouds.vcloud.director.v1_5.domain.query.CatalogReferences;
import org.jclouds.vcloud.director.v1_5.domain.query.QueryList; import org.jclouds.vcloud.director.v1_5.domain.query.QueryList;
import org.jclouds.vcloud.director.v1_5.domain.query.QueryResultRecords; import org.jclouds.vcloud.director.v1_5.domain.query.QueryResultRecords;
import org.jclouds.vcloud.director.v1_5.domain.query.VAppReferences; import org.jclouds.vcloud.director.v1_5.domain.query.VAppReferences;
import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest; import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest;
import org.jclouds.vcloud.director.v1_5.functions.ThrowVCloudErrorOn4xx;
import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.ListenableFuture;
@ -55,7 +54,7 @@ public interface QueryAsyncClient {
@Path("/entity/{id}") @Path("/entity/{id}")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture<Entity> entity(@PathParam("id") String id); ListenableFuture<Entity> entity(@PathParam("id") String id);
/** /**
@ -65,28 +64,24 @@ public interface QueryAsyncClient {
@Path("/query") @Path("/query")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<QueryList> queryList(); ListenableFuture<QueryList> queryList();
@GET @GET
@Path("/query") @Path("/query")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<QueryResultRecords> queryAll(@QueryParam("type") String type); ListenableFuture<QueryResultRecords> queryAll(@QueryParam("type") String type);
@GET @GET
@Path("/query") @Path("/query")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<QueryResultRecords> query(@QueryParam("type") String type, @QueryParam("filter") String filter); ListenableFuture<QueryResultRecords> query(@QueryParam("type") String type, @QueryParam("filter") String filter);
@GET @GET
@Path("/query") @Path("/query")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<QueryResultRecords> query(@QueryParam("page") Integer page, @QueryParam("pageSize") Integer pageSize, ListenableFuture<QueryResultRecords> query(@QueryParam("page") Integer page, @QueryParam("pageSize") Integer pageSize,
@QueryParam("format") String format, @QueryParam("type") String type, @QueryParam("filter") String filter); @QueryParam("format") String format, @QueryParam("type") String type, @QueryParam("filter") String filter);
@ -97,21 +92,18 @@ public interface QueryAsyncClient {
@Path("/catalogs/query") @Path("/catalogs/query")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<QueryResultRecords> catalogsQueryAll(); ListenableFuture<QueryResultRecords> catalogsQueryAll();
@GET @GET
@Path("/catalogs/query") @Path("/catalogs/query")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<QueryResultRecords> catalogsQuery(@QueryParam("filter") String filter); ListenableFuture<QueryResultRecords> catalogsQuery(@QueryParam("filter") String filter);
@GET @GET
@Path("/catalogs/query") @Path("/catalogs/query")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<QueryResultRecords> catalogsQuery(@QueryParam("page") Integer page, @QueryParam("pageSize") Integer pageSize, ListenableFuture<QueryResultRecords> catalogsQuery(@QueryParam("page") Integer page, @QueryParam("pageSize") Integer pageSize,
@QueryParam("filter") String filter); @QueryParam("filter") String filter);
@ -120,7 +112,6 @@ public interface QueryAsyncClient {
@Consumes @Consumes
@QueryParams(keys = { "format" }, values = { "references" }) @QueryParams(keys = { "format" }, values = { "references" })
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<CatalogReferences> catalogReferencesQueryAll(); ListenableFuture<CatalogReferences> catalogReferencesQueryAll();
@GET @GET
@ -128,7 +119,6 @@ public interface QueryAsyncClient {
@Consumes @Consumes
@QueryParams(keys = { "format" }, values = { "references" }) @QueryParams(keys = { "format" }, values = { "references" })
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<CatalogReferences> catalogReferencesQuery(@QueryParam("filter") String filter); ListenableFuture<CatalogReferences> catalogReferencesQuery(@QueryParam("filter") String filter);
@GET @GET
@ -136,7 +126,6 @@ public interface QueryAsyncClient {
@Consumes @Consumes
@QueryParams(keys = { "format" }, values = { "references" }) @QueryParams(keys = { "format" }, values = { "references" })
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<CatalogReferences> catalogReferencesQuery(@QueryParam("page") Integer page, @QueryParam("pageSize") Integer pageSize, ListenableFuture<CatalogReferences> catalogReferencesQuery(@QueryParam("page") Integer page, @QueryParam("pageSize") Integer pageSize,
@QueryParam("filter") String filter); @QueryParam("filter") String filter);
@ -144,14 +133,12 @@ public interface QueryAsyncClient {
@Path("/vAppTemplates/query") @Path("/vAppTemplates/query")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<QueryResultRecords> vAppTemplatesQueryAll(); ListenableFuture<QueryResultRecords> vAppTemplatesQueryAll();
@GET @GET
@Path("/vAppTemplates/query") @Path("/vAppTemplates/query")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<QueryResultRecords> vAppTemplatesQuery(@QueryParam("filter") String filter); ListenableFuture<QueryResultRecords> vAppTemplatesQuery(@QueryParam("filter") String filter);
/** /**
@ -161,21 +148,18 @@ public interface QueryAsyncClient {
@Path("/vApps/query") @Path("/vApps/query")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<QueryResultRecords> vAppsQueryAll(); ListenableFuture<QueryResultRecords> vAppsQueryAll();
@GET @GET
@Path("/vApps/query") @Path("/vApps/query")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<QueryResultRecords> vAppsQuery(@QueryParam("filter") String filter); ListenableFuture<QueryResultRecords> vAppsQuery(@QueryParam("filter") String filter);
@GET @GET
@Path("/vApps/query") @Path("/vApps/query")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<QueryResultRecords> vAppsQuery(@QueryParam("page") Integer page, @QueryParam("pageSize") Integer pageSize, ListenableFuture<QueryResultRecords> vAppsQuery(@QueryParam("page") Integer page, @QueryParam("pageSize") Integer pageSize,
@QueryParam("filter") String filter); @QueryParam("filter") String filter);
@ -184,7 +168,6 @@ public interface QueryAsyncClient {
@Consumes @Consumes
@QueryParams(keys = { "format" }, values = { "references" }) @QueryParams(keys = { "format" }, values = { "references" })
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<VAppReferences> vAppReferencesQueryAll(); ListenableFuture<VAppReferences> vAppReferencesQueryAll();
@GET @GET
@ -192,7 +175,6 @@ public interface QueryAsyncClient {
@Consumes @Consumes
@QueryParams(keys = { "format" }, values = { "references" }) @QueryParams(keys = { "format" }, values = { "references" })
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<VAppReferences> vAppReferencesQuery(@QueryParam("filter") String filter); ListenableFuture<VAppReferences> vAppReferencesQuery(@QueryParam("filter") String filter);
@GET @GET
@ -200,7 +182,6 @@ public interface QueryAsyncClient {
@Consumes @Consumes
@QueryParams(keys = { "format" }, values = { "references" }) @QueryParams(keys = { "format" }, values = { "references" })
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<VAppReferences> vAppReferencesQuery(@QueryParam("page") Integer page, @QueryParam("pageSize") Integer pageSize, ListenableFuture<VAppReferences> vAppReferencesQuery(@QueryParam("page") Integer page, @QueryParam("pageSize") Integer pageSize,
@QueryParam("filter") String filter); @QueryParam("filter") String filter);
@ -208,27 +189,23 @@ public interface QueryAsyncClient {
@Path("/vms/query") @Path("/vms/query")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<QueryResultRecords> vmsQueryAll(); ListenableFuture<QueryResultRecords> vmsQueryAll();
@GET @GET
@Path("/vms/query") @Path("/vms/query")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<QueryResultRecords> vmsQuery(@QueryParam("filter") String filter); ListenableFuture<QueryResultRecords> vmsQuery(@QueryParam("filter") String filter);
@GET @GET
@Path("/mediaList/query") @Path("/mediaList/query")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<QueryResultRecords> mediaListQueryAll(); ListenableFuture<QueryResultRecords> mediaListQueryAll();
@GET @GET
@Path("/mediaList/query") @Path("/mediaList/query")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<QueryResultRecords> mediaListQuery(@QueryParam("filter") String filter); ListenableFuture<QueryResultRecords> mediaListQuery(@QueryParam("filter") String filter);
} }

View File

@ -21,11 +21,7 @@ package org.jclouds.vcloud.director.v1_5.features;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import org.jclouds.concurrent.Timeout; import org.jclouds.concurrent.Timeout;
import org.jclouds.vcloud.director.v1_5.domain.CatalogReference;
import org.jclouds.vcloud.director.v1_5.domain.Entity; import org.jclouds.vcloud.director.v1_5.domain.Entity;
import org.jclouds.vcloud.director.v1_5.domain.VApp;
import org.jclouds.vcloud.director.v1_5.domain.VAppTemplate;
import org.jclouds.vcloud.director.v1_5.domain.Vm;
import org.jclouds.vcloud.director.v1_5.domain.query.CatalogReferences; import org.jclouds.vcloud.director.v1_5.domain.query.CatalogReferences;
import org.jclouds.vcloud.director.v1_5.domain.query.QueryList; import org.jclouds.vcloud.director.v1_5.domain.query.QueryList;
import org.jclouds.vcloud.director.v1_5.domain.query.QueryResultRecords; import org.jclouds.vcloud.director.v1_5.domain.query.QueryResultRecords;

View File

@ -29,11 +29,11 @@ import org.jclouds.rest.annotations.EndpointParam;
import org.jclouds.rest.annotations.ExceptionParser; import org.jclouds.rest.annotations.ExceptionParser;
import org.jclouds.rest.annotations.JAXBResponseParser; import org.jclouds.rest.annotations.JAXBResponseParser;
import org.jclouds.rest.annotations.RequestFilters; import org.jclouds.rest.annotations.RequestFilters;
import org.jclouds.rest.functions.ReturnNullOnNotFoundOr404;
import org.jclouds.vcloud.director.v1_5.domain.Task; import org.jclouds.vcloud.director.v1_5.domain.Task;
import org.jclouds.vcloud.director.v1_5.domain.TasksList; import org.jclouds.vcloud.director.v1_5.domain.TasksList;
import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest; import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest;
import org.jclouds.vcloud.director.v1_5.functions.OrgReferenceToTaskListEndpoint; import org.jclouds.vcloud.director.v1_5.functions.OrgReferenceToTaskListEndpoint;
import org.jclouds.vcloud.director.v1_5.functions.ThrowVCloudErrorOn4xx;
import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.ListenableFuture;
@ -50,7 +50,7 @@ public interface TaskAsyncClient {
@GET @GET
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture<TasksList> getTaskList(@EndpointParam(parser = OrgReferenceToTaskListEndpoint.class) URI orgURI); ListenableFuture<TasksList> getTaskList(@EndpointParam(parser = OrgReferenceToTaskListEndpoint.class) URI orgURI);
/** /**
@ -59,7 +59,7 @@ public interface TaskAsyncClient {
@GET @GET
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture<Task> getTask(@EndpointParam URI taskURI); ListenableFuture<Task> getTask(@EndpointParam URI taskURI);
/** /**
@ -69,6 +69,5 @@ public interface TaskAsyncClient {
@Path("/action/cancel") @Path("/action/cancel")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Void> cancelTask(@EndpointParam URI taskURI); ListenableFuture<Void> cancelTask(@EndpointParam URI taskURI);
} }

View File

@ -34,10 +34,10 @@ import org.jclouds.rest.annotations.ExceptionParser;
import org.jclouds.rest.annotations.JAXBResponseParser; import org.jclouds.rest.annotations.JAXBResponseParser;
import org.jclouds.rest.annotations.RequestFilters; import org.jclouds.rest.annotations.RequestFilters;
import org.jclouds.rest.binders.BindToXMLPayload; import org.jclouds.rest.binders.BindToXMLPayload;
import org.jclouds.rest.functions.ReturnNullOnNotFoundOr404;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType; import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
import org.jclouds.vcloud.director.v1_5.domain.User; import org.jclouds.vcloud.director.v1_5.domain.User;
import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest; import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest;
import org.jclouds.vcloud.director.v1_5.functions.ThrowVCloudErrorOn4xx;
import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.ListenableFuture;
@ -56,7 +56,6 @@ public interface UserAsyncClient {
@Consumes(VCloudDirectorMediaType.USER) @Consumes(VCloudDirectorMediaType.USER)
@Produces(VCloudDirectorMediaType.USER) @Produces(VCloudDirectorMediaType.USER)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<User> createUser(@EndpointParam URI userRef, ListenableFuture<User> createUser(@EndpointParam URI userRef,
@BinderParam(BindToXMLPayload.class) User user); @BinderParam(BindToXMLPayload.class) User user);
@ -66,7 +65,7 @@ public interface UserAsyncClient {
@GET @GET
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture<User> getUser(@EndpointParam URI userRef); ListenableFuture<User> getUser(@EndpointParam URI userRef);
/** /**
@ -76,7 +75,6 @@ public interface UserAsyncClient {
@Consumes(VCloudDirectorMediaType.USER) @Consumes(VCloudDirectorMediaType.USER)
@Produces(VCloudDirectorMediaType.USER) @Produces(VCloudDirectorMediaType.USER)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<User> updateUser(@EndpointParam URI userRef, ListenableFuture<User> updateUser(@EndpointParam URI userRef,
@BinderParam(BindToXMLPayload.class) User user); @BinderParam(BindToXMLPayload.class) User user);
@ -86,7 +84,6 @@ public interface UserAsyncClient {
@DELETE @DELETE
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Void> deleteUser(@EndpointParam URI userRef); ListenableFuture<Void> deleteUser(@EndpointParam URI userRef);
/** /**
@ -96,6 +93,5 @@ public interface UserAsyncClient {
@Path("/action/unlock") @Path("/action/unlock")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Void> unlockUser(@EndpointParam URI userRef); ListenableFuture<Void> unlockUser(@EndpointParam URI userRef);
} }

View File

@ -58,6 +58,7 @@ import org.jclouds.rest.annotations.JAXBResponseParser;
import org.jclouds.rest.annotations.RequestFilters; import org.jclouds.rest.annotations.RequestFilters;
import org.jclouds.rest.annotations.ResponseParser; import org.jclouds.rest.annotations.ResponseParser;
import org.jclouds.rest.binders.BindToXMLPayload; import org.jclouds.rest.binders.BindToXMLPayload;
import org.jclouds.rest.functions.ReturnNullOnNotFoundOr404;
import org.jclouds.vcloud.director.v1_5.domain.ControlAccessParams; import org.jclouds.vcloud.director.v1_5.domain.ControlAccessParams;
import org.jclouds.vcloud.director.v1_5.domain.DeployVAppParams; import org.jclouds.vcloud.director.v1_5.domain.DeployVAppParams;
import org.jclouds.vcloud.director.v1_5.domain.GuestCustomizationSection; import org.jclouds.vcloud.director.v1_5.domain.GuestCustomizationSection;
@ -84,7 +85,6 @@ import org.jclouds.vcloud.director.v1_5.domain.ovf.StartupSection;
import org.jclouds.vcloud.director.v1_5.domain.ovf.VirtualHardwareSection; import org.jclouds.vcloud.director.v1_5.domain.ovf.VirtualHardwareSection;
import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest; import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest;
import org.jclouds.vcloud.director.v1_5.functions.ReturnPayloadBytes; import org.jclouds.vcloud.director.v1_5.functions.ReturnPayloadBytes;
import org.jclouds.vcloud.director.v1_5.functions.ThrowVCloudErrorOn4xx;
import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.ListenableFuture;
@ -101,7 +101,7 @@ public interface VAppAsyncClient {
@GET @GET
@Consumes(VAPP) @Consumes(VAPP)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture<VApp> getVApp(@EndpointParam URI vAppURI); ListenableFuture<VApp> getVApp(@EndpointParam URI vAppURI);
/** /**
@ -111,7 +111,6 @@ public interface VAppAsyncClient {
@Produces(VAPP) @Produces(VAPP)
@Consumes(TASK) @Consumes(TASK)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Task> modifyVApp(@EndpointParam URI vAppURI, ListenableFuture<Task> modifyVApp(@EndpointParam URI vAppURI,
@BinderParam(BindToXMLPayload.class) VApp vApp); @BinderParam(BindToXMLPayload.class) VApp vApp);
@ -121,7 +120,6 @@ public interface VAppAsyncClient {
@DELETE @DELETE
@Consumes(TASK) @Consumes(TASK)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Task> deleteVApp(@EndpointParam URI vAppURI); ListenableFuture<Task> deleteVApp(@EndpointParam URI vAppURI);
/** /**
@ -131,7 +129,6 @@ public interface VAppAsyncClient {
@Path("/action/consolidate") @Path("/action/consolidate")
@Consumes(TASK) @Consumes(TASK)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Task> consolidateVApp(@EndpointParam URI vAppURI); ListenableFuture<Task> consolidateVApp(@EndpointParam URI vAppURI);
/** /**
@ -142,7 +139,6 @@ public interface VAppAsyncClient {
@Produces(CONTROL_ACCESS) @Produces(CONTROL_ACCESS)
@Consumes(CONTROL_ACCESS) @Consumes(CONTROL_ACCESS)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<ControlAccessParams> controlAccess(@EndpointParam URI vAppURI, ListenableFuture<ControlAccessParams> controlAccess(@EndpointParam URI vAppURI,
@BinderParam(BindToXMLPayload.class) ControlAccessParams params); @BinderParam(BindToXMLPayload.class) ControlAccessParams params);
@ -154,7 +150,6 @@ public interface VAppAsyncClient {
@Produces(DEPLOY_VAPP_PARAMS) @Produces(DEPLOY_VAPP_PARAMS)
@Consumes(TASK) @Consumes(TASK)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Task> deploy(@EndpointParam URI vAppURI, ListenableFuture<Task> deploy(@EndpointParam URI vAppURI,
@BinderParam(BindToXMLPayload.class) DeployVAppParams params); @BinderParam(BindToXMLPayload.class) DeployVAppParams params);
@ -165,7 +160,6 @@ public interface VAppAsyncClient {
@Path("/action/discardSuspendedState") @Path("/action/discardSuspendedState")
@Consumes(TASK) @Consumes(TASK)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Task> discardSuspendedState(@EndpointParam URI vAppURI); ListenableFuture<Task> discardSuspendedState(@EndpointParam URI vAppURI);
/** /**
@ -175,7 +169,6 @@ public interface VAppAsyncClient {
@Path("/action/enterMaintenanceMode") @Path("/action/enterMaintenanceMode")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Void> enterMaintenanceMode(@EndpointParam URI vAppURI); ListenableFuture<Void> enterMaintenanceMode(@EndpointParam URI vAppURI);
/** /**
@ -185,7 +178,6 @@ public interface VAppAsyncClient {
@Path("/action/exitMaintenanceMode") @Path("/action/exitMaintenanceMode")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Void> exitMaintenanceMode(@EndpointParam URI vAppURI); ListenableFuture<Void> exitMaintenanceMode(@EndpointParam URI vAppURI);
/** /**
@ -195,7 +187,6 @@ public interface VAppAsyncClient {
@Path("/action/installVMwareTools") @Path("/action/installVMwareTools")
@Consumes(TASK) @Consumes(TASK)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Task> installVMwareTools(@EndpointParam URI vAppURI); ListenableFuture<Task> installVMwareTools(@EndpointParam URI vAppURI);
/** /**
@ -206,7 +197,6 @@ public interface VAppAsyncClient {
@Produces(RECOMPOSE_VAPP_PARAMS) @Produces(RECOMPOSE_VAPP_PARAMS)
@Consumes(TASK) @Consumes(TASK)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Task> recomposeVApp(@EndpointParam URI vAppURI, ListenableFuture<Task> recomposeVApp(@EndpointParam URI vAppURI,
@BinderParam(BindToXMLPayload.class) RecomposeVAppParams params); @BinderParam(BindToXMLPayload.class) RecomposeVAppParams params);
@ -218,7 +208,6 @@ public interface VAppAsyncClient {
@Produces(RELOCATE_VM_PARAMS) @Produces(RELOCATE_VM_PARAMS)
@Consumes(TASK) @Consumes(TASK)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Task> relocate(@EndpointParam URI vAppURI, ListenableFuture<Task> relocate(@EndpointParam URI vAppURI,
@BinderParam(BindToXMLPayload.class) RelocateParams params); @BinderParam(BindToXMLPayload.class) RelocateParams params);
@ -230,7 +219,6 @@ public interface VAppAsyncClient {
@Produces(UNDEPLOY_VAPP_PARAMS) @Produces(UNDEPLOY_VAPP_PARAMS)
@Consumes(TASK) @Consumes(TASK)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Task> undeploy(@EndpointParam URI vAppURI, ListenableFuture<Task> undeploy(@EndpointParam URI vAppURI,
@BinderParam(BindToXMLPayload.class) UndeployVAppParams params); @BinderParam(BindToXMLPayload.class) UndeployVAppParams params);
@ -241,7 +229,6 @@ public interface VAppAsyncClient {
@Path("/action/upgradeHardwareVersion") @Path("/action/upgradeHardwareVersion")
@Consumes(TASK) @Consumes(TASK)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Task> upgradeHardwareVersion(@EndpointParam URI vAppURI); ListenableFuture<Task> upgradeHardwareVersion(@EndpointParam URI vAppURI);
/** /**
@ -251,7 +238,7 @@ public interface VAppAsyncClient {
@Path("/controlAccess") @Path("/controlAccess")
@Consumes(CONTROL_ACCESS) @Consumes(CONTROL_ACCESS)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture<ControlAccessParams> getControlAccess(@EndpointParam URI vAppURI); ListenableFuture<ControlAccessParams> getControlAccess(@EndpointParam URI vAppURI);
/** /**
@ -261,7 +248,6 @@ public interface VAppAsyncClient {
@Path("/power/action/powerOff") @Path("/power/action/powerOff")
@Consumes(TASK) @Consumes(TASK)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Task> powerOff(@EndpointParam URI vAppURI); ListenableFuture<Task> powerOff(@EndpointParam URI vAppURI);
/** /**
@ -271,7 +257,6 @@ public interface VAppAsyncClient {
@Path("/power/action/powerOn") @Path("/power/action/powerOn")
@Consumes(TASK) @Consumes(TASK)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Task> powerOn(@EndpointParam URI vAppURI); ListenableFuture<Task> powerOn(@EndpointParam URI vAppURI);
/** /**
@ -281,7 +266,6 @@ public interface VAppAsyncClient {
@Path("/power/action/powerOff") @Path("/power/action/powerOff")
@Consumes(TASK) @Consumes(TASK)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Task> reboot(@EndpointParam URI vAppURI); ListenableFuture<Task> reboot(@EndpointParam URI vAppURI);
/** /**
@ -291,7 +275,6 @@ public interface VAppAsyncClient {
@Path("/power/action/reset") @Path("/power/action/reset")
@Consumes(TASK) @Consumes(TASK)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Task> reset(@EndpointParam URI vAppURI); ListenableFuture<Task> reset(@EndpointParam URI vAppURI);
/** /**
@ -301,7 +284,6 @@ public interface VAppAsyncClient {
@Path("/power/action/shutdown") @Path("/power/action/shutdown")
@Consumes(TASK) @Consumes(TASK)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Task> shutdown(@EndpointParam URI vAppURI); ListenableFuture<Task> shutdown(@EndpointParam URI vAppURI);
/** /**
@ -311,7 +293,6 @@ public interface VAppAsyncClient {
@Path("/power/action/suspend") @Path("/power/action/suspend")
@Consumes(TASK) @Consumes(TASK)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Task> suspend(@EndpointParam URI vAppURI); ListenableFuture<Task> suspend(@EndpointParam URI vAppURI);
/** /**
@ -321,7 +302,7 @@ public interface VAppAsyncClient {
@Path("/guestCustomizationSection") @Path("/guestCustomizationSection")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture<GuestCustomizationSection> getGuestCustomizationSection(@EndpointParam URI vmURI); ListenableFuture<GuestCustomizationSection> getGuestCustomizationSection(@EndpointParam URI vmURI);
/** /**
@ -332,7 +313,6 @@ public interface VAppAsyncClient {
@Produces(GUEST_CUSTOMIZATION_SECTION) @Produces(GUEST_CUSTOMIZATION_SECTION)
@Consumes(TASK) @Consumes(TASK)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Task> modifyGuestCustomizationSection(@EndpointParam URI vmURI, ListenableFuture<Task> modifyGuestCustomizationSection(@EndpointParam URI vmURI,
@BinderParam(BindToXMLPayload.class) GuestCustomizationSection section); @BinderParam(BindToXMLPayload.class) GuestCustomizationSection section);
@ -343,7 +323,7 @@ public interface VAppAsyncClient {
@Path("/leaseSettingsSection") @Path("/leaseSettingsSection")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture<LeaseSettingsSection> getLeaseSettingsSection(@EndpointParam URI vAppURI); ListenableFuture<LeaseSettingsSection> getLeaseSettingsSection(@EndpointParam URI vAppURI);
/** /**
@ -354,7 +334,6 @@ public interface VAppAsyncClient {
@Produces(LEASE_SETTINGS_SECTION) @Produces(LEASE_SETTINGS_SECTION)
@Consumes(TASK) @Consumes(TASK)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Task> modifyLeaseSettingsSection(@EndpointParam URI vAppURI, ListenableFuture<Task> modifyLeaseSettingsSection(@EndpointParam URI vAppURI,
@BinderParam(BindToXMLPayload.class) LeaseSettingsSection section); @BinderParam(BindToXMLPayload.class) LeaseSettingsSection section);
@ -366,7 +345,6 @@ public interface VAppAsyncClient {
@Produces(MEDIA_PARAMS) @Produces(MEDIA_PARAMS)
@Consumes(TASK) @Consumes(TASK)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Task> ejectMedia(@EndpointParam URI vmURI, ListenableFuture<Task> ejectMedia(@EndpointParam URI vmURI,
@BinderParam(BindToXMLPayload.class) MediaInsertOrEjectParams mediaParams); @BinderParam(BindToXMLPayload.class) MediaInsertOrEjectParams mediaParams);
@ -378,7 +356,6 @@ public interface VAppAsyncClient {
@Produces(MEDIA_PARAMS) @Produces(MEDIA_PARAMS)
@Consumes(TASK) @Consumes(TASK)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Task> insertMedia(@EndpointParam URI vmURI, ListenableFuture<Task> insertMedia(@EndpointParam URI vmURI,
@BinderParam(BindToXMLPayload.class) MediaInsertOrEjectParams mediaParams); @BinderParam(BindToXMLPayload.class) MediaInsertOrEjectParams mediaParams);
@ -389,7 +366,7 @@ public interface VAppAsyncClient {
@Path("/networkConfigSection") @Path("/networkConfigSection")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture<NetworkConfigSection> getNetworkConfigSection(@EndpointParam URI vAppURI); ListenableFuture<NetworkConfigSection> getNetworkConfigSection(@EndpointParam URI vAppURI);
/** /**
@ -400,7 +377,6 @@ public interface VAppAsyncClient {
@Produces(NETWORK_CONFIG_SECTION) @Produces(NETWORK_CONFIG_SECTION)
@Consumes(TASK) @Consumes(TASK)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Task> modifyNetworkConfigSection(@EndpointParam URI vAppURI, ListenableFuture<Task> modifyNetworkConfigSection(@EndpointParam URI vAppURI,
@BinderParam(BindToXMLPayload.class) NetworkConfigSection section); @BinderParam(BindToXMLPayload.class) NetworkConfigSection section);
@ -411,7 +387,7 @@ public interface VAppAsyncClient {
@Path("/networkConnectionSection") @Path("/networkConnectionSection")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture<NetworkConnectionSection> getNetworkConnectionSection(@EndpointParam URI vmURI); ListenableFuture<NetworkConnectionSection> getNetworkConnectionSection(@EndpointParam URI vmURI);
/** /**
@ -422,7 +398,6 @@ public interface VAppAsyncClient {
@Produces(NETWORK_CONNECTION_SECTION) @Produces(NETWORK_CONNECTION_SECTION)
@Consumes(TASK) @Consumes(TASK)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Task> modifyNetworkConnectionSection(@EndpointParam URI vmURI, ListenableFuture<Task> modifyNetworkConnectionSection(@EndpointParam URI vmURI,
@BinderParam(BindToXMLPayload.class) NetworkConnectionSection section); @BinderParam(BindToXMLPayload.class) NetworkConnectionSection section);
@ -433,7 +408,7 @@ public interface VAppAsyncClient {
@Path("/networkSection") @Path("/networkSection")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture<NetworkSection> getNetworkSection(@EndpointParam URI vAppURI); ListenableFuture<NetworkSection> getNetworkSection(@EndpointParam URI vAppURI);
/** /**
@ -443,7 +418,7 @@ public interface VAppAsyncClient {
@Path("/operatingSystemSection") @Path("/operatingSystemSection")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture<OperatingSystemSection> getOperatingSystemSection(@EndpointParam URI vmURI); ListenableFuture<OperatingSystemSection> getOperatingSystemSection(@EndpointParam URI vmURI);
/** /**
@ -454,7 +429,6 @@ public interface VAppAsyncClient {
@Produces(OPERATING_SYSTEM_SECTION) @Produces(OPERATING_SYSTEM_SECTION)
@Consumes(TASK) @Consumes(TASK)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Task> modifyOperatingSystemSection(@EndpointParam URI vmURI, ListenableFuture<Task> modifyOperatingSystemSection(@EndpointParam URI vmURI,
@BinderParam(BindToXMLPayload.class) OperatingSystemSection section); @BinderParam(BindToXMLPayload.class) OperatingSystemSection section);
@ -465,7 +439,7 @@ public interface VAppAsyncClient {
@Path("/owner") @Path("/owner")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture<Owner> getOwner(@EndpointParam URI vAppURI); ListenableFuture<Owner> getOwner(@EndpointParam URI vAppURI);
/** /**
@ -476,7 +450,6 @@ public interface VAppAsyncClient {
@Produces(OWNER) @Produces(OWNER)
@Consumes(TASK) @Consumes(TASK)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Void> modifyOwner(@EndpointParam URI vAppURI, ListenableFuture<Void> modifyOwner(@EndpointParam URI vAppURI,
@BinderParam(BindToXMLPayload.class) Owner owner); @BinderParam(BindToXMLPayload.class) Owner owner);
@ -487,7 +460,7 @@ public interface VAppAsyncClient {
@Path("/productSections") @Path("/productSections")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture<ProductSectionList> getProductSections(@EndpointParam URI vAppURI); ListenableFuture<ProductSectionList> getProductSections(@EndpointParam URI vAppURI);
/** /**
@ -498,7 +471,6 @@ public interface VAppAsyncClient {
@Produces(PRODUCT_SECTION_LIST) @Produces(PRODUCT_SECTION_LIST)
@Consumes(TASK) @Consumes(TASK)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Task> modifyProductSections(@EndpointParam URI vAppURI, ListenableFuture<Task> modifyProductSections(@EndpointParam URI vAppURI,
@BinderParam(BindToXMLPayload.class) ProductSectionList sectionList); @BinderParam(BindToXMLPayload.class) ProductSectionList sectionList);
@ -509,7 +481,7 @@ public interface VAppAsyncClient {
@Path("/question") @Path("/question")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture<VmPendingQuestion> getPendingQuestion(@EndpointParam URI vAppURI); ListenableFuture<VmPendingQuestion> getPendingQuestion(@EndpointParam URI vAppURI);
/** /**
@ -520,7 +492,6 @@ public interface VAppAsyncClient {
@Produces(VM_PENDING_ANSWER) @Produces(VM_PENDING_ANSWER)
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Void> answerQuestion(@EndpointParam URI vAppURI, ListenableFuture<Void> answerQuestion(@EndpointParam URI vAppURI,
@BinderParam(BindToXMLPayload.class) VmQuestionAnswer answer); @BinderParam(BindToXMLPayload.class) VmQuestionAnswer answer);
@ -531,7 +502,7 @@ public interface VAppAsyncClient {
@Path("/runtimeInfoSection") @Path("/runtimeInfoSection")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture<RuntimeInfoSection> getRuntimeInfoSection(@EndpointParam URI vmURI); ListenableFuture<RuntimeInfoSection> getRuntimeInfoSection(@EndpointParam URI vmURI);
/** /**
@ -540,7 +511,7 @@ public interface VAppAsyncClient {
@GET @GET
@Path("/screen") @Path("/screen")
@Consumes(ANY_IMAGE) @Consumes(ANY_IMAGE)
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
@ResponseParser(ReturnPayloadBytes.class) @ResponseParser(ReturnPayloadBytes.class)
ListenableFuture<byte[]> getScreenImage(@EndpointParam URI vAppURI); ListenableFuture<byte[]> getScreenImage(@EndpointParam URI vAppURI);
@ -551,7 +522,7 @@ public interface VAppAsyncClient {
@Path("/screen/action/acquireTicket") @Path("/screen/action/acquireTicket")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture<ScreenTicket> getScreenTicket(@EndpointParam URI vAppURI); ListenableFuture<ScreenTicket> getScreenTicket(@EndpointParam URI vAppURI);
/** /**
@ -561,7 +532,7 @@ public interface VAppAsyncClient {
@Path("/startupSection") @Path("/startupSection")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture<StartupSection> getStartupSection(@EndpointParam URI vAppURI); ListenableFuture<StartupSection> getStartupSection(@EndpointParam URI vAppURI);
/** /**
@ -572,7 +543,6 @@ public interface VAppAsyncClient {
@Produces(STARTUP_SECTION) @Produces(STARTUP_SECTION)
@Consumes(TASK) @Consumes(TASK)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Task> modifyStartupSection(@EndpointParam URI vAppURI, ListenableFuture<Task> modifyStartupSection(@EndpointParam URI vAppURI,
@BinderParam(BindToXMLPayload.class) StartupSection section); @BinderParam(BindToXMLPayload.class) StartupSection section);
@ -583,7 +553,7 @@ public interface VAppAsyncClient {
@Path("/virtualHardwareSection") @Path("/virtualHardwareSection")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture<VirtualHardwareSection> getVirtualHardwareSection(@EndpointParam URI vmURI); ListenableFuture<VirtualHardwareSection> getVirtualHardwareSection(@EndpointParam URI vmURI);
/** /**
@ -594,7 +564,6 @@ public interface VAppAsyncClient {
@Produces(VIRTUAL_HARDWARE_SECTION) @Produces(VIRTUAL_HARDWARE_SECTION)
@Consumes(TASK) @Consumes(TASK)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Task> modifyVirtualHardwareSection(@EndpointParam URI vmURI, ListenableFuture<Task> modifyVirtualHardwareSection(@EndpointParam URI vmURI,
@BinderParam(BindToXMLPayload.class) VirtualHardwareSection section); @BinderParam(BindToXMLPayload.class) VirtualHardwareSection section);
@ -605,7 +574,7 @@ public interface VAppAsyncClient {
@Path("/virtualHardwareSection/cpu") @Path("/virtualHardwareSection/cpu")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture<ResourceAllocationSettingData> getVirtualHardwareSectionCpu(@EndpointParam URI vAppURI); ListenableFuture<ResourceAllocationSettingData> getVirtualHardwareSectionCpu(@EndpointParam URI vAppURI);
/** /**
@ -616,7 +585,6 @@ public interface VAppAsyncClient {
@Produces(OVF_RASD_ITEM) @Produces(OVF_RASD_ITEM)
@Consumes(TASK) @Consumes(TASK)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Task> modifyVirtualHardwareSectionCpu(@EndpointParam URI vAppURI, ListenableFuture<Task> modifyVirtualHardwareSectionCpu(@EndpointParam URI vAppURI,
@BinderParam(BindToXMLPayload.class) ResourceAllocationSettingData rasd); @BinderParam(BindToXMLPayload.class) ResourceAllocationSettingData rasd);
@ -627,7 +595,7 @@ public interface VAppAsyncClient {
@Path("/virtualHardwareSection/disks") @Path("/virtualHardwareSection/disks")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture<RasdItemsList> getVirtualHardwareSectionDisks(@EndpointParam URI vAppURI); ListenableFuture<RasdItemsList> getVirtualHardwareSectionDisks(@EndpointParam URI vAppURI);
/** /**
@ -638,7 +606,6 @@ public interface VAppAsyncClient {
@Produces(OVF_RASD_ITEMS_LIST) @Produces(OVF_RASD_ITEMS_LIST)
@Consumes(TASK) @Consumes(TASK)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Task> modifyVirtualHardwareSectionDisks(@EndpointParam URI vAppURI, ListenableFuture<Task> modifyVirtualHardwareSectionDisks(@EndpointParam URI vAppURI,
@BinderParam(BindToXMLPayload.class) RasdItemsList rasdItemsList); @BinderParam(BindToXMLPayload.class) RasdItemsList rasdItemsList);
@ -649,7 +616,7 @@ public interface VAppAsyncClient {
@Path("/virtualHardwareSection/media") @Path("/virtualHardwareSection/media")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture<RasdItemsList> getVirtualHardwareSectionMedia(@EndpointParam URI vAppURI); ListenableFuture<RasdItemsList> getVirtualHardwareSectionMedia(@EndpointParam URI vAppURI);
/** /**
@ -659,7 +626,7 @@ public interface VAppAsyncClient {
@Path("/virtualHardwareSection/memory") @Path("/virtualHardwareSection/memory")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture<ResourceAllocationSettingData> getVirtualHardwareSectionMemory(@EndpointParam URI vAppURI); ListenableFuture<ResourceAllocationSettingData> getVirtualHardwareSectionMemory(@EndpointParam URI vAppURI);
/** /**
@ -670,7 +637,6 @@ public interface VAppAsyncClient {
@Produces(OVF_RASD_ITEM) @Produces(OVF_RASD_ITEM)
@Consumes(TASK) @Consumes(TASK)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Task> modifyVirtualHardwareSectionMemory(@EndpointParam URI vAppURI, ListenableFuture<Task> modifyVirtualHardwareSectionMemory(@EndpointParam URI vAppURI,
@BinderParam(BindToXMLPayload.class) ResourceAllocationSettingData rasd); @BinderParam(BindToXMLPayload.class) ResourceAllocationSettingData rasd);
@ -681,7 +647,7 @@ public interface VAppAsyncClient {
@Path("/virtualHardwareSection/networkCards") @Path("/virtualHardwareSection/networkCards")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture<RasdItemsList> getVirtualHardwareSectionNetworkCards(@EndpointParam URI vAppURI); ListenableFuture<RasdItemsList> getVirtualHardwareSectionNetworkCards(@EndpointParam URI vAppURI);
/** /**
@ -692,7 +658,6 @@ public interface VAppAsyncClient {
@Produces(OVF_RASD_ITEMS_LIST) @Produces(OVF_RASD_ITEMS_LIST)
@Consumes(TASK) @Consumes(TASK)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Task> modifyVirtualHardwareSectionNetworkCards(@EndpointParam URI vAppURI, ListenableFuture<Task> modifyVirtualHardwareSectionNetworkCards(@EndpointParam URI vAppURI,
@BinderParam(BindToXMLPayload.class) RasdItemsList rasdItemsList); @BinderParam(BindToXMLPayload.class) RasdItemsList rasdItemsList);
@ -703,7 +668,7 @@ public interface VAppAsyncClient {
@Path("/virtualHardwareSection/serialPorts") @Path("/virtualHardwareSection/serialPorts")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture<RasdItemsList> getVirtualHardwareSectionSerialPorts(@EndpointParam URI vAppURI); ListenableFuture<RasdItemsList> getVirtualHardwareSectionSerialPorts(@EndpointParam URI vAppURI);
/** /**
@ -714,7 +679,6 @@ public interface VAppAsyncClient {
@Produces(OVF_RASD_ITEMS_LIST) @Produces(OVF_RASD_ITEMS_LIST)
@Consumes(TASK) @Consumes(TASK)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Task> modifyVirtualHardwareSectionSerialPorts(@EndpointParam URI vAppURI, ListenableFuture<Task> modifyVirtualHardwareSectionSerialPorts(@EndpointParam URI vAppURI,
@BinderParam(BindToXMLPayload.class) RasdItemsList rasdItemsList); @BinderParam(BindToXMLPayload.class) RasdItemsList rasdItemsList);

View File

@ -47,6 +47,7 @@ import org.jclouds.rest.annotations.ExceptionParser;
import org.jclouds.rest.annotations.JAXBResponseParser; import org.jclouds.rest.annotations.JAXBResponseParser;
import org.jclouds.rest.annotations.RequestFilters; import org.jclouds.rest.annotations.RequestFilters;
import org.jclouds.rest.binders.BindToXMLPayload; import org.jclouds.rest.binders.BindToXMLPayload;
import org.jclouds.rest.functions.ReturnNullOnNotFoundOr404;
import org.jclouds.vcloud.director.v1_5.domain.CustomizationSection; 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.GuestCustomizationSection;
import org.jclouds.vcloud.director.v1_5.domain.LeaseSettingsSection; import org.jclouds.vcloud.director.v1_5.domain.LeaseSettingsSection;
@ -61,7 +62,6 @@ import org.jclouds.vcloud.director.v1_5.domain.VAppTemplate;
import org.jclouds.vcloud.director.v1_5.domain.ovf.Envelope; import org.jclouds.vcloud.director.v1_5.domain.ovf.Envelope;
import org.jclouds.vcloud.director.v1_5.domain.ovf.NetworkSection; import org.jclouds.vcloud.director.v1_5.domain.ovf.NetworkSection;
import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest; import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest;
import org.jclouds.vcloud.director.v1_5.functions.ThrowVCloudErrorOn4xx;
import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.ListenableFuture;
@ -78,7 +78,7 @@ public interface VAppTemplateAsyncClient {
@GET @GET
@Consumes(VAPP_TEMPLATE) @Consumes(VAPP_TEMPLATE)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture<VAppTemplate> getVAppTemplate(@EndpointParam URI reference); ListenableFuture<VAppTemplate> getVAppTemplate(@EndpointParam URI reference);
@ -89,7 +89,6 @@ public interface VAppTemplateAsyncClient {
@Produces(VAPP_TEMPLATE) @Produces(VAPP_TEMPLATE)
@Consumes(TASK) @Consumes(TASK)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Task> editVAppTemplate(@EndpointParam URI templateURI, ListenableFuture<Task> editVAppTemplate(@EndpointParam URI templateURI,
@BinderParam(BindToXMLPayload.class) VAppTemplate template); @BinderParam(BindToXMLPayload.class) VAppTemplate template);
@ -99,7 +98,6 @@ public interface VAppTemplateAsyncClient {
@DELETE @DELETE
@Consumes(TASK) @Consumes(TASK)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Task> deleteVappTemplate(@EndpointParam URI templateUri); ListenableFuture<Task> deleteVappTemplate(@EndpointParam URI templateUri);
/** /**
@ -109,7 +107,6 @@ public interface VAppTemplateAsyncClient {
@Consumes(TASK) @Consumes(TASK)
@Path("/action/consolidate") @Path("/action/consolidate")
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Task> consolidateVappTemplate(@EndpointParam URI templateURI); ListenableFuture<Task> consolidateVappTemplate(@EndpointParam URI templateURI);
/** /**
@ -118,7 +115,6 @@ public interface VAppTemplateAsyncClient {
@POST @POST
@Path("/action/disableDownload") @Path("/action/disableDownload")
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Void> disableDownloadVappTemplate(@EndpointParam URI templateURI); ListenableFuture<Void> disableDownloadVappTemplate(@EndpointParam URI templateURI);
/** /**
@ -128,7 +124,6 @@ public interface VAppTemplateAsyncClient {
@Consumes(TASK) @Consumes(TASK)
@Path("/action/enableDownload") @Path("/action/enableDownload")
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Task> enableDownloadVappTemplate(@EndpointParam URI templateURI); ListenableFuture<Task> enableDownloadVappTemplate(@EndpointParam URI templateURI);
/** /**
@ -139,7 +134,6 @@ public interface VAppTemplateAsyncClient {
@Consumes(TASK) @Consumes(TASK)
@Path("/action/relocate") @Path("/action/relocate")
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Task> relocateVappTemplate(@EndpointParam URI templateURI, ListenableFuture<Task> relocateVappTemplate(@EndpointParam URI templateURI,
@BinderParam(BindToXMLPayload.class) RelocateParams params); @BinderParam(BindToXMLPayload.class) RelocateParams params);
@ -150,7 +144,7 @@ public interface VAppTemplateAsyncClient {
@Consumes(CUSTOMIZATION_SECTION) @Consumes(CUSTOMIZATION_SECTION)
@Path("/customizationSection") @Path("/customizationSection")
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture<CustomizationSection> getVAppTemplateCustomizationSection(@EndpointParam URI templateURI); ListenableFuture<CustomizationSection> getVAppTemplateCustomizationSection(@EndpointParam URI templateURI);
/** /**
@ -161,7 +155,6 @@ public interface VAppTemplateAsyncClient {
@Consumes(TASK) @Consumes(TASK)
@Path("/customizationSection") @Path("/customizationSection")
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Task> editVAppTemplateCustomizationSection(@EndpointParam URI templateURI, ListenableFuture<Task> editVAppTemplateCustomizationSection(@EndpointParam URI templateURI,
@BinderParam(BindToXMLPayload.class) CustomizationSection sectionType); @BinderParam(BindToXMLPayload.class) CustomizationSection sectionType);
@ -172,7 +165,7 @@ public interface VAppTemplateAsyncClient {
@Consumes(GUEST_CUSTOMIZATION_SECTION) @Consumes(GUEST_CUSTOMIZATION_SECTION)
@Path("/guestCustomizationSection") @Path("/guestCustomizationSection")
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture<GuestCustomizationSection> getVAppTemplateGuestCustomizationSection(@EndpointParam URI templateURI); ListenableFuture<GuestCustomizationSection> getVAppTemplateGuestCustomizationSection(@EndpointParam URI templateURI);
/** /**
@ -183,7 +176,6 @@ public interface VAppTemplateAsyncClient {
@Consumes(TASK) @Consumes(TASK)
@Path("/guestCustomizationSection") @Path("/guestCustomizationSection")
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Task> editVAppTemplateGuestCustomizationSection(@EndpointParam URI templateURI, ListenableFuture<Task> editVAppTemplateGuestCustomizationSection(@EndpointParam URI templateURI,
@BinderParam(BindToXMLPayload.class) GuestCustomizationSection section); @BinderParam(BindToXMLPayload.class) GuestCustomizationSection section);
@ -194,7 +186,7 @@ public interface VAppTemplateAsyncClient {
@Consumes(LEASE_SETTINGS_SECTION) @Consumes(LEASE_SETTINGS_SECTION)
@Path("/leaseSettingsSection") @Path("/leaseSettingsSection")
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture<LeaseSettingsSection> getVappTemplateLeaseSettingsSection(@EndpointParam URI templateURI); ListenableFuture<LeaseSettingsSection> getVappTemplateLeaseSettingsSection(@EndpointParam URI templateURI);
/** /**
@ -205,7 +197,6 @@ public interface VAppTemplateAsyncClient {
@Consumes(TASK) @Consumes(TASK)
@Path("/leaseSettingsSection") @Path("/leaseSettingsSection")
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Task> editVappTemplateLeaseSettingsSection(@EndpointParam URI templateURI, ListenableFuture<Task> editVappTemplateLeaseSettingsSection(@EndpointParam URI templateURI,
@BinderParam(BindToXMLPayload.class) LeaseSettingsSection settingsSection); @BinderParam(BindToXMLPayload.class) LeaseSettingsSection settingsSection);
@ -216,7 +207,7 @@ public interface VAppTemplateAsyncClient {
@Consumes(NETWORK_CONFIG_SECTION) @Consumes(NETWORK_CONFIG_SECTION)
@Path("/networkConfigSection") @Path("/networkConfigSection")
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture<NetworkConfigSection> getVAppTemplateNetworkConfigSection(@EndpointParam URI templateURI); ListenableFuture<NetworkConfigSection> getVAppTemplateNetworkConfigSection(@EndpointParam URI templateURI);
/** /**
@ -227,7 +218,6 @@ public interface VAppTemplateAsyncClient {
@Consumes(TASK) @Consumes(TASK)
@Path("/networkConfigSection") @Path("/networkConfigSection")
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Task> editVAppTemplateNetworkConfigSection(@EndpointParam URI templateURI, ListenableFuture<Task> editVAppTemplateNetworkConfigSection(@EndpointParam URI templateURI,
@BinderParam(BindToXMLPayload.class) NetworkConfigSection section); @BinderParam(BindToXMLPayload.class) NetworkConfigSection section);
@ -238,7 +228,7 @@ public interface VAppTemplateAsyncClient {
@Consumes(NETWORK_CONNECTION_SECTION) @Consumes(NETWORK_CONNECTION_SECTION)
@Path("/networkConnectionSection") @Path("/networkConnectionSection")
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture<NetworkConnectionSection> getVAppTemplateNetworkConnectionSection(@EndpointParam URI templateURI); ListenableFuture<NetworkConnectionSection> getVAppTemplateNetworkConnectionSection(@EndpointParam URI templateURI);
/** /**
@ -249,7 +239,6 @@ public interface VAppTemplateAsyncClient {
@Consumes(TASK) @Consumes(TASK)
@Path("/networkConnectionSection") @Path("/networkConnectionSection")
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Task> editVAppTemplateNetworkConnectionSection(@EndpointParam URI templateURI, ListenableFuture<Task> editVAppTemplateNetworkConnectionSection(@EndpointParam URI templateURI,
@BinderParam(BindToXMLPayload.class) NetworkConnectionSection section); @BinderParam(BindToXMLPayload.class) NetworkConnectionSection section);
@ -260,7 +249,7 @@ public interface VAppTemplateAsyncClient {
@Consumes(NETWORK_SECTION) @Consumes(NETWORK_SECTION)
@Path("/networkSection") @Path("/networkSection")
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture<NetworkSection> getVAppTemplateNetworkSection(@EndpointParam URI templateURI); ListenableFuture<NetworkSection> getVAppTemplateNetworkSection(@EndpointParam URI templateURI);
/** /**
@ -270,7 +259,7 @@ public interface VAppTemplateAsyncClient {
@Consumes @Consumes
@Path("/ovf") @Path("/ovf")
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture<Envelope> getVAppTemplateOvf(@EndpointParam URI templateURI); ListenableFuture<Envelope> getVAppTemplateOvf(@EndpointParam URI templateURI);
/** /**
@ -280,7 +269,7 @@ public interface VAppTemplateAsyncClient {
@Consumes(OWNER) @Consumes(OWNER)
@Path("/owner") @Path("/owner")
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture<Owner> getOwnerOfVAppTemplate(@EndpointParam URI templateURI); ListenableFuture<Owner> getOwnerOfVAppTemplate(@EndpointParam URI templateURI);
/** /**
@ -290,7 +279,7 @@ public interface VAppTemplateAsyncClient {
@Consumes(PRODUCT_SECTION_LIST) @Consumes(PRODUCT_SECTION_LIST)
@Path("/productSections") @Path("/productSections")
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture<ProductSectionList> getProductSectionsForVAppTemplate(@EndpointParam URI templateURI); ListenableFuture<ProductSectionList> getProductSectionsForVAppTemplate(@EndpointParam URI templateURI);
/** /**
@ -301,7 +290,6 @@ public interface VAppTemplateAsyncClient {
@Consumes(TASK) @Consumes(TASK)
@Path("/productSections") @Path("/productSections")
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Task> editProductSectionsForVAppTemplate(@EndpointParam URI templateURI, ListenableFuture<Task> editProductSectionsForVAppTemplate(@EndpointParam URI templateURI,
@BinderParam(BindToXMLPayload.class) ProductSectionList sections); @BinderParam(BindToXMLPayload.class) ProductSectionList sections);
@ -312,7 +300,7 @@ public interface VAppTemplateAsyncClient {
@Consumes @Consumes
@Path("/shadowVms") @Path("/shadowVms")
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture<References> getShadowVms(@EndpointParam URI templateURI); ListenableFuture<References> getShadowVms(@EndpointParam URI templateURI);
/** /**

View File

@ -33,6 +33,7 @@ import org.jclouds.rest.annotations.ExceptionParser;
import org.jclouds.rest.annotations.JAXBResponseParser; import org.jclouds.rest.annotations.JAXBResponseParser;
import org.jclouds.rest.annotations.RequestFilters; import org.jclouds.rest.annotations.RequestFilters;
import org.jclouds.rest.binders.BindToXMLPayload; import org.jclouds.rest.binders.BindToXMLPayload;
import org.jclouds.rest.functions.ReturnNullOnNotFoundOr404;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType; import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
import org.jclouds.vcloud.director.v1_5.domain.CaptureVAppParams; import org.jclouds.vcloud.director.v1_5.domain.CaptureVAppParams;
import org.jclouds.vcloud.director.v1_5.domain.CloneMediaParams; import org.jclouds.vcloud.director.v1_5.domain.CloneMediaParams;
@ -46,7 +47,6 @@ import org.jclouds.vcloud.director.v1_5.domain.VApp;
import org.jclouds.vcloud.director.v1_5.domain.VAppTemplate; import org.jclouds.vcloud.director.v1_5.domain.VAppTemplate;
import org.jclouds.vcloud.director.v1_5.domain.Vdc; import org.jclouds.vcloud.director.v1_5.domain.Vdc;
import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest; import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest;
import org.jclouds.vcloud.director.v1_5.functions.ThrowVCloudErrorOn4xx;
import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.ListenableFuture;
@ -63,7 +63,7 @@ public interface VdcAsyncClient {
@GET @GET
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class) @ExceptionParser(ReturnNullOnNotFoundOr404.class)
ListenableFuture<? extends Vdc> getVdc(@EndpointParam URI vdcURI); ListenableFuture<? extends Vdc> getVdc(@EndpointParam URI vdcURI);
/** /**
@ -74,7 +74,6 @@ public interface VdcAsyncClient {
@Consumes(VCloudDirectorMediaType.VAPP_TEMPLATE) @Consumes(VCloudDirectorMediaType.VAPP_TEMPLATE)
@Produces(VCloudDirectorMediaType.CAPTURE_VAPP_PARAMS) @Produces(VCloudDirectorMediaType.CAPTURE_VAPP_PARAMS)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<VAppTemplate> captureVApp(@EndpointParam URI vdcURI, ListenableFuture<VAppTemplate> captureVApp(@EndpointParam URI vdcURI,
@BinderParam(BindToXMLPayload.class) CaptureVAppParams params); @BinderParam(BindToXMLPayload.class) CaptureVAppParams params);
@ -86,7 +85,6 @@ public interface VdcAsyncClient {
@Consumes(VCloudDirectorMediaType.MEDIA) @Consumes(VCloudDirectorMediaType.MEDIA)
@Produces(VCloudDirectorMediaType.CLONE_MEDIA_PARAMS) @Produces(VCloudDirectorMediaType.CLONE_MEDIA_PARAMS)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Media> cloneMedia(@EndpointParam URI vdcURI, ListenableFuture<Media> cloneMedia(@EndpointParam URI vdcURI,
@BinderParam(BindToXMLPayload.class) CloneMediaParams params); @BinderParam(BindToXMLPayload.class) CloneMediaParams params);
@ -98,7 +96,6 @@ public interface VdcAsyncClient {
@Consumes(VCloudDirectorMediaType.VAPP) @Consumes(VCloudDirectorMediaType.VAPP)
@Produces(VCloudDirectorMediaType.CLONE_VAPP_PARAMS) //TODO fix these etc. @Produces(VCloudDirectorMediaType.CLONE_VAPP_PARAMS) //TODO fix these etc.
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<VApp> cloneVApp(@EndpointParam URI vdcURI, ListenableFuture<VApp> cloneVApp(@EndpointParam URI vdcURI,
@BinderParam(BindToXMLPayload.class) CloneVAppParams params); @BinderParam(BindToXMLPayload.class) CloneVAppParams params);
@ -110,7 +107,6 @@ public interface VdcAsyncClient {
@Consumes(VCloudDirectorMediaType.VAPP_TEMPLATE) @Consumes(VCloudDirectorMediaType.VAPP_TEMPLATE)
@Produces(VCloudDirectorMediaType.CLONE_VAPP_TEMPLATE_PARAMS) @Produces(VCloudDirectorMediaType.CLONE_VAPP_TEMPLATE_PARAMS)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<VAppTemplate> cloneVAppTemplate(@EndpointParam URI vdcURI, ListenableFuture<VAppTemplate> cloneVAppTemplate(@EndpointParam URI vdcURI,
@BinderParam(BindToXMLPayload.class) CloneVAppTemplateParams params); @BinderParam(BindToXMLPayload.class) CloneVAppTemplateParams params);
@ -122,7 +118,6 @@ public interface VdcAsyncClient {
@Consumes(VCloudDirectorMediaType.VAPP) @Consumes(VCloudDirectorMediaType.VAPP)
@Produces(VCloudDirectorMediaType.COMPOSE_VAPP_PARAMS) @Produces(VCloudDirectorMediaType.COMPOSE_VAPP_PARAMS)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<VApp> composeVApp(@EndpointParam URI vdcURI, ListenableFuture<VApp> composeVApp(@EndpointParam URI vdcURI,
@BinderParam(BindToXMLPayload.class) ComposeVAppParams params); @BinderParam(BindToXMLPayload.class) ComposeVAppParams params);
@ -134,7 +129,6 @@ public interface VdcAsyncClient {
@Consumes(VCloudDirectorMediaType.VAPP) @Consumes(VCloudDirectorMediaType.VAPP)
@Produces(VCloudDirectorMediaType.INSTANTIATE_VAPP_TEMPLATE_PARAMS) @Produces(VCloudDirectorMediaType.INSTANTIATE_VAPP_TEMPLATE_PARAMS)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<VApp> instantiateVApp(@EndpointParam URI vdcURI, ListenableFuture<VApp> instantiateVApp(@EndpointParam URI vdcURI,
@BinderParam(BindToXMLPayload.class) InstantiateVAppParamsType params); @BinderParam(BindToXMLPayload.class) InstantiateVAppParamsType params);
@ -146,7 +140,6 @@ public interface VdcAsyncClient {
@Consumes(VCloudDirectorMediaType.VAPP_TEMPLATE) @Consumes(VCloudDirectorMediaType.VAPP_TEMPLATE)
@Produces(VCloudDirectorMediaType.UPLOAD_VAPP_TEMPLATE_PARAMS) @Produces(VCloudDirectorMediaType.UPLOAD_VAPP_TEMPLATE_PARAMS)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<VAppTemplate> uploadVAppTemplate(@EndpointParam URI vdcURI, ListenableFuture<VAppTemplate> uploadVAppTemplate(@EndpointParam URI vdcURI,
@BinderParam(BindToXMLPayload.class) UploadVAppTemplateParams params); @BinderParam(BindToXMLPayload.class) UploadVAppTemplateParams params);
@ -158,7 +151,6 @@ public interface VdcAsyncClient {
@Consumes(VCloudDirectorMediaType.MEDIA) @Consumes(VCloudDirectorMediaType.MEDIA)
@Produces(VCloudDirectorMediaType.MEDIA) @Produces(VCloudDirectorMediaType.MEDIA)
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Media> createMedia(@EndpointParam URI vdcURI, ListenableFuture<Media> createMedia(@EndpointParam URI vdcURI,
@BinderParam(BindToXMLPayload.class) Media media); @BinderParam(BindToXMLPayload.class) Media media);

View File

@ -30,7 +30,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.ComposeVAppParams;
import org.jclouds.vcloud.director.v1_5.domain.InstantiateVAppParamsType; 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.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.UploadVAppTemplateParams;
import org.jclouds.vcloud.director.v1_5.domain.VApp; import org.jclouds.vcloud.director.v1_5.domain.VApp;
import org.jclouds.vcloud.director.v1_5.domain.VAppTemplate; import org.jclouds.vcloud.director.v1_5.domain.VAppTemplate;

View File

@ -23,6 +23,7 @@ import java.net.URI;
import javax.inject.Inject; import javax.inject.Inject;
import javax.inject.Singleton; import javax.inject.Singleton;
import org.jclouds.rest.ResourceNotFoundException;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType; import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
import org.jclouds.vcloud.director.v1_5.domain.Link; import org.jclouds.vcloud.director.v1_5.domain.Link;
import org.jclouds.vcloud.director.v1_5.domain.Org; import org.jclouds.vcloud.director.v1_5.domain.Org;
@ -49,6 +50,9 @@ public class OrgReferenceToTaskListEndpoint implements Function<Object, URI> {
Preconditions.checkArgument(input instanceof URI); Preconditions.checkArgument(input instanceof URI);
URI reference = (URI) input; URI reference = (URI) input;
Org org = client.getOrg(reference); Org org = client.getOrg(reference);
if (org == null) {
throw new ResourceNotFoundException();
}
for (Link link : org.getLinks()) { for (Link link : org.getLinks()) {
if (link.getType().equals(VCloudDirectorMediaType.TASKS_LIST)) { if (link.getType().equals(VCloudDirectorMediaType.TASKS_LIST)) {
return link.getHref(); return link.getHref();

View File

@ -1,63 +0,0 @@
/**
* 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.functions;
import java.io.IOException;
import javax.inject.Inject;
import javax.inject.Singleton;
import javax.xml.bind.JAXB;
import org.jclouds.http.HttpResponseException;
import org.jclouds.io.InputSuppliers;
import org.jclouds.rest.ResourceNotFoundException;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorException;
import org.jclouds.vcloud.director.v1_5.domain.Error;
import com.google.common.base.Function;
import com.google.common.base.Throwables;
import com.google.common.collect.Iterables;
/**
* @author grkvlt@apache.org
*/
@Singleton
public class ThrowVCloudErrorOn4xx implements Function<Exception, Object> {
@Inject
private ThrowVCloudErrorOn4xx() {
}
@Override
public Object apply(Exception from) {
Iterable<HttpResponseException> throwables = Iterables.filter(Throwables.getCausalChain(from), HttpResponseException.class);
HttpResponseException exception = Iterables.getFirst(throwables, null);
if (exception != null && exception.getResponse() != null && exception.getResponse().getStatusCode() >= 400 && exception.getResponse().getStatusCode() < 500) {
try {
Error error = JAXB.unmarshal(InputSuppliers.of(exception.getContent()).getInput(), Error.class);
if (exception.getResponse().getStatusCode() == 403 && error.getMinorErrorCode().equals("ACCESS_TO_RESOURCE_IS_FORBIDDEN")) {
throw new ResourceNotFoundException(error.getMessage());
}
throw new VCloudDirectorException(error);
} catch (IOException e) {
Throwables.propagate(e);
}
}
throw Throwables.propagate(from);
}
}

View File

@ -21,48 +21,57 @@ package org.jclouds.vcloud.director.v1_5.handlers;
import static org.jclouds.http.HttpUtils.closeClientButKeepContentStream; import static org.jclouds.http.HttpUtils.closeClientButKeepContentStream;
import javax.inject.Singleton; import javax.inject.Singleton;
import javax.xml.bind.JAXB;
import org.jclouds.http.HttpCommand; import org.jclouds.http.HttpCommand;
import org.jclouds.http.HttpErrorHandler; import org.jclouds.http.HttpErrorHandler;
import org.jclouds.http.HttpResponse; import org.jclouds.http.HttpResponse;
import org.jclouds.http.HttpResponseException; import org.jclouds.http.HttpResponseException;
import org.jclouds.io.InputSuppliers;
import org.jclouds.rest.AuthorizationException; import org.jclouds.rest.AuthorizationException;
import org.jclouds.rest.ResourceNotFoundException; import org.jclouds.rest.ResourceNotFoundException;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorException;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
import org.jclouds.vcloud.director.v1_5.domain.Error;
import com.google.common.base.Throwables;
/** /**
* This will parse and set an appropriate exception on the command object. * This will parse and set an appropriate exception on the command object.
* *
* @author Adrian Cole * @author Adrian Cole
*
*/ */
//TODO: is there error spec someplace? let's type errors, etc.
@Singleton @Singleton
public class VCloudDirectorErrorHandler implements HttpErrorHandler { public class VCloudDirectorErrorHandler implements HttpErrorHandler {
@Override
public void handleError(HttpCommand command, HttpResponse response) { public void handleError(HttpCommand command, HttpResponse response) {
// it is important to always read fully and close streams // it is important to always read fully and close streams
byte[] data = closeClientButKeepContentStream(response); byte[] data = closeClientButKeepContentStream(response);
String message = data != null ? new String(data) : null;
Exception exception = message != null ? new HttpResponseException(command, response, message) // Create default exception
: new HttpResponseException(command, response); String message = data != null
message = message != null ? message : String.format("%s -> %s", command.getCurrentRequest().getRequestLine(), ? new String(data)
response.getStatusLine()); : String.format("%s -> %s", command.getCurrentRequest().getRequestLine(), response.getStatusLine());
switch (response.getStatusCode()) { Exception exception = new HttpResponseException(command, response, response.getPayload().getContentMetadata().getContentType());
case 401:
case 403: // Try to create a VCloudDirectorException from XML payload
exception = new AuthorizationException(message, exception); if (response.getPayload().getContentMetadata().getContentType().startsWith(VCloudDirectorMediaType.ERROR)) {
break; try {
case 404: Error error = JAXB.unmarshal(InputSuppliers.of(data).getInput(), Error.class);
if (!command.getCurrentRequest().getMethod().equals("DELETE")) { exception = new VCloudDirectorException(error);
exception = new ResourceNotFoundException(message, exception); } catch (Exception e) {
} Throwables.propagate(e);
break; }
default:
exception = new HttpResponseException(command, response, message);
break;
} }
// Create custom exception for error codes we know about
if (response.getStatusCode() == 401) {
exception = new AuthorizationException(message, exception);
} else if (response.getStatusCode() == 403 || response.getStatusCode() == 404) {
exception = new ResourceNotFoundException(message, exception);
}
command.setException(exception); command.setException(exception);
} }
} }

View File

@ -34,7 +34,7 @@ import org.testng.annotations.Test;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
/** /**
* Test the {@link GroupClient} by observing its side effects. * Test the {@link AdminNetworkClient} by observing its side effects.
* *
* @author danikov * @author danikov
*/ */

View File

@ -30,7 +30,7 @@ import org.jclouds.vcloud.director.v1_5.internal.BaseVCloudDirectorRestClientExp
import org.testng.annotations.Test; import org.testng.annotations.Test;
/** /**
* Allows us to test a client via its side effects. * Test the {@link AdminVdcClient} by observing its side effects.
* *
* @author danikov * @author danikov
*/ */

View File

@ -19,11 +19,11 @@
package org.jclouds.vcloud.director.v1_5.features; package org.jclouds.vcloud.director.v1_5.features;
import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNull;
import static org.testng.Assert.fail; import static org.testng.Assert.fail;
import java.net.URI; import java.net.URI;
import org.jclouds.rest.ResourceNotFoundException;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorClient; import org.jclouds.vcloud.director.v1_5.VCloudDirectorClient;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorException; import org.jclouds.vcloud.director.v1_5.VCloudDirectorException;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType; import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
@ -44,7 +44,7 @@ import org.testng.annotations.Test;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
/** /**
* Allows us to test a client via its side effects. * Test the {@link MediaClient} via its side effects.
* *
* @author danikov * @author danikov
*/ */
@ -154,7 +154,7 @@ public class MediaClientExpectTest extends BaseVCloudDirectorRestClientExpectTes
} }
@Test @Test
public void testResponse403ForCatalogIdUsedAsMediaId() { public void testNullResponseForCatalogIdUsedAsMediaId() {
URI mediaUri = URI.create(endpoint + "/media/e9cd3387-ac57-4d27-a481-9bee75e0690f"); URI mediaUri = URI.create(endpoint + "/media/e9cd3387-ac57-4d27-a481-9bee75e0690f");
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse, VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
@ -166,16 +166,7 @@ public class MediaClientExpectTest extends BaseVCloudDirectorRestClientExpectTes
.xmlFilePayload("/media/error403-catalog.xml", VCloudDirectorMediaType.ERROR) .xmlFilePayload("/media/error403-catalog.xml", VCloudDirectorMediaType.ERROR)
.httpResponseBuilder().statusCode(403).build()); .httpResponseBuilder().statusCode(403).build());
String message = "No access to entity \"(com.vmware.vcloud.entity.media:e9cd3387-ac57-4d27-a481-9bee75e0690f)\"."; assertNull(client.getMediaClient().getMedia(mediaUri));
try {
client.getMediaClient().getMedia(mediaUri);
fail("Should give HTTP 403 error");
} catch (ResourceNotFoundException rnfe) {
assertEquals(rnfe.getMessage(), message);
} catch (Exception e) {
fail("Should have thrown a ResourceNotFoundException");
}
} }
@Test @Test
@ -191,16 +182,7 @@ public class MediaClientExpectTest extends BaseVCloudDirectorRestClientExpectTes
.xmlFilePayload("/media/error403-fake.xml", VCloudDirectorMediaType.ERROR) .xmlFilePayload("/media/error403-fake.xml", VCloudDirectorMediaType.ERROR)
.httpResponseBuilder().statusCode(403).build()); .httpResponseBuilder().statusCode(403).build());
String message = "No access to entity \"(com.vmware.vcloud.entity.media:aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee)\"."; assertNull(client.getMediaClient().getMedia(mediaUri));
try {
client.getMediaClient().getMedia(mediaUri);
fail("Should give HTTP 403 error");
} catch (ResourceNotFoundException rnfe) {
assertEquals(rnfe.getMessage(), message);
} catch (Exception e) {
fail("Should have thrown a ResourceNotFoundException");
}
} }
@Test @Test

View File

@ -19,11 +19,11 @@
package org.jclouds.vcloud.director.v1_5.features; package org.jclouds.vcloud.director.v1_5.features;
import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNull;
import static org.testng.Assert.fail; import static org.testng.Assert.fail;
import java.net.URI; import java.net.URI;
import org.jclouds.rest.ResourceNotFoundException;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorClient; import org.jclouds.vcloud.director.v1_5.VCloudDirectorClient;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorException; import org.jclouds.vcloud.director.v1_5.VCloudDirectorException;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType; import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
@ -48,7 +48,7 @@ import org.testng.annotations.Test;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
/** /**
* Allows us to test a client via its side effects. * Test the {@link NetworkClient} via its side effects.
* *
* @author danikov * @author danikov
*/ */
@ -114,16 +114,7 @@ public class NetworkClientExpectTest extends BaseVCloudDirectorRestClientExpectT
.xmlFilePayload("/network/error403-catalog.xml", VCloudDirectorMediaType.ERROR) .xmlFilePayload("/network/error403-catalog.xml", VCloudDirectorMediaType.ERROR)
.httpResponseBuilder().statusCode(403).build()); .httpResponseBuilder().statusCode(403).build());
String message = "This operation is denied."; assertNull(client.getNetworkClient().getNetwork(networkUri));
try {
client.getNetworkClient().getNetwork(networkUri);
fail("Should give HTTP 403 error");
} catch (ResourceNotFoundException rnfe) {
assertEquals(rnfe.getMessage(), message);
} catch (Exception e) {
fail("Should have thrown a ResourceNotFoundException");
}
} }
@Test @Test
@ -139,16 +130,7 @@ public class NetworkClientExpectTest extends BaseVCloudDirectorRestClientExpectT
.xmlFilePayload("/network/error403-fake.xml", VCloudDirectorMediaType.ERROR) .xmlFilePayload("/network/error403-fake.xml", VCloudDirectorMediaType.ERROR)
.httpResponseBuilder().statusCode(403).build()); .httpResponseBuilder().statusCode(403).build());
String message = "This operation is denied."; assertNull(client.getNetworkClient().getNetwork(networkUri));
try {
client.getNetworkClient().getNetwork(networkUri);
fail("Should give HTTP 403 error");
} catch (ResourceNotFoundException rnfe) {
assertEquals(rnfe.getMessage(), message);
} catch (Exception e) {
fail("Should have thrown a ResourceNotFoundException");
}
} }
@Test @Test

View File

@ -19,11 +19,11 @@
package org.jclouds.vcloud.director.v1_5.features; package org.jclouds.vcloud.director.v1_5.features;
import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNull;
import static org.testng.Assert.fail; import static org.testng.Assert.fail;
import java.net.URI; import java.net.URI;
import org.jclouds.rest.ResourceNotFoundException;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorClient; import org.jclouds.vcloud.director.v1_5.VCloudDirectorClient;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorException; import org.jclouds.vcloud.director.v1_5.VCloudDirectorException;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType; import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
@ -128,16 +128,7 @@ public class OrgClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
getStandardRequest("GET", "/org/9e08c2f6-077a-42ce-bece-d5332e2ebb5c"), getStandardRequest("GET", "/org/9e08c2f6-077a-42ce-bece-d5332e2ebb5c"),
getStandardPayloadResponse(403, "/org/error403-catalog.xml", VCloudDirectorMediaType.ERROR)); getStandardPayloadResponse(403, "/org/error403-catalog.xml", VCloudDirectorMediaType.ERROR));
String message = "No access to entity \"com.vmware.vcloud.entity.org:9e08c2f6-077a-42ce-bece-d5332e2ebb5c\"."; assertNull(client.getOrgClient().getOrg(orgUri));
try {
client.getOrgClient().getOrg(orgUri);
fail("Should give HTTP 403 error");
} catch (ResourceNotFoundException rnfe) {
assertEquals(rnfe.getMessage(), message);
} catch (Exception e) {
fail("Should have thrown a ResourceNotFoundException");
}
} }
@Test @Test
@ -148,16 +139,7 @@ public class OrgClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
getStandardRequest("GET", "/org/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), getStandardRequest("GET", "/org/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"),
getStandardPayloadResponse(403, "/org/error403-fake.xml", VCloudDirectorMediaType.ERROR)); getStandardPayloadResponse(403, "/org/error403-fake.xml", VCloudDirectorMediaType.ERROR));
String message = "No access to entity \"com.vmware.vcloud.entity.org:aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee\"."; assertNull(client.getOrgClient().getOrg(orgUri));
try {
client.getOrgClient().getOrg(orgUri);
fail("Should give HTTP 403 error");
} catch (ResourceNotFoundException rnfe) {
assertEquals(rnfe.getMessage(), message);
} catch (Exception e) {
fail("Should have thrown a ResourceNotFoundException");
}
} }
@Test @Test

View File

@ -19,13 +19,13 @@
package org.jclouds.vcloud.director.v1_5.features; package org.jclouds.vcloud.director.v1_5.features;
import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNull;
import static org.testng.Assert.fail; import static org.testng.Assert.fail;
import java.net.URI; import java.net.URI;
import org.jclouds.http.HttpRequest; import org.jclouds.http.HttpRequest;
import org.jclouds.http.HttpResponse; import org.jclouds.http.HttpResponse;
import org.jclouds.rest.ResourceNotFoundException;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorClient; import org.jclouds.vcloud.director.v1_5.VCloudDirectorClient;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorException; import org.jclouds.vcloud.director.v1_5.VCloudDirectorException;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType; import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
@ -163,16 +163,7 @@ public class TaskClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse, taskRequest, taskResponse, orgRequest, orgResponse); VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse, taskRequest, taskResponse, orgRequest, orgResponse);
String message = "No access to entity \"com.vmware.vcloud.entity.org:aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee\"."; assertNull(client.getTaskClient().getTaskList(URI.create("https://vcloudbeta.bluelock.com/api/org/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee")));
try {
client.getTaskClient().getTaskList(URI.create("https://vcloudbeta.bluelock.com/api/org/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"));
fail("Should give HTTP 403 error");
} catch (ResourceNotFoundException rnfe) {
assertEquals(rnfe.getMessage(), message);
} catch (Exception e) {
fail("Should have thrown a ResourceNotFoundException");
}
} }
@Test @Test

View File

@ -23,8 +23,8 @@ import static org.testng.Assert.assertEquals;
import java.net.URI; import java.net.URI;
import java.util.Collections; import java.util.Collections;
import org.jclouds.rest.ResourceNotFoundException;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorClient; import org.jclouds.vcloud.director.v1_5.VCloudDirectorClient;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorException;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType; import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
import org.jclouds.vcloud.director.v1_5.domain.Link; import org.jclouds.vcloud.director.v1_5.domain.Link;
import org.jclouds.vcloud.director.v1_5.domain.Reference; import org.jclouds.vcloud.director.v1_5.domain.Reference;
@ -33,11 +33,11 @@ import org.jclouds.vcloud.director.v1_5.internal.BaseVCloudDirectorRestClientExp
import org.testng.annotations.Test; import org.testng.annotations.Test;
/** /**
* Test the {@link GroupClient} by observing its side effects. * Test the {@link UserClient} by observing its side effects.
* *
* @author danikov * @author danikov
*/ */
@Test(groups = { "unit", "admin", "adminUser"}, singleThreaded = true, testName = "UserClientExpectTest") @Test(groups = { "unit", "admin", "adminUser" }, singleThreaded = true, testName = "UserClientExpectTest")
public class UserClientExpectTest extends BaseVCloudDirectorRestClientExpectTest { public class UserClientExpectTest extends BaseVCloudDirectorRestClientExpectTest {
private Reference orgRef = Reference.builder() private Reference orgRef = Reference.builder()
@ -199,7 +199,7 @@ public class UserClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
client.getUserClient().unlockUser(userRef.getHref()); client.getUserClient().unlockUser(userRef.getHref());
} }
@Test(expectedExceptions = VCloudDirectorException.class) @Test(expectedExceptions = ResourceNotFoundException.class)
public void testUnlockUserFailNotFound() { public void testUnlockUserFailNotFound() {
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse, VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
new VcloudHttpRequestPrimer() new VcloudHttpRequestPrimer()

View File

@ -31,6 +31,7 @@ import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.TASK;
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.VAPP_TEMPLATE; import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.VAPP_TEMPLATE;
import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotNull; import static org.testng.Assert.assertNotNull;
import static org.testng.Assert.assertNull;
import java.net.URI; import java.net.URI;
import java.text.ParseException; import java.text.ParseException;
@ -275,7 +276,6 @@ public class VAppTemplateClientExpectTest extends BaseVCloudDirectorRestClientEx
assertNotNull(task); assertNotNull(task);
} }
@Test(expectedExceptions = ResourceNotFoundException.class)
public void testErrorGetCustomizationSection() { public void testErrorGetCustomizationSection() {
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9"; final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
URI uri = URI.create(endpoint + templateId); URI uri = URI.create(endpoint + templateId);
@ -284,7 +284,7 @@ public class VAppTemplateClientExpectTest extends BaseVCloudDirectorRestClientEx
new VcloudHttpRequestPrimer().apiCommand("GET", templateId + "/customizationSection").acceptMedia(CUSTOMIZATION_SECTION).httpRequestBuilder().build(), new VcloudHttpRequestPrimer().apiCommand("GET", templateId + "/customizationSection").acceptMedia(CUSTOMIZATION_SECTION).httpRequestBuilder().build(),
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/error403.xml", ERROR).httpResponseBuilder().statusCode(403).build()).getVAppTemplateClient(); new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/error403.xml", ERROR).httpResponseBuilder().statusCode(403).build()).getVAppTemplateClient();
client.getVAppTemplateCustomizationSection(uri); assertNull(client.getVAppTemplateCustomizationSection(uri));
} }
@Test(expectedExceptions = ResourceNotFoundException.class) @Test(expectedExceptions = ResourceNotFoundException.class)
@ -363,7 +363,6 @@ public class VAppTemplateClientExpectTest extends BaseVCloudDirectorRestClientEx
assertNotNull(task); assertNotNull(task);
} }
@Test(expectedExceptions = ResourceNotFoundException.class)
public void testErrorGetLeaseSettingsSection() { public void testErrorGetLeaseSettingsSection() {
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9"; final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
URI uri = URI.create(endpoint + templateId); URI uri = URI.create(endpoint + templateId);
@ -372,7 +371,7 @@ public class VAppTemplateClientExpectTest extends BaseVCloudDirectorRestClientEx
new VcloudHttpRequestPrimer().apiCommand("GET", templateId + "/leaseSettingsSection").acceptMedia(LEASE_SETTINGS_SECTION).httpRequestBuilder().build(), new VcloudHttpRequestPrimer().apiCommand("GET", templateId + "/leaseSettingsSection").acceptMedia(LEASE_SETTINGS_SECTION).httpRequestBuilder().build(),
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/error403.xml", ERROR).httpResponseBuilder().statusCode(403).build()).getVAppTemplateClient(); new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/error403.xml", ERROR).httpResponseBuilder().statusCode(403).build()).getVAppTemplateClient();
client.getVappTemplateLeaseSettingsSection(uri); assertNull(client.getVappTemplateLeaseSettingsSection(uri));
} }
@Test(expectedExceptions = ResourceNotFoundException.class) @Test(expectedExceptions = ResourceNotFoundException.class)
@ -456,7 +455,6 @@ public class VAppTemplateClientExpectTest extends BaseVCloudDirectorRestClientEx
assertNotNull(task); assertNotNull(task);
} }
@Test(expectedExceptions = ResourceNotFoundException.class)
public void testErrorGetMetadataValue() { public void testErrorGetMetadataValue() {
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9"; final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
URI uri = URI.create(endpoint + templateId); URI uri = URI.create(endpoint + templateId);
@ -465,7 +463,7 @@ public class VAppTemplateClientExpectTest extends BaseVCloudDirectorRestClientEx
new VcloudHttpRequestPrimer().apiCommand("GET", templateId + "/metadata/12345").acceptMedia(METADATA_ENTRY).httpRequestBuilder().build(), new VcloudHttpRequestPrimer().apiCommand("GET", templateId + "/metadata/12345").acceptMedia(METADATA_ENTRY).httpRequestBuilder().build(),
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/error403.xml", ERROR).httpResponseBuilder().statusCode(403).build()).getVAppTemplateClient(); new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/error403.xml", ERROR).httpResponseBuilder().statusCode(403).build()).getVAppTemplateClient();
client.getMetadataClient().getMetadataValue(uri, "12345"); assertNull(client.getMetadataClient().getMetadataValue(uri, "12345"));
} }
@Test(expectedExceptions = VCloudDirectorException.class) @Test(expectedExceptions = VCloudDirectorException.class)

View File

@ -19,11 +19,11 @@
package org.jclouds.vcloud.director.v1_5.features; package org.jclouds.vcloud.director.v1_5.features;
import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNull;
import static org.testng.Assert.fail; import static org.testng.Assert.fail;
import java.net.URI; import java.net.URI;
import org.jclouds.rest.ResourceNotFoundException;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorClient; import org.jclouds.vcloud.director.v1_5.VCloudDirectorClient;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorException; import org.jclouds.vcloud.director.v1_5.VCloudDirectorException;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType; import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
@ -120,16 +120,7 @@ public class VdcClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
.xmlFilePayload("/vdc/error403-fake.xml", VCloudDirectorMediaType.ERROR) .xmlFilePayload("/vdc/error403-fake.xml", VCloudDirectorMediaType.ERROR)
.httpResponseBuilder().statusCode(403).build()); .httpResponseBuilder().statusCode(403).build());
String message = "No access to entity \"com.vmware.vcloud.entity.vdc:aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee\"."; assertNull(client.getVdcClient().getVdc(URI.create(endpoint + "/vdc/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee")));
try {
client.getVdcClient().getVdc(URI.create(endpoint + "/vdc/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"));
fail("Should give HTTP 403 error");
} catch (ResourceNotFoundException rnfe) {
assertEquals(rnfe.getMessage(), message);
} catch (Exception e) {
fail("Should have thrown a ResourceNotFoundException");
}
} }
@Test(enabled = false) @Test(enabled = false)