update client with new approach

This commit is contained in:
danikov 2012-02-13 12:06:41 +00:00
parent ed316161ac
commit 1944bd19f6
1 changed files with 17 additions and 13 deletions

View File

@ -18,21 +18,22 @@
*/ */
package org.jclouds.vcloud.director.v1_5.features; package org.jclouds.vcloud.director.v1_5.features;
import java.net.URI;
import javax.ws.rs.Consumes; import javax.ws.rs.Consumes;
import javax.ws.rs.GET; import javax.ws.rs.GET;
import javax.ws.rs.Path; import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import org.jclouds.rest.annotations.EndpointParam; 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.Metadata; 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.MetadataEntry;
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.ReferenceType;
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.ReferenceToEndpoint;
import org.jclouds.vcloud.director.v1_5.functions.ThrowVCloudErrorOn4xx;
import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.ListenableFuture;
@ -45,30 +46,33 @@ import com.google.common.util.concurrent.ListenableFuture;
public interface NetworkAsyncClient { public interface NetworkAsyncClient {
/** /**
* @see NeworkClient#getNetwork() * @see NeworkClient#getNetwork(ReferenceType)
*/ */
@GET @GET
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ReturnNullOnNotFoundOr404.class) @ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<OrgNetwork> getNetwork(@EndpointParam URI uri); ListenableFuture<OrgNetwork> getNetwork(@EndpointParam(parser = ReferenceToEndpoint.class) ReferenceType<?> networkRef);
/** /**
* @see NeworkClient#getMetadata() * @see NeworkClient#getMetadata(ReferenceType)
*/ */
@GET @GET
@Path("/metadata/") @Path("/metadata")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ReturnNullOnNotFoundOr404.class) @ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Metadata> getMetadata(@EndpointParam URI orgRef); ListenableFuture<Metadata> getMetadata(@EndpointParam(parser = ReferenceToEndpoint.class) ReferenceType<?> networkRef);
/** /**
* @see NeworkClient#getMetadataEntry() * @see NeworkClient#getMetadataEntry(ReferenceType, String)
*/ */
@GET @GET
@Path("/metadata/{key}")
@Consumes @Consumes
@JAXBResponseParser @JAXBResponseParser
@ExceptionParser(ReturnNullOnNotFoundOr404.class) @ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<MetadataEntry> getMetadataEntry(@EndpointParam URI metaDataRef); ListenableFuture<MetadataEntry> getMetadataEntry(@EndpointParam(parser = ReferenceToEndpoint.class) ReferenceType<?> networkRef ,
@PathParam("key") String key);
} }