You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jclouds.apache.org by ab...@apache.org on 2013/08/27 22:40:57 UTC

[1/2] git commit: JCLOUDS-150. De-async SQS.

Updated Branches:
  refs/heads/master 100afba1d -> e6765cc5d


JCLOUDS-150. De-async SQS.


Project: http://git-wip-us.apache.org/repos/asf/incubator-jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-jclouds/commit/e6765cc5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-jclouds/tree/e6765cc5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-jclouds/diff/e6765cc5

Branch: refs/heads/master
Commit: e6765cc5db1a531345f0dbe8ce95a82595be5912
Parents: 91d6736
Author: Andrew Bayer <an...@gmail.com>
Authored: Tue Jul 2 19:03:59 2013 -0700
Committer: Andrew Bayer <an...@gmail.com>
Committed: Tue Aug 27 12:16:30 2013 -0700

----------------------------------------------------------------------
 .../src/main/java/org/jclouds/sqs/SQSApi.java   |   1 -
 .../java/org/jclouds/sqs/SQSApiMetadata.java    |  37 +--
 .../main/java/org/jclouds/sqs/SQSAsyncApi.java  |  84 ------
 .../jclouds/sqs/config/SQSHttpApiModule.java    |  66 +++++
 .../jclouds/sqs/config/SQSRestClientModule.java |  75 -----
 .../org/jclouds/sqs/features/MessageApi.java    | 212 +++++++++++--
 .../jclouds/sqs/features/MessageAsyncApi.java   | 294 -------------------
 .../org/jclouds/sqs/features/PermissionApi.java |  30 +-
 .../sqs/features/PermissionAsyncApi.java        |  66 -----
 .../java/org/jclouds/sqs/features/QueueApi.java | 141 +++++++--
 .../org/jclouds/sqs/features/QueueAsyncApi.java | 183 ------------
 .../org/jclouds/sqs/SQSApiMetadataTest.java     |   4 +-
 .../jclouds/sqs/internal/BaseSQSExpectTest.java |  10 +-
 13 files changed, 414 insertions(+), 789 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/e6765cc5/apis/sqs/src/main/java/org/jclouds/sqs/SQSApi.java
----------------------------------------------------------------------
diff --git a/apis/sqs/src/main/java/org/jclouds/sqs/SQSApi.java b/apis/sqs/src/main/java/org/jclouds/sqs/SQSApi.java
index 6959806..4c8b5f9 100644
--- a/apis/sqs/src/main/java/org/jclouds/sqs/SQSApi.java
+++ b/apis/sqs/src/main/java/org/jclouds/sqs/SQSApi.java
@@ -36,7 +36,6 @@ import com.google.inject.Provides;
  * <p/>
  * 
  * @author Adrian Cole
- * @see SQSAsyncApi
  */
 @Beta
 public interface SQSApi extends Closeable {

http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/e6765cc5/apis/sqs/src/main/java/org/jclouds/sqs/SQSApiMetadata.java
----------------------------------------------------------------------
diff --git a/apis/sqs/src/main/java/org/jclouds/sqs/SQSApiMetadata.java b/apis/sqs/src/main/java/org/jclouds/sqs/SQSApiMetadata.java
index 4d6c7a5..c9a9db4 100644
--- a/apis/sqs/src/main/java/org/jclouds/sqs/SQSApiMetadata.java
+++ b/apis/sqs/src/main/java/org/jclouds/sqs/SQSApiMetadata.java
@@ -25,8 +25,8 @@ import java.net.URI;
 import java.util.Properties;
 
 import org.jclouds.apis.ApiMetadata;
-import org.jclouds.rest.internal.BaseRestApiMetadata;
-import org.jclouds.sqs.config.SQSRestClientModule;
+import org.jclouds.rest.internal.BaseHttpApiMetadata;
+import org.jclouds.sqs.config.SQSHttpApiModule;
 
 import com.google.common.collect.ImmutableSet;
 import com.google.common.reflect.TypeToken;
@@ -37,33 +37,23 @@ import com.google.inject.Module;
  * 
  * @author Adrian Cole
  */
-public class SQSApiMetadata extends BaseRestApiMetadata {
+public class SQSApiMetadata extends BaseHttpApiMetadata {
    
-   /**
-    * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(SQSApi.class)} as
-    *             {@link SQSAsyncApi} interface will be removed in jclouds 1.7.
-    */
-   @Deprecated
-   public static final TypeToken<org.jclouds.rest.RestContext<SQSApi, SQSAsyncApi>> CONTEXT_TOKEN = new TypeToken<org.jclouds.rest.RestContext<SQSApi, SQSAsyncApi>>() {
-      private static final long serialVersionUID = 1L;
-   };
-
    @Override
-   public Builder toBuilder() {
-      return new Builder(getApi(), getAsyncApi()).fromApiMetadata(this);
+   public Builder<?> toBuilder() {
+      return new ConcreteBuilder().fromApiMetadata(this);
    }
 
-   @SuppressWarnings("deprecation")
    public SQSApiMetadata() {
-      this(new Builder(SQSApi.class, SQSAsyncApi.class));
+      this(new ConcreteBuilder());
    }
 
-   protected SQSApiMetadata(Builder builder) {
+   protected SQSApiMetadata(Builder<?> builder) {
       super(builder);
    }
 
    public static Properties defaultProperties() {
-      Properties properties = BaseRestApiMetadata.defaultProperties();
+      Properties properties = BaseHttpApiMetadata.defaultProperties();
       properties.setProperty(CREATE_QUEUE_MAX_RETRIES, "60");
       properties.setProperty(CREATE_QUEUE_RETRY_INTERVAL, "1000");
       properties.setProperty(PROPERTY_AUTH_TAG, "AWS");
@@ -71,10 +61,9 @@ public class SQSApiMetadata extends BaseRestApiMetadata {
       return properties;
    }
    
-   public static class Builder extends BaseRestApiMetadata.Builder<Builder> {
+   public abstract static class Builder<T extends Builder<T>> extends BaseHttpApiMetadata.Builder<SQSApi, T> {
 
-      protected Builder(Class<?> api, Class<?> asyncApi) {
-         super(api, asyncApi);
+      protected Builder() {
          id("sqs")
          .name("Amazon Simple Queue Service API")
          .identityName("Access Key ID")
@@ -83,16 +72,18 @@ public class SQSApiMetadata extends BaseRestApiMetadata {
          .defaultProperties(SQSApiMetadata.defaultProperties())
          .defaultEndpoint("https://sqs.us-east-1.amazonaws.com")
          .documentation(URI.create("http://docs.amazonwebservices.com/AWSSimpleQueueService/latest/APIReference"))
-         .defaultModules(ImmutableSet.<Class<? extends Module>>of(SQSRestClientModule.class));
+         .defaultModules(ImmutableSet.<Class<? extends Module>>of(SQSHttpApiModule.class));
       }
 
       @Override
       public SQSApiMetadata build() {
          return new SQSApiMetadata(this);
       }
+   }
 
+   private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
       @Override
-      protected Builder self() {
+      protected ConcreteBuilder self() {
          return this;
       }
    }

http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/e6765cc5/apis/sqs/src/main/java/org/jclouds/sqs/SQSAsyncApi.java
----------------------------------------------------------------------
diff --git a/apis/sqs/src/main/java/org/jclouds/sqs/SQSAsyncApi.java b/apis/sqs/src/main/java/org/jclouds/sqs/SQSAsyncApi.java
deleted file mode 100644
index b9abe89..0000000
--- a/apis/sqs/src/main/java/org/jclouds/sqs/SQSAsyncApi.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.sqs;
-
-import java.io.Closeable;
-import java.net.URI;
-import java.util.Set;
-
-import org.jclouds.aws.filters.FormSigner;
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.location.Region;
-import org.jclouds.location.functions.RegionToEndpointOrProviderIfNull;
-import org.jclouds.rest.annotations.Delegate;
-import org.jclouds.rest.annotations.EndpointParam;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.VirtualHost;
-import org.jclouds.sqs.features.MessageAsyncApi;
-import org.jclouds.sqs.features.PermissionAsyncApi;
-import org.jclouds.sqs.features.QueueAsyncApi;
-
-import com.google.common.annotations.Beta;
-import com.google.inject.Provides;
-
-/**
- * Provides access to SQS via REST API.
- * <p/>
- * 
- * @see <a
- *      href="http://docs.amazonwebservices.com/AWSSimpleQueueService/2011-10-01/APIReference/Welcome.html">SQS
- *      documentation</a>
- * @author Adrian Cole
- * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(SQSApi.class)} as
- *             {@link SQSAsyncApi} interface will be removed in jclouds 1.7.
- */
-@Deprecated
-@Beta
-@RequestFilters(FormSigner.class)
-@VirtualHost
-public interface SQSAsyncApi extends Closeable {
-   /**
-    * 
-    * @return the Region codes configured
-    */
-   @Provides
-   @Region
-   Set<String> getConfiguredRegions();
-
-   /**
-    * Provides asynchronous access to Queue features.
-    */
-   @Delegate
-   QueueAsyncApi getQueueApi();
-
-   @Delegate
-   QueueAsyncApi getQueueApiForRegion(
-         @EndpointParam(parser = RegionToEndpointOrProviderIfNull.class) @Nullable String region);
-
-   /**
-    * Provides asynchronous access to Message features.
-    */
-   @Delegate
-   MessageAsyncApi getMessageApiForQueue(@EndpointParam URI queue);
-
-   /**
-    * Provides asynchronous access to Permission features.
-    */
-   @Delegate
-   PermissionAsyncApi getPermissionApiForQueue(@EndpointParam URI queue);
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/e6765cc5/apis/sqs/src/main/java/org/jclouds/sqs/config/SQSHttpApiModule.java
----------------------------------------------------------------------
diff --git a/apis/sqs/src/main/java/org/jclouds/sqs/config/SQSHttpApiModule.java b/apis/sqs/src/main/java/org/jclouds/sqs/config/SQSHttpApiModule.java
new file mode 100644
index 0000000..71a91fe
--- /dev/null
+++ b/apis/sqs/src/main/java/org/jclouds/sqs/config/SQSHttpApiModule.java
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.sqs.config;
+
+
+import static org.jclouds.reflect.Reflection2.typeToken;
+
+import java.util.Map;
+
+import org.jclouds.aws.config.FormSigningHttpApiModule;
+import org.jclouds.aws.handlers.AWSServerErrorRetryHandler;
+import org.jclouds.http.HttpErrorHandler;
+import org.jclouds.http.HttpRetryHandler;
+import org.jclouds.http.annotation.ClientError;
+import org.jclouds.http.annotation.Redirection;
+import org.jclouds.http.annotation.ServerError;
+import org.jclouds.rest.ConfiguresHttpApi;
+import org.jclouds.sqs.SQSApi;
+import org.jclouds.sqs.features.MessageApi;
+import org.jclouds.sqs.features.PermissionApi;
+import org.jclouds.sqs.features.QueueApi;
+import org.jclouds.sqs.handlers.ParseSQSErrorFromXmlContent;
+import org.jclouds.sqs.handlers.SQSErrorRetryHandler;
+
+import com.google.common.collect.ImmutableMap;
+
+/**
+ * Configures the SQS connection.
+ * 
+ * @author Adrian Cole
+ */
+@ConfiguresHttpApi
+public class SQSHttpApiModule extends FormSigningHttpApiModule<SQSApi> {
+
+   public SQSHttpApiModule() {
+      super(SQSApi.class);
+   }
+   
+   @Override
+   protected void bindErrorHandlers() {
+      bind(HttpErrorHandler.class).annotatedWith(Redirection.class).to(ParseSQSErrorFromXmlContent.class);
+      bind(HttpErrorHandler.class).annotatedWith(ClientError.class).to(ParseSQSErrorFromXmlContent.class);
+      bind(HttpErrorHandler.class).annotatedWith(ServerError.class).to(ParseSQSErrorFromXmlContent.class);
+   }
+
+   @Override
+   protected void bindRetryHandlers() {
+      bind(HttpRetryHandler.class).annotatedWith(ClientError.class).to(SQSErrorRetryHandler.class);
+      bind(HttpRetryHandler.class).annotatedWith(ServerError.class).to(AWSServerErrorRetryHandler.class);
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/e6765cc5/apis/sqs/src/main/java/org/jclouds/sqs/config/SQSRestClientModule.java
----------------------------------------------------------------------
diff --git a/apis/sqs/src/main/java/org/jclouds/sqs/config/SQSRestClientModule.java b/apis/sqs/src/main/java/org/jclouds/sqs/config/SQSRestClientModule.java
deleted file mode 100644
index 69e16d5..0000000
--- a/apis/sqs/src/main/java/org/jclouds/sqs/config/SQSRestClientModule.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.sqs.config;
-
-
-import static org.jclouds.reflect.Reflection2.typeToken;
-
-import java.util.Map;
-
-import org.jclouds.aws.config.FormSigningRestClientModule;
-import org.jclouds.aws.handlers.AWSServerErrorRetryHandler;
-import org.jclouds.http.HttpErrorHandler;
-import org.jclouds.http.HttpRetryHandler;
-import org.jclouds.http.annotation.ClientError;
-import org.jclouds.http.annotation.Redirection;
-import org.jclouds.http.annotation.ServerError;
-import org.jclouds.rest.ConfiguresRestClient;
-import org.jclouds.sqs.SQSApi;
-import org.jclouds.sqs.SQSAsyncApi;
-import org.jclouds.sqs.features.MessageApi;
-import org.jclouds.sqs.features.MessageAsyncApi;
-import org.jclouds.sqs.features.PermissionApi;
-import org.jclouds.sqs.features.PermissionAsyncApi;
-import org.jclouds.sqs.features.QueueApi;
-import org.jclouds.sqs.features.QueueAsyncApi;
-import org.jclouds.sqs.handlers.ParseSQSErrorFromXmlContent;
-import org.jclouds.sqs.handlers.SQSErrorRetryHandler;
-
-import com.google.common.collect.ImmutableMap;
-
-/**
- * Configures the SQS connection.
- * 
- * @author Adrian Cole
- */
-@ConfiguresRestClient
-public class SQSRestClientModule extends FormSigningRestClientModule<SQSApi, SQSAsyncApi> {
-   public static final Map<Class<?>, Class<?>> DELEGATE_MAP = ImmutableMap.<Class<?>, Class<?>> builder()//
-         .put(QueueApi.class, QueueAsyncApi.class)
-         .put(MessageApi.class, MessageAsyncApi.class)
-         .put(PermissionApi.class, PermissionAsyncApi.class)
-         .build();
-
-   public SQSRestClientModule() {
-      super(typeToken(SQSApi.class), typeToken(SQSAsyncApi.class), DELEGATE_MAP);
-   }
-   
-   @Override
-   protected void bindErrorHandlers() {
-      bind(HttpErrorHandler.class).annotatedWith(Redirection.class).to(ParseSQSErrorFromXmlContent.class);
-      bind(HttpErrorHandler.class).annotatedWith(ClientError.class).to(ParseSQSErrorFromXmlContent.class);
-      bind(HttpErrorHandler.class).annotatedWith(ServerError.class).to(ParseSQSErrorFromXmlContent.class);
-   }
-
-   @Override
-   protected void bindRetryHandlers() {
-      bind(HttpRetryHandler.class).annotatedWith(ClientError.class).to(SQSErrorRetryHandler.class);
-      bind(HttpRetryHandler.class).annotatedWith(ServerError.class).to(AWSServerErrorRetryHandler.class);
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/e6765cc5/apis/sqs/src/main/java/org/jclouds/sqs/features/MessageApi.java
----------------------------------------------------------------------
diff --git a/apis/sqs/src/main/java/org/jclouds/sqs/features/MessageApi.java b/apis/sqs/src/main/java/org/jclouds/sqs/features/MessageApi.java
index d8a4eee..7cc5291 100644
--- a/apis/sqs/src/main/java/org/jclouds/sqs/features/MessageApi.java
+++ b/apis/sqs/src/main/java/org/jclouds/sqs/features/MessageApi.java
@@ -16,12 +16,43 @@
  */
 package org.jclouds.sqs.features;
 
+import static org.jclouds.sqs.reference.SQSParameters.ACTION;
+import static org.jclouds.sqs.reference.SQSParameters.VERSION;
+
 import java.util.Map;
+
+import javax.inject.Named;
+import javax.ws.rs.FormParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+
+import org.jclouds.Constants;
+import org.jclouds.Fallbacks.VoidOnNotFoundOr404;
+import org.jclouds.aws.filters.FormSigner;
+import org.jclouds.rest.annotations.BinderParam;
+import org.jclouds.rest.annotations.Fallback;
+import org.jclouds.rest.annotations.FormParams;
+import org.jclouds.rest.annotations.MapBinder;
+import org.jclouds.rest.annotations.PayloadParam;
+import org.jclouds.rest.annotations.RequestFilters;
+import org.jclouds.rest.annotations.ResponseParser;
+import org.jclouds.rest.annotations.VirtualHost;
+import org.jclouds.rest.annotations.XMLResponseParser;
+import org.jclouds.sqs.binders.BindChangeMessageVisibilityBatchRequestEntryToIndexedFormParams;
+import org.jclouds.sqs.binders.BindDeleteMessageBatchRequestEntryToIndexedFormParams;
+import org.jclouds.sqs.binders.BindSendMessageBatchRequestEntryToIndexedFormParams;
+import org.jclouds.sqs.binders.BindSendMessageBatchRequestEntryWithDelaysToIndexedFormParams;
 import org.jclouds.sqs.domain.BatchResult;
 import org.jclouds.sqs.domain.Message;
 import org.jclouds.sqs.domain.MessageIdAndMD5;
 import org.jclouds.sqs.options.ReceiveMessageOptions;
 import org.jclouds.sqs.options.SendMessageOptions;
+import org.jclouds.sqs.xml.ChangeMessageVisibilityBatchResponseHandler;
+import org.jclouds.sqs.xml.DeleteMessageBatchResponseHandler;
+import org.jclouds.sqs.xml.MessageHandler;
+import org.jclouds.sqs.xml.ReceiveMessageResponseHandler;
+import org.jclouds.sqs.xml.RegexMessageIdAndMD5Handler;
+import org.jclouds.sqs.xml.SendMessageBatchResponseHandler;
 
 import com.google.common.collect.FluentIterable;
 import com.google.common.collect.Table;
@@ -30,9 +61,11 @@ import com.google.common.collect.Table;
  * Provides access to SQS via their REST API.
  * <p/>
  * 
- * @see MessageAsyncApi
  * @author Adrian Cole
  */
+@RequestFilters(FormSigner.class)
+@FormParams(keys = VERSION, values = "{" + Constants.PROPERTY_API_VERSION + "}")
+@VirtualHost
 public interface MessageApi {
 
    /**
@@ -67,7 +100,12 @@ public interface MessageApi {
     *           The receipt handle associated with the message you want to
     *           delete.
     */
-   void delete(String receiptHandle);
+   @Named("DeleteMessage")
+   @POST
+   @Path("/")
+   @FormParams(keys = ACTION, values = "DeleteMessage")
+   @Fallback(VoidOnNotFoundOr404.class)
+   void delete(@FormParam("ReceiptHandle") String receiptHandle);
 
    /**
     * Currently, you can send up to 10 {@link #delete} requests.
@@ -91,7 +129,13 @@ public interface MessageApi {
     * @return result that contains success or errors of the operation
     * @see #delete(String)
     */
-   BatchResult<String> delete(Map<String, String> idReceiptHandle);
+   @Named("DeleteMessageBatch")
+   @POST
+   @Path("/")
+   @FormParams(keys = ACTION, values = "DeleteMessageBatch")
+   @XMLResponseParser(DeleteMessageBatchResponseHandler.class)
+   BatchResult<String> delete(
+         @BinderParam(BindDeleteMessageBatchRequestEntryToIndexedFormParams.class) Map<String, String> idReceiptHandle);
 
    /**
     * Same as {@link #delete(Map)}, except that we generate numeric ids starting
@@ -101,7 +145,13 @@ public interface MessageApi {
     *           receipt handles to delete
     * @see #delete(Map)
     */
-   BatchResult<String> delete(Iterable<String> receiptHandles);
+   @Named("DeleteMessageBatch")
+   @POST
+   @Path("/")
+   @FormParams(keys = ACTION, values = "DeleteMessageBatch")
+   @XMLResponseParser(DeleteMessageBatchResponseHandler.class)
+   BatchResult<String> delete(
+         @BinderParam(BindDeleteMessageBatchRequestEntryToIndexedFormParams.class) Iterable<String> receiptHandles);
 
    /**
     * The ChangeMessageVisibility action changes the visibility timeout of a
@@ -143,7 +193,12 @@ public interface MessageApi {
     *           The new value for the message's visibility timeout (in seconds)
     *           from 0 to 43200 (maximum 12 hours)
     */
-   void changeVisibility(String receiptHandle, int visibilityTimeout);
+   @Named("ChangeMessageVisibility")
+   @POST
+   @Path("/")
+   @FormParams(keys = ACTION, values = "ChangeMessageVisibility")
+   void changeVisibility(@FormParam("ReceiptHandle") String receiptHandle,
+         @FormParam("VisibilityTimeout") int visibilityTimeout);
 
    /**
     * Currently, you can send up to 10 {@link #changeVisibility} requests.
@@ -168,7 +223,13 @@ public interface MessageApi {
     * @return result that contains success or errors of the operation
     * @see #changeVisibility(String, int)
     */
-   BatchResult<String> changeVisibility(Table<String, String, Integer> idReceiptHandleVisibilityTimeout);
+   @Named("ChangeMessageVisibilityBatch")
+   @POST
+   @Path("/")
+   @FormParams(keys = ACTION, values = "ChangeMessageVisibilityBatch")
+   @XMLResponseParser(ChangeMessageVisibilityBatchResponseHandler.class)
+   BatchResult<String> changeVisibility(
+         @BinderParam(BindChangeMessageVisibilityBatchRequestEntryToIndexedFormParams.class) Table<String, String, Integer> idReceiptHandleVisibilityTimeout);
 
    /**
     * Same as {@link #changeVisibility(Table)}, except that we generate numeric
@@ -178,7 +239,13 @@ public interface MessageApi {
     *           receipt handle to visibility timeout
     * @see #changeVisibility(Table)
     */
-   BatchResult<? extends MessageIdAndMD5> changeVisibility(Map<String, Integer> receiptHandleVisibilityTimeout);
+   @Named("ChangeMessageVisibilityBatch")
+   @POST
+   @Path("/")
+   @FormParams(keys = ACTION, values = "ChangeMessageVisibilityBatch")
+   @XMLResponseParser(ChangeMessageVisibilityBatchResponseHandler.class)
+   BatchResult<MessageIdAndMD5> changeVisibility(
+         @BinderParam(BindChangeMessageVisibilityBatchRequestEntryToIndexedFormParams.class) Map<String, Integer> receiptHandleVisibilityTimeout);
 
    /**
     * Currently, you can send up to 10 {@link #changeVisibility} requests.
@@ -204,7 +271,15 @@ public interface MessageApi {
     * @return result that contains success or errors of the operation
     * @see #changeVisibility(String, int)
     */
-   BatchResult<String> changeVisibility(Map<String, String> idReceiptHandle, int visibilityTimeout);
+   @Named("ChangeMessageVisibilityBatch")
+   @POST
+   @Path("/")
+   @FormParams(keys = ACTION, values = "ChangeMessageVisibilityBatch")
+   @MapBinder(BindChangeMessageVisibilityBatchRequestEntryToIndexedFormParams.class)
+   @XMLResponseParser(ChangeMessageVisibilityBatchResponseHandler.class)
+   BatchResult<String> changeVisibility(
+         @PayloadParam("idReceiptHandle") Map<String, String> idReceiptHandle,
+         @PayloadParam("visibilityTimeout") int visibilityTimeout);
 
    /**
     * Same as {@link #changeVisibility(Map, int)}, except that we generate
@@ -214,7 +289,15 @@ public interface MessageApi {
     *           receipt handles to change visibility
     * @see #changeVisibility(Map, int)
     */
-   BatchResult<String> changeVisibility(Iterable<String> receiptHandles, int visibilityTimeout);
+   @Named("ChangeMessageVisibilityBatch")
+   @POST
+   @Path("/")
+   @FormParams(keys = ACTION, values = "ChangeMessageVisibilityBatch")
+   @MapBinder(BindChangeMessageVisibilityBatchRequestEntryToIndexedFormParams.class)
+   @XMLResponseParser(ChangeMessageVisibilityBatchResponseHandler.class)
+   BatchResult<String> changeVisibility(
+         @PayloadParam("receiptHandles") Iterable<String> receiptHandles,
+         @PayloadParam("visibilityTimeout") int visibilityTimeout);
 
    /**
     * The SendMessage action delivers a message to the specified queue. The
@@ -238,7 +321,27 @@ public interface MessageApi {
     *           characters, see the preceding important note.
     * @return id of the message and md5 of the content sent
     */
-   MessageIdAndMD5 send(String message);
+   @Named("SendMessage")
+   @POST
+   @Path("/")
+   @FormParams(keys = ACTION, values = "SendMessage")
+   @ResponseParser(RegexMessageIdAndMD5Handler.class)
+   MessageIdAndMD5 send(@FormParam("MessageBody") String message);
+
+   /**
+    * same as {@link #sendMessage(URI, String)} except you can control options
+    * such as delay seconds.
+    * 
+    * @param options
+    *           options such as delay seconds
+    * @see #sendMessage(URI, String)
+    */
+   @Named("SendMessage")
+   @POST
+   @Path("/")
+   @FormParams(keys = ACTION, values = "SendMessage")
+   @ResponseParser(RegexMessageIdAndMD5Handler.class)
+   MessageIdAndMD5 send(@FormParam("MessageBody") String message, SendMessageOptions options);
 
    /**
     * Same as {@link #send(Map)} except you can set a delay for each message in
@@ -264,7 +367,14 @@ public interface MessageApi {
     * @return result that contains success or errors of the operation
     * @see #send(String, SendMessageOptions)
     */
-   BatchResult<? extends MessageIdAndMD5> sendWithDelays(Table<String, String, Integer> idMessageBodyDelaySeconds);
+   @Named("SendMessageBatch")
+   @POST
+   @Path("/")
+   @FormParams(keys = ACTION, values = "SendMessageBatch")
+   @ResponseParser(RegexMessageIdAndMD5Handler.class)
+   @XMLResponseParser(SendMessageBatchResponseHandler.class)
+   BatchResult<? extends MessageIdAndMD5> sendWithDelays(
+         @BinderParam(BindSendMessageBatchRequestEntryWithDelaysToIndexedFormParams.class) Table<String, String, Integer> idMessageBodyDelaySeconds);
 
    /**
     * Same as {@link #sendWithDelays(Table)}, except that we generate numeric
@@ -274,7 +384,14 @@ public interface MessageApi {
     *           message body to the delay desired
     * @see #sendWithDelays(Table)
     */
-   BatchResult<? extends MessageIdAndMD5> sendWithDelays(Map<String, Integer> messageBodyDelaySeconds);
+   @Named("SendMessageBatch")
+   @POST
+   @Path("/")
+   @FormParams(keys = ACTION, values = "SendMessageBatch")
+   @ResponseParser(RegexMessageIdAndMD5Handler.class)
+   @XMLResponseParser(SendMessageBatchResponseHandler.class)
+   BatchResult<? extends MessageIdAndMD5> sendWithDelays(
+         @BinderParam(BindSendMessageBatchRequestEntryWithDelaysToIndexedFormParams.class) Map<String, Integer> messageBodyDelaySeconds);
 
    /**
     * Same as {@link #send(Map)} except you set a delay for all messages in the
@@ -287,7 +404,15 @@ public interface MessageApi {
     * 
     * @see #send(String, SendMessageOptions)
     */
-   BatchResult<? extends MessageIdAndMD5> sendWithDelay(Map<String, String> idMessageBody, int delaySeconds);
+   @Named("SendMessageBatch")
+   @POST
+   @Path("/")
+   @FormParams(keys = ACTION, values = "SendMessageBatch")
+   @MapBinder(BindSendMessageBatchRequestEntryWithDelaysToIndexedFormParams.class)
+   @XMLResponseParser(SendMessageBatchResponseHandler.class)
+   BatchResult<? extends MessageIdAndMD5> sendWithDelay(
+         @PayloadParam("idMessageBody") Map<String, String> idMessageBody,
+         @PayloadParam("delaySeconds") int delaySeconds);
 
    /**
     * Same as {@link #sendWithDelay(Map, int)}, except that we generate numeric
@@ -297,7 +422,14 @@ public interface MessageApi {
     *           message bodies to send
     * @see #sendWithDelay(Map, int)
     */
-   BatchResult<? extends MessageIdAndMD5> sendWithDelay(Iterable<String> messageBodies, int delaySeconds);
+   @Named("SendMessageBatch")
+   @POST
+   @Path("/")
+   @FormParams(keys = ACTION, values = "SendMessageBatch")
+   @MapBinder(BindSendMessageBatchRequestEntryWithDelaysToIndexedFormParams.class)
+   @XMLResponseParser(SendMessageBatchResponseHandler.class)
+   BatchResult<? extends MessageIdAndMD5> sendWithDelay(
+         @PayloadParam("messageBodies") Iterable<String> messageBodies, @PayloadParam("delaySeconds") int delaySeconds);
 
    /**
     * The SendMessageBatch action delivers up to ten messages to the specified
@@ -329,7 +461,13 @@ public interface MessageApi {
     * @return result that contains success or errors of the operation
     * @see #send(String)
     */
-   BatchResult<? extends MessageIdAndMD5> send(Map<String, String> idMessageBody);
+   @Named("SendMessageBatch")
+   @POST
+   @Path("/")
+   @FormParams(keys = ACTION, values = "SendMessageBatch")
+   @XMLResponseParser(SendMessageBatchResponseHandler.class)
+   BatchResult<? extends MessageIdAndMD5> send(
+         @BinderParam(BindSendMessageBatchRequestEntryToIndexedFormParams.class) Map<String, String> idMessageBody);
 
    /**
     * Same as {@link #send(Map)}, except that we generate numeric ids starting
@@ -339,17 +477,13 @@ public interface MessageApi {
     *           message bodies to send
     * @see #send(Map)
     */
-   BatchResult<? extends MessageIdAndMD5> send(Iterable<String> messageBodies);
-
-   /**
-    * same as {@link #sendMessage(URI, String)} except you can control options
-    * such as delay seconds.
-    * 
-    * @param options
-    *           options such as delay seconds
-    * @see #sendMessage(URI, String)
-    */
-   MessageIdAndMD5 send(String message, SendMessageOptions options);
+   @Named("SendMessageBatch")
+   @POST
+   @Path("/")
+   @FormParams(keys = ACTION, values = "SendMessageBatch")
+   @XMLResponseParser(SendMessageBatchResponseHandler.class)
+   BatchResult<? extends MessageIdAndMD5> send(
+         @BinderParam(BindSendMessageBatchRequestEntryToIndexedFormParams.class) Iterable<String> messageBodies);
 
    /**
     * The ReceiveMessage action retrieves one or more messages from the
@@ -373,6 +507,11 @@ public interface MessageApi {
     *           from where you are receiving messages
     * @return message including the receipt handle you can use to delete it
     */
+   @Named("ReceiveMessage")
+   @POST
+   @Path("/")
+   @FormParams(keys = ACTION, values = "ReceiveMessage")
+   @XMLResponseParser(MessageHandler.class)
    Message receive();
 
    /**
@@ -386,6 +525,11 @@ public interface MessageApi {
     *           options such as VisibilityTimeout
     * @see #receive(URI)
     */
+   @Named("ReceiveMessage")
+   @POST
+   @Path("/")
+   @FormParams(keys = ACTION, values = "ReceiveMessage")
+   @XMLResponseParser(MessageHandler.class)
    Message receive(ReceiveMessageOptions options);
 
    /**
@@ -395,7 +539,12 @@ public interface MessageApi {
     *           maximum messages to receive, current limit is 10
     * @see #receive(URI)
     */
-   FluentIterable<Message> receive(int max);
+   @Named("ReceiveMessage")
+   @POST
+   @Path("/")
+   @FormParams(keys = ACTION, values = "ReceiveMessage")
+   @XMLResponseParser(ReceiveMessageResponseHandler.class)
+   FluentIterable<Message> receive(@FormParam("MaxNumberOfMessages") int max);
 
    /**
     * same as {@link #receive(URI, int)} except you can provide options like
@@ -408,5 +557,12 @@ public interface MessageApi {
     *           options such as VisibilityTimeout
     * @see #receive(URI, int)
     */
-   FluentIterable<Message> receive(int max, ReceiveMessageOptions options);
+   @Named("ReceiveMessage")
+   @POST
+   @Path("/")
+   @FormParams(keys = ACTION, values = "ReceiveMessage")
+   @XMLResponseParser(ReceiveMessageResponseHandler.class)
+   FluentIterable<Message> receive(@FormParam("MaxNumberOfMessages") int max,
+         ReceiveMessageOptions options);
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/e6765cc5/apis/sqs/src/main/java/org/jclouds/sqs/features/MessageAsyncApi.java
----------------------------------------------------------------------
diff --git a/apis/sqs/src/main/java/org/jclouds/sqs/features/MessageAsyncApi.java b/apis/sqs/src/main/java/org/jclouds/sqs/features/MessageAsyncApi.java
deleted file mode 100644
index ac96415..0000000
--- a/apis/sqs/src/main/java/org/jclouds/sqs/features/MessageAsyncApi.java
+++ /dev/null
@@ -1,294 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.sqs.features;
-
-import static org.jclouds.sqs.reference.SQSParameters.ACTION;
-import static org.jclouds.sqs.reference.SQSParameters.VERSION;
-
-import java.util.Map;
-
-import javax.inject.Named;
-import javax.ws.rs.FormParam;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-
-import org.jclouds.Constants;
-import org.jclouds.Fallbacks.VoidOnNotFoundOr404;
-import org.jclouds.aws.filters.FormSigner;
-import org.jclouds.rest.annotations.BinderParam;
-import org.jclouds.rest.annotations.Fallback;
-import org.jclouds.rest.annotations.FormParams;
-import org.jclouds.rest.annotations.MapBinder;
-import org.jclouds.rest.annotations.PayloadParam;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.ResponseParser;
-import org.jclouds.rest.annotations.VirtualHost;
-import org.jclouds.rest.annotations.XMLResponseParser;
-import org.jclouds.sqs.binders.BindChangeMessageVisibilityBatchRequestEntryToIndexedFormParams;
-import org.jclouds.sqs.binders.BindDeleteMessageBatchRequestEntryToIndexedFormParams;
-import org.jclouds.sqs.binders.BindSendMessageBatchRequestEntryToIndexedFormParams;
-import org.jclouds.sqs.binders.BindSendMessageBatchRequestEntryWithDelaysToIndexedFormParams;
-import org.jclouds.sqs.domain.BatchResult;
-import org.jclouds.sqs.domain.Message;
-import org.jclouds.sqs.domain.MessageIdAndMD5;
-import org.jclouds.sqs.options.ReceiveMessageOptions;
-import org.jclouds.sqs.options.SendMessageOptions;
-import org.jclouds.sqs.xml.ChangeMessageVisibilityBatchResponseHandler;
-import org.jclouds.sqs.xml.DeleteMessageBatchResponseHandler;
-import org.jclouds.sqs.xml.MessageHandler;
-import org.jclouds.sqs.xml.ReceiveMessageResponseHandler;
-import org.jclouds.sqs.xml.RegexMessageIdAndMD5Handler;
-import org.jclouds.sqs.xml.SendMessageBatchResponseHandler;
-
-import com.google.common.collect.FluentIterable;
-import com.google.common.collect.Table;
-import com.google.common.util.concurrent.ListenableFuture;
-
-/**
- * Provides access to SQS via their REST API.
- * <p/>
- * 
- * @author Adrian Cole
- */
-@RequestFilters(FormSigner.class)
-@FormParams(keys = VERSION, values = "{" + Constants.PROPERTY_API_VERSION + "}")
-@VirtualHost
-public interface MessageAsyncApi {
-
-   /**
-    * @see MessageApi#delete(String)
-    */
-   @Named("DeleteMessage")
-   @POST
-   @Path("/")
-   @FormParams(keys = ACTION, values = "DeleteMessage")
-   @Fallback(VoidOnNotFoundOr404.class)
-   ListenableFuture<Void> delete(@FormParam("ReceiptHandle") String receiptHandle);
-
-   /**
-    * @see MessageApi#delete(Map)
-    */
-   @Named("DeleteMessageBatch")
-   @POST
-   @Path("/")
-   @FormParams(keys = ACTION, values = "DeleteMessageBatch")
-   @XMLResponseParser(DeleteMessageBatchResponseHandler.class)
-   ListenableFuture<? extends BatchResult<String>> delete(
-         @BinderParam(BindDeleteMessageBatchRequestEntryToIndexedFormParams.class) Map<String, String> idReceiptHandle);
-
-   /**
-    * @see MessageApi#delete(Iterable)
-    */
-   @Named("DeleteMessageBatch")
-   @POST
-   @Path("/")
-   @FormParams(keys = ACTION, values = "DeleteMessageBatch")
-   @XMLResponseParser(DeleteMessageBatchResponseHandler.class)
-   ListenableFuture<? extends BatchResult<String>> delete(
-         @BinderParam(BindDeleteMessageBatchRequestEntryToIndexedFormParams.class) Iterable<String> receiptHandles);
-
-   /**
-    * @see MessageApi#changeVisibility(String, int)
-    */
-   @Named("ChangeMessageVisibility")
-   @POST
-   @Path("/")
-   @FormParams(keys = ACTION, values = "ChangeMessageVisibility")
-   ListenableFuture<Void> changeVisibility(@FormParam("ReceiptHandle") String receiptHandle,
-         @FormParam("VisibilityTimeout") int visibilityTimeout);
-
-   /**
-    * @see MessageApi#changeVisibility(Table)
-    */
-   @Named("ChangeMessageVisibilityBatch")
-   @POST
-   @Path("/")
-   @FormParams(keys = ACTION, values = "ChangeMessageVisibilityBatch")
-   @XMLResponseParser(ChangeMessageVisibilityBatchResponseHandler.class)
-   ListenableFuture<? extends BatchResult<String>> changeVisibility(
-         @BinderParam(BindChangeMessageVisibilityBatchRequestEntryToIndexedFormParams.class) Table<String, String, Integer> idReceiptHandleVisibilityTimeout);
-
-   /**
-    * @see MessageApi#changeVisibility(Map)
-    */
-   @Named("ChangeMessageVisibilityBatch")
-   @POST
-   @Path("/")
-   @FormParams(keys = ACTION, values = "ChangeMessageVisibilityBatch")
-   @XMLResponseParser(ChangeMessageVisibilityBatchResponseHandler.class)
-   ListenableFuture<? extends BatchResult<String>> changeVisibility(
-         @BinderParam(BindChangeMessageVisibilityBatchRequestEntryToIndexedFormParams.class) Map<String, Integer> receiptHandleVisibilityTimeout);
-
-   /**
-    * @see MessageApi#changeVisibility(Map, int)
-    */
-   @Named("ChangeMessageVisibilityBatch")
-   @POST
-   @Path("/")
-   @FormParams(keys = ACTION, values = "ChangeMessageVisibilityBatch")
-   @MapBinder(BindChangeMessageVisibilityBatchRequestEntryToIndexedFormParams.class)
-   @XMLResponseParser(ChangeMessageVisibilityBatchResponseHandler.class)
-   ListenableFuture<? extends BatchResult<String>> changeVisibility(
-         @PayloadParam("idReceiptHandle") Map<String, String> idReceiptHandle,
-         @PayloadParam("visibilityTimeout") int visibilityTimeout);
-
-   /**
-    * @see MessageApi#changeVisibility(Iterable, int)
-    */
-   @Named("ChangeMessageVisibilityBatch")
-   @POST
-   @Path("/")
-   @FormParams(keys = ACTION, values = "ChangeMessageVisibilityBatch")
-   @MapBinder(BindChangeMessageVisibilityBatchRequestEntryToIndexedFormParams.class)
-   @XMLResponseParser(ChangeMessageVisibilityBatchResponseHandler.class)
-   ListenableFuture<? extends BatchResult<String>> changeVisibility(
-         @PayloadParam("receiptHandles") Iterable<String> receiptHandles,
-         @PayloadParam("visibilityTimeout") int visibilityTimeout);
-
-   /**
-    * @see MessageApi#send(String)
-    */
-   @Named("SendMessage")
-   @POST
-   @Path("/")
-   @FormParams(keys = ACTION, values = "SendMessage")
-   @ResponseParser(RegexMessageIdAndMD5Handler.class)
-   ListenableFuture<? extends MessageIdAndMD5> send(@FormParam("MessageBody") String message);
-
-   /**
-    * @see MessageApi#send(String, SendMessageOptions)
-    */
-   @Named("SendMessage")
-   @POST
-   @Path("/")
-   @FormParams(keys = ACTION, values = "SendMessage")
-   @ResponseParser(RegexMessageIdAndMD5Handler.class)
-   ListenableFuture<? extends MessageIdAndMD5> send(@FormParam("MessageBody") String message, SendMessageOptions options);
-
-   /**
-    * @see MessageApi#sendWithDelays(Table)
-    */
-   @Named("SendMessageBatch")
-   @POST
-   @Path("/")
-   @FormParams(keys = ACTION, values = "SendMessageBatch")
-   @ResponseParser(RegexMessageIdAndMD5Handler.class)
-   @XMLResponseParser(SendMessageBatchResponseHandler.class)
-   ListenableFuture<? extends BatchResult<? extends MessageIdAndMD5>> sendWithDelays(
-         @BinderParam(BindSendMessageBatchRequestEntryWithDelaysToIndexedFormParams.class) Table<String, String, Integer> idMessageBodyDelaySeconds);
-
-   /**
-    * @see MessageApi#sendWithDelays(Map)
-    */
-   @Named("SendMessageBatch")
-   @POST
-   @Path("/")
-   @FormParams(keys = ACTION, values = "SendMessageBatch")
-   @ResponseParser(RegexMessageIdAndMD5Handler.class)
-   @XMLResponseParser(SendMessageBatchResponseHandler.class)
-   ListenableFuture<? extends BatchResult<? extends MessageIdAndMD5>> sendWithDelays(
-         @BinderParam(BindSendMessageBatchRequestEntryWithDelaysToIndexedFormParams.class) Map<String, Integer> messageBodyDelaySeconds);
-
-   /**
-    * @see MessageApi#sendWithDelay(Map, int)
-    */
-   @Named("SendMessageBatch")
-   @POST
-   @Path("/")
-   @FormParams(keys = ACTION, values = "SendMessageBatch")
-   @MapBinder(BindSendMessageBatchRequestEntryWithDelaysToIndexedFormParams.class)
-   @XMLResponseParser(SendMessageBatchResponseHandler.class)
-   ListenableFuture<? extends BatchResult<? extends MessageIdAndMD5>> sendWithDelay(
-         @PayloadParam("idMessageBody") Map<String, String> idMessageBody,
-         @PayloadParam("delaySeconds") int delaySeconds);
-
-   /**
-    * @see MessageApi#sendWithDelay(Iterable, int)
-    */
-   @Named("SendMessageBatch")
-   @POST
-   @Path("/")
-   @FormParams(keys = ACTION, values = "SendMessageBatch")
-   @MapBinder(BindSendMessageBatchRequestEntryWithDelaysToIndexedFormParams.class)
-   @XMLResponseParser(SendMessageBatchResponseHandler.class)
-   ListenableFuture<? extends BatchResult<? extends MessageIdAndMD5>> sendWithDelay(
-         @PayloadParam("messageBodies") Iterable<String> messageBodies, @PayloadParam("delaySeconds") int delaySeconds);
-
-   /**
-    * @see MessageApi#send(Map)
-    */
-   @Named("SendMessageBatch")
-   @POST
-   @Path("/")
-   @FormParams(keys = ACTION, values = "SendMessageBatch")
-   @XMLResponseParser(SendMessageBatchResponseHandler.class)
-   ListenableFuture<? extends BatchResult<? extends MessageIdAndMD5>> send(
-         @BinderParam(BindSendMessageBatchRequestEntryToIndexedFormParams.class) Map<String, String> idMessageBody);
-
-   /**
-    * @see MessageApi#send(Iterable)
-    */
-   @Named("SendMessageBatch")
-   @POST
-   @Path("/")
-   @FormParams(keys = ACTION, values = "SendMessageBatch")
-   @XMLResponseParser(SendMessageBatchResponseHandler.class)
-   ListenableFuture<? extends BatchResult<? extends MessageIdAndMD5>> send(
-         @BinderParam(BindSendMessageBatchRequestEntryToIndexedFormParams.class) Iterable<String> messageBodies);
-
-   /**
-    * @see MessageApi#receive()
-    */
-   @Named("ReceiveMessage")
-   @POST
-   @Path("/")
-   @FormParams(keys = ACTION, values = "ReceiveMessage")
-   @XMLResponseParser(MessageHandler.class)
-   ListenableFuture<Message> receive();
-
-   /**
-    * @see MessageApi#receive(ReceiveMessageOptions)
-    */
-   @Named("ReceiveMessage")
-   @POST
-   @Path("/")
-   @FormParams(keys = ACTION, values = "ReceiveMessage")
-   @XMLResponseParser(MessageHandler.class)
-   ListenableFuture<? extends Message> receive(ReceiveMessageOptions options);
-
-   /**
-    * @see MessageApi#receive(int)
-    */
-   @Named("ReceiveMessage")
-   @POST
-   @Path("/")
-   @FormParams(keys = ACTION, values = "ReceiveMessage")
-   @XMLResponseParser(ReceiveMessageResponseHandler.class)
-   ListenableFuture<? extends FluentIterable<? extends Message>> receive(@FormParam("MaxNumberOfMessages") int max);
-
-   /**
-    * @see MessageApi#receive(int, ReceiveMessageOptions)
-    */
-   @Named("ReceiveMessage")
-   @POST
-   @Path("/")
-   @FormParams(keys = ACTION, values = "ReceiveMessage")
-   @XMLResponseParser(ReceiveMessageResponseHandler.class)
-   ListenableFuture<? extends FluentIterable<? extends Message>> receive(@FormParam("MaxNumberOfMessages") int max,
-         ReceiveMessageOptions options);
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/e6765cc5/apis/sqs/src/main/java/org/jclouds/sqs/features/PermissionApi.java
----------------------------------------------------------------------
diff --git a/apis/sqs/src/main/java/org/jclouds/sqs/features/PermissionApi.java b/apis/sqs/src/main/java/org/jclouds/sqs/features/PermissionApi.java
index 6ebd781..2d57875 100644
--- a/apis/sqs/src/main/java/org/jclouds/sqs/features/PermissionApi.java
+++ b/apis/sqs/src/main/java/org/jclouds/sqs/features/PermissionApi.java
@@ -16,15 +16,30 @@
  */
 package org.jclouds.sqs.features;
 
+import static org.jclouds.sqs.reference.SQSParameters.ACTION;
+import static org.jclouds.sqs.reference.SQSParameters.VERSION;
+
+import javax.inject.Named;
+import javax.ws.rs.FormParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+
+import org.jclouds.Constants;
+import org.jclouds.aws.filters.FormSigner;
+import org.jclouds.rest.annotations.FormParams;
+import org.jclouds.rest.annotations.RequestFilters;
+import org.jclouds.rest.annotations.VirtualHost;
 import org.jclouds.sqs.domain.Action;
 
 /**
  * Provides access to SQS via their REST API.
  * <p/>
  * 
- * @see PermissionAsyncApi
  * @author Adrian Cole
  */
+@RequestFilters(FormSigner.class)
+@FormParams(keys = VERSION, values = "{" + Constants.PROPERTY_API_VERSION + "}")
+@VirtualHost
 public interface PermissionApi {
 
    /**
@@ -62,7 +77,12 @@ public interface PermissionApi {
     *           Constraints: Valid 12-digit AWS account number, without hyphens
     * 
     */
-   void addPermissionToAccount(String label, Action permission, String accountId);
+   @Named("AddPermission")
+   @POST
+   @Path("/")
+   @FormParams(keys = ACTION, values = "AddPermission")
+   void addPermissionToAccount(@FormParam("Label") String label,
+         @FormParam("ActionName.1") Action permission, @FormParam("AWSAccountId.1") String accountId);
 
    /**
     * The RemovePermission action revokes any permissions in the queue policy
@@ -76,6 +96,10 @@ public interface PermissionApi {
     *           The identification of the permission you want to remove. This is
     *           the label you added in AddPermission. example: AliceSendMessage
     */
-   void remove(String label);
+   @Named("RemovePermission")
+   @POST
+   @Path("/")
+   @FormParams(keys = ACTION, values = "RemovePermission")
+   void remove(@FormParam("Label") String label);
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/e6765cc5/apis/sqs/src/main/java/org/jclouds/sqs/features/PermissionAsyncApi.java
----------------------------------------------------------------------
diff --git a/apis/sqs/src/main/java/org/jclouds/sqs/features/PermissionAsyncApi.java b/apis/sqs/src/main/java/org/jclouds/sqs/features/PermissionAsyncApi.java
deleted file mode 100644
index c647b95..0000000
--- a/apis/sqs/src/main/java/org/jclouds/sqs/features/PermissionAsyncApi.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.sqs.features;
-
-import static org.jclouds.sqs.reference.SQSParameters.ACTION;
-import static org.jclouds.sqs.reference.SQSParameters.VERSION;
-
-import javax.inject.Named;
-import javax.ws.rs.FormParam;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-
-import org.jclouds.Constants;
-import org.jclouds.aws.filters.FormSigner;
-import org.jclouds.rest.annotations.FormParams;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.VirtualHost;
-import org.jclouds.sqs.domain.Action;
-
-import com.google.common.util.concurrent.ListenableFuture;
-
-/**
- * Provides access to SQS via their REST API.
- * <p/>
- * 
- * @author Adrian Cole
- */
-@RequestFilters(FormSigner.class)
-@FormParams(keys = VERSION, values = "{" + Constants.PROPERTY_API_VERSION + "}")
-@VirtualHost
-public interface PermissionAsyncApi {
-
-   /**
-    * @see PermissionApi#addPermissionToAccount
-    */
-   @Named("AddPermission")
-   @POST
-   @Path("/")
-   @FormParams(keys = ACTION, values = "AddPermission")
-   ListenableFuture<Void> addPermissionToAccount(@FormParam("Label") String label,
-         @FormParam("ActionName.1") Action permission, @FormParam("AWSAccountId.1") String accountId);
-
-   /**
-    * @see PermissionApi#remove
-    */
-   @Named("RemovePermission")
-   @POST
-   @Path("/")
-   @FormParams(keys = ACTION, values = "RemovePermission")
-   ListenableFuture<Void> remove(@FormParam("Label") String label);
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/e6765cc5/apis/sqs/src/main/java/org/jclouds/sqs/features/QueueApi.java
----------------------------------------------------------------------
diff --git a/apis/sqs/src/main/java/org/jclouds/sqs/features/QueueApi.java b/apis/sqs/src/main/java/org/jclouds/sqs/features/QueueApi.java
index 3cfc926..0e80783 100644
--- a/apis/sqs/src/main/java/org/jclouds/sqs/features/QueueApi.java
+++ b/apis/sqs/src/main/java/org/jclouds/sqs/features/QueueApi.java
@@ -16,11 +16,39 @@
  */
 package org.jclouds.sqs.features;
 
+import static org.jclouds.sqs.reference.SQSParameters.ACTION;
+import static org.jclouds.sqs.reference.SQSParameters.VERSION;
+
 import java.net.URI;
 import java.util.Map;
+
+import javax.inject.Named;
+import javax.ws.rs.FormParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+
+import org.jclouds.Constants;
+import org.jclouds.Fallbacks.NullOnNotFoundOr404;
+import org.jclouds.Fallbacks.VoidOnNotFoundOr404;
+import org.jclouds.aws.filters.FormSigner;
+import org.jclouds.rest.annotations.BinderParam;
+import org.jclouds.rest.annotations.EndpointParam;
+import org.jclouds.rest.annotations.Fallback;
+import org.jclouds.rest.annotations.FormParams;
+import org.jclouds.rest.annotations.RequestFilters;
+import org.jclouds.rest.annotations.ResponseParser;
+import org.jclouds.rest.annotations.Transform;
+import org.jclouds.rest.annotations.VirtualHost;
+import org.jclouds.rest.annotations.XMLResponseParser;
+import org.jclouds.sqs.binders.BindAttributeNamesToIndexedFormParams;
 import org.jclouds.sqs.domain.QueueAttributes;
+import org.jclouds.sqs.functions.MapToQueueAttributes;
 import org.jclouds.sqs.options.CreateQueueOptions;
 import org.jclouds.sqs.options.ListQueuesOptions;
+import org.jclouds.sqs.xml.AttributesHandler;
+import org.jclouds.sqs.xml.RegexListQueuesResponseHandler;
+import org.jclouds.sqs.xml.RegexQueueHandler;
+import org.jclouds.sqs.xml.ValueHandler;
 
 import com.google.common.collect.FluentIterable;
 
@@ -28,9 +56,11 @@ import com.google.common.collect.FluentIterable;
  * Provides access to SQS via their REST API.
  * <p/>
  * 
- * @see QueueAsyncApi
  * @author Adrian Cole
  */
+@RequestFilters(FormSigner.class)
+@FormParams(keys = VERSION, values = "{" + Constants.PROPERTY_API_VERSION + "}")
+@VirtualHost
 public interface QueueApi {
 
    /**
@@ -48,10 +78,20 @@ public interface QueueApi {
     *      "http://docs.amazonwebservices.com/AWSSimpleQueueService/2011-10-01/APIReference/Query_QueryListQueues.html"
     *      />
     */
+   @Named("ListQueues")
+   @POST
+   @Path("/")
+   @FormParams(keys = ACTION, values = "ListQueues")
+   @ResponseParser(RegexListQueuesResponseHandler.class)
    FluentIterable<URI> list();
 
+   @Named("ListQueues")
+   @POST
+   @Path("/")
+   @FormParams(keys = ACTION, values = "ListQueues")
+   @ResponseParser(RegexListQueuesResponseHandler.class)
    FluentIterable<URI> list(ListQueuesOptions options);
-   
+
    /**
     * The GetQueueUrl action returns the Uniform Resource Locater (URL) of a
     * queue. This action provides a simple way to retrieve the URL of an SQS
@@ -61,7 +101,13 @@ public interface QueueApi {
     *           The name of an existing queue.
     * @return uri of the queue or null if not found
     */
-   URI get(String queueName);
+   @Named("GetQueueUrl")
+   @POST
+   @Path("/")
+   @FormParams(keys = ACTION, values = "GetQueueUrl")
+   @ResponseParser(RegexQueueHandler.class)
+   @Fallback(NullOnNotFoundOr404.class)
+   URI get(@FormParam("QueueName") String queueName);
 
    /**
     * like {@link #get(String)}, except specifying the owner of the queue.
@@ -73,7 +119,14 @@ public interface QueueApi {
     * @param accountId
     * @return The AWS account ID of the account that created the queue.
     */
-   URI getInAccount(String queueName, String accountId);
+   @Named("GetQueueUrl")
+   @POST
+   @Path("/")
+   @FormParams(keys = ACTION, values = "GetQueueUrl")
+   @ResponseParser(RegexQueueHandler.class)
+   @Fallback(NullOnNotFoundOr404.class)
+   URI getInAccount(@FormParam("QueueName") String queueName,
+         @FormParam("QueueOwnerAWSAccountId") String accountId);
 
    /**
     * The CreateQueue action creates a new queue.
@@ -104,7 +157,12 @@ public interface QueueApi {
     *           characters; alphanumeric characters, hyphens (-), and
     *           underscores (_) are allowed.
     */
-   URI create(String queueName);
+   @Named("CreateQueue")
+   @POST
+   @Path("/")
+   @FormParams(keys = ACTION, values = "CreateQueue")
+   @ResponseParser(RegexQueueHandler.class)
+   URI create(@FormParam("QueueName") String queueName);
 
    /**
     * same as {@link #create(String, String)} except you can
@@ -114,7 +172,12 @@ public interface QueueApi {
     *           options such as delay seconds
     * @see #create(String, String)
     */
-   URI create(String queueName, CreateQueueOptions options);
+   @Named("CreateQueue")
+   @POST
+   @Path("/")
+   @FormParams(keys = ACTION, values = "CreateQueue")
+   @ResponseParser(RegexQueueHandler.class)
+   URI create(@FormParam("QueueName") String queueName, CreateQueueOptions options);
 
    /**
     * The DeleteQueue action deletes the queue specified by the queue URL,
@@ -140,7 +203,12 @@ public interface QueueApi {
     * @param queue
     *           queue you want to delete
     */
-   void delete(URI queue);
+   @Named("DeleteQueue")
+   @POST
+   @Path("/")
+   @FormParams(keys = ACTION, values = "DeleteQueue")
+   @Fallback(VoidOnNotFoundOr404.class)
+   void delete(@EndpointParam URI queue);
 
    /**
     * returns all attributes of a queue.
@@ -148,7 +216,41 @@ public interface QueueApi {
     * @param queue
     *           queue to get the attributes of
     */
-   QueueAttributes getAttributes(URI queue);
+   @Named("GetQueueAttributes")
+   @POST
+   @Path("/")
+   @FormParams(keys = { ACTION, "AttributeName.1" }, values = { "GetQueueAttributes", "All" })
+   @Transform(MapToQueueAttributes.class)
+   @Fallback(NullOnNotFoundOr404.class)
+   @XMLResponseParser(AttributesHandler.class)
+   QueueAttributes getAttributes(@EndpointParam URI queue);
+
+   /**
+    * returns an attribute of a queue.
+    * 
+    * @param queue
+    *           queue to get the attributes of
+    */
+   @Named("GetQueueAttributes")
+   @POST
+   @Path("/")
+   @FormParams(keys = ACTION, values = "GetQueueAttributes")
+   @XMLResponseParser(AttributesHandler.class)
+   Map<String, String> getAttributes(@EndpointParam URI queue,
+         @BinderParam(BindAttributeNamesToIndexedFormParams.class) Iterable<String> attributeNames);
+
+   /**
+    * returns an attribute of a queue.
+    * 
+    * @param queue
+    *           queue to get the attributes of
+    */
+   @Named("GetQueueAttributes")
+   @POST
+   @Path("/")
+   @FormParams(keys = ACTION, values = "GetQueueAttributes")
+   @XMLResponseParser(ValueHandler.class)
+   String getAttribute(@EndpointParam URI queue, @FormParam("AttributeName.1") String attributeName);
 
    /**
     * The SetQueueAttributes action sets one attribute of a queue per request.
@@ -205,22 +307,11 @@ public interface QueueApi {
     *           DelaySeconds - An integer from 0 to 900 (15 minutes). The
     *           default for this attribute is 0.
     */
-   void setAttribute(URI queue, String name, String value);
-
-   /**
-    * returns some attributes of a queue.
-    * 
-    * @param queue
-    *           queue to get the attributes of
-    */
-   Map<String, String> getAttributes(URI queue, Iterable<String> attributeNames);
-
-   /**
-    * returns an attribute of a queue.
-    * 
-    * @param queue
-    *           queue to get the attributes of
-    */
-   String getAttribute(URI queue, String attributeName);
+   @Named("SetQueueAttributes")
+   @POST
+   @Path("/")
+   @FormParams(keys = ACTION, values = "SetQueueAttributes")
+   void setAttribute(@EndpointParam URI queue, @FormParam("Attribute.Name") String name,
+         @FormParam("Attribute.Value") String value);
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/e6765cc5/apis/sqs/src/main/java/org/jclouds/sqs/features/QueueAsyncApi.java
----------------------------------------------------------------------
diff --git a/apis/sqs/src/main/java/org/jclouds/sqs/features/QueueAsyncApi.java b/apis/sqs/src/main/java/org/jclouds/sqs/features/QueueAsyncApi.java
deleted file mode 100644
index 26d78c1..0000000
--- a/apis/sqs/src/main/java/org/jclouds/sqs/features/QueueAsyncApi.java
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.sqs.features;
-
-import static org.jclouds.sqs.reference.SQSParameters.ACTION;
-import static org.jclouds.sqs.reference.SQSParameters.VERSION;
-
-import java.net.URI;
-import java.util.Map;
-
-import javax.inject.Named;
-import javax.ws.rs.FormParam;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-
-import org.jclouds.Constants;
-import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.Fallbacks.VoidOnNotFoundOr404;
-import org.jclouds.aws.filters.FormSigner;
-import org.jclouds.rest.annotations.BinderParam;
-import org.jclouds.rest.annotations.EndpointParam;
-import org.jclouds.rest.annotations.Fallback;
-import org.jclouds.rest.annotations.FormParams;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.ResponseParser;
-import org.jclouds.rest.annotations.Transform;
-import org.jclouds.rest.annotations.VirtualHost;
-import org.jclouds.rest.annotations.XMLResponseParser;
-import org.jclouds.sqs.binders.BindAttributeNamesToIndexedFormParams;
-import org.jclouds.sqs.domain.QueueAttributes;
-import org.jclouds.sqs.functions.MapToQueueAttributes;
-import org.jclouds.sqs.options.CreateQueueOptions;
-import org.jclouds.sqs.options.ListQueuesOptions;
-import org.jclouds.sqs.xml.AttributesHandler;
-import org.jclouds.sqs.xml.RegexListQueuesResponseHandler;
-import org.jclouds.sqs.xml.RegexQueueHandler;
-import org.jclouds.sqs.xml.ValueHandler;
-
-import com.google.common.collect.FluentIterable;
-import com.google.common.util.concurrent.ListenableFuture;
-
-/**
- * Provides access to SQS via their REST API.
- * <p/>
- * 
- * @author Adrian Cole
- */
-@RequestFilters(FormSigner.class)
-@FormParams(keys = VERSION, values = "{" + Constants.PROPERTY_API_VERSION + "}")
-@VirtualHost
-public interface QueueAsyncApi {
-
-   /**
-    * @see QueueApi#list
-    */
-   @Named("ListQueues")
-   @POST
-   @Path("/")
-   @FormParams(keys = ACTION, values = "ListQueues")
-   @ResponseParser(RegexListQueuesResponseHandler.class)
-   ListenableFuture<FluentIterable<URI>> list();
-
-   /**
-    * @see QueueApi#list(ListQueuesOptions)
-    */
-   @Named("ListQueues")
-   @POST
-   @Path("/")
-   @FormParams(keys = ACTION, values = "ListQueues")
-   @ResponseParser(RegexListQueuesResponseHandler.class)
-   ListenableFuture<FluentIterable<URI>> list(ListQueuesOptions options);
-
-   /**
-    * @see QueueApi#get(String)
-    */
-   @Named("GetQueueUrl")
-   @POST
-   @Path("/")
-   @FormParams(keys = ACTION, values = "GetQueueUrl")
-   @ResponseParser(RegexQueueHandler.class)
-   @Fallback(NullOnNotFoundOr404.class)
-   ListenableFuture<URI> get(@FormParam("QueueName") String queueName);
-
-   /**
-    * @see QueueApi#getInAccount
-    */
-   @Named("GetQueueUrl")
-   @POST
-   @Path("/")
-   @FormParams(keys = ACTION, values = "GetQueueUrl")
-   @ResponseParser(RegexQueueHandler.class)
-   @Fallback(NullOnNotFoundOr404.class)
-   ListenableFuture<URI> getInAccount(@FormParam("QueueName") String queueName,
-         @FormParam("QueueOwnerAWSAccountId") String accountId);
-
-   /**
-    * @see QueueApi#create
-    */
-   @Named("CreateQueue")
-   @POST
-   @Path("/")
-   @FormParams(keys = ACTION, values = "CreateQueue")
-   @ResponseParser(RegexQueueHandler.class)
-   ListenableFuture<URI> create(@FormParam("QueueName") String queueName);
-
-   /**
-    * @see QueueApi#create
-    */
-   @Named("CreateQueue")
-   @POST
-   @Path("/")
-   @FormParams(keys = ACTION, values = "CreateQueue")
-   @ResponseParser(RegexQueueHandler.class)
-   ListenableFuture<URI> create(@FormParam("QueueName") String queueName, CreateQueueOptions options);
-
-   /**
-    * @see QueueApi#delete
-    */
-   @Named("DeleteQueue")
-   @POST
-   @Path("/")
-   @FormParams(keys = ACTION, values = "DeleteQueue")
-   @Fallback(VoidOnNotFoundOr404.class)
-   ListenableFuture<Void> delete(@EndpointParam URI queue);
-
-   /**
-    * @see QueueApi#getAttributes(URI)
-    */
-   @Named("GetQueueAttributes")
-   @POST
-   @Path("/")
-   @FormParams(keys = { ACTION, "AttributeName.1" }, values = { "GetQueueAttributes", "All" })
-   @Transform(MapToQueueAttributes.class)
-   @Fallback(NullOnNotFoundOr404.class)
-   @XMLResponseParser(AttributesHandler.class)
-   ListenableFuture<? extends QueueAttributes> getAttributes(@EndpointParam URI queue);
-
-   /**
-    * @see QueueApi#getAttributes(URI, Iterable)
-    */
-   @Named("GetQueueAttributes")
-   @POST
-   @Path("/")
-   @FormParams(keys = ACTION, values = "GetQueueAttributes")
-   @XMLResponseParser(AttributesHandler.class)
-   ListenableFuture<Map<String, String>> getAttributes(@EndpointParam URI queue,
-         @BinderParam(BindAttributeNamesToIndexedFormParams.class) Iterable<String> attributeNames);
-
-   /**
-    * @see QueueApi#getAttribute
-    */
-   @Named("GetQueueAttributes")
-   @POST
-   @Path("/")
-   @FormParams(keys = ACTION, values = "GetQueueAttributes")
-   @XMLResponseParser(ValueHandler.class)
-   ListenableFuture<String> getAttribute(@EndpointParam URI queue, @FormParam("AttributeName.1") String attributeName);
-
-   /**
-    * @see QueueApi#setAttribute
-    */
-   @Named("SetQueueAttributes")
-   @POST
-   @Path("/")
-   @FormParams(keys = ACTION, values = "SetQueueAttributes")
-   ListenableFuture<Void> setAttribute(@EndpointParam URI queue, @FormParam("Attribute.Name") String name,
-         @FormParam("Attribute.Value") String value);
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/e6765cc5/apis/sqs/src/test/java/org/jclouds/sqs/SQSApiMetadataTest.java
----------------------------------------------------------------------
diff --git a/apis/sqs/src/test/java/org/jclouds/sqs/SQSApiMetadataTest.java b/apis/sqs/src/test/java/org/jclouds/sqs/SQSApiMetadataTest.java
index 263ade0..ca20042 100644
--- a/apis/sqs/src/test/java/org/jclouds/sqs/SQSApiMetadataTest.java
+++ b/apis/sqs/src/test/java/org/jclouds/sqs/SQSApiMetadataTest.java
@@ -17,7 +17,7 @@
 package org.jclouds.sqs;
 
 import org.jclouds.View;
-import org.jclouds.rest.internal.BaseRestApiMetadataTest;
+import org.jclouds.rest.internal.BaseHttpApiMetadataTest;
 import org.testng.annotations.Test;
 
 import com.google.common.collect.ImmutableSet;
@@ -28,7 +28,7 @@ import com.google.common.reflect.TypeToken;
  * @author Adrian Cole
  */
 @Test(groups = "unit", testName = "SQSApiMetadataTest")
-public class SQSApiMetadataTest extends BaseRestApiMetadataTest {
+public class SQSApiMetadataTest extends BaseHttpApiMetadataTest {
 
    // no queue abstraction, yet
    public SQSApiMetadataTest() {

http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/e6765cc5/apis/sqs/src/test/java/org/jclouds/sqs/internal/BaseSQSExpectTest.java
----------------------------------------------------------------------
diff --git a/apis/sqs/src/test/java/org/jclouds/sqs/internal/BaseSQSExpectTest.java b/apis/sqs/src/test/java/org/jclouds/sqs/internal/BaseSQSExpectTest.java
index 0698e37..087c158 100644
--- a/apis/sqs/src/test/java/org/jclouds/sqs/internal/BaseSQSExpectTest.java
+++ b/apis/sqs/src/test/java/org/jclouds/sqs/internal/BaseSQSExpectTest.java
@@ -19,9 +19,9 @@ package org.jclouds.sqs.internal;
 import java.net.URI;
 
 import org.jclouds.date.DateService;
-import org.jclouds.rest.ConfiguresRestClient;
+import org.jclouds.rest.ConfiguresHttpApi;
 import org.jclouds.rest.internal.BaseRestApiExpectTest;
-import org.jclouds.sqs.config.SQSRestClientModule;
+import org.jclouds.sqs.config.SQSHttpApiModule;
 
 import com.google.inject.Module;
 
@@ -36,8 +36,8 @@ public class BaseSQSExpectTest<T> extends BaseRestApiExpectTest<T> {
       provider = "sqs";
    }
 
-   @ConfiguresRestClient
-   private static final class TestSQSRestClientModule extends SQSRestClientModule {
+   @ConfiguresHttpApi
+   private static final class TestSQSHttpApiModule extends SQSHttpApiModule {
 
       @Override
       protected String provideTimeStamp(final DateService dateService) {
@@ -47,6 +47,6 @@ public class BaseSQSExpectTest<T> extends BaseRestApiExpectTest<T> {
 
    @Override
    protected Module createModule() {
-      return new TestSQSRestClientModule();
+      return new TestSQSHttpApiModule();
    }
 }


[2/2] git commit: JCLOUDS-150. De-async CloudWatch.

Posted by ab...@apache.org.
JCLOUDS-150. De-async CloudWatch.


Project: http://git-wip-us.apache.org/repos/asf/incubator-jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-jclouds/commit/91d6736c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-jclouds/tree/91d6736c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-jclouds/diff/91d6736c

Branch: refs/heads/master
Commit: 91d6736c22d9cb488c0c0ba1ed3ec54f26ac146e
Parents: 100afba
Author: Andrew Bayer <an...@gmail.com>
Authored: Tue Jul 2 18:42:28 2013 -0700
Committer: Andrew Bayer <an...@gmail.com>
Committed: Tue Aug 27 12:16:30 2013 -0700

----------------------------------------------------------------------
 .../cloudwatch/CloudWatchApiMetadata.java       |  39 ++--
 .../jclouds/cloudwatch/CloudWatchAsyncApi.java  |  75 -------
 .../config/CloudWatchHttpApiModule.java         |  51 +++++
 .../config/CloudWatchRestClientModule.java      |  59 ------
 .../jclouds/cloudwatch/features/AlarmApi.java   | 104 +++++++++-
 .../cloudwatch/features/AlarmAsyncApi.java      | 193 -------------------
 .../jclouds/cloudwatch/features/MetricApi.java  |  60 +++++-
 .../cloudwatch/features/MetricAsyncApi.java     | 117 -----------
 .../cloudwatch/CloudWatchApiMetadataTest.java   |   4 +-
 .../internal/BaseCloudWatchExpectTest.java      |  10 +-
 10 files changed, 227 insertions(+), 485 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/91d6736c/apis/cloudwatch/src/main/java/org/jclouds/cloudwatch/CloudWatchApiMetadata.java
----------------------------------------------------------------------
diff --git a/apis/cloudwatch/src/main/java/org/jclouds/cloudwatch/CloudWatchApiMetadata.java b/apis/cloudwatch/src/main/java/org/jclouds/cloudwatch/CloudWatchApiMetadata.java
index d48863b..14ef3d4 100644
--- a/apis/cloudwatch/src/main/java/org/jclouds/cloudwatch/CloudWatchApiMetadata.java
+++ b/apis/cloudwatch/src/main/java/org/jclouds/cloudwatch/CloudWatchApiMetadata.java
@@ -24,50 +24,40 @@ import java.util.Properties;
 
 import com.google.common.reflect.TypeToken;
 import org.jclouds.apis.ApiMetadata;
-import org.jclouds.cloudwatch.config.CloudWatchRestClientModule;
-import org.jclouds.rest.internal.BaseRestApiMetadata;
+import org.jclouds.cloudwatch.config.CloudWatchHttpApiModule;
+import org.jclouds.rest.internal.BaseHttpApiMetadata;
 
 /**
  * Implementation of {@link ApiMetadata} for Amazon's CloudWatch api.
  * 
  * @author Adrian Cole
  */
-public class CloudWatchApiMetadata extends BaseRestApiMetadata {
+public class CloudWatchApiMetadata extends BaseHttpApiMetadata {
 
-   /**
-    * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(CloudWatchApi.class)} as
-    *             {@link CloudWatchAsyncApi} interface will be removed in jclouds 1.7.
-    */
-   @Deprecated
-   public static final TypeToken<org.jclouds.rest.RestContext<CloudWatchApi, CloudWatchAsyncApi>> CONTEXT_TOKEN = new TypeToken<org.jclouds.rest.RestContext<CloudWatchApi, CloudWatchAsyncApi>>() {
-      private static final long serialVersionUID = 1L;
-   };
 
    @Override
-   public Builder toBuilder() {
-      return new Builder(getApi(), getAsyncApi()).fromApiMetadata(this);
+   public Builder<?> toBuilder() {
+      return new ConcreteBuilder().fromApiMetadata(this);
    }
 
-   @SuppressWarnings("deprecation")
    public CloudWatchApiMetadata() {
-      this(new Builder(CloudWatchApi.class, CloudWatchAsyncApi.class));
+      this(new ConcreteBuilder());
    }
 
-   protected CloudWatchApiMetadata(Builder builder) {
-      super(Builder.class.cast(builder));
+   protected CloudWatchApiMetadata(Builder<?> builder) {
+      super(builder);
    }
 
    public static Properties defaultProperties() {
-      Properties properties = BaseRestApiMetadata.defaultProperties();
+      Properties properties = BaseHttpApiMetadata.defaultProperties();
       properties.setProperty(PROPERTY_AUTH_TAG, "AWS");
       properties.setProperty(PROPERTY_HEADER_TAG, "amz");
       return properties;
    }
 
-   public static class Builder extends BaseRestApiMetadata.Builder<Builder> {
+   public abstract static class Builder<T extends Builder<T>> extends BaseHttpApiMetadata.Builder<CloudWatchApi, T> {
 
-      protected Builder(Class<?> api, Class<?> asyncApi) {
-         super(api, asyncApi);
+      protected Builder() {
          id("cloudwatch")
          .name("Amazon CloudWatch Api")
          .identityName("Access Key ID")
@@ -76,7 +66,7 @@ public class CloudWatchApiMetadata extends BaseRestApiMetadata {
          .documentation(URI.create("http://docs.amazonwebservices.com/AmazonCloudWatch/latest/APIReference/"))
          .defaultEndpoint("https://monitoring.us-east-1.amazonaws.com")
          .defaultProperties(CloudWatchApiMetadata.defaultProperties())
-         .defaultModule(CloudWatchRestClientModule.class);
+         .defaultModule(CloudWatchHttpApiModule.class);
       }
 
       @Override
@@ -84,8 +74,11 @@ public class CloudWatchApiMetadata extends BaseRestApiMetadata {
          return new CloudWatchApiMetadata(this);
       }
       
+   }
+
+   private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
       @Override
-      protected Builder self() {
+      protected ConcreteBuilder self() {
          return this;
       }
    }

http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/91d6736c/apis/cloudwatch/src/main/java/org/jclouds/cloudwatch/CloudWatchAsyncApi.java
----------------------------------------------------------------------
diff --git a/apis/cloudwatch/src/main/java/org/jclouds/cloudwatch/CloudWatchAsyncApi.java b/apis/cloudwatch/src/main/java/org/jclouds/cloudwatch/CloudWatchAsyncApi.java
deleted file mode 100644
index 946280a..0000000
--- a/apis/cloudwatch/src/main/java/org/jclouds/cloudwatch/CloudWatchAsyncApi.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.cloudwatch;
-
-import java.io.Closeable;
-import java.util.Set;
-
-import com.google.inject.Provides;
-import org.jclouds.cloudwatch.features.AlarmAsyncApi;
-import org.jclouds.cloudwatch.features.MetricAsyncApi;
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.location.Region;
-import org.jclouds.location.functions.RegionToEndpointOrProviderIfNull;
-import org.jclouds.rest.annotations.Delegate;
-import org.jclouds.rest.annotations.EndpointParam;
-
-/**
- * Provides access to Amazon CloudWatch via the Query API
- * <p/>
- * 
- * @see <a
- *      href="http://docs.amazonwebservices.com/AmazonCloudWatch/latest/APIReference"
- *      />
- * @author Adrian Cole
- * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(CloudWatchApi.class)} as
- *             {@link CloudWatchAsyncApi} interface will be removed in jclouds 1.7.
- */
-@Deprecated
-public interface CloudWatchAsyncApi extends Closeable {
-   /**
-    * 
-    * @return the Region codes configured
-    */
-   @Provides
-   @Region
-   Set<String> getConfiguredRegions();
-
-   /**
-    * Provides asynchronous access to Metric features.
-    */
-   @Delegate
-   MetricAsyncApi getMetricApi();
-
-   /**
-    * Provides asynchronous access to Metric features.
-    */
-   @Delegate
-   MetricAsyncApi getMetricApiForRegion(@EndpointParam(parser = RegionToEndpointOrProviderIfNull.class) @Nullable String region);
-
-   /**
-    * Provides asynchronous access to Alarm features.
-    */
-   @Delegate
-   AlarmAsyncApi getAlarmApi();
-
-   /**
-    * Provides asynchronous access to Metric features.
-    */
-   @Delegate
-   AlarmAsyncApi getAlarmApiForRegion(@EndpointParam(parser = RegionToEndpointOrProviderIfNull.class) @Nullable String region);
-}

http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/91d6736c/apis/cloudwatch/src/main/java/org/jclouds/cloudwatch/config/CloudWatchHttpApiModule.java
----------------------------------------------------------------------
diff --git a/apis/cloudwatch/src/main/java/org/jclouds/cloudwatch/config/CloudWatchHttpApiModule.java b/apis/cloudwatch/src/main/java/org/jclouds/cloudwatch/config/CloudWatchHttpApiModule.java
new file mode 100644
index 0000000..500e7e7
--- /dev/null
+++ b/apis/cloudwatch/src/main/java/org/jclouds/cloudwatch/config/CloudWatchHttpApiModule.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.cloudwatch.config;
+
+import com.google.common.collect.ImmutableMap;
+import org.jclouds.aws.config.FormSigningHttpApiModule;
+import org.jclouds.cloudwatch.CloudWatchApi;
+import org.jclouds.cloudwatch.features.AlarmApi;
+import org.jclouds.cloudwatch.features.MetricApi;
+import org.jclouds.cloudwatch.handlers.CloudWatchErrorHandler;
+import org.jclouds.http.HttpErrorHandler;
+import org.jclouds.http.annotation.ClientError;
+import org.jclouds.http.annotation.ServerError;
+import org.jclouds.rest.ConfiguresHttpApi;
+
+import java.util.Map;
+
+import static org.jclouds.reflect.Reflection2.typeToken;
+
+/**
+ * Configures the Monitoring connection.
+ * 
+ * @author Adrian Cole
+ */
+@ConfiguresHttpApi
+public class CloudWatchHttpApiModule extends FormSigningHttpApiModule<CloudWatchApi> {
+   public CloudWatchHttpApiModule() {
+      super(CloudWatchApi.class);
+   }
+
+   @Override
+   protected void bindErrorHandlers() {
+      bind(HttpErrorHandler.class).annotatedWith(ClientError.class).to(CloudWatchErrorHandler.class);
+      bind(HttpErrorHandler.class).annotatedWith(ServerError.class).to(CloudWatchErrorHandler.class);
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/91d6736c/apis/cloudwatch/src/main/java/org/jclouds/cloudwatch/config/CloudWatchRestClientModule.java
----------------------------------------------------------------------
diff --git a/apis/cloudwatch/src/main/java/org/jclouds/cloudwatch/config/CloudWatchRestClientModule.java b/apis/cloudwatch/src/main/java/org/jclouds/cloudwatch/config/CloudWatchRestClientModule.java
deleted file mode 100644
index 8c92594..0000000
--- a/apis/cloudwatch/src/main/java/org/jclouds/cloudwatch/config/CloudWatchRestClientModule.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.cloudwatch.config;
-
-import com.google.common.collect.ImmutableMap;
-import org.jclouds.aws.config.FormSigningRestClientModule;
-import org.jclouds.cloudwatch.CloudWatchApi;
-import org.jclouds.cloudwatch.CloudWatchAsyncApi;
-import org.jclouds.cloudwatch.features.AlarmApi;
-import org.jclouds.cloudwatch.features.AlarmAsyncApi;
-import org.jclouds.cloudwatch.features.MetricApi;
-import org.jclouds.cloudwatch.features.MetricAsyncApi;
-import org.jclouds.cloudwatch.handlers.CloudWatchErrorHandler;
-import org.jclouds.http.HttpErrorHandler;
-import org.jclouds.http.annotation.ClientError;
-import org.jclouds.http.annotation.ServerError;
-import org.jclouds.rest.ConfiguresRestClient;
-
-import java.util.Map;
-
-import static org.jclouds.reflect.Reflection2.typeToken;
-
-/**
- * Configures the Monitoring connection.
- * 
- * @author Adrian Cole
- */
-@ConfiguresRestClient
-public class CloudWatchRestClientModule extends FormSigningRestClientModule<CloudWatchApi, CloudWatchAsyncApi> {
-   public static final Map<Class<?>, Class<?>> DELEGATE_MAP = ImmutableMap.<Class<?>, Class<?>> builder()//
-         .put(MetricApi.class, MetricAsyncApi.class)
-         .put(AlarmApi.class, AlarmAsyncApi.class)
-         .build();
-   
-   public CloudWatchRestClientModule() {
-      super(typeToken(CloudWatchApi.class), typeToken(CloudWatchAsyncApi.class), DELEGATE_MAP);
-   }
-
-   @Override
-   protected void bindErrorHandlers() {
-      bind(HttpErrorHandler.class).annotatedWith(ClientError.class).to(CloudWatchErrorHandler.class);
-      bind(HttpErrorHandler.class).annotatedWith(ServerError.class).to(CloudWatchErrorHandler.class);
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/91d6736c/apis/cloudwatch/src/main/java/org/jclouds/cloudwatch/features/AlarmApi.java
----------------------------------------------------------------------
diff --git a/apis/cloudwatch/src/main/java/org/jclouds/cloudwatch/features/AlarmApi.java b/apis/cloudwatch/src/main/java/org/jclouds/cloudwatch/features/AlarmApi.java
index be22656..25ab508 100644
--- a/apis/cloudwatch/src/main/java/org/jclouds/cloudwatch/features/AlarmApi.java
+++ b/apis/cloudwatch/src/main/java/org/jclouds/cloudwatch/features/AlarmApi.java
@@ -16,26 +16,46 @@
  */
 package org.jclouds.cloudwatch.features;
 
+import javax.inject.Named;
+import javax.ws.rs.FormParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+
 import com.google.common.annotations.Beta;
 import com.google.common.collect.FluentIterable;
+import org.jclouds.Fallbacks;
+import org.jclouds.aws.filters.FormSigner;
+import org.jclouds.cloudwatch.binders.AlarmNamesBinder;
 import org.jclouds.cloudwatch.domain.Alarm;
 import org.jclouds.cloudwatch.domain.AlarmHistoryItem;
+import org.jclouds.cloudwatch.functions.ListAlarmsToPagedIterable;
 import org.jclouds.cloudwatch.options.ListAlarmHistoryOptions;
 import org.jclouds.cloudwatch.options.ListAlarmsForMetric;
 import org.jclouds.cloudwatch.options.ListAlarmsOptions;
 import org.jclouds.cloudwatch.options.SaveAlarmOptions;
+import org.jclouds.cloudwatch.xml.ListAlarmHistoryResponseHandler;
+import org.jclouds.cloudwatch.xml.ListAlarmsForMetricResponseHandler;
+import org.jclouds.cloudwatch.xml.ListAlarmsResponseHandler;
 import org.jclouds.collect.IterableWithMarker;
 import org.jclouds.collect.PagedIterable;
 import org.jclouds.javax.annotation.Nullable;
+import org.jclouds.rest.annotations.BinderParam;
+import org.jclouds.rest.annotations.Fallback;
+import org.jclouds.rest.annotations.FormParams;
+import org.jclouds.rest.annotations.RequestFilters;
+import org.jclouds.rest.annotations.Transform;
+import org.jclouds.rest.annotations.VirtualHost;
+import org.jclouds.rest.annotations.XMLResponseParser;
 
 /**
  * Provides access to Amazon CloudWatch via the Query API
  * <p/>
  *
- * @see AlarmAsyncApi
  * @see <a href="http://docs.amazonwebservices.com/AmazonCloudWatch/latest/APIReference" />
  * @author Jeremy Whitlock
  */
+@RequestFilters(FormSigner.class)
+@VirtualHost
 @Beta
 public interface AlarmApi {
 
@@ -47,13 +67,24 @@ public interface AlarmApi {
     *
     * @param alarmNames the list of alarms to delete
     */
-   void delete(Iterable<String> alarmNames);
+   @Named("DeleteAlarms")
+   @POST
+   @Path("/")
+   @FormParams(keys = "Action", values = "DeleteAlarms")
+   void delete(@BinderParam(AlarmNamesBinder.class) Iterable<String> alarmNames);
 
    /**
     * Return all history for all alarms.
     *
     * @return the response object
     */
+   @Named("DescribeAlarmHistory")
+   @POST
+   @Path("/")
+   @XMLResponseParser(ListAlarmHistoryResponseHandler.class)
+   @FormParams(keys = "Action", values = "DescribeAlarmHistory")
+   @Transform(ListAlarmsToPagedIterable.class)
+   @Fallback(Fallbacks.EmptyIterableWithMarkerOnNotFoundOr404.class)
    PagedIterable<AlarmHistoryItem> listHistory();
 
    /**
@@ -61,6 +92,13 @@ public interface AlarmApi {
     *
     * @return the response object
     */
+   @Named("DescribeAlarmHistory")
+   @POST
+   @Path("/")
+   @XMLResponseParser(ListAlarmHistoryResponseHandler.class)
+   @FormParams(keys = "Action", values = "DescribeAlarmHistory")
+   @Transform(ListAlarmsToPagedIterable.class)
+   @Fallback(Fallbacks.EmptyIterableWithMarkerOnNotFoundOr404.class)
    PagedIterable<AlarmHistoryItem> listHistory(ListAlarmHistoryOptions options);
 
    /**
@@ -70,13 +108,27 @@ public interface AlarmApi {
     *
     * @return the response object
     */
-   IterableWithMarker<AlarmHistoryItem> listHistoryAt(String nextToken);
+   @Named("DescribeAlarmHistory")
+   @POST
+   @Path("/")
+   @XMLResponseParser(ListAlarmHistoryResponseHandler.class)
+   @FormParams(keys = "Action", values = "DescribeAlarmHistory")
+   @Fallback(Fallbacks.EmptyIterableWithMarkerOnNotFoundOr404.class)
+   IterableWithMarker<AlarmHistoryItem> listHistoryAt(@FormParam("NextToken")
+                                                                                        String nextToken);
 
    /**
     * Return all alarms.
     *
     * @return the response object
     */
+   @Named("DescribeAlarms")
+   @POST
+   @Path("/")
+   @XMLResponseParser(ListAlarmsResponseHandler.class)
+   @FormParams(keys = "Action", values = "DescribeAlarms")
+   @Transform(ListAlarmsToPagedIterable.class)
+   @Fallback(Fallbacks.EmptyIterableWithMarkerOnNotFoundOr404.class)
    PagedIterable<Alarm> list();
 
    /**
@@ -86,6 +138,13 @@ public interface AlarmApi {
     *
     * @return the response object
     */
+   @Named("DescribeAlarms")
+   @POST
+   @Path("/")
+   @XMLResponseParser(ListAlarmsResponseHandler.class)
+   @FormParams(keys = "Action", values = "DescribeAlarms")
+   @Transform(ListAlarmsToPagedIterable.class)
+   @Fallback(Fallbacks.EmptyIterableWithMarkerOnNotFoundOr404.class)
    PagedIterable<Alarm> list(ListAlarmsOptions options);
 
    /**
@@ -95,7 +154,13 @@ public interface AlarmApi {
     *
     * @return the response object
     */
-   IterableWithMarker<Alarm> listAt(String nextToken);
+   @Named("DescribeAlarms")
+   @POST
+   @Path("/")
+   @XMLResponseParser(ListAlarmsResponseHandler.class)
+   @FormParams(keys = "Action", values = "DescribeAlarms")
+   @Fallback(Fallbacks.EmptyIterableWithMarkerOnNotFoundOr404.class)
+   IterableWithMarker<Alarm> listAt(@FormParam("NextToken") String nextToken);
 
    /**
     * Return alarms all alarms for a single metric.
@@ -104,6 +169,12 @@ public interface AlarmApi {
     *
     * @return the response object
     */
+   @Named("DescribeAlarmsForMetric")
+   @POST
+   @Path("/")
+   @XMLResponseParser(ListAlarmsForMetricResponseHandler.class)
+   @FormParams(keys = "Action", values = "DescribeAlarmsForMetric")
+   @Fallback(Fallbacks.EmptyIterableWithMarkerOnNotFoundOr404.class)
    FluentIterable<Alarm> listForMetric(ListAlarmsForMetric options);
 
    /**
@@ -111,20 +182,32 @@ public interface AlarmApi {
     *
     * @param alarmNames the list of alarms to disable
     */
-   void disable(Iterable<String> alarmNames);
+   @Named("DisableAlarmActions")
+   @POST
+   @Path("/")
+   @FormParams(keys = "Action", values = "DisableAlarmActions")
+   void disable(@BinderParam(AlarmNamesBinder.class) Iterable<String> alarmNames);
 
    /**
     * Enables actions for the specified alarms.
     *
     * @param alarmNames the list of alarms to enable
     */
-   void enable(Iterable<String> alarmNames);
+   @Named("EnableAlarmActions")
+   @POST
+   @Path("/")
+   @FormParams(keys = "Action", values = "EnableAlarmActions")
+   void enable(@BinderParam(AlarmNamesBinder.class) Iterable<String> alarmNames);
 
    /**
     * Creates or updates an alarm and associates it with the specified Amazon CloudWatch metric.
     *
     * @param options the options describing the metric alarm to create/update
     */
+   @Named("PutMetricAlarm")
+   @POST
+   @Path("/")
+   @FormParams(keys = "Action", values = "PutMetricAlarm")
    void save(SaveAlarmOptions options);
 
    /**
@@ -135,6 +218,13 @@ public interface AlarmApi {
     * @param stateReasonData the reason that this alarm is set to this specific state (in machine-readable JSON format)
     * @param state the value of the state
     */
-   void setState(String alarmName, String stateReason, @Nullable String stateReasonData, Alarm.State state);
+   @Named("SetAlarmState")
+   @POST
+   @Path("/")
+   @FormParams(keys = "Action", values = "SetAlarmState")
+   void setState(@FormParam("AlarmName") String alarmName,
+                                   @FormParam("StateReason") String stateReason,
+                                   @FormParam("StateReasonData") @Nullable String stateReasonData,
+                                   @FormParam("StateValue") Alarm.State state);
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/91d6736c/apis/cloudwatch/src/main/java/org/jclouds/cloudwatch/features/AlarmAsyncApi.java
----------------------------------------------------------------------
diff --git a/apis/cloudwatch/src/main/java/org/jclouds/cloudwatch/features/AlarmAsyncApi.java b/apis/cloudwatch/src/main/java/org/jclouds/cloudwatch/features/AlarmAsyncApi.java
deleted file mode 100644
index 28a9255..0000000
--- a/apis/cloudwatch/src/main/java/org/jclouds/cloudwatch/features/AlarmAsyncApi.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.cloudwatch.features;
-
-import javax.inject.Named;
-import javax.ws.rs.FormParam;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-
-import com.google.common.annotations.Beta;
-import com.google.common.collect.FluentIterable;
-import com.google.common.util.concurrent.ListenableFuture;
-import org.jclouds.Fallbacks;
-import org.jclouds.aws.filters.FormSigner;
-import org.jclouds.cloudwatch.binders.AlarmNamesBinder;
-import org.jclouds.cloudwatch.domain.Alarm;
-import org.jclouds.cloudwatch.domain.AlarmHistoryItem;
-import org.jclouds.cloudwatch.functions.ListAlarmsToPagedIterable;
-import org.jclouds.cloudwatch.options.ListAlarmHistoryOptions;
-import org.jclouds.cloudwatch.options.ListAlarmsForMetric;
-import org.jclouds.cloudwatch.options.ListAlarmsOptions;
-import org.jclouds.cloudwatch.options.SaveAlarmOptions;
-import org.jclouds.cloudwatch.xml.ListAlarmHistoryResponseHandler;
-import org.jclouds.cloudwatch.xml.ListAlarmsForMetricResponseHandler;
-import org.jclouds.cloudwatch.xml.ListAlarmsResponseHandler;
-import org.jclouds.collect.IterableWithMarker;
-import org.jclouds.collect.PagedIterable;
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.rest.annotations.BinderParam;
-import org.jclouds.rest.annotations.Fallback;
-import org.jclouds.rest.annotations.FormParams;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.Transform;
-import org.jclouds.rest.annotations.VirtualHost;
-import org.jclouds.rest.annotations.XMLResponseParser;
-
-/**
- * Provides access to Amazon CloudWatch via the Query API
- * <p/>
- *
- * @see <a href="http://docs.amazonwebservices.com/AmazonCloudWatch/latest/APIReference" />
- * @author Jeremy Whitlock
- */
-@RequestFilters(FormSigner.class)
-@VirtualHost
-@Beta
-public interface AlarmAsyncApi {
-
-   /**
-    * @see AlarmApi#delete(Iterable)
-    */
-   @Named("DeleteAlarms")
-   @POST
-   @Path("/")
-   @FormParams(keys = "Action", values = "DeleteAlarms")
-   ListenableFuture<Void> delete(@BinderParam(AlarmNamesBinder.class) Iterable<String> alarmNames);
-
-   /**
-    * @see AlarmApi#listHistory()
-    */
-   @Named("DescribeAlarmHistory")
-   @POST
-   @Path("/")
-   @XMLResponseParser(ListAlarmHistoryResponseHandler.class)
-   @FormParams(keys = "Action", values = "DescribeAlarmHistory")
-   @Transform(ListAlarmsToPagedIterable.class)
-   @Fallback(Fallbacks.EmptyIterableWithMarkerOnNotFoundOr404.class)
-   ListenableFuture<? extends PagedIterable<AlarmHistoryItem>> listHistory();
-
-   /**
-    * @see AlarmApi#listHistory(org.jclouds.cloudwatch.options.ListAlarmHistoryOptions)
-    */
-   @Named("DescribeAlarmHistory")
-   @POST
-   @Path("/")
-   @XMLResponseParser(ListAlarmHistoryResponseHandler.class)
-   @FormParams(keys = "Action", values = "DescribeAlarmHistory")
-   @Transform(ListAlarmsToPagedIterable.class)
-   @Fallback(Fallbacks.EmptyIterableWithMarkerOnNotFoundOr404.class)
-   ListenableFuture<? extends PagedIterable<AlarmHistoryItem>> listHistory(ListAlarmHistoryOptions options);
-
-   /**
-    * @see AlarmApi#listHistoryAt(String)
-    */
-   @Named("DescribeAlarmHistory")
-   @POST
-   @Path("/")
-   @XMLResponseParser(ListAlarmHistoryResponseHandler.class)
-   @FormParams(keys = "Action", values = "DescribeAlarmHistory")
-   @Fallback(Fallbacks.EmptyIterableWithMarkerOnNotFoundOr404.class)
-   ListenableFuture<? extends IterableWithMarker<AlarmHistoryItem>> listHistoryAt(@FormParam("NextToken")
-                                                                                        String nextToken);
-
-   /**
-    * @see org.jclouds.cloudwatch.features.AlarmApi#list()
-    */
-   @Named("DescribeAlarms")
-   @POST
-   @Path("/")
-   @XMLResponseParser(ListAlarmsResponseHandler.class)
-   @FormParams(keys = "Action", values = "DescribeAlarms")
-   @Transform(ListAlarmsToPagedIterable.class)
-   @Fallback(Fallbacks.EmptyIterableWithMarkerOnNotFoundOr404.class)
-   ListenableFuture<? extends PagedIterable<Alarm>> list();
-
-   /**
-    * @see AlarmApi#list(org.jclouds.cloudwatch.options.ListAlarmsOptions)
-    */
-   @Named("DescribeAlarms")
-   @POST
-   @Path("/")
-   @XMLResponseParser(ListAlarmsResponseHandler.class)
-   @FormParams(keys = "Action", values = "DescribeAlarms")
-   @Transform(ListAlarmsToPagedIterable.class)
-   @Fallback(Fallbacks.EmptyIterableWithMarkerOnNotFoundOr404.class)
-   ListenableFuture<? extends PagedIterable<Alarm>> list(ListAlarmsOptions options);
-
-   /**
-    * @see AlarmApi#listAt(String)
-    */
-   @Named("DescribeAlarms")
-   @POST
-   @Path("/")
-   @XMLResponseParser(ListAlarmsResponseHandler.class)
-   @FormParams(keys = "Action", values = "DescribeAlarms")
-   @Fallback(Fallbacks.EmptyIterableWithMarkerOnNotFoundOr404.class)
-   ListenableFuture<? extends IterableWithMarker<Alarm>> listAt(@FormParam("NextToken") String nextToken);
-
-   /**
-    * @see AlarmApi#listForMetric(org.jclouds.cloudwatch.options.ListAlarmsForMetric)
-    */
-   @Named("DescribeAlarmsForMetric")
-   @POST
-   @Path("/")
-   @XMLResponseParser(ListAlarmsForMetricResponseHandler.class)
-   @FormParams(keys = "Action", values = "DescribeAlarmsForMetric")
-   @Fallback(Fallbacks.EmptyIterableWithMarkerOnNotFoundOr404.class)
-   ListenableFuture<? extends FluentIterable<Alarm>> listForMetric(ListAlarmsForMetric options);
-
-   /**
-    * @see AlarmApi#disable(Iterable)
-    */
-   @Named("DisableAlarmActions")
-   @POST
-   @Path("/")
-   @FormParams(keys = "Action", values = "DisableAlarmActions")
-   ListenableFuture<Void> disable(@BinderParam(AlarmNamesBinder.class) Iterable<String> alarmNames);
-
-   /**
-    * @see AlarmApi#enable(Iterable)
-    */
-   @Named("EnableAlarmActions")
-   @POST
-   @Path("/")
-   @FormParams(keys = "Action", values = "EnableAlarmActions")
-   ListenableFuture<Void> enable(@BinderParam(AlarmNamesBinder.class) Iterable<String> alarmNames);
-
-   /**
-    * @see AlarmApi#save(org.jclouds.cloudwatch.options.SaveAlarmOptions)
-    */
-   @Named("PutMetricAlarm")
-   @POST
-   @Path("/")
-   @FormParams(keys = "Action", values = "PutMetricAlarm")
-   ListenableFuture<Void> save(SaveAlarmOptions options);
-
-   /**
-    * @see AlarmApi#setState(String, String, String, org.jclouds.cloudwatch.domain.Alarm.State)
-    */
-   @Named("SetAlarmState")
-   @POST
-   @Path("/")
-   @FormParams(keys = "Action", values = "SetAlarmState")
-   ListenableFuture<Void> setState(@FormParam("AlarmName") String alarmName,
-                                   @FormParam("StateReason") String stateReason,
-                                   @FormParam("StateReasonData") @Nullable String stateReasonData,
-                                   @FormParam("StateValue") Alarm.State state);
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/91d6736c/apis/cloudwatch/src/main/java/org/jclouds/cloudwatch/features/MetricApi.java
----------------------------------------------------------------------
diff --git a/apis/cloudwatch/src/main/java/org/jclouds/cloudwatch/features/MetricApi.java b/apis/cloudwatch/src/main/java/org/jclouds/cloudwatch/features/MetricApi.java
index 8ff7079..9d47745 100644
--- a/apis/cloudwatch/src/main/java/org/jclouds/cloudwatch/features/MetricApi.java
+++ b/apis/cloudwatch/src/main/java/org/jclouds/cloudwatch/features/MetricApi.java
@@ -16,23 +16,44 @@
  */
 package org.jclouds.cloudwatch.features;
 
+import javax.inject.Named;
+import javax.ws.rs.FormParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+
+import org.jclouds.Fallbacks.EmptyIterableWithMarkerOnNotFoundOr404;
+import org.jclouds.Fallbacks.EmptyPagedIterableOnNotFoundOr404;
+import org.jclouds.aws.filters.FormSigner;
+import org.jclouds.cloudwatch.binders.GetMetricStatisticsBinder;
+import org.jclouds.cloudwatch.binders.MetricDataBinder;
 import org.jclouds.cloudwatch.domain.GetMetricStatistics;
 import org.jclouds.cloudwatch.domain.GetMetricStatisticsResponse;
 import org.jclouds.cloudwatch.domain.Metric;
 import org.jclouds.cloudwatch.domain.MetricDatum;
+import org.jclouds.cloudwatch.functions.MetricsToPagedIterable;
 import org.jclouds.cloudwatch.options.GetMetricStatisticsOptions;
 import org.jclouds.cloudwatch.options.ListMetricsOptions;
+import org.jclouds.cloudwatch.xml.GetMetricStatisticsResponseHandlerV2;
+import org.jclouds.cloudwatch.xml.ListMetricsResponseHandler;
 import org.jclouds.collect.IterableWithMarker;
 import org.jclouds.collect.PagedIterable;
+import org.jclouds.rest.annotations.BinderParam;
+import org.jclouds.rest.annotations.Fallback;
+import org.jclouds.rest.annotations.FormParams;
+import org.jclouds.rest.annotations.RequestFilters;
+import org.jclouds.rest.annotations.Transform;
+import org.jclouds.rest.annotations.VirtualHost;
+import org.jclouds.rest.annotations.XMLResponseParser;
 
 /**
  * Provides access to Amazon CloudWatch via the Query API
  * <p/>
  * 
- * @see MetricAsyncApi
  * @see <a href="http://docs.amazonwebservices.com/AmazonCloudWatch/latest/APIReference" />
  * @author Jeremy Whitlock
  */
+@RequestFilters(FormSigner.class)
+@VirtualHost
 public interface MetricApi {
 
    /**
@@ -50,8 +71,21 @@ public interface MetricApi {
     * 
     * @return the response object
     */
+   @Named("ListMetrics")
+   @POST
+   @Path("/")
+   @XMLResponseParser(ListMetricsResponseHandler.class)
+   @FormParams(keys = "Action", values = "ListMetrics")
+   @Fallback(EmptyIterableWithMarkerOnNotFoundOr404.class)
    IterableWithMarker<Metric> list(ListMetricsOptions options);
 
+   @Named("ListMetrics")
+   @POST
+   @Path("/")
+   @XMLResponseParser(ListMetricsResponseHandler.class)
+   @Transform(MetricsToPagedIterable.class)
+   @FormParams(keys = "Action", values = "ListMetrics")
+   @Fallback(EmptyPagedIterableOnNotFoundOr404.class)
    PagedIterable<Metric> list();
 
    /**
@@ -62,9 +96,22 @@ public interface MetricApi {
     * 
     * @return the response object
     */
-   GetMetricStatisticsResponse getMetricStatistics(GetMetricStatistics statistics, GetMetricStatisticsOptions options);
+   @Named("GetMetricStatistics")
+   @POST
+   @Path("/")
+   @XMLResponseParser(GetMetricStatisticsResponseHandlerV2.class)
+   @FormParams(keys = "Action", values = "GetMetricStatistics")
+   GetMetricStatisticsResponse getMetricStatistics(
+            @BinderParam(GetMetricStatisticsBinder.class) GetMetricStatistics statistics,
+            GetMetricStatisticsOptions options);
 
-   GetMetricStatisticsResponse getMetricStatistics(GetMetricStatistics statistics);
+   @Named("GetMetricStatistics")
+   @POST
+   @Path("/")
+   @XMLResponseParser(GetMetricStatisticsResponseHandlerV2.class)
+   @FormParams(keys = "Action", values = "GetMetricStatistics")
+   GetMetricStatisticsResponse getMetricStatistics(
+            @BinderParam(GetMetricStatisticsBinder.class) GetMetricStatistics statistics);
 
    /**
     * Publishes metric data points to Amazon CloudWatch.
@@ -72,6 +119,11 @@ public interface MetricApi {
     * @param metrics the metrics to publish
     * @param namespace the namespace to publish the metrics to
     */
-   void putMetricsInNamespace(Iterable<MetricDatum> metrics, String namespace);
+   @Named("PutMetricData")
+   @POST
+   @Path("/")
+   @FormParams(keys = "Action", values = "PutMetricData")
+   void putMetricsInNamespace(@BinderParam(MetricDataBinder.class) Iterable<MetricDatum> metrics,
+                                        @FormParam("Namespace") String namespace);
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/91d6736c/apis/cloudwatch/src/main/java/org/jclouds/cloudwatch/features/MetricAsyncApi.java
----------------------------------------------------------------------
diff --git a/apis/cloudwatch/src/main/java/org/jclouds/cloudwatch/features/MetricAsyncApi.java b/apis/cloudwatch/src/main/java/org/jclouds/cloudwatch/features/MetricAsyncApi.java
deleted file mode 100644
index 7a760ed..0000000
--- a/apis/cloudwatch/src/main/java/org/jclouds/cloudwatch/features/MetricAsyncApi.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.cloudwatch.features;
-
-import javax.inject.Named;
-import javax.ws.rs.FormParam;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-
-import org.jclouds.Fallbacks.EmptyIterableWithMarkerOnNotFoundOr404;
-import org.jclouds.Fallbacks.EmptyPagedIterableOnNotFoundOr404;
-import org.jclouds.aws.filters.FormSigner;
-import org.jclouds.cloudwatch.binders.GetMetricStatisticsBinder;
-import org.jclouds.cloudwatch.binders.MetricDataBinder;
-import org.jclouds.cloudwatch.domain.GetMetricStatistics;
-import org.jclouds.cloudwatch.domain.GetMetricStatisticsResponse;
-import org.jclouds.cloudwatch.domain.Metric;
-import org.jclouds.cloudwatch.domain.MetricDatum;
-import org.jclouds.cloudwatch.functions.MetricsToPagedIterable;
-import org.jclouds.cloudwatch.options.GetMetricStatisticsOptions;
-import org.jclouds.cloudwatch.options.ListMetricsOptions;
-import org.jclouds.cloudwatch.xml.GetMetricStatisticsResponseHandlerV2;
-import org.jclouds.cloudwatch.xml.ListMetricsResponseHandler;
-import org.jclouds.collect.IterableWithMarker;
-import org.jclouds.collect.PagedIterable;
-import org.jclouds.rest.annotations.BinderParam;
-import org.jclouds.rest.annotations.Fallback;
-import org.jclouds.rest.annotations.FormParams;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.Transform;
-import org.jclouds.rest.annotations.VirtualHost;
-import org.jclouds.rest.annotations.XMLResponseParser;
-
-import com.google.common.util.concurrent.ListenableFuture;
-
-/**
- * Provides access to Amazon CloudWatch via the Query API
- * <p/>
- * 
- * @see <a href="http://docs.amazonwebservices.com/AmazonCloudWatch/latest/APIReference" />
- * @author Jeremy Whitlock
- */
-@RequestFilters(FormSigner.class)
-@VirtualHost
-public interface MetricAsyncApi {
-
-   /**
-    * @see MetricApi#list()
-    */
-   @Named("ListMetrics")
-   @POST
-   @Path("/")
-   @XMLResponseParser(ListMetricsResponseHandler.class)
-   @Transform(MetricsToPagedIterable.class)
-   @FormParams(keys = "Action", values = "ListMetrics")
-   @Fallback(EmptyPagedIterableOnNotFoundOr404.class)
-   ListenableFuture<? extends PagedIterable<Metric>> list();
-
-   /**
-    * @see MetricApi#list(ListMetricsOptions)
-    */
-   @Named("ListMetrics")
-   @POST
-   @Path("/")
-   @XMLResponseParser(ListMetricsResponseHandler.class)
-   @FormParams(keys = "Action", values = "ListMetrics")
-   @Fallback(EmptyIterableWithMarkerOnNotFoundOr404.class)
-   ListenableFuture<? extends IterableWithMarker<Metric>> list(ListMetricsOptions options);
-
-   /**
-    * @see MetricApi#getMetricStatistics(GetMetricStatistics)
-    */
-   @Named("GetMetricStatistics")
-   @POST
-   @Path("/")
-   @XMLResponseParser(GetMetricStatisticsResponseHandlerV2.class)
-   @FormParams(keys = "Action", values = "GetMetricStatistics")
-   ListenableFuture<? extends GetMetricStatisticsResponse> getMetricStatistics(
-            @BinderParam(GetMetricStatisticsBinder.class) GetMetricStatistics statistics);
-
-   /**
-    * @see MetricApi#getMetricStatistics(GetMetricStatistics, GetMetricStatisticsOptions)
-    */
-   @Named("GetMetricStatistics")
-   @POST
-   @Path("/")
-   @XMLResponseParser(GetMetricStatisticsResponseHandlerV2.class)
-   @FormParams(keys = "Action", values = "GetMetricStatistics")
-   ListenableFuture<? extends GetMetricStatisticsResponse> getMetricStatistics(
-            @BinderParam(GetMetricStatisticsBinder.class) GetMetricStatistics statistics,
-            GetMetricStatisticsOptions options);
-
-   /**
-    * @see MetricApi#putMetricsInNamespace(Iterable, String)
-    */
-   @Named("PutMetricData")
-   @POST
-   @Path("/")
-   @FormParams(keys = "Action", values = "PutMetricData")
-   ListenableFuture<Void> putMetricsInNamespace(@BinderParam(MetricDataBinder.class) Iterable<MetricDatum> metrics,
-                                        @FormParam("Namespace") String namespace);
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/91d6736c/apis/cloudwatch/src/test/java/org/jclouds/cloudwatch/CloudWatchApiMetadataTest.java
----------------------------------------------------------------------
diff --git a/apis/cloudwatch/src/test/java/org/jclouds/cloudwatch/CloudWatchApiMetadataTest.java b/apis/cloudwatch/src/test/java/org/jclouds/cloudwatch/CloudWatchApiMetadataTest.java
index 7bfe24f..831110b 100644
--- a/apis/cloudwatch/src/test/java/org/jclouds/cloudwatch/CloudWatchApiMetadataTest.java
+++ b/apis/cloudwatch/src/test/java/org/jclouds/cloudwatch/CloudWatchApiMetadataTest.java
@@ -17,7 +17,7 @@
 package org.jclouds.cloudwatch;
 
 import org.jclouds.View;
-import org.jclouds.rest.internal.BaseRestApiMetadataTest;
+import org.jclouds.rest.internal.BaseHttpApiMetadataTest;
 import org.testng.annotations.Test;
 
 import com.google.common.collect.ImmutableSet;
@@ -28,7 +28,7 @@ import com.google.common.reflect.TypeToken;
  * @author Adrian Cole
  */
 @Test(groups = "unit", testName = "CloudWatchApiMetadataTest")
-public class CloudWatchApiMetadataTest extends BaseRestApiMetadataTest {
+public class CloudWatchApiMetadataTest extends BaseHttpApiMetadataTest {
 
    // no monitoring abstraction, yet
    public CloudWatchApiMetadataTest() {

http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/91d6736c/apis/cloudwatch/src/test/java/org/jclouds/cloudwatch/internal/BaseCloudWatchExpectTest.java
----------------------------------------------------------------------
diff --git a/apis/cloudwatch/src/test/java/org/jclouds/cloudwatch/internal/BaseCloudWatchExpectTest.java b/apis/cloudwatch/src/test/java/org/jclouds/cloudwatch/internal/BaseCloudWatchExpectTest.java
index a852d46..2c4e7e7 100644
--- a/apis/cloudwatch/src/test/java/org/jclouds/cloudwatch/internal/BaseCloudWatchExpectTest.java
+++ b/apis/cloudwatch/src/test/java/org/jclouds/cloudwatch/internal/BaseCloudWatchExpectTest.java
@@ -22,11 +22,11 @@ import java.net.URI;
 import java.util.Map;
 
 import org.jclouds.aws.domain.Region;
-import org.jclouds.cloudwatch.config.CloudWatchRestClientModule;
+import org.jclouds.cloudwatch.config.CloudWatchHttpApiModule;
 import org.jclouds.date.DateService;
 import org.jclouds.location.config.LocationModule;
 import org.jclouds.location.suppliers.RegionIdToURISupplier;
-import org.jclouds.rest.ConfiguresRestClient;
+import org.jclouds.rest.ConfiguresHttpApi;
 import org.jclouds.rest.internal.BaseRestApiExpectTest;
 import org.jclouds.util.Suppliers2;
 
@@ -44,8 +44,8 @@ public class BaseCloudWatchExpectTest<T> extends BaseRestApiExpectTest<T> {
       provider = "cloudwatch";
    }
    
-   @ConfiguresRestClient
-   private static final class TestMonitoringRestClientModule extends CloudWatchRestClientModule {
+   @ConfiguresHttpApi
+   private static final class TestMonitoringHttpApiModule extends CloudWatchHttpApiModule {
 
       @Override
       protected void installLocations() {
@@ -71,6 +71,6 @@ public class BaseCloudWatchExpectTest<T> extends BaseRestApiExpectTest<T> {
 
    @Override
    protected Module createModule() {
-      return new TestMonitoringRestClientModule();
+      return new TestMonitoringHttpApiModule();
    }
 }