Issue 1184 in jclouds: @Named annotations in all async api methods.

This commit is contained in:
Ignasi Barrera 2013-01-19 11:32:39 +01:00
parent c1be4300a4
commit 63d203325f
1 changed files with 48 additions and 1 deletions

View File

@ -23,6 +23,7 @@ import java.net.URI;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import javax.inject.Named;
import javax.ws.rs.Consumes; import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE; import javax.ws.rs.DELETE;
import javax.ws.rs.GET; import javax.ws.rs.GET;
@ -86,7 +87,6 @@ import com.google.common.util.concurrent.ListenableFuture;
* <p/> * <p/>
* *
* @see ChefApi * @see ChefApi
* @see <a href="TODO: insert URL of provider documentation" />
* @author Adrian Cole * @author Adrian Cole
*/ */
@RequestFilters(SignedHeaderAuth.class) @RequestFilters(SignedHeaderAuth.class)
@ -98,6 +98,7 @@ public interface ChefAsyncApi {
/** /**
* @see ChefApi#getUploadSandboxForChecksums(Set) * @see ChefApi#getUploadSandboxForChecksums(Set)
*/ */
@Named("sandbox:upload")
@POST @POST
@Path("/sandboxes") @Path("/sandboxes")
ListenableFuture<UploadSandbox> getUploadSandboxForChecksums( ListenableFuture<UploadSandbox> getUploadSandboxForChecksums(
@ -106,6 +107,7 @@ public interface ChefAsyncApi {
/** /**
* @see ChefApi#uploadContent(URI, Payload) * @see ChefApi#uploadContent(URI, Payload)
*/ */
@Named("content:upload")
@PUT @PUT
@Produces("application/x-binary") @Produces("application/x-binary")
ListenableFuture<Void> uploadContent(@EndpointParam URI location, Payload content); ListenableFuture<Void> uploadContent(@EndpointParam URI location, Payload content);
@ -113,6 +115,7 @@ public interface ChefAsyncApi {
/** /**
* @see ChefApi#commitSandbox(String, boolean) * @see ChefApi#commitSandbox(String, boolean)
*/ */
@Named("sandbox:commit")
@PUT @PUT
@Path("/sandboxes/{id}") @Path("/sandboxes/{id}")
ListenableFuture<Sandbox> commitSandbox(@PathParam("id") String id, ListenableFuture<Sandbox> commitSandbox(@PathParam("id") String id,
@ -121,6 +124,7 @@ public interface ChefAsyncApi {
/** /**
* @see ChefApi#listCookbooks() * @see ChefApi#listCookbooks()
*/ */
@Named("cookbook:list")
@GET @GET
@Path("/cookbooks") @Path("/cookbooks")
@ResponseParser(ParseCookbookDefinitionCheckingChefVersion.class) @ResponseParser(ParseCookbookDefinitionCheckingChefVersion.class)
@ -130,6 +134,7 @@ public interface ChefAsyncApi {
/** /**
* @see ChefApi#updateCookbook(String, String, CookbookVersion) * @see ChefApi#updateCookbook(String, String, CookbookVersion)
*/ */
@Named("cookbook:update")
@PUT @PUT
@Path("/cookbooks/{cookbookname}/{version}") @Path("/cookbooks/{cookbookname}/{version}")
ListenableFuture<CookbookVersion> updateCookbook(@PathParam("cookbookname") String cookbookName, ListenableFuture<CookbookVersion> updateCookbook(@PathParam("cookbookname") String cookbookName,
@ -138,6 +143,7 @@ public interface ChefAsyncApi {
/** /**
* @see ChefApi#deleteCookbook(String, String) * @see ChefApi#deleteCookbook(String, String)
*/ */
@Named("cookbook:delete")
@DELETE @DELETE
@Path("/cookbooks/{cookbookname}/{version}") @Path("/cookbooks/{cookbookname}/{version}")
@Fallback(NullOnNotFoundOr404.class) @Fallback(NullOnNotFoundOr404.class)
@ -147,6 +153,7 @@ public interface ChefAsyncApi {
/** /**
* @see ChefApi#getVersionsOfCookbook(String) * @see ChefApi#getVersionsOfCookbook(String)
*/ */
@Named("cookbook:versions")
@GET @GET
@Path("/cookbooks/{cookbookname}") @Path("/cookbooks/{cookbookname}")
@ResponseParser(ParseCookbookVersionsCheckingChefVersion.class) @ResponseParser(ParseCookbookVersionsCheckingChefVersion.class)
@ -156,6 +163,7 @@ public interface ChefAsyncApi {
/** /**
* @see ChefApi#getCookbook(String, String) * @see ChefApi#getCookbook(String, String)
*/ */
@Named("cookbook:get")
@GET @GET
@Path("/cookbooks/{cookbookname}/{version}") @Path("/cookbooks/{cookbookname}/{version}")
@Fallback(NullOnNotFoundOr404.class) @Fallback(NullOnNotFoundOr404.class)
@ -165,6 +173,7 @@ public interface ChefAsyncApi {
/** /**
* @see ChefApi#createClient(String) * @see ChefApi#createClient(String)
*/ */
@Named("client:create")
@POST @POST
@Path("/clients") @Path("/clients")
@MapBinder(BindToJsonPayload.class) @MapBinder(BindToJsonPayload.class)
@ -173,6 +182,7 @@ public interface ChefAsyncApi {
/** /**
* @see ChefApi#createClient(String, CreateApiOptions) * @see ChefApi#createClient(String, CreateApiOptions)
*/ */
@Named("client:create")
@POST @POST
@Path("/clients") @Path("/clients")
@MapBinder(BindCreateClientOptionsToJsonPayload.class) @MapBinder(BindCreateClientOptionsToJsonPayload.class)
@ -181,6 +191,7 @@ public interface ChefAsyncApi {
/** /**
* @see ChefApi#generateKeyForClient(String) * @see ChefApi#generateKeyForClient(String)
*/ */
@Named("client:generatekey")
@PUT @PUT
@Path("/clients/{clientname}") @Path("/clients/{clientname}")
ListenableFuture<Client> generateKeyForClient( ListenableFuture<Client> generateKeyForClient(
@ -189,6 +200,7 @@ public interface ChefAsyncApi {
/** /**
* @see ChefApi#clientExists(String) * @see ChefApi#clientExists(String)
*/ */
@Named("client:exists")
@HEAD @HEAD
@Path("/clients/{clientname}") @Path("/clients/{clientname}")
@Fallback(FalseOnNotFoundOr404.class) @Fallback(FalseOnNotFoundOr404.class)
@ -197,6 +209,7 @@ public interface ChefAsyncApi {
/** /**
* @see ChefApi#getClient(String) * @see ChefApi#getClient(String)
*/ */
@Named("client:get")
@GET @GET
@Path("/clients/{clientname}") @Path("/clients/{clientname}")
@Fallback(NullOnNotFoundOr404.class) @Fallback(NullOnNotFoundOr404.class)
@ -205,6 +218,7 @@ public interface ChefAsyncApi {
/** /**
* @see ChefApi#deleteClient(String) * @see ChefApi#deleteClient(String)
*/ */
@Named("client:delete")
@DELETE @DELETE
@Path("/clients/{clientname}") @Path("/clients/{clientname}")
@Fallback(NullOnNotFoundOr404.class) @Fallback(NullOnNotFoundOr404.class)
@ -213,6 +227,7 @@ public interface ChefAsyncApi {
/** /**
* @see ChefApi#listClients() * @see ChefApi#listClients()
*/ */
@Named("client:list")
@GET @GET
@Path("/clients") @Path("/clients")
@ResponseParser(ParseKeySetFromJson.class) @ResponseParser(ParseKeySetFromJson.class)
@ -222,6 +237,7 @@ public interface ChefAsyncApi {
/** /**
* @see ChefApi#createNode(Node) * @see ChefApi#createNode(Node)
*/ */
@Named("node:create")
@POST @POST
@Path("/nodes") @Path("/nodes")
ListenableFuture<Void> createNode(@BinderParam(BindToJsonPayload.class) Node node); ListenableFuture<Void> createNode(@BinderParam(BindToJsonPayload.class) Node node);
@ -229,6 +245,7 @@ public interface ChefAsyncApi {
/** /**
* @see ChefApi#updateNode(Node) * @see ChefApi#updateNode(Node)
*/ */
@Named("node:update")
@PUT @PUT
@Path("/nodes/{nodename}") @Path("/nodes/{nodename}")
ListenableFuture<Node> updateNode( ListenableFuture<Node> updateNode(
@ -237,6 +254,7 @@ public interface ChefAsyncApi {
/** /**
* @see ChefApi#nodeExists(String) * @see ChefApi#nodeExists(String)
*/ */
@Named("node:exists")
@HEAD @HEAD
@Path("/nodes/{nodename}") @Path("/nodes/{nodename}")
@Fallback(FalseOnNotFoundOr404.class) @Fallback(FalseOnNotFoundOr404.class)
@ -245,6 +263,7 @@ public interface ChefAsyncApi {
/** /**
* @see ChefApi#getNode(String) * @see ChefApi#getNode(String)
*/ */
@Named("node:get")
@GET @GET
@Path("/nodes/{nodename}") @Path("/nodes/{nodename}")
@Fallback(NullOnNotFoundOr404.class) @Fallback(NullOnNotFoundOr404.class)
@ -253,6 +272,7 @@ public interface ChefAsyncApi {
/** /**
* @see ChefNode#deleteNode * @see ChefNode#deleteNode
*/ */
@Named("node:delete")
@DELETE @DELETE
@Path("/nodes/{nodename}") @Path("/nodes/{nodename}")
@Fallback(NullOnNotFoundOr404.class) @Fallback(NullOnNotFoundOr404.class)
@ -261,6 +281,7 @@ public interface ChefAsyncApi {
/** /**
* @see ChefApi#listNodes() * @see ChefApi#listNodes()
*/ */
@Named("node:list")
@GET @GET
@Path("/nodes") @Path("/nodes")
@ResponseParser(ParseKeySetFromJson.class) @ResponseParser(ParseKeySetFromJson.class)
@ -270,6 +291,7 @@ public interface ChefAsyncApi {
/** /**
* @see ChefApi#createRole(Role) * @see ChefApi#createRole(Role)
*/ */
@Named("role:create")
@POST @POST
@Path("/roles") @Path("/roles")
ListenableFuture<Void> createRole(@BinderParam(BindToJsonPayload.class) Role role); ListenableFuture<Void> createRole(@BinderParam(BindToJsonPayload.class) Role role);
@ -277,6 +299,7 @@ public interface ChefAsyncApi {
/** /**
* @see ChefApi#updateRole(Role) * @see ChefApi#updateRole(Role)
*/ */
@Named("role:update")
@PUT @PUT
@Path("/roles/{rolename}") @Path("/roles/{rolename}")
ListenableFuture<Role> updateRole( ListenableFuture<Role> updateRole(
@ -285,6 +308,7 @@ public interface ChefAsyncApi {
/** /**
* @see ChefApi#roleExists(String) * @see ChefApi#roleExists(String)
*/ */
@Named("role:exists")
@HEAD @HEAD
@Path("/roles/{rolename}") @Path("/roles/{rolename}")
@Fallback(FalseOnNotFoundOr404.class) @Fallback(FalseOnNotFoundOr404.class)
@ -293,6 +317,7 @@ public interface ChefAsyncApi {
/** /**
* @see ChefApi#getRole(String) * @see ChefApi#getRole(String)
*/ */
@Named("role:get")
@GET @GET
@Path("/roles/{rolename}") @Path("/roles/{rolename}")
@Fallback(NullOnNotFoundOr404.class) @Fallback(NullOnNotFoundOr404.class)
@ -301,6 +326,7 @@ public interface ChefAsyncApi {
/** /**
* @see ChefApi#deleteRole(String) * @see ChefApi#deleteRole(String)
*/ */
@Named("role:delete")
@DELETE @DELETE
@Path("/roles/{rolename}") @Path("/roles/{rolename}")
@Fallback(NullOnNotFoundOr404.class) @Fallback(NullOnNotFoundOr404.class)
@ -309,6 +335,7 @@ public interface ChefAsyncApi {
/** /**
* @see ChefApi#listRoles() * @see ChefApi#listRoles()
*/ */
@Named("role:list")
@GET @GET
@Path("/roles") @Path("/roles")
@ResponseParser(ParseKeySetFromJson.class) @ResponseParser(ParseKeySetFromJson.class)
@ -318,6 +345,7 @@ public interface ChefAsyncApi {
/** /**
* @see ChefApi#listDatabags() * @see ChefApi#listDatabags()
*/ */
@Named("databag:list")
@GET @GET
@Path("/data") @Path("/data")
@ResponseParser(ParseKeySetFromJson.class) @ResponseParser(ParseKeySetFromJson.class)
@ -327,6 +355,7 @@ public interface ChefAsyncApi {
/** /**
* @see ChefApi#createDatabag(String) * @see ChefApi#createDatabag(String)
*/ */
@Named("databag:create")
@POST @POST
@Path("/data") @Path("/data")
ListenableFuture<Void> createDatabag(@BinderParam(BindNameToJsonPayload.class) String databagName); ListenableFuture<Void> createDatabag(@BinderParam(BindNameToJsonPayload.class) String databagName);
@ -334,6 +363,7 @@ public interface ChefAsyncApi {
/** /**
* @see ChefApi#databagExists(String) * @see ChefApi#databagExists(String)
*/ */
@Named("databag:exists")
@HEAD @HEAD
@Path("/data/{name}") @Path("/data/{name}")
@Fallback(FalseOnNotFoundOr404.class) @Fallback(FalseOnNotFoundOr404.class)
@ -342,6 +372,7 @@ public interface ChefAsyncApi {
/** /**
* @see ChefApi#deleteDatabag(String) * @see ChefApi#deleteDatabag(String)
*/ */
@Named("databag:delete")
@DELETE @DELETE
@Path("/data/{name}") @Path("/data/{name}")
@Fallback(VoidOnNotFoundOr404.class) @Fallback(VoidOnNotFoundOr404.class)
@ -350,6 +381,7 @@ public interface ChefAsyncApi {
/** /**
* @see ChefApi#listDatabagItems(String) * @see ChefApi#listDatabagItems(String)
*/ */
@Named("databag:listitems")
@GET @GET
@Path("/data/{name}") @Path("/data/{name}")
@ResponseParser(ParseKeySetFromJson.class) @ResponseParser(ParseKeySetFromJson.class)
@ -359,6 +391,7 @@ public interface ChefAsyncApi {
/** /**
* @see ChefApi#createDatabagItem(String, DatabagItem) * @see ChefApi#createDatabagItem(String, DatabagItem)
*/ */
@Named("databag:createitem")
@POST @POST
@Path("/data/{databagName}") @Path("/data/{databagName}")
ListenableFuture<DatabagItem> createDatabagItem(@PathParam("databagName") String databagName, ListenableFuture<DatabagItem> createDatabagItem(@PathParam("databagName") String databagName,
@ -367,6 +400,7 @@ public interface ChefAsyncApi {
/** /**
* @see ChefApi#updateDatabagItem(String, DatabagItem) * @see ChefApi#updateDatabagItem(String, DatabagItem)
*/ */
@Named("databag:updateitem")
@PUT @PUT
@Path("/data/{databagName}/{databagItemId}") @Path("/data/{databagName}/{databagItemId}")
ListenableFuture<DatabagItem> updateDatabagItem( ListenableFuture<DatabagItem> updateDatabagItem(
@ -376,6 +410,7 @@ public interface ChefAsyncApi {
/** /**
* @see ChefApi#databagItemExists(String, String) * @see ChefApi#databagItemExists(String, String)
*/ */
@Named("databag:itemexists")
@HEAD @HEAD
@Path("/data/{databagName}/{databagItemId}") @Path("/data/{databagName}/{databagItemId}")
@Fallback(FalseOnNotFoundOr404.class) @Fallback(FalseOnNotFoundOr404.class)
@ -385,6 +420,7 @@ public interface ChefAsyncApi {
/** /**
* @see ChefApi#getDatabagItem(String, String) * @see ChefApi#getDatabagItem(String, String)
*/ */
@Named("databag:getitem")
@GET @GET
@Path("/data/{databagName}/{databagItemId}") @Path("/data/{databagName}/{databagItemId}")
@Fallback(NullOnNotFoundOr404.class) @Fallback(NullOnNotFoundOr404.class)
@ -394,6 +430,7 @@ public interface ChefAsyncApi {
/** /**
* @see ChefApi#deleteDatabagItem(String, String) * @see ChefApi#deleteDatabagItem(String, String)
*/ */
@Named("databag:deleteitem")
@DELETE @DELETE
@Path("/data/{databagName}/{databagItemId}") @Path("/data/{databagName}/{databagItemId}")
@Fallback(NullOnNotFoundOr404.class) @Fallback(NullOnNotFoundOr404.class)
@ -403,6 +440,7 @@ public interface ChefAsyncApi {
/** /**
* @see ChefApi#listSearchIndexes() * @see ChefApi#listSearchIndexes()
*/ */
@Named("search:indexes")
@GET @GET
@Path("/search") @Path("/search")
@ResponseParser(ParseKeySetFromJson.class) @ResponseParser(ParseKeySetFromJson.class)
@ -412,6 +450,7 @@ public interface ChefAsyncApi {
/** /**
* @see ChefApi#searchRoles() * @see ChefApi#searchRoles()
*/ */
@Named("search:roles")
@GET @GET
@Path("/search/role") @Path("/search/role")
@ResponseParser(ParseSearchRolesFromJson.class) @ResponseParser(ParseSearchRolesFromJson.class)
@ -420,6 +459,7 @@ public interface ChefAsyncApi {
/** /**
* @see ChefApi#searchRoles(SearchOptions) * @see ChefApi#searchRoles(SearchOptions)
*/ */
@Named("search:roles")
@GET @GET
@Path("/search/role") @Path("/search/role")
@ResponseParser(ParseSearchRolesFromJson.class) @ResponseParser(ParseSearchRolesFromJson.class)
@ -428,6 +468,7 @@ public interface ChefAsyncApi {
/** /**
* @see ChefApi#searchClients() * @see ChefApi#searchClients()
*/ */
@Named("search:clients")
@GET @GET
@Path("/search/client") @Path("/search/client")
@ResponseParser(ParseSearchClientsFromJson.class) @ResponseParser(ParseSearchClientsFromJson.class)
@ -436,6 +477,7 @@ public interface ChefAsyncApi {
/** /**
* @see ChefApi#searchClients(SearchOptions) * @see ChefApi#searchClients(SearchOptions)
*/ */
@Named("search:clients")
@GET @GET
@Path("/search/client") @Path("/search/client")
@ResponseParser(ParseSearchClientsFromJson.class) @ResponseParser(ParseSearchClientsFromJson.class)
@ -444,6 +486,7 @@ public interface ChefAsyncApi {
/** /**
* @see ChefApi#searchNodes() * @see ChefApi#searchNodes()
*/ */
@Named("search:nodes")
@GET @GET
@Path("/search/node") @Path("/search/node")
@ResponseParser(ParseSearchNodesFromJson.class) @ResponseParser(ParseSearchNodesFromJson.class)
@ -452,6 +495,7 @@ public interface ChefAsyncApi {
/** /**
* @see ChefApi#searchNodes(SearchOptions) * @see ChefApi#searchNodes(SearchOptions)
*/ */
@Named("search:nodes")
@GET @GET
@Path("/search/node") @Path("/search/node")
@ResponseParser(ParseSearchNodesFromJson.class) @ResponseParser(ParseSearchNodesFromJson.class)
@ -460,6 +504,7 @@ public interface ChefAsyncApi {
/** /**
* @see ChefApi#searchDatabag(String) * @see ChefApi#searchDatabag(String)
*/ */
@Named("search:databag")
@GET @GET
@Path("/search/{databagName}") @Path("/search/{databagName}")
@ResponseParser(ParseSearchDatabagFromJson.class) @ResponseParser(ParseSearchDatabagFromJson.class)
@ -469,6 +514,7 @@ public interface ChefAsyncApi {
/** /**
* @see ChefApi#searchDatabag(String, SearchOptions) * @see ChefApi#searchDatabag(String, SearchOptions)
*/ */
@Named("search:databag")
@GET @GET
@Path("/search/{databagName}") @Path("/search/{databagName}")
@ResponseParser(ParseSearchDatabagFromJson.class) @ResponseParser(ParseSearchDatabagFromJson.class)
@ -478,6 +524,7 @@ public interface ChefAsyncApi {
/** /**
* @see ChefApi#getResourceContents(Resource) * @see ChefApi#getResourceContents(Resource)
*/ */
@Named("content:get")
@GET @GET
@Fallback(NullOnNotFoundOr404.class) @Fallback(NullOnNotFoundOr404.class)
ListenableFuture<InputStream> getResourceContents(@EndpointParam(parser=UriForResource.class) Resource resource); ListenableFuture<InputStream> getResourceContents(@EndpointParam(parser=UriForResource.class) Resource resource);