diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/NetworkAsyncClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/NetworkAsyncClient.java index aea399dbb4..fee21f3778 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/NetworkAsyncClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/NetworkAsyncClient.java @@ -18,21 +18,22 @@ */ package org.jclouds.vcloud.director.v1_5.features; -import java.net.URI; - import javax.ws.rs.Consumes; import javax.ws.rs.GET; import javax.ws.rs.Path; +import javax.ws.rs.PathParam; import org.jclouds.rest.annotations.EndpointParam; import org.jclouds.rest.annotations.ExceptionParser; import org.jclouds.rest.annotations.JAXBResponseParser; import org.jclouds.rest.annotations.RequestFilters; -import org.jclouds.rest.functions.ReturnNullOnNotFoundOr404; import org.jclouds.vcloud.director.v1_5.domain.Metadata; import org.jclouds.vcloud.director.v1_5.domain.MetadataEntry; import org.jclouds.vcloud.director.v1_5.domain.OrgNetwork; +import org.jclouds.vcloud.director.v1_5.domain.ReferenceType; import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest; +import org.jclouds.vcloud.director.v1_5.functions.ReferenceToEndpoint; +import org.jclouds.vcloud.director.v1_5.functions.ThrowVCloudErrorOn4xx; import com.google.common.util.concurrent.ListenableFuture; @@ -45,30 +46,33 @@ import com.google.common.util.concurrent.ListenableFuture; public interface NetworkAsyncClient { /** - * @see NeworkClient#getNetwork() + * @see NeworkClient#getNetwork(ReferenceType) */ @GET @Consumes @JAXBResponseParser - @ExceptionParser(ReturnNullOnNotFoundOr404.class) - ListenableFuture getNetwork(@EndpointParam URI uri); + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture getNetwork(@EndpointParam(parser = ReferenceToEndpoint.class) ReferenceType networkRef); /** - * @see NeworkClient#getMetadata() + * @see NeworkClient#getMetadata(ReferenceType) */ @GET - @Path("/metadata/") + @Path("/metadata") @Consumes @JAXBResponseParser - @ExceptionParser(ReturnNullOnNotFoundOr404.class) - ListenableFuture getMetadata(@EndpointParam URI orgRef); + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture getMetadata(@EndpointParam(parser = ReferenceToEndpoint.class) ReferenceType networkRef); /** - * @see NeworkClient#getMetadataEntry() + * @see NeworkClient#getMetadataEntry(ReferenceType, String) */ @GET + @Path("/metadata/{key}") @Consumes @JAXBResponseParser - @ExceptionParser(ReturnNullOnNotFoundOr404.class) - ListenableFuture getMetadataEntry(@EndpointParam URI metaDataRef); + @ExceptionParser(ThrowVCloudErrorOn4xx.class) + ListenableFuture getMetadataEntry(@EndpointParam(parser = ReferenceToEndpoint.class) ReferenceType networkRef , + @PathParam("key") String key); + }