You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jclouds.apache.org by an...@apache.org on 2014/10/07 00:31:10 UTC
[33/52] [abbrv] git commit: JCLOUDS-40 Replaced incorrect use of
@ConfiguresRestClient and deleted old rest client modules.
JCLOUDS-40 Replaced incorrect use of @ConfiguresRestClient and deleted old rest client modules.
Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/1b2cee07
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/1b2cee07
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/1b2cee07
Branch: refs/heads/use-agentproxy-008
Commit: 1b2cee070041acd8069e0d19b7ede4a8cedd335b
Parents: d190040
Author: Adrian Cole <ad...@gmail.com>
Authored: Sun Oct 5 14:47:33 2014 -0700
Committer: Adrian Cole <ad...@gmail.com>
Committed: Sun Oct 5 16:21:16 2014 -0700
----------------------------------------------------------------------
.../config/ElasticStackHttpApiModule.java | 4 +-
.../nova/v2_0/config/NovaHttpApiModule.java | 4 +-
.../jclouds/aws/config/AWSRestClientModule.java | 93 --------------------
.../aws/config/FormSigningRestClientModule.java | 64 --------------
.../WithZonesFormSigningRestClientModule.java | 45 ----------
.../glesys/config/GleSYSHttpApiModule.java | 4 +-
.../gogrid/config/GoGridHttpApiModule.java | 4 +-
.../gogrid/features/BaseGoGridApiTest.java | 4 +-
.../features/BaseGoGridHttpApiExpectTest.java | 4 +-
9 files changed, 12 insertions(+), 214 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jclouds/blob/1b2cee07/apis/elasticstack/src/main/java/org/jclouds/elasticstack/config/ElasticStackHttpApiModule.java
----------------------------------------------------------------------
diff --git a/apis/elasticstack/src/main/java/org/jclouds/elasticstack/config/ElasticStackHttpApiModule.java b/apis/elasticstack/src/main/java/org/jclouds/elasticstack/config/ElasticStackHttpApiModule.java
index 71e68a6..86395cb 100644
--- a/apis/elasticstack/src/main/java/org/jclouds/elasticstack/config/ElasticStackHttpApiModule.java
+++ b/apis/elasticstack/src/main/java/org/jclouds/elasticstack/config/ElasticStackHttpApiModule.java
@@ -40,7 +40,7 @@ import org.jclouds.http.HttpErrorHandler;
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.rest.ConfiguresHttpApi;
import org.jclouds.rest.config.HttpApiModule;
import com.google.common.base.Function;
@@ -49,7 +49,7 @@ import com.google.inject.TypeLiteral;
/**
* Configures the elasticstack connection.
*/
-@ConfiguresRestClient
+@ConfiguresHttpApi
public class ElasticStackHttpApiModule extends HttpApiModule<ElasticStackApi> {
@Override
http://git-wip-us.apache.org/repos/asf/jclouds/blob/1b2cee07/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/config/NovaHttpApiModule.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/config/NovaHttpApiModule.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/config/NovaHttpApiModule.java
index f2a410f..1c5cc46 100644
--- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/config/NovaHttpApiModule.java
+++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/config/NovaHttpApiModule.java
@@ -32,7 +32,7 @@ import org.jclouds.openstack.nova.v2_0.extensions.ExtensionNamespaces;
import org.jclouds.openstack.nova.v2_0.handlers.NovaErrorHandler;
import org.jclouds.openstack.v2_0.domain.Extension;
import org.jclouds.openstack.v2_0.functions.PresentWhenExtensionAnnotationNamespaceEqualsAnyNamespaceInExtensionsSet;
-import org.jclouds.rest.ConfiguresRestClient;
+import org.jclouds.rest.ConfiguresHttpApi;
import org.jclouds.rest.config.HttpApiModule;
import org.jclouds.rest.functions.ImplicitOptionalConverter;
@@ -47,7 +47,7 @@ import com.google.inject.Provides;
* Configures the Nova connection.
*
*/
-@ConfiguresRestClient
+@ConfiguresHttpApi
public class NovaHttpApiModule extends HttpApiModule<NovaApi> {
public NovaHttpApiModule() {
http://git-wip-us.apache.org/repos/asf/jclouds/blob/1b2cee07/apis/sts/src/main/java/org/jclouds/aws/config/AWSRestClientModule.java
----------------------------------------------------------------------
diff --git a/apis/sts/src/main/java/org/jclouds/aws/config/AWSRestClientModule.java b/apis/sts/src/main/java/org/jclouds/aws/config/AWSRestClientModule.java
deleted file mode 100644
index 0ef34bb..0000000
--- a/apis/sts/src/main/java/org/jclouds/aws/config/AWSRestClientModule.java
+++ /dev/null
@@ -1,93 +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.aws.config;
-
-
-import java.util.Map;
-import java.util.Set;
-
-import javax.inject.Singleton;
-
-import org.jclouds.aws.handlers.AWSClientErrorRetryHandler;
-import org.jclouds.aws.handlers.AWSServerErrorRetryHandler;
-import org.jclouds.aws.handlers.ParseAWSErrorFromXmlContent;
-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.rest.config.RestClientModule;
-
-import com.google.common.collect.ImmutableSet;
-import com.google.common.reflect.TypeToken;
-import com.google.inject.Provides;
-
-
-/**
- *
- *
- * @deprecated will be removed in jclouds 1.7; use {@link AWSHttpApiModule}
- */
-@Deprecated
-@ConfiguresRestClient
-public abstract class AWSRestClientModule<S, A> extends RestClientModule<S, A> {
-
- protected AWSRestClientModule(Map<Class<?>, Class<?>> delegates) {
- super(delegates);
- }
-
- protected AWSRestClientModule() {
- }
-
- protected AWSRestClientModule(TypeToken<S> syncClientType, TypeToken<A> asyncClientType) {
- super(syncClientType, asyncClientType);
- }
-
- protected AWSRestClientModule(TypeToken<S> syncClientType, TypeToken<A> asyncClientType,
- Map<Class<?>, Class<?>> sync2Async) {
- super(syncClientType, asyncClientType, sync2Async);
- }
-
- @Provides
- @ClientError
- @Singleton
- protected Set<String> provideRetryableCodes() {
- return ImmutableSet.of("RequestTimeout", "OperationAborted", "SignatureDoesNotMatch");
- }
-
- @Provides
- @ServerError
- @Singleton
- protected Set<String> provideRetryableServerCodes() {
- return ImmutableSet.of("RequestLimitExceeded");
- }
-
- @Override
- protected void bindErrorHandlers() {
- bind(HttpErrorHandler.class).annotatedWith(Redirection.class).to(ParseAWSErrorFromXmlContent.class);
- bind(HttpErrorHandler.class).annotatedWith(ClientError.class).to(ParseAWSErrorFromXmlContent.class);
- bind(HttpErrorHandler.class).annotatedWith(ServerError.class).to(ParseAWSErrorFromXmlContent.class);
- }
-
- @Override
- protected void bindRetryHandlers() {
- bind(HttpRetryHandler.class).annotatedWith(ClientError.class).to(AWSClientErrorRetryHandler.class);
- bind(HttpRetryHandler.class).annotatedWith(ServerError.class).to(AWSServerErrorRetryHandler.class);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/1b2cee07/apis/sts/src/main/java/org/jclouds/aws/config/FormSigningRestClientModule.java
----------------------------------------------------------------------
diff --git a/apis/sts/src/main/java/org/jclouds/aws/config/FormSigningRestClientModule.java b/apis/sts/src/main/java/org/jclouds/aws/config/FormSigningRestClientModule.java
deleted file mode 100644
index 6c18d52..0000000
--- a/apis/sts/src/main/java/org/jclouds/aws/config/FormSigningRestClientModule.java
+++ /dev/null
@@ -1,64 +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.aws.config;
-
-import java.util.Date;
-import java.util.Map;
-
-import javax.inject.Singleton;
-
-import org.jclouds.aws.filters.FormSigner;
-import org.jclouds.date.DateService;
-import org.jclouds.date.TimeStamp;
-import org.jclouds.rest.ConfiguresRestClient;
-import org.jclouds.rest.RequestSigner;
-
-import com.google.common.reflect.TypeToken;
-import com.google.inject.Provides;
-
-@ConfiguresRestClient
-public abstract class FormSigningRestClientModule<S, A> extends AWSRestClientModule<S, A> {
-
- protected FormSigningRestClientModule(Map<Class<?>, Class<?>> delegates) {
- super(delegates);
- }
-
- protected FormSigningRestClientModule() {
- }
-
- protected FormSigningRestClientModule(TypeToken<S> syncClientType, TypeToken<A> asyncClientType) {
- super(syncClientType, asyncClientType);
- }
-
- protected FormSigningRestClientModule(TypeToken<S> syncClientType, TypeToken<A> asyncClientType,
- Map<Class<?>, Class<?>> sync2Async) {
- super(syncClientType, asyncClientType, sync2Async);
- }
-
- @Provides
- @TimeStamp
- protected String provideTimeStamp(DateService dateService) {
- return dateService.iso8601DateFormat(new Date(System.currentTimeMillis()));
- }
-
- @Provides
- @Singleton
- RequestSigner provideRequestSigner(FormSigner in) {
- return in;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/1b2cee07/apis/sts/src/main/java/org/jclouds/aws/config/WithZonesFormSigningRestClientModule.java
----------------------------------------------------------------------
diff --git a/apis/sts/src/main/java/org/jclouds/aws/config/WithZonesFormSigningRestClientModule.java b/apis/sts/src/main/java/org/jclouds/aws/config/WithZonesFormSigningRestClientModule.java
deleted file mode 100644
index 5306d58..0000000
--- a/apis/sts/src/main/java/org/jclouds/aws/config/WithZonesFormSigningRestClientModule.java
+++ /dev/null
@@ -1,45 +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.aws.config;
-
-
-import java.util.Map;
-
-import org.jclouds.rest.ConfiguresRestClient;
-
-import com.google.common.reflect.TypeToken;
-
-
-@ConfiguresRestClient
-public abstract class WithZonesFormSigningRestClientModule<S, A> extends FormSigningRestClientModule<S, A> {
- protected WithZonesFormSigningRestClientModule(Map<Class<?>, Class<?>> delegates) {
- super(delegates);
- }
-
- protected WithZonesFormSigningRestClientModule() {
- }
-
- protected WithZonesFormSigningRestClientModule(TypeToken<S> syncClientType, TypeToken<A> asyncClientType) {
- super(syncClientType, asyncClientType);
- }
-
- protected WithZonesFormSigningRestClientModule(TypeToken<S> syncClientType, TypeToken<A> asyncClientType,
- Map<Class<?>, Class<?>> sync2Async) {
- super(syncClientType, asyncClientType, sync2Async);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/1b2cee07/providers/glesys/src/main/java/org/jclouds/glesys/config/GleSYSHttpApiModule.java
----------------------------------------------------------------------
diff --git a/providers/glesys/src/main/java/org/jclouds/glesys/config/GleSYSHttpApiModule.java b/providers/glesys/src/main/java/org/jclouds/glesys/config/GleSYSHttpApiModule.java
index d8d7302..b1ac5be 100644
--- a/providers/glesys/src/main/java/org/jclouds/glesys/config/GleSYSHttpApiModule.java
+++ b/providers/glesys/src/main/java/org/jclouds/glesys/config/GleSYSHttpApiModule.java
@@ -26,7 +26,7 @@ import org.jclouds.http.annotation.ServerError;
import org.jclouds.http.handlers.BackoffLimitedRetryHandler;
import org.jclouds.location.suppliers.ImplicitLocationSupplier;
import org.jclouds.location.suppliers.implicit.OnlyLocationOrFirstZone;
-import org.jclouds.rest.ConfiguresRestClient;
+import org.jclouds.rest.ConfiguresHttpApi;
import org.jclouds.rest.config.HttpApiModule;
import com.google.inject.Scopes;
@@ -34,7 +34,7 @@ import com.google.inject.Scopes;
/**
* Configures the GleSYS connection.
*/
-@ConfiguresRestClient
+@ConfiguresHttpApi
public class GleSYSHttpApiModule extends HttpApiModule<GleSYSApi> {
@Override
http://git-wip-us.apache.org/repos/asf/jclouds/blob/1b2cee07/providers/gogrid/src/main/java/org/jclouds/gogrid/config/GoGridHttpApiModule.java
----------------------------------------------------------------------
diff --git a/providers/gogrid/src/main/java/org/jclouds/gogrid/config/GoGridHttpApiModule.java b/providers/gogrid/src/main/java/org/jclouds/gogrid/config/GoGridHttpApiModule.java
index a41de28..3a691b4 100644
--- a/providers/gogrid/src/main/java/org/jclouds/gogrid/config/GoGridHttpApiModule.java
+++ b/providers/gogrid/src/main/java/org/jclouds/gogrid/config/GoGridHttpApiModule.java
@@ -31,7 +31,7 @@ import org.jclouds.http.annotation.ClientError;
import org.jclouds.http.annotation.Redirection;
import org.jclouds.http.annotation.ServerError;
import org.jclouds.location.suppliers.ImplicitLocationSupplier;
-import org.jclouds.rest.ConfiguresRestClient;
+import org.jclouds.rest.ConfiguresHttpApi;
import org.jclouds.rest.config.HttpApiModule;
import com.google.common.base.Supplier;
@@ -42,7 +42,7 @@ import com.google.inject.Scopes;
/**
* Configures the GoGrid connection.
*/
-@ConfiguresRestClient
+@ConfiguresHttpApi
public class GoGridHttpApiModule extends HttpApiModule<GoGridApi> {
@Provides
http://git-wip-us.apache.org/repos/asf/jclouds/blob/1b2cee07/providers/gogrid/src/test/java/org/jclouds/gogrid/features/BaseGoGridApiTest.java
----------------------------------------------------------------------
diff --git a/providers/gogrid/src/test/java/org/jclouds/gogrid/features/BaseGoGridApiTest.java b/providers/gogrid/src/test/java/org/jclouds/gogrid/features/BaseGoGridApiTest.java
index b65ae53..4a90875 100644
--- a/providers/gogrid/src/test/java/org/jclouds/gogrid/features/BaseGoGridApiTest.java
+++ b/providers/gogrid/src/test/java/org/jclouds/gogrid/features/BaseGoGridApiTest.java
@@ -24,7 +24,7 @@ import org.jclouds.gogrid.config.GoGridHttpApiModule;
import org.jclouds.gogrid.filters.SharedKeyLiteAuthentication;
import org.jclouds.http.HttpRequest;
import org.jclouds.providers.ProviderMetadata;
-import org.jclouds.rest.ConfiguresRestClient;
+import org.jclouds.rest.ConfiguresHttpApi;
import org.jclouds.rest.internal.BaseAsyncClientTest;
import org.testng.annotations.Test;
@@ -39,7 +39,7 @@ public abstract class BaseGoGridApiTest<T> extends BaseAsyncClientTest<T> {
assertEquals(request.getFilters().get(0).getClass(), SharedKeyLiteAuthentication.class);
}
- @ConfiguresRestClient
+ @ConfiguresHttpApi
protected static final class TestGoGridHttpApiModule extends GoGridHttpApiModule {
@Override
protected void configure() {
http://git-wip-us.apache.org/repos/asf/jclouds/blob/1b2cee07/providers/gogrid/src/test/java/org/jclouds/gogrid/features/BaseGoGridHttpApiExpectTest.java
----------------------------------------------------------------------
diff --git a/providers/gogrid/src/test/java/org/jclouds/gogrid/features/BaseGoGridHttpApiExpectTest.java b/providers/gogrid/src/test/java/org/jclouds/gogrid/features/BaseGoGridHttpApiExpectTest.java
index e4a0cb1..4b6fd2d 100644
--- a/providers/gogrid/src/test/java/org/jclouds/gogrid/features/BaseGoGridHttpApiExpectTest.java
+++ b/providers/gogrid/src/test/java/org/jclouds/gogrid/features/BaseGoGridHttpApiExpectTest.java
@@ -19,7 +19,7 @@ package org.jclouds.gogrid.features;
import org.jclouds.date.TimeStamp;
import org.jclouds.gogrid.GoGridApi;
import org.jclouds.gogrid.config.GoGridHttpApiModule;
-import org.jclouds.rest.ConfiguresRestClient;
+import org.jclouds.rest.ConfiguresHttpApi;
import org.jclouds.rest.internal.BaseRestClientExpectTest;
import com.google.common.base.Supplier;
@@ -31,7 +31,7 @@ public class BaseGoGridHttpApiExpectTest extends BaseRestClientExpectTest<GoGrid
provider = "gogrid";
}
- @ConfiguresRestClient
+ @ConfiguresHttpApi
protected static final class TestGoGridHttpApiModule extends GoGridHttpApiModule {
@Override