From 47c215c63ca098d43b95365737911eeb206118c9 Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Tue, 8 Jan 2013 22:24:07 -0800 Subject: [PATCH] removed custom guava code for scoped binding and type params --- .../blobstore/AtmosBlobRequestSigner.java | 18 +++++------ .../jclouds/atmos/AtmosAsyncClientTest.java | 2 +- .../CloudServersAsyncClientTest.java | 2 +- .../cloudsigma/CloudSigmaAsyncClientTest.java | 2 +- ...loneDriveOptionsToPlainTextStringTest.java | 4 +-- .../config/CloudStackRestClientModule.java | 8 ++--- .../features/AccountAsyncClientTest.java | 2 +- .../features/AddressAsyncClientTest.java | 2 +- .../features/AsyncJobAsyncClientTest.java | 2 +- .../ConfigurationAsyncClientTest.java | 2 +- .../DomainAccountAsyncClientTest.java | 2 +- .../features/DomainLimitAsyncClientTest.java | 2 +- .../features/EventAsyncClientTest.java | 2 +- .../features/FirewallAsyncClientTest.java | 2 +- .../GlobalAccountAsyncClientTest.java | 2 +- .../features/GlobalAlertAsyncClientTest.java | 2 +- .../GlobalCapacityAsyncClientTest.java | 2 +- .../features/GlobalHostAsyncClientTest.java | 2 +- .../GlobalOfferingAsyncClientTest.java | 2 +- .../GlobalStoragePoolAsyncClientTest.java | 2 +- .../features/GlobalUsageAsyncClientTest.java | 2 +- .../features/GlobalUserAsyncClientTest.java | 2 +- .../features/GuestOSAsyncClientTest.java | 2 +- .../features/HypervisorAsyncClientTest.java | 2 +- .../features/ISOAsyncClientTest.java | 2 +- .../features/LimitAsyncClientTest.java | 2 +- .../features/LoadBalancerAsyncClientTest.java | 2 +- .../features/NATAsyncClientTest.java | 2 +- .../features/NetworkAsyncClientTest.java | 2 +- .../features/OfferingAsyncClientTest.java | 2 +- .../features/SSHKeyPairAsyncClientTest.java | 2 +- .../SecurityGroupAsyncClientTest.java | 2 +- .../features/SnapshotAsyncClientTest.java | 2 +- .../features/TemplateAsyncClientTest.java | 2 +- .../features/VMGroupAsyncClientTest.java | 2 +- .../VirtualMachineAsyncClientTest.java | 2 +- .../features/VolumeAsyncClientTest.java | 2 +- .../features/ZoneAsyncClientTest.java | 2 +- .../ec2/services/AMIAsyncClientTest.java | 2 +- ...ilabilityZoneAndRegionAsyncClientTest.java | 2 +- .../ElasticBlockStoreAsyncClientTest.java | 2 +- .../ElasticIPAddressAsyncClientTest.java | 2 +- .../ec2/services/InstanceAsyncClientTest.java | 2 +- .../ec2/services/KeyPairAsyncClientTest.java | 2 +- .../SecurityGroupAsyncClientTest.java | 2 +- .../ec2/services/WindowsAsyncClientTest.java | 2 +- .../ElasticStackAsyncClientTest.java | 2 +- .../FilesystemBlobStoreContextModule.java | 4 +-- .../config/KeystoneAuthenticationModule.java | 4 +-- ...EqualsAnyNamespaceInExtensionsSetTest.java | 2 +- .../CloudIdentityAuthenticationModule.java | 4 +-- .../s3/blobstore/S3BlobRequestSigner.java | 28 ++++++++--------- .../org/jclouds/s3/S3AsyncClientTest.java | 4 +-- ...indAsHostPrefixIfConfiguredNoPathTest.java | 2 +- .../BindAsHostPrefixIfConfiguredTest.java | 2 +- ...rOperationAbortedWhenBucketExistsTest.java | 6 ++-- .../RequestAuthorizeSignatureTest.java | 2 +- .../swift/blobstore/SwiftBlobSigner.java | 27 +++++++---------- .../config/TemporaryUrlExtensionModule.java | 6 ++-- .../swift/internal/BasePayloadTest.java | 6 ++-- .../vcloud/config/VCloudRestClientModule.java | 6 ++-- .../vcloud/VCloudVersionsAsyncClientTest.java | 2 +- .../features/CatalogAsyncClientTest.java | 2 +- .../features/NetworkAsyncClientTest.java | 2 +- .../vcloud/features/OrgAsyncClientTest.java | 2 +- .../vcloud/features/TaskAsyncClientTest.java | 2 +- .../vcloud/features/VAppAsyncClientTest.java | 2 +- .../features/VAppTemplateAsyncClientTest.java | 2 +- .../vcloud/features/VDCAsyncClientTest.java | 2 +- .../vcloud/features/VmAsyncClientTest.java | 2 +- .../vcloud/internal/BasePayloadTest.java | 6 ++-- .../internal/VCloudLoginAsyncClientTest.java | 2 +- .../TransientBlobStoreContextModule.java | 4 +-- .../blobstore/util/BlobStoreUtilsTest.java | 10 +++---- .../config/OpenStackAuthenticationModule.java | 4 +-- .../config/AuthenticationServiceModule.java | 4 +-- .../OpenStackAuthAsyncClientTest.java | 2 +- .../TerremarkVCloudRestClientModule.java | 6 ++-- .../vcloud_0_8/internal/BasePayloadTest.java | 6 ++-- .../TerremarkVCloudLoginAsyncClientTest.java | 2 +- ...erremarkVCloudVersionsAsyncClientTest.java | 2 +- .../abiquo/config/AbiquoRestClientModule.java | 4 +-- .../abiquo/binders/BindToPathTest.java | 14 ++++----- .../cloud/BindMoveVolumeToPathTest.java | 4 +-- ...dNetworkConfigurationRefToPayloadTest.java | 10 +++---- .../BindSupportedDevicesLinkToPathTest.java | 6 ++-- .../abiquo/features/AdminAsyncApiTest.java | 2 +- .../abiquo/features/CloudAsyncApiTest.java | 2 +- .../abiquo/features/ConfigAsyncApiTest.java | 2 +- .../features/EnterpriseAsyncApiTest.java | 2 +- .../abiquo/features/EventAsyncApiTest.java | 2 +- .../features/InfrastructureAsyncApiTest.java | 2 +- .../abiquo/features/PricingAsyncApiTest.java | 2 +- .../abiquo/features/TaskAsyncApiTest.java | 2 +- .../VirtualMachineTemplateAsyncApiTest.java | 2 +- .../internal/AbiquoHttpAsyncClientTest.java | 2 +- .../OAuthModuleWithoutTypeAdapters.java | 2 +- .../internal/BaseToPagedIterable.java | 2 +- .../config/DatacentersAreZonesModule.java | 4 +-- .../v2/config/OAuthAuthenticationModule.java | 4 +-- .../jclouds/oauth/v2/config/OAuthModule.java | 2 +- .../oauth/v2/filters/OAuthAuthenticator.java | 6 ++-- .../oauth/v2/functions/BuildTokenRequest.java | 13 ++++---- .../java/org/jclouds/savvis/vpdc/VPDCApi.java | 7 +++++ .../vpdc/config/VPDCRestClientModule.java | 4 +-- .../vpdc/features/BrowsingAsyncApiTest.java | 2 +- .../vpdc/features/FirewallAsyncApiTest.java | 2 +- .../ServiceManagementAsyncApiTest.java | 2 +- .../savvis/vpdc/features/VMAsyncApiTest.java | 2 +- .../VCloudDirectorRestClientModule.java | 14 ++++----- .../DescribeSecurityGroupsResponseTest.java | 2 +- .../ec2/services/AWSAMIAsyncClientTest.java | 2 +- .../services/AWSInstanceAsyncClientTest.java | 2 +- .../services/AWSKeyPairAsyncClientTest.java | 2 +- .../AWSSecurityGroupAsyncClientTest.java | 2 +- .../services/MonitoringAsyncClientTest.java | 2 +- .../PlacementGroupAsyncClientTest.java | 2 +- .../services/SpotInstanceAsyncClientTest.java | 2 +- .../jclouds/aws/s3/AWSS3AsyncClientTest.java | 2 +- .../blobstore/AzureBlobRequestSigner.java | 19 ++++++------ .../azureblob/AzureBlobAsyncClientTest.java | 2 +- .../services/GridImageAsyncClientTest.java | 2 +- .../services/GridIpAsyncClientTest.java | 2 +- .../services/GridJobAsyncClientTest.java | 2 +- .../GridLoadBalancerAsyncClientTest.java | 2 +- .../services/GridServerAsyncClientTest.java | 2 +- .../HPCloudObjectStorageApiMetadata.java | 4 +-- ...HPCloudObjectStorageBlobRequestSigner.java | 30 +++++++++---------- .../features/AccountAsyncClientTest.java | 2 +- .../features/DatacenterAsyncClientTest.java | 2 +- .../ProductPackageAsyncClientTest.java | 2 +- .../features/VirtualGuestAsyncClientTest.java | 2 +- .../TerremarkECloudAsyncClientTest.java | 2 +- .../DataCenterOperationsAsyncClientTest.java | 2 +- .../TagOperationsAsyncClientTest.java | 2 +- ...TerremarkVCloudExpressAsyncClientTest.java | 2 +- 136 files changed, 251 insertions(+), 259 deletions(-) diff --git a/apis/atmos/src/main/java/org/jclouds/atmos/blobstore/AtmosBlobRequestSigner.java b/apis/atmos/src/main/java/org/jclouds/atmos/blobstore/AtmosBlobRequestSigner.java index 79e56fe38c..829e2ad488 100644 --- a/apis/atmos/src/main/java/org/jclouds/atmos/blobstore/AtmosBlobRequestSigner.java +++ b/apis/atmos/src/main/java/org/jclouds/atmos/blobstore/AtmosBlobRequestSigner.java @@ -37,9 +37,7 @@ import org.jclouds.reflect.Invocation; import org.jclouds.rest.internal.RestAnnotationProcessor; import com.google.common.collect.ImmutableList; -import com.google.common.reflect.TypeToken; - -import org.jclouds.reflect.Invokable; +import com.google.common.reflect.Invokable; /** * @@ -47,7 +45,7 @@ import org.jclouds.reflect.Invokable; */ @Singleton public class AtmosBlobRequestSigner implements BlobRequestSigner { - private final RestAnnotationProcessor processor; + private final RestAnnotationProcessor processor; private final BlobToObject blobToObject; private final BlobToHttpGetOptions blob2ObjectGetOptions; @@ -56,17 +54,15 @@ public class AtmosBlobRequestSigner implements BlobRequestSigner { private final Invokable createMethod; @Inject - public AtmosBlobRequestSigner(RestAnnotationProcessor processor, BlobToObject blobToObject, + public AtmosBlobRequestSigner(RestAnnotationProcessor processor, BlobToObject blobToObject, BlobToHttpGetOptions blob2ObjectGetOptions) throws SecurityException, NoSuchMethodException { this.processor = checkNotNull(processor, "processor"); this.blobToObject = checkNotNull(blobToObject, "blobToObject"); this.blob2ObjectGetOptions = checkNotNull(blob2ObjectGetOptions, "blob2ObjectGetOptions"); - this.getMethod = Invokable.from(TypeToken.of(AtmosAsyncClient.class), - AtmosAsyncClient.class.getMethod("readFile", String.class, GetOptions[].class)); - this.deleteMethod = Invokable.from(TypeToken.of(AtmosAsyncClient.class), - AtmosAsyncClient.class.getMethod("deletePath", String.class)); - this.createMethod = Invokable.from(TypeToken.of(AtmosAsyncClient.class), - AtmosAsyncClient.class.getMethod("createFile", String.class, AtmosObject.class, PutOptions[].class)); + this.getMethod = Invokable.from(AtmosAsyncClient.class.getMethod("readFile", String.class, GetOptions[].class)); + this.deleteMethod = Invokable.from(AtmosAsyncClient.class.getMethod("deletePath", String.class)); + this.createMethod = Invokable.from(AtmosAsyncClient.class.getMethod("createFile", String.class, + AtmosObject.class, PutOptions[].class)); } @Override diff --git a/apis/atmos/src/test/java/org/jclouds/atmos/AtmosAsyncClientTest.java b/apis/atmos/src/test/java/org/jclouds/atmos/AtmosAsyncClientTest.java index f84c79a8ce..3da991ce15 100644 --- a/apis/atmos/src/test/java/org/jclouds/atmos/AtmosAsyncClientTest.java +++ b/apis/atmos/src/test/java/org/jclouds/atmos/AtmosAsyncClientTest.java @@ -47,7 +47,7 @@ import org.jclouds.http.HttpRequest; import org.jclouds.http.functions.ParseURIFromListOrLocationHeaderIf20x; import org.jclouds.http.functions.ReleasePayloadAndReturn; import org.jclouds.http.options.GetOptions; -import org.jclouds.reflect.Invokable; +import com.google.common.reflect.Invokable; import org.jclouds.rest.ConfiguresRestClient; import org.jclouds.rest.internal.BaseAsyncClientTest; import org.jclouds.rest.internal.GeneratedHttpRequest; diff --git a/apis/cloudservers/src/test/java/org/jclouds/cloudservers/CloudServersAsyncClientTest.java b/apis/cloudservers/src/test/java/org/jclouds/cloudservers/CloudServersAsyncClientTest.java index 03356a36bc..427b49929a 100644 --- a/apis/cloudservers/src/test/java/org/jclouds/cloudservers/CloudServersAsyncClientTest.java +++ b/apis/cloudservers/src/test/java/org/jclouds/cloudservers/CloudServersAsyncClientTest.java @@ -62,7 +62,7 @@ import org.jclouds.openstack.filters.AuthenticateRequest; import org.jclouds.openstack.keystone.v1_1.config.AuthenticationServiceModule.GetAuth; import org.jclouds.openstack.keystone.v1_1.domain.Auth; import org.jclouds.openstack.keystone.v1_1.parse.ParseAuthTest; -import org.jclouds.reflect.Invokable; +import com.google.common.reflect.Invokable; import org.jclouds.rest.ConfiguresRestClient; import org.jclouds.rest.internal.BaseAsyncClientTest; import org.jclouds.rest.internal.GeneratedHttpRequest; diff --git a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/CloudSigmaAsyncClientTest.java b/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/CloudSigmaAsyncClientTest.java index b28ddb19e5..42b53c944e 100644 --- a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/CloudSigmaAsyncClientTest.java +++ b/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/CloudSigmaAsyncClientTest.java @@ -46,7 +46,7 @@ import org.jclouds.fallbacks.MapHttp4xxCodesToExceptions; import org.jclouds.http.HttpRequest; import org.jclouds.http.filters.BasicAuthentication; import org.jclouds.http.functions.ReleasePayloadAndReturn; -import org.jclouds.reflect.Invokable; +import com.google.common.reflect.Invokable; import org.jclouds.rest.internal.BaseAsyncClientTest; import org.jclouds.rest.internal.GeneratedHttpRequest; import org.testng.annotations.Test; diff --git a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/binders/BindCloneDriveOptionsToPlainTextStringTest.java b/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/binders/BindCloneDriveOptionsToPlainTextStringTest.java index 2cf9eec8d3..9ffb0f0556 100644 --- a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/binders/BindCloneDriveOptionsToPlainTextStringTest.java +++ b/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/binders/BindCloneDriveOptionsToPlainTextStringTest.java @@ -27,7 +27,7 @@ import java.util.Map; import org.jclouds.cloudsigma.options.CloneDriveOptions; import org.jclouds.reflect.Invocation; -import org.jclouds.reflect.Invokable; +import com.google.common.reflect.Invokable; import org.jclouds.rest.internal.GeneratedHttpRequest; import org.testng.annotations.Test; @@ -65,7 +65,7 @@ public class BindCloneDriveOptionsToPlainTextStringTest { protected GeneratedHttpRequest requestForArgs(List args) { try { Invocation invocation = Invocation.create(Invokable.from(String.class.getDeclaredMethod("toString")), args); - return GeneratedHttpRequest.builder().method("POST").endpoint(URI.create("http://localhost/key")) + return GeneratedHttpRequest.builder(String.class).method("POST").endpoint(URI.create("http://localhost/key")) .invocation(invocation).build(); } catch (SecurityException e) { throw Throwables.propagate(e); diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/config/CloudStackRestClientModule.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/config/CloudStackRestClientModule.java index 1e31dc957e..495e4d23bf 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/config/CloudStackRestClientModule.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/config/CloudStackRestClientModule.java @@ -19,7 +19,7 @@ package org.jclouds.cloudstack.config; import static com.google.common.base.Throwables.propagate; -import static org.jclouds.rest.config.BinderUtils.bindClientAndAsyncClient; +import static org.jclouds.rest.config.BinderUtils.bindHttpApi; import java.util.Map; import java.util.concurrent.ExecutionException; @@ -209,9 +209,9 @@ public class CloudStackRestClientModule extends RestClientModule implements BlobRequestSigner { - private final RestAnnotationProcessor processor; + private final RestAnnotationProcessor processor; private final BlobToObject blobToObject; private final BlobToHttpGetOptions blob2HttpGetOptions; @@ -55,26 +54,24 @@ public class S3BlobRequestSigner implements BlobRequest private final Invokable createMethod; @Inject - public S3BlobRequestSigner(RestAnnotationProcessor processor, BlobToObject blobToObject, + public S3BlobRequestSigner(RestAnnotationProcessor processor, BlobToObject blobToObject, BlobToHttpGetOptions blob2HttpGetOptions, Class interfaceType) throws SecurityException, NoSuchMethodException { this.processor = checkNotNull(processor, "processor"); this.blobToObject = checkNotNull(blobToObject, "blobToObject"); this.blob2HttpGetOptions = checkNotNull(blob2HttpGetOptions, "blob2HttpGetOptions"); - this.getMethod = Invokable.from(TypeToken.of(interfaceType), - interfaceType.getMethod("getObject", String.class, String.class, GetOptions[].class)); - this.deleteMethod = Invokable.from(TypeToken.of(interfaceType), - interfaceType.getMethod("deleteObject", String.class, String.class)); - this.createMethod = Invokable.from(TypeToken.of(interfaceType), - interfaceType.getMethod("putObject", String.class, S3Object.class, PutObjectOptions[].class)); + this.getMethod = Invokable.from(interfaceType.getMethod("getObject", String.class, String.class, + GetOptions[].class)); + this.deleteMethod = Invokable.from(interfaceType.getMethod("deleteObject", String.class, String.class)); + this.createMethod = Invokable.from(interfaceType.getMethod("putObject", String.class, S3Object.class, + PutObjectOptions[].class)); } @Override public HttpRequest signGetBlob(String container, String name) { checkNotNull(container, "container"); checkNotNull(name, "name"); - return cleanRequest(processor.apply(Invocation.create( getMethod, - ImmutableList. of(container, name)))); + return cleanRequest(processor.apply(Invocation.create(getMethod, ImmutableList. of(container, name)))); } @Override @@ -86,7 +83,7 @@ public class S3BlobRequestSigner implements BlobRequest public HttpRequest signPutBlob(String container, Blob blob) { checkNotNull(container, "container"); checkNotNull(blob, "blob"); - return cleanRequest(processor.apply(Invocation.create( createMethod, + return cleanRequest(processor.apply(Invocation.create(createMethod, ImmutableList. of(container, blobToObject.apply(blob))))); } @@ -99,15 +96,14 @@ public class S3BlobRequestSigner implements BlobRequest public HttpRequest signRemoveBlob(String container, String name) { checkNotNull(container, "container"); checkNotNull(name, "name"); - return cleanRequest(processor.apply(Invocation.create( deleteMethod, - ImmutableList. of(container, name)))); + return cleanRequest(processor.apply(Invocation.create(deleteMethod, ImmutableList. of(container, name)))); } @Override public HttpRequest signGetBlob(String container, String name, org.jclouds.blobstore.options.GetOptions options) { checkNotNull(container, "container"); checkNotNull(name, "name"); - return cleanRequest(processor.apply(Invocation.create( getMethod, + return cleanRequest(processor.apply(Invocation.create(getMethod, ImmutableList.of(container, name, blob2HttpGetOptions.apply(checkNotNull(options, "options")))))); } } diff --git a/apis/s3/src/test/java/org/jclouds/s3/S3AsyncClientTest.java b/apis/s3/src/test/java/org/jclouds/s3/S3AsyncClientTest.java index 2beb3ac58e..411326cff9 100644 --- a/apis/s3/src/test/java/org/jclouds/s3/S3AsyncClientTest.java +++ b/apis/s3/src/test/java/org/jclouds/s3/S3AsyncClientTest.java @@ -36,7 +36,7 @@ import org.jclouds.http.functions.ParseSax; import org.jclouds.http.functions.ReleasePayloadAndReturn; import org.jclouds.http.functions.ReturnTrueIf2xx; import org.jclouds.http.options.GetOptions; -import org.jclouds.reflect.Invokable; +import com.google.common.reflect.Invokable; import org.jclouds.rest.ConfiguresRestClient; import org.jclouds.rest.internal.GeneratedHttpRequest; import org.jclouds.s3.S3Fallbacks.TrueOn404OrNotFoundFalseOnIllegalState; @@ -80,7 +80,7 @@ import com.google.inject.Module; */ // NOTE:without testName, this will not call @Before* and fail w/NPE during surefire @Test(groups = "unit", testName = "S3AsyncClientTest") -public class S3AsyncClientTest extends BaseS3AsyncClientTest { +public abstract class S3AsyncClientTest extends BaseS3AsyncClientTest { protected String url = "s3.amazonaws.com"; diff --git a/apis/s3/src/test/java/org/jclouds/s3/binders/BindAsHostPrefixIfConfiguredNoPathTest.java b/apis/s3/src/test/java/org/jclouds/s3/binders/BindAsHostPrefixIfConfiguredNoPathTest.java index b280cfbcbd..148b932075 100644 --- a/apis/s3/src/test/java/org/jclouds/s3/binders/BindAsHostPrefixIfConfiguredNoPathTest.java +++ b/apis/s3/src/test/java/org/jclouds/s3/binders/BindAsHostPrefixIfConfiguredNoPathTest.java @@ -29,7 +29,7 @@ import org.jclouds.s3.internal.BaseS3AsyncClientTest; import org.testng.annotations.Test; import com.google.common.collect.ImmutableList; -import org.jclouds.reflect.Invokable; +import com.google.common.reflect.Invokable; /** * Tests behavior of {@code BindAsHostPrefixIfConfigured} diff --git a/apis/s3/src/test/java/org/jclouds/s3/binders/BindAsHostPrefixIfConfiguredTest.java b/apis/s3/src/test/java/org/jclouds/s3/binders/BindAsHostPrefixIfConfiguredTest.java index 23b2fb50b8..d1687ff39e 100644 --- a/apis/s3/src/test/java/org/jclouds/s3/binders/BindAsHostPrefixIfConfiguredTest.java +++ b/apis/s3/src/test/java/org/jclouds/s3/binders/BindAsHostPrefixIfConfiguredTest.java @@ -32,7 +32,7 @@ import org.testng.annotations.DataProvider; import org.testng.annotations.Test; import com.google.common.collect.ImmutableList; -import org.jclouds.reflect.Invokable; +import com.google.common.reflect.Invokable; /** * Tests behavior of {@code BindAsHostPrefixIfConfigured} diff --git a/apis/s3/src/test/java/org/jclouds/s3/fallbacks/FalseIfBucketAlreadyOwnedByYouOrOperationAbortedWhenBucketExistsTest.java b/apis/s3/src/test/java/org/jclouds/s3/fallbacks/FalseIfBucketAlreadyOwnedByYouOrOperationAbortedWhenBucketExistsTest.java index 48223d8d57..8199810664 100644 --- a/apis/s3/src/test/java/org/jclouds/s3/fallbacks/FalseIfBucketAlreadyOwnedByYouOrOperationAbortedWhenBucketExistsTest.java +++ b/apis/s3/src/test/java/org/jclouds/s3/fallbacks/FalseIfBucketAlreadyOwnedByYouOrOperationAbortedWhenBucketExistsTest.java @@ -35,7 +35,7 @@ import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; import com.google.common.collect.Lists; -import org.jclouds.reflect.Invokable; +import com.google.common.reflect.Invokable; /** * @author Adrian Cole @@ -43,11 +43,11 @@ import org.jclouds.reflect.Invokable; @Test(testName = "FalseIfBucketAlreadyOwnedByYouOrOperationAbortedWhenBucketExistsTest") public class FalseIfBucketAlreadyOwnedByYouOrOperationAbortedWhenBucketExistsTest { - GeneratedHttpRequest putBucket; + GeneratedHttpRequest putBucket; @BeforeClass void setUp() throws SecurityException, NoSuchMethodException { - putBucket = GeneratedHttpRequest.builder() + putBucket = GeneratedHttpRequest.builder(S3Client.class) .method("PUT") .endpoint("https://adriancole-blobstore113.s3.amazonaws.com/") .invocation( diff --git a/apis/s3/src/test/java/org/jclouds/s3/filters/RequestAuthorizeSignatureTest.java b/apis/s3/src/test/java/org/jclouds/s3/filters/RequestAuthorizeSignatureTest.java index c00c3dfb2f..9c29bfd233 100644 --- a/apis/s3/src/test/java/org/jclouds/s3/filters/RequestAuthorizeSignatureTest.java +++ b/apis/s3/src/test/java/org/jclouds/s3/filters/RequestAuthorizeSignatureTest.java @@ -41,7 +41,7 @@ import org.testng.annotations.Test; import com.google.common.collect.ImmutableList; import com.google.common.collect.SortedSetMultimap; import com.google.common.collect.TreeMultimap; -import org.jclouds.reflect.Invokable; +import com.google.common.reflect.Invokable; /** * Tests behavior of {@code RequestAuthorizeSignature} diff --git a/apis/swift/src/main/java/org/jclouds/openstack/swift/blobstore/SwiftBlobSigner.java b/apis/swift/src/main/java/org/jclouds/openstack/swift/blobstore/SwiftBlobSigner.java index b44c0ea38c..6bbba08148 100644 --- a/apis/swift/src/main/java/org/jclouds/openstack/swift/blobstore/SwiftBlobSigner.java +++ b/apis/swift/src/main/java/org/jclouds/openstack/swift/blobstore/SwiftBlobSigner.java @@ -46,7 +46,6 @@ import org.jclouds.openstack.swift.TemporaryUrlKey; import org.jclouds.openstack.swift.blobstore.functions.BlobToObject; import org.jclouds.openstack.swift.domain.SwiftObject; import org.jclouds.reflect.Invocation; -import org.jclouds.reflect.Invokable; import org.jclouds.rest.internal.GeneratedHttpRequest; import org.jclouds.rest.internal.RestAnnotationProcessor; @@ -55,7 +54,7 @@ import com.google.common.base.Throwables; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import com.google.common.io.ByteProcessor; -import com.google.common.reflect.TypeToken; +import com.google.common.reflect.Invokable; import com.google.inject.Provider; /** @@ -64,7 +63,7 @@ import com.google.inject.Provider; @Singleton public class SwiftBlobSigner implements BlobRequestSigner { - private final RestAnnotationProcessor processor; + private final RestAnnotationProcessor processor; private final Crypto crypto; private final Provider unixEpochTimestampProvider; @@ -86,7 +85,7 @@ public class SwiftBlobSigner implements BlobRe @Inject protected SwiftBlobSigner(BlobToObject blobToObject, BlobToHttpGetOptions blob2HttpGetOptions, Crypto crypto, @TimeStamp Provider unixEpochTimestampProvider, - @TemporaryUrlKey Supplier temporaryUrlKeySupplier, RestAnnotationProcessor processor, + @TemporaryUrlKey Supplier temporaryUrlKeySupplier, RestAnnotationProcessor processor, Class interfaceType) throws SecurityException, NoSuchMethodException { this.processor = checkNotNull(processor, "processor"); this.crypto = checkNotNull(crypto, "crypto"); @@ -97,27 +96,24 @@ public class SwiftBlobSigner implements BlobRe this.blobToObject = checkNotNull(blobToObject, "blobToObject"); this.blob2HttpGetOptions = checkNotNull(blob2HttpGetOptions, "blob2HttpGetOptions"); - this.getMethod = Invokable.from(TypeToken.of(interfaceType), - interfaceType.getMethod("getObject", String.class, String.class, GetOptions[].class)); - this.deleteMethod = Invokable.from(TypeToken.of(interfaceType), - interfaceType.getMethod("removeObject", String.class, String.class)); - this.createMethod = Invokable.from(TypeToken.of(interfaceType), - interfaceType.getMethod("putObject", String.class, SwiftObject.class)); + this.getMethod = Invokable.from(interfaceType.getMethod("getObject", String.class, String.class, + GetOptions[].class)); + this.deleteMethod = Invokable.from(interfaceType.getMethod("removeObject", String.class, String.class)); + this.createMethod = Invokable.from(interfaceType.getMethod("putObject", String.class, SwiftObject.class)); } @Override public HttpRequest signGetBlob(String container, String name) { checkNotNull(container, "container"); checkNotNull(name, "name"); - return cleanRequest(processor.apply(Invocation.create(getMethod, - ImmutableList. of(container, name)))); + return cleanRequest(processor.apply(Invocation.create(getMethod, ImmutableList. of(container, name)))); } @Override public HttpRequest signGetBlob(String container, String name, long timeInSeconds) { checkNotNull(container, "container"); checkNotNull(name, "name"); - GeneratedHttpRequest request = processor.apply(Invocation.create(getMethod, + GeneratedHttpRequest request = processor.apply(Invocation.create(getMethod, ImmutableList. of(container, name))); return cleanRequest(signForTemporaryAccess(request, timeInSeconds)); } @@ -142,7 +138,7 @@ public class SwiftBlobSigner implements BlobRe public HttpRequest signPutBlob(String container, Blob blob, long timeInSeconds) { checkNotNull(container, "container"); checkNotNull(blob, "blob"); - GeneratedHttpRequest request = processor.apply(Invocation.create(createMethod, + GeneratedHttpRequest request = processor.apply(Invocation.create(createMethod, ImmutableList. of(container, blobToObject.apply(blob)))); return cleanRequest(signForTemporaryAccess(request, timeInSeconds)); } @@ -151,8 +147,7 @@ public class SwiftBlobSigner implements BlobRe public HttpRequest signRemoveBlob(String container, String name) { checkNotNull(container, "container"); checkNotNull(name, "name"); - return cleanRequest(processor.apply(Invocation.create(deleteMethod, - ImmutableList. of(container, name)))); + return cleanRequest(processor.apply(Invocation.create(deleteMethod, ImmutableList. of(container, name)))); } private HttpRequest signForTemporaryAccess(HttpRequest request, long timeInSeconds) { diff --git a/apis/swift/src/main/java/org/jclouds/openstack/swift/blobstore/config/TemporaryUrlExtensionModule.java b/apis/swift/src/main/java/org/jclouds/openstack/swift/blobstore/config/TemporaryUrlExtensionModule.java index 10b639bf59..f9341df0c5 100644 --- a/apis/swift/src/main/java/org/jclouds/openstack/swift/blobstore/config/TemporaryUrlExtensionModule.java +++ b/apis/swift/src/main/java/org/jclouds/openstack/swift/blobstore/config/TemporaryUrlExtensionModule.java @@ -18,7 +18,7 @@ */ package org.jclouds.openstack.swift.blobstore.config; -import static org.jclouds.rest.config.BinderUtils.bindClientAndAsyncClient; +import static org.jclouds.rest.config.BinderUtils.bindHttpApi; import org.jclouds.blobstore.BlobRequestSigner; import org.jclouds.date.TimeStamp; @@ -63,7 +63,7 @@ public abstract class TemporaryUrlExtensionModule { protected void bindTemporaryUrlKeyApi() { - bindClientAndAsyncClient(binder(), TemporaryUrlKeyApi.class, KeystoneTemporaryUrlKeyAsyncApi.class); + bindHttpApi(binder(), TemporaryUrlKeyApi.class, KeystoneTemporaryUrlKeyAsyncApi.class); } @Override @@ -91,7 +91,7 @@ public abstract class TemporaryUrlExtensionModule args) { + protected GeneratedHttpRequest requestForArgs(List args) { try { Invocation invocation = Invocation.create(Invokable.from(String.class.getDeclaredMethod("toString")), args); - return GeneratedHttpRequest.builder().method("POST").endpoint(URI.create("http://localhost/key")) + return GeneratedHttpRequest.builder(String.class).method("POST").endpoint(URI.create("http://localhost/key")) .invocation(invocation).build(); } catch (SecurityException e) { throw Throwables.propagate(e); diff --git a/apis/vcloud/src/main/java/org/jclouds/vcloud/config/VCloudRestClientModule.java b/apis/vcloud/src/main/java/org/jclouds/vcloud/config/VCloudRestClientModule.java index 1552dc757a..33d06d9501 100644 --- a/apis/vcloud/src/main/java/org/jclouds/vcloud/config/VCloudRestClientModule.java +++ b/apis/vcloud/src/main/java/org/jclouds/vcloud/config/VCloudRestClientModule.java @@ -28,7 +28,7 @@ import static com.google.common.collect.Iterables.transform; import static com.google.common.collect.Maps.transformValues; import static com.google.common.collect.Maps.uniqueIndex; import static org.jclouds.Constants.PROPERTY_SESSION_INTERVAL; -import static org.jclouds.rest.config.BinderUtils.bindClientAndAsyncClient; +import static org.jclouds.rest.config.BinderUtils.bindHttpApi; import static org.jclouds.vcloud.reference.VCloudConstants.PROPERTY_VCLOUD_DEFAULT_FENCEMODE; import static org.jclouds.vcloud.reference.VCloudConstants.PROPERTY_VCLOUD_TIMEOUT_TASK_COMPLETED; @@ -206,8 +206,8 @@ public class VCloudRestClientModule extends RestClientModule>() { }).to(new TypeLiteral() { }); - bindClientAndAsyncClient(binder(), VCloudVersionsClient.class, VCloudVersionsAsyncClient.class); - bindClientAndAsyncClient(binder(), VCloudLoginClient.class, VCloudLoginAsyncClient.class); + bindHttpApi(binder(), VCloudVersionsClient.class, VCloudVersionsAsyncClient.class); + bindHttpApi(binder(), VCloudLoginClient.class, VCloudLoginAsyncClient.class); } protected void bindCacheLoaders() { diff --git a/apis/vcloud/src/test/java/org/jclouds/vcloud/VCloudVersionsAsyncClientTest.java b/apis/vcloud/src/test/java/org/jclouds/vcloud/VCloudVersionsAsyncClientTest.java index deeb155fd4..6241fc2f56 100644 --- a/apis/vcloud/src/test/java/org/jclouds/vcloud/VCloudVersionsAsyncClientTest.java +++ b/apis/vcloud/src/test/java/org/jclouds/vcloud/VCloudVersionsAsyncClientTest.java @@ -26,7 +26,7 @@ import org.jclouds.http.HttpRequest; import org.jclouds.http.functions.ParseSax; import org.jclouds.providers.AnonymousProviderMetadata; import org.jclouds.providers.ProviderMetadata; -import org.jclouds.reflect.Invokable; +import com.google.common.reflect.Invokable; import org.jclouds.rest.internal.BaseAsyncClientTest; import org.jclouds.rest.internal.GeneratedHttpRequest; import org.jclouds.vcloud.xml.SupportedVersionsHandler; diff --git a/apis/vcloud/src/test/java/org/jclouds/vcloud/features/CatalogAsyncClientTest.java b/apis/vcloud/src/test/java/org/jclouds/vcloud/features/CatalogAsyncClientTest.java index 11616704d7..d487459dd4 100644 --- a/apis/vcloud/src/test/java/org/jclouds/vcloud/features/CatalogAsyncClientTest.java +++ b/apis/vcloud/src/test/java/org/jclouds/vcloud/features/CatalogAsyncClientTest.java @@ -23,7 +23,7 @@ import java.net.URI; import org.jclouds.Fallbacks.NullOnNotFoundOr404; import org.jclouds.http.functions.ParseSax; -import org.jclouds.reflect.Invokable; +import com.google.common.reflect.Invokable; import org.jclouds.rest.internal.GeneratedHttpRequest; import org.jclouds.vcloud.internal.BaseVCloudAsyncClientTest; import org.jclouds.vcloud.options.CatalogItemOptions; diff --git a/apis/vcloud/src/test/java/org/jclouds/vcloud/features/NetworkAsyncClientTest.java b/apis/vcloud/src/test/java/org/jclouds/vcloud/features/NetworkAsyncClientTest.java index 5c2696f85f..66a8644c7a 100644 --- a/apis/vcloud/src/test/java/org/jclouds/vcloud/features/NetworkAsyncClientTest.java +++ b/apis/vcloud/src/test/java/org/jclouds/vcloud/features/NetworkAsyncClientTest.java @@ -23,7 +23,7 @@ import java.net.URI; import org.jclouds.Fallbacks.NullOnNotFoundOr404; import org.jclouds.http.functions.ParseSax; -import org.jclouds.reflect.Invokable; +import com.google.common.reflect.Invokable; import org.jclouds.rest.internal.GeneratedHttpRequest; import org.jclouds.vcloud.internal.BaseVCloudAsyncClientTest; import org.jclouds.vcloud.xml.OrgNetworkHandler; diff --git a/apis/vcloud/src/test/java/org/jclouds/vcloud/features/OrgAsyncClientTest.java b/apis/vcloud/src/test/java/org/jclouds/vcloud/features/OrgAsyncClientTest.java index 6dde3eca0c..4591a89eec 100644 --- a/apis/vcloud/src/test/java/org/jclouds/vcloud/features/OrgAsyncClientTest.java +++ b/apis/vcloud/src/test/java/org/jclouds/vcloud/features/OrgAsyncClientTest.java @@ -24,7 +24,7 @@ import java.net.URI; import org.jclouds.Fallbacks.NullOnNotFoundOr404; import org.jclouds.fallbacks.MapHttp4xxCodesToExceptions; import org.jclouds.http.functions.ParseSax; -import org.jclouds.reflect.Invokable; +import com.google.common.reflect.Invokable; import org.jclouds.rest.internal.GeneratedHttpRequest; import org.jclouds.vcloud.internal.BaseVCloudAsyncClientTest; import org.jclouds.vcloud.xml.OrgHandler; diff --git a/apis/vcloud/src/test/java/org/jclouds/vcloud/features/TaskAsyncClientTest.java b/apis/vcloud/src/test/java/org/jclouds/vcloud/features/TaskAsyncClientTest.java index e770f2ad0a..d9478049b4 100644 --- a/apis/vcloud/src/test/java/org/jclouds/vcloud/features/TaskAsyncClientTest.java +++ b/apis/vcloud/src/test/java/org/jclouds/vcloud/features/TaskAsyncClientTest.java @@ -24,7 +24,7 @@ import java.net.URI; import org.jclouds.Fallbacks.NullOnNotFoundOr404; import org.jclouds.http.functions.ParseSax; import org.jclouds.http.functions.ReleasePayloadAndReturn; -import org.jclouds.reflect.Invokable; +import com.google.common.reflect.Invokable; import org.jclouds.rest.internal.GeneratedHttpRequest; import org.jclouds.vcloud.internal.BaseVCloudAsyncClientTest; import org.jclouds.vcloud.xml.TaskHandler; diff --git a/apis/vcloud/src/test/java/org/jclouds/vcloud/features/VAppAsyncClientTest.java b/apis/vcloud/src/test/java/org/jclouds/vcloud/features/VAppAsyncClientTest.java index b6a57e83d1..4abd506852 100644 --- a/apis/vcloud/src/test/java/org/jclouds/vcloud/features/VAppAsyncClientTest.java +++ b/apis/vcloud/src/test/java/org/jclouds/vcloud/features/VAppAsyncClientTest.java @@ -25,7 +25,7 @@ import org.jclouds.Fallbacks.NullOnNotFoundOr404; import org.jclouds.Fallbacks.VoidOnNotFoundOr404; import org.jclouds.http.functions.ParseSax; import org.jclouds.http.functions.ReleasePayloadAndReturn; -import org.jclouds.reflect.Invokable; +import com.google.common.reflect.Invokable; import org.jclouds.rest.internal.GeneratedHttpRequest; import org.jclouds.util.Strings2; import org.jclouds.vcloud.internal.BaseVCloudAsyncClientTest; diff --git a/apis/vcloud/src/test/java/org/jclouds/vcloud/features/VAppTemplateAsyncClientTest.java b/apis/vcloud/src/test/java/org/jclouds/vcloud/features/VAppTemplateAsyncClientTest.java index 48a442f0f3..731e2e0134 100644 --- a/apis/vcloud/src/test/java/org/jclouds/vcloud/features/VAppTemplateAsyncClientTest.java +++ b/apis/vcloud/src/test/java/org/jclouds/vcloud/features/VAppTemplateAsyncClientTest.java @@ -26,7 +26,7 @@ import java.net.URI; import org.jclouds.Fallbacks.NullOnNotFoundOr404; import org.jclouds.http.functions.ParseSax; import org.jclouds.ovf.xml.EnvelopeHandler; -import org.jclouds.reflect.Invokable; +import com.google.common.reflect.Invokable; import org.jclouds.rest.internal.GeneratedHttpRequest; import org.jclouds.util.Strings2; import org.jclouds.vcloud.domain.network.FenceMode; diff --git a/apis/vcloud/src/test/java/org/jclouds/vcloud/features/VDCAsyncClientTest.java b/apis/vcloud/src/test/java/org/jclouds/vcloud/features/VDCAsyncClientTest.java index 5f0e59f505..7a4398575e 100644 --- a/apis/vcloud/src/test/java/org/jclouds/vcloud/features/VDCAsyncClientTest.java +++ b/apis/vcloud/src/test/java/org/jclouds/vcloud/features/VDCAsyncClientTest.java @@ -24,7 +24,7 @@ import java.util.NoSuchElementException; import org.jclouds.Fallbacks.NullOnNotFoundOr404; import org.jclouds.http.functions.ParseSax; -import org.jclouds.reflect.Invokable; +import com.google.common.reflect.Invokable; import org.jclouds.rest.internal.GeneratedHttpRequest; import org.jclouds.vcloud.internal.BaseVCloudAsyncClientTest; import org.jclouds.vcloud.xml.VDCHandler; diff --git a/apis/vcloud/src/test/java/org/jclouds/vcloud/features/VmAsyncClientTest.java b/apis/vcloud/src/test/java/org/jclouds/vcloud/features/VmAsyncClientTest.java index 792d8f5982..1278fe6b3c 100644 --- a/apis/vcloud/src/test/java/org/jclouds/vcloud/features/VmAsyncClientTest.java +++ b/apis/vcloud/src/test/java/org/jclouds/vcloud/features/VmAsyncClientTest.java @@ -25,7 +25,7 @@ import org.jclouds.Fallbacks.NullOnNotFoundOr404; import org.jclouds.http.functions.ParseSax; import org.jclouds.http.functions.ReleasePayloadAndReturn; import org.jclouds.http.functions.ReturnInputStream; -import org.jclouds.reflect.Invokable; +import com.google.common.reflect.Invokable; import org.jclouds.rest.internal.GeneratedHttpRequest; import org.jclouds.util.Strings2; import org.jclouds.vcloud.domain.GuestCustomizationSection; diff --git a/apis/vcloud/src/test/java/org/jclouds/vcloud/internal/BasePayloadTest.java b/apis/vcloud/src/test/java/org/jclouds/vcloud/internal/BasePayloadTest.java index 65f0b3010c..b01d52e4e6 100644 --- a/apis/vcloud/src/test/java/org/jclouds/vcloud/internal/BasePayloadTest.java +++ b/apis/vcloud/src/test/java/org/jclouds/vcloud/internal/BasePayloadTest.java @@ -28,7 +28,7 @@ import org.nnsoft.guice.rocoto.Rocoto; import org.nnsoft.guice.rocoto.configuration.ConfigurationModule; import com.google.common.base.Throwables; -import org.jclouds.reflect.Invokable; +import com.google.common.reflect.Invokable; import com.google.inject.Guice; import com.google.inject.Injector; @@ -40,10 +40,10 @@ public class BasePayloadTest { } })); - protected GeneratedHttpRequest requestForArgs(List args) { + protected GeneratedHttpRequest requestForArgs(List args) { try { Invocation invocation = Invocation.create(Invokable.from(String.class.getDeclaredMethod("toString")), args); - return GeneratedHttpRequest.builder().method("POST").endpoint(URI.create("http://localhost/key")) + return GeneratedHttpRequest.builder(String.class).method("POST").endpoint(URI.create("http://localhost/key")) .invocation(invocation).build(); } catch (SecurityException e) { throw Throwables.propagate(e); diff --git a/apis/vcloud/src/test/java/org/jclouds/vcloud/internal/VCloudLoginAsyncClientTest.java b/apis/vcloud/src/test/java/org/jclouds/vcloud/internal/VCloudLoginAsyncClientTest.java index 3db64e2008..ae3dcd6c0e 100644 --- a/apis/vcloud/src/test/java/org/jclouds/vcloud/internal/VCloudLoginAsyncClientTest.java +++ b/apis/vcloud/src/test/java/org/jclouds/vcloud/internal/VCloudLoginAsyncClientTest.java @@ -30,7 +30,7 @@ import org.jclouds.http.filters.BasicAuthentication; import org.jclouds.location.Provider; import org.jclouds.providers.AnonymousProviderMetadata; import org.jclouds.providers.ProviderMetadata; -import org.jclouds.reflect.Invokable; +import com.google.common.reflect.Invokable; import org.jclouds.rest.internal.BaseAsyncClientTest; import org.jclouds.rest.internal.GeneratedHttpRequest; import org.jclouds.vcloud.endpoints.VCloudLogin; diff --git a/blobstore/src/main/java/org/jclouds/blobstore/config/TransientBlobStoreContextModule.java b/blobstore/src/main/java/org/jclouds/blobstore/config/TransientBlobStoreContextModule.java index 1bb5ebae6e..e04e90ceec 100644 --- a/blobstore/src/main/java/org/jclouds/blobstore/config/TransientBlobStoreContextModule.java +++ b/blobstore/src/main/java/org/jclouds/blobstore/config/TransientBlobStoreContextModule.java @@ -18,7 +18,7 @@ */ package org.jclouds.blobstore.config; -import static org.jclouds.rest.config.BinderUtils.bindClient; +import static org.jclouds.rest.config.BinderUtils.bindBlockingApi; import org.jclouds.blobstore.AsyncBlobStore; import org.jclouds.blobstore.BlobRequestSigner; @@ -41,7 +41,7 @@ public class TransientBlobStoreContextModule extends AbstractModule { protected void configure() { bind(AsyncBlobStore.class).to(LocalAsyncBlobStore.class).asEagerSingleton(); // forward all requests from TransientBlobStore to TransientAsyncBlobStore. needs above binding as cannot proxy a class - bindClient(binder(), LocalBlobStore.class, AsyncBlobStore.class); + bindBlockingApi(binder(), LocalBlobStore.class, AsyncBlobStore.class); install(new BlobStoreObjectModule()); install(new BlobStoreMapModule()); bind(BlobStore.class).to(LocalBlobStore.class); diff --git a/blobstore/src/test/java/org/jclouds/blobstore/util/BlobStoreUtilsTest.java b/blobstore/src/test/java/org/jclouds/blobstore/util/BlobStoreUtilsTest.java index 7682426812..4fcf3d2212 100644 --- a/blobstore/src/test/java/org/jclouds/blobstore/util/BlobStoreUtilsTest.java +++ b/blobstore/src/test/java/org/jclouds/blobstore/util/BlobStoreUtilsTest.java @@ -33,6 +33,7 @@ import org.jclouds.blobstore.AsyncBlobStore; import org.jclouds.blobstore.domain.Blob; import org.jclouds.blobstore.domain.MutableBlobMetadata; import org.jclouds.reflect.Invocation; +import com.google.common.reflect.Invokable; import org.jclouds.rest.Providers; import org.jclouds.rest.internal.GeneratedHttpRequest; import org.testng.annotations.Test; @@ -40,7 +41,6 @@ import org.testng.annotations.Test; import com.google.common.base.Throwables; import com.google.common.collect.ImmutableList; import com.google.common.collect.Iterables; -import org.jclouds.reflect.Invokable; /** * Tests behavior of {@code BlobStoreUtils} @@ -125,23 +125,23 @@ public class BlobStoreUtilsTest { } public void testGetKeyForAzureS3AndRackspace() { - GeneratedHttpRequest request = requestForEndpointAndArgs( + GeneratedHttpRequest request = requestForEndpointAndArgs( "https://jclouds.blob.core.windows.net/adriancole-blobstore0/five", ImmutableList. of("adriancole-blobstore0", "five")); assertEquals(getNameFor(request), "five"); } public void testGetKeyForAtmos() { - GeneratedHttpRequest request = requestForEndpointAndArgs( + GeneratedHttpRequest request = requestForEndpointAndArgs( "https://storage4.clouddrive.com/v1/MossoCloudFS_dc1f419c-5059-4c87-a389-3f2e33a77b22/adriancole-blobstore0/four", ImmutableList. of("adriancole-blobstore0/four")); assertEquals(getNameFor(request), "four"); } - GeneratedHttpRequest requestForEndpointAndArgs(String endpoint, List args) { + GeneratedHttpRequest requestForEndpointAndArgs(String endpoint, List args) { try { Invocation invocation = Invocation.create(Invokable.from(String.class.getDeclaredMethod("toString")), args); - return GeneratedHttpRequest.builder().method("POST").endpoint(URI.create(endpoint)).invocation(invocation) + return GeneratedHttpRequest.builder(String.class).method("POST").endpoint(URI.create(endpoint)).invocation(invocation) .build(); } catch (SecurityException e) { throw Throwables.propagate(e); diff --git a/common/openstack/src/main/java/org/jclouds/openstack/config/OpenStackAuthenticationModule.java b/common/openstack/src/main/java/org/jclouds/openstack/config/OpenStackAuthenticationModule.java index 0958e0b2d0..f8af820385 100644 --- a/common/openstack/src/main/java/org/jclouds/openstack/config/OpenStackAuthenticationModule.java +++ b/common/openstack/src/main/java/org/jclouds/openstack/config/OpenStackAuthenticationModule.java @@ -19,7 +19,7 @@ package org.jclouds.openstack.config; import static com.google.common.base.Suppliers.memoizeWithExpiration; -import static org.jclouds.rest.config.BinderUtils.bindClientAndAsyncClient; +import static org.jclouds.rest.config.BinderUtils.bindHttpApi; import java.util.Date; import java.util.concurrent.ExecutionException; @@ -59,7 +59,7 @@ public class OpenStackAuthenticationModule extends AbstractModule { @Override protected void configure() { // OpenStackAuthClient is used directly for filters and retry handlers, so let's bind it explicitly - bindClientAndAsyncClient(binder(), OpenStackAuthClient.class, OpenStackAuthAsyncClient.class); + bindHttpApi(binder(), OpenStackAuthClient.class, OpenStackAuthAsyncClient.class); install(new FactoryModuleBuilder().build(URIFromAuthenticationResponseForService.Factory.class)); bind(HttpRetryHandler.class).annotatedWith(ClientError.class).to(RetryOnRenew.class); } diff --git a/common/openstack/src/main/java/org/jclouds/openstack/keystone/v1_1/config/AuthenticationServiceModule.java b/common/openstack/src/main/java/org/jclouds/openstack/keystone/v1_1/config/AuthenticationServiceModule.java index d4e3fc257b..bce01e4e76 100644 --- a/common/openstack/src/main/java/org/jclouds/openstack/keystone/v1_1/config/AuthenticationServiceModule.java +++ b/common/openstack/src/main/java/org/jclouds/openstack/keystone/v1_1/config/AuthenticationServiceModule.java @@ -19,7 +19,7 @@ package org.jclouds.openstack.keystone.v1_1.config; import static com.google.common.base.Throwables.propagate; -import static org.jclouds.rest.config.BinderUtils.bindClientAndAsyncClient; +import static org.jclouds.rest.config.BinderUtils.bindHttpApi; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; @@ -59,7 +59,7 @@ public class AuthenticationServiceModule extends AbstractModule { @Override protected void configure() { // ServiceClient is used directly for filters and retry handlers, so let's bind it explicitly - bindClientAndAsyncClient(binder(), AuthenticationClient.class, AuthenticationAsyncClient.class); + bindHttpApi(binder(), AuthenticationClient.class, AuthenticationAsyncClient.class); install(new FactoryModuleBuilder().implement(RegionIdToURISupplier.class, RegionIdToURIFromAuthForServiceSupplier.class).build(RegionIdToURISupplier.Factory.class)); install(new FactoryModuleBuilder().implement(ImplicitRegionIdSupplier.class, V1DefaultRegionIdSupplier.class) diff --git a/common/openstack/src/test/java/org/jclouds/openstack/internal/OpenStackAuthAsyncClientTest.java b/common/openstack/src/test/java/org/jclouds/openstack/internal/OpenStackAuthAsyncClientTest.java index 0805583846..87f9bb62da 100644 --- a/common/openstack/src/test/java/org/jclouds/openstack/internal/OpenStackAuthAsyncClientTest.java +++ b/common/openstack/src/test/java/org/jclouds/openstack/internal/OpenStackAuthAsyncClientTest.java @@ -26,7 +26,7 @@ import org.jclouds.http.HttpRequest; import org.jclouds.http.IntegrationTestAsyncClient; import org.jclouds.http.IntegrationTestClient; import org.jclouds.openstack.functions.ParseAuthenticationResponseFromHeaders; -import org.jclouds.reflect.Invokable; +import com.google.common.reflect.Invokable; import org.jclouds.rest.AnonymousRestApiMetadata; import org.jclouds.rest.internal.BaseAsyncClientTest; import org.jclouds.rest.internal.GeneratedHttpRequest; diff --git a/common/trmk/src/main/java/org/jclouds/trmk/vcloud_0_8/config/TerremarkVCloudRestClientModule.java b/common/trmk/src/main/java/org/jclouds/trmk/vcloud_0_8/config/TerremarkVCloudRestClientModule.java index 75fefd92f0..1d1ca1582f 100644 --- a/common/trmk/src/main/java/org/jclouds/trmk/vcloud_0_8/config/TerremarkVCloudRestClientModule.java +++ b/common/trmk/src/main/java/org/jclouds/trmk/vcloud_0_8/config/TerremarkVCloudRestClientModule.java @@ -26,7 +26,7 @@ import static com.google.common.collect.Iterables.transform; import static com.google.common.collect.Maps.transformValues; import static com.google.common.collect.Maps.uniqueIndex; import static org.jclouds.Constants.PROPERTY_SESSION_INTERVAL; -import static org.jclouds.rest.config.BinderUtils.bindClientAndAsyncClient; +import static org.jclouds.rest.config.BinderUtils.bindHttpApi; import static org.jclouds.trmk.vcloud_0_8.reference.VCloudConstants.PROPERTY_VCLOUD_TIMEOUT_TASK_COMPLETED; import java.io.IOException; @@ -134,8 +134,8 @@ public class TerremarkVCloudRestClientModule extends RestClientModule>>() { }).to(new TypeLiteral() { }); - bindClientAndAsyncClient(binder(), TerremarkVCloudVersionsClient.class, TerremarkVCloudVersionsAsyncClient.class); - bindClientAndAsyncClient(binder(), TerremarkVCloudLoginClient.class, TerremarkVCloudLoginAsyncClient.class); + bindHttpApi(binder(), TerremarkVCloudVersionsClient.class, TerremarkVCloudVersionsAsyncClient.class); + bindHttpApi(binder(), TerremarkVCloudLoginClient.class, TerremarkVCloudLoginAsyncClient.class); } @Provides diff --git a/common/trmk/src/test/java/org/jclouds/trmk/vcloud_0_8/internal/BasePayloadTest.java b/common/trmk/src/test/java/org/jclouds/trmk/vcloud_0_8/internal/BasePayloadTest.java index 464e86de4d..31b94d779f 100644 --- a/common/trmk/src/test/java/org/jclouds/trmk/vcloud_0_8/internal/BasePayloadTest.java +++ b/common/trmk/src/test/java/org/jclouds/trmk/vcloud_0_8/internal/BasePayloadTest.java @@ -25,14 +25,14 @@ import org.jclouds.reflect.Invocation; import org.jclouds.rest.internal.GeneratedHttpRequest; import com.google.common.base.Throwables; -import org.jclouds.reflect.Invokable; +import com.google.common.reflect.Invokable; public class BasePayloadTest { - protected GeneratedHttpRequest requestForArgs(List args) { + protected GeneratedHttpRequest requestForArgs(List args) { try { Invocation invocation = Invocation.create(Invokable.from(String.class.getDeclaredMethod("toString")), args); - return GeneratedHttpRequest.builder().method("POST").endpoint(URI.create("http://localhost/key")) + return GeneratedHttpRequest.builder(String.class).method("POST").endpoint(URI.create("http://localhost/key")) .invocation(invocation).build(); } catch (SecurityException e) { throw Throwables.propagate(e); diff --git a/common/trmk/src/test/java/org/jclouds/trmk/vcloud_0_8/internal/TerremarkVCloudLoginAsyncClientTest.java b/common/trmk/src/test/java/org/jclouds/trmk/vcloud_0_8/internal/TerremarkVCloudLoginAsyncClientTest.java index 62ba6718b3..08c8dcc08d 100644 --- a/common/trmk/src/test/java/org/jclouds/trmk/vcloud_0_8/internal/TerremarkVCloudLoginAsyncClientTest.java +++ b/common/trmk/src/test/java/org/jclouds/trmk/vcloud_0_8/internal/TerremarkVCloudLoginAsyncClientTest.java @@ -30,7 +30,7 @@ import org.jclouds.http.filters.BasicAuthentication; import org.jclouds.location.Provider; import org.jclouds.providers.AnonymousProviderMetadata; import org.jclouds.providers.ProviderMetadata; -import org.jclouds.reflect.Invokable; +import com.google.common.reflect.Invokable; import org.jclouds.rest.internal.BaseAsyncClientTest; import org.jclouds.rest.internal.GeneratedHttpRequest; import org.jclouds.trmk.vcloud_0_8.endpoints.VCloudLogin; diff --git a/common/trmk/src/test/java/org/jclouds/trmk/vcloud_0_8/internal/TerremarkVCloudVersionsAsyncClientTest.java b/common/trmk/src/test/java/org/jclouds/trmk/vcloud_0_8/internal/TerremarkVCloudVersionsAsyncClientTest.java index 01b6cc79e6..0164fbfc0c 100644 --- a/common/trmk/src/test/java/org/jclouds/trmk/vcloud_0_8/internal/TerremarkVCloudVersionsAsyncClientTest.java +++ b/common/trmk/src/test/java/org/jclouds/trmk/vcloud_0_8/internal/TerremarkVCloudVersionsAsyncClientTest.java @@ -26,7 +26,7 @@ import org.jclouds.http.HttpRequest; import org.jclouds.http.functions.ParseSax; import org.jclouds.providers.AnonymousProviderMetadata; import org.jclouds.providers.ProviderMetadata; -import org.jclouds.reflect.Invokable; +import com.google.common.reflect.Invokable; import org.jclouds.rest.internal.BaseAsyncClientTest; import org.jclouds.rest.internal.GeneratedHttpRequest; import org.jclouds.trmk.vcloud_0_8.xml.SupportedVersionsHandler; diff --git a/labs/abiquo/src/main/java/org/jclouds/abiquo/config/AbiquoRestClientModule.java b/labs/abiquo/src/main/java/org/jclouds/abiquo/config/AbiquoRestClientModule.java index fab3ca1831..3bbe2d5e39 100644 --- a/labs/abiquo/src/main/java/org/jclouds/abiquo/config/AbiquoRestClientModule.java +++ b/labs/abiquo/src/main/java/org/jclouds/abiquo/config/AbiquoRestClientModule.java @@ -21,7 +21,7 @@ package org.jclouds.abiquo.config; import static org.jclouds.Constants.PROPERTY_SESSION_INTERVAL; import static org.jclouds.abiquo.domain.DomainWrapper.wrap; -import static org.jclouds.rest.config.BinderUtils.bindClientAndAsyncClient; +import static org.jclouds.rest.config.BinderUtils.bindHttpApi; import java.util.List; import java.util.Map; @@ -103,7 +103,7 @@ public class AbiquoRestClientModule extends RestClientModule withEndpointLink = Invokable.from(TestEndpointLink.class.getMethod("withEndpointLink", TestDto.class)); - GeneratedHttpRequest request = GeneratedHttpRequest.builder() + GeneratedHttpRequest request = GeneratedHttpRequest.builder(TestEndpointLink.class) .invocation(Invocation.create(withEndpointLink, ImmutableList. of(new TestDto()))) .method(HttpMethod.GET) .endpoint(URI.create("http://localhost")).build(); @@ -73,7 +73,7 @@ public class BindToPathTest { @Test(expectedExceptions = IllegalArgumentException.class) public void testInvalidInputType() throws SecurityException, NoSuchMethodException { Invokable withEndpointLink = Invokable.from(TestEndpointLink.class.getMethod("withEndpointLink", TestDto.class)); - GeneratedHttpRequest request = GeneratedHttpRequest.builder() + GeneratedHttpRequest request = GeneratedHttpRequest.builder(TestEndpointLink.class) .invocation(Invocation.create(withEndpointLink, ImmutableList. of(new TestDto()))) .method(HttpMethod.GET) .endpoint(URI.create("http://localhost")).build(); @@ -86,7 +86,7 @@ public class BindToPathTest { public void testAnnotationNotPresent() throws SecurityException, NoSuchMethodException { TestDto dto = new TestDto(); Invokable withoutEndpointLink = Invokable.from(TestEndpointLink.class.getMethod("withoutEndpointLink", TestDto.class)); - GeneratedHttpRequest request = GeneratedHttpRequest.builder() + GeneratedHttpRequest request = GeneratedHttpRequest.builder(TestEndpointLink.class) .invocation(Invocation.create(withoutEndpointLink, ImmutableList. of(dto))) .method(HttpMethod.GET) .endpoint(URI.create("http://localhost")).build(); @@ -99,7 +99,7 @@ public class BindToPathTest { public void testLinkNotPresent() throws SecurityException, NoSuchMethodException { TestDto dto = new TestDto(); Invokable withUnexistingLink = Invokable.from(TestEndpointLink.class.getMethod("withUnexistingLink", TestDto.class)); - GeneratedHttpRequest request = GeneratedHttpRequest.builder() + GeneratedHttpRequest request = GeneratedHttpRequest.builder(TestEndpointLink.class) .invocation(Invocation.create(withUnexistingLink, ImmutableList. of(dto))) .method(HttpMethod.GET) .endpoint(URI.create("http://localhost")).build(); @@ -111,7 +111,7 @@ public class BindToPathTest { public void testBindWithoutParameters() throws SecurityException, NoSuchMethodException { TestDto dto = new TestDto(); Invokable withEndpointLink = Invokable.from(TestEndpointLink.class.getMethod("withEndpointLink", TestDto.class)); - GeneratedHttpRequest request = GeneratedHttpRequest.builder() + GeneratedHttpRequest request = GeneratedHttpRequest.builder(TestEndpointLink.class) .invocation(Invocation.create(withEndpointLink, ImmutableList. of(dto))) .method(HttpMethod.GET) .endpoint(URI.create("http://localhost")).build(); @@ -124,7 +124,7 @@ public class BindToPathTest { public void testBindWithQueryParameters() throws SecurityException, NoSuchMethodException { TestDto dto = new TestDto(); Invokable withEndpointLink = Invokable.from(TestEndpointLink.class.getMethod("withEndpointLink", TestDto.class)); - GeneratedHttpRequest request = GeneratedHttpRequest.builder() + GeneratedHttpRequest request = GeneratedHttpRequest.builder(TestEndpointLink.class) .invocation(Invocation.create(withEndpointLink, ImmutableList. of(dto))) .method(HttpMethod.GET) .endpoint(URI.create("http://localhost?param=value")).build(); diff --git a/labs/abiquo/src/test/java/org/jclouds/abiquo/binders/cloud/BindMoveVolumeToPathTest.java b/labs/abiquo/src/test/java/org/jclouds/abiquo/binders/cloud/BindMoveVolumeToPathTest.java index 20e0a7eed4..75f5375abc 100644 --- a/labs/abiquo/src/test/java/org/jclouds/abiquo/binders/cloud/BindMoveVolumeToPathTest.java +++ b/labs/abiquo/src/test/java/org/jclouds/abiquo/binders/cloud/BindMoveVolumeToPathTest.java @@ -34,7 +34,7 @@ import org.testng.annotations.Test; import com.abiquo.server.core.cloud.VirtualDatacenterDto; import com.abiquo.server.core.infrastructure.storage.VolumeManagementDto; import com.google.common.collect.ImmutableList; -import org.jclouds.reflect.Invokable; +import com.google.common.reflect.Invokable; /** * Unit tests for the {@link BindMoveVolumeToPath} binder. @@ -64,7 +64,7 @@ public class BindMoveVolumeToPathTest { private static GeneratedHttpRequest generatedHttpRequest() throws SecurityException, NoSuchMethodException { Invokable withEndpointLink = Invokable.from(CloudAsyncApi.class.getMethod("moveVolume", VolumeManagementDto.class, VirtualDatacenterDto.class)); - return GeneratedHttpRequest.builder() + return GeneratedHttpRequest.builder(CloudAsyncApi.class) .invocation(Invocation.create(withEndpointLink, ImmutableList. of(CloudResources.volumePut(), CloudResources.virtualDatacenterPut()))) .method(HttpMethod.POST).endpoint(URI.create("http://localhost")).build(); } diff --git a/labs/abiquo/src/test/java/org/jclouds/abiquo/binders/cloud/BindNetworkConfigurationRefToPayloadTest.java b/labs/abiquo/src/test/java/org/jclouds/abiquo/binders/cloud/BindNetworkConfigurationRefToPayloadTest.java index 6ae521ee57..a0d452378f 100644 --- a/labs/abiquo/src/test/java/org/jclouds/abiquo/binders/cloud/BindNetworkConfigurationRefToPayloadTest.java +++ b/labs/abiquo/src/test/java/org/jclouds/abiquo/binders/cloud/BindNetworkConfigurationRefToPayloadTest.java @@ -42,7 +42,7 @@ import com.abiquo.server.core.cloud.VirtualMachineDto; import com.abiquo.server.core.infrastructure.network.VLANNetworkDto; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; -import org.jclouds.reflect.Invokable; +import com.google.common.reflect.Invokable; /** * Unit tests for the {@link BindNetworkConfigurationRefToPayload} binder. @@ -70,7 +70,7 @@ public class BindNetworkConfigurationRefToPayloadTest { Invokable method = Invokable.from(TestNetworkConfig.class.getMethod("withAll", VirtualMachineDto.class, VLANNetworkDto.class)); - GeneratedHttpRequest request = GeneratedHttpRequest.builder() + GeneratedHttpRequest request = GeneratedHttpRequest.builder(TestNetworkConfig.class) .invocation(Invocation.create(method, Lists. newArrayList(vm, null))) .method(HttpMethod.GET) .endpoint(URI.create("http://localhost")).build(); @@ -86,7 +86,7 @@ public class BindNetworkConfigurationRefToPayloadTest { Invokable method = Invokable.from(TestNetworkConfig.class.getMethod("withAll", VirtualMachineDto.class, VLANNetworkDto.class)); - GeneratedHttpRequest request = GeneratedHttpRequest.builder() + GeneratedHttpRequest request = GeneratedHttpRequest.builder(TestNetworkConfig.class) .invocation(Invocation.create(method, ImmutableList. of(vm, network))) .method(HttpMethod.GET) .endpoint(URI.create("http://localhost")).build(); @@ -101,7 +101,7 @@ public class BindNetworkConfigurationRefToPayloadTest { Invokable method = Invokable.from(TestNetworkConfig.class.getMethod("withoutVirtualMachine", VLANNetworkDto.class)); - GeneratedHttpRequest request = GeneratedHttpRequest.builder() + GeneratedHttpRequest request = GeneratedHttpRequest.builder(TestNetworkConfig.class) .invocation(Invocation.create(method, ImmutableList. of(network))) .method(HttpMethod.GET) .endpoint(URI.create("http://localhost")).build(); @@ -116,7 +116,7 @@ public class BindNetworkConfigurationRefToPayloadTest { Invokable method = Invokable.from(TestNetworkConfig.class.getMethod("withAll", VirtualMachineDto.class, VLANNetworkDto.class)); - GeneratedHttpRequest request = GeneratedHttpRequest.builder() + GeneratedHttpRequest request = GeneratedHttpRequest.builder(TestNetworkConfig.class) .invocation(Invocation.create(method, ImmutableList. of(vm, network))) .method(HttpMethod.GET) .endpoint(URI.create("http://localhost")).build(); diff --git a/labs/abiquo/src/test/java/org/jclouds/abiquo/binders/infrastructure/BindSupportedDevicesLinkToPathTest.java b/labs/abiquo/src/test/java/org/jclouds/abiquo/binders/infrastructure/BindSupportedDevicesLinkToPathTest.java index 8aea9d92e3..77873a0fb5 100644 --- a/labs/abiquo/src/test/java/org/jclouds/abiquo/binders/infrastructure/BindSupportedDevicesLinkToPathTest.java +++ b/labs/abiquo/src/test/java/org/jclouds/abiquo/binders/infrastructure/BindSupportedDevicesLinkToPathTest.java @@ -33,7 +33,7 @@ import org.testng.annotations.Test; import com.abiquo.model.rest.RESTLink; import com.abiquo.server.core.infrastructure.DatacenterDto; import com.google.common.collect.ImmutableList; -import org.jclouds.reflect.Invokable; +import com.google.common.reflect.Invokable; /** * Unit tests for the {@link BindSupportedDevicesLinkToPath} class. @@ -63,7 +63,7 @@ public class BindSupportedDevicesLinkToPathTest { Invokable withEndpointLink = Invokable.from(InfrastructureAsyncApi.class.getMethod( "listSupportedStorageDevices", DatacenterDto.class)); - GeneratedHttpRequest request = GeneratedHttpRequest.builder() + GeneratedHttpRequest request = GeneratedHttpRequest.builder(InfrastructureAsyncApi.class) .invocation(Invocation.create(withEndpointLink, ImmutableList. of(datacenter))) .method(HttpMethod.GET) .endpoint(URI.create("http://foo/bar")).build(); @@ -80,7 +80,7 @@ public class BindSupportedDevicesLinkToPathTest { Invokable withEndpointLink = Invokable.from(InfrastructureAsyncApi.class.getMethod( "listSupportedStorageDevices", DatacenterDto.class)); - GeneratedHttpRequest request = GeneratedHttpRequest.builder() + GeneratedHttpRequest request = GeneratedHttpRequest.builder(InfrastructureAsyncApi.class) .invocation(Invocation.create(withEndpointLink, ImmutableList. of(datacenter))) .method(HttpMethod.GET) .endpoint(URI.create("http://foo/bar")).build(); diff --git a/labs/abiquo/src/test/java/org/jclouds/abiquo/features/AdminAsyncApiTest.java b/labs/abiquo/src/test/java/org/jclouds/abiquo/features/AdminAsyncApiTest.java index 622184949d..7fb153836e 100644 --- a/labs/abiquo/src/test/java/org/jclouds/abiquo/features/AdminAsyncApiTest.java +++ b/labs/abiquo/src/test/java/org/jclouds/abiquo/features/AdminAsyncApiTest.java @@ -36,7 +36,7 @@ import com.abiquo.server.core.enterprise.RoleDto; import com.abiquo.server.core.enterprise.RolesDto; import com.abiquo.server.core.enterprise.UserDto; import com.google.common.collect.ImmutableList; -import org.jclouds.reflect.Invokable; +import com.google.common.reflect.Invokable; /** * Tests annotation parsing of {@code AdminAsyncApi} diff --git a/labs/abiquo/src/test/java/org/jclouds/abiquo/features/CloudAsyncApiTest.java b/labs/abiquo/src/test/java/org/jclouds/abiquo/features/CloudAsyncApiTest.java index ecafc10602..98617ac2a2 100644 --- a/labs/abiquo/src/test/java/org/jclouds/abiquo/features/CloudAsyncApiTest.java +++ b/labs/abiquo/src/test/java/org/jclouds/abiquo/features/CloudAsyncApiTest.java @@ -77,7 +77,7 @@ import com.abiquo.server.core.infrastructure.storage.TiersDto; import com.abiquo.server.core.infrastructure.storage.VolumeManagementDto; import com.abiquo.server.core.infrastructure.storage.VolumesManagementDto; import com.google.common.collect.ImmutableList; -import org.jclouds.reflect.Invokable; +import com.google.common.reflect.Invokable; /** * Tests annotation parsing of {@code CloudAsyncApi} diff --git a/labs/abiquo/src/test/java/org/jclouds/abiquo/features/ConfigAsyncApiTest.java b/labs/abiquo/src/test/java/org/jclouds/abiquo/features/ConfigAsyncApiTest.java index d4061f7392..fcd4c844df 100644 --- a/labs/abiquo/src/test/java/org/jclouds/abiquo/features/ConfigAsyncApiTest.java +++ b/labs/abiquo/src/test/java/org/jclouds/abiquo/features/ConfigAsyncApiTest.java @@ -41,7 +41,7 @@ import com.abiquo.server.core.config.SystemPropertyDto; import com.abiquo.server.core.enterprise.PrivilegeDto; import com.abiquo.server.core.enterprise.PrivilegesDto; import com.google.common.collect.ImmutableList; -import org.jclouds.reflect.Invokable; +import com.google.common.reflect.Invokable; /** * Tests annotation parsing of {@code AdminAsyncApi}. diff --git a/labs/abiquo/src/test/java/org/jclouds/abiquo/features/EnterpriseAsyncApiTest.java b/labs/abiquo/src/test/java/org/jclouds/abiquo/features/EnterpriseAsyncApiTest.java index 8fb341e38d..be6cf8232a 100644 --- a/labs/abiquo/src/test/java/org/jclouds/abiquo/features/EnterpriseAsyncApiTest.java +++ b/labs/abiquo/src/test/java/org/jclouds/abiquo/features/EnterpriseAsyncApiTest.java @@ -53,7 +53,7 @@ import com.abiquo.server.core.infrastructure.DatacentersDto; import com.abiquo.server.core.infrastructure.MachinesDto; import com.abiquo.server.core.infrastructure.network.VLANNetworksDto; import com.google.common.collect.ImmutableList; -import org.jclouds.reflect.Invokable; +import com.google.common.reflect.Invokable; /** * Tests annotation parsing of {@code EnterpriseAsyncApi} diff --git a/labs/abiquo/src/test/java/org/jclouds/abiquo/features/EventAsyncApiTest.java b/labs/abiquo/src/test/java/org/jclouds/abiquo/features/EventAsyncApiTest.java index 3cbf91ad7c..4a9e964327 100644 --- a/labs/abiquo/src/test/java/org/jclouds/abiquo/features/EventAsyncApiTest.java +++ b/labs/abiquo/src/test/java/org/jclouds/abiquo/features/EventAsyncApiTest.java @@ -27,7 +27,7 @@ import org.testng.annotations.Test; import com.abiquo.server.core.event.EventsDto; import com.google.common.collect.ImmutableList; -import org.jclouds.reflect.Invokable; +import com.google.common.reflect.Invokable; /** * Tests annotation parsing of {@code EventAsyncApi} diff --git a/labs/abiquo/src/test/java/org/jclouds/abiquo/features/InfrastructureAsyncApiTest.java b/labs/abiquo/src/test/java/org/jclouds/abiquo/features/InfrastructureAsyncApiTest.java index b614566436..681338a1ec 100644 --- a/labs/abiquo/src/test/java/org/jclouds/abiquo/features/InfrastructureAsyncApiTest.java +++ b/labs/abiquo/src/test/java/org/jclouds/abiquo/features/InfrastructureAsyncApiTest.java @@ -89,7 +89,7 @@ import com.abiquo.server.core.infrastructure.storage.StoragePoolsDto; import com.abiquo.server.core.infrastructure.storage.TierDto; import com.abiquo.server.core.infrastructure.storage.TiersDto; import com.google.common.collect.ImmutableList; -import org.jclouds.reflect.Invokable; +import com.google.common.reflect.Invokable; /** * Tests annotation parsing of {@code InfrastructureAsyncApi} diff --git a/labs/abiquo/src/test/java/org/jclouds/abiquo/features/PricingAsyncApiTest.java b/labs/abiquo/src/test/java/org/jclouds/abiquo/features/PricingAsyncApiTest.java index 961639ec77..978a3d0f85 100644 --- a/labs/abiquo/src/test/java/org/jclouds/abiquo/features/PricingAsyncApiTest.java +++ b/labs/abiquo/src/test/java/org/jclouds/abiquo/features/PricingAsyncApiTest.java @@ -42,7 +42,7 @@ import com.abiquo.server.core.pricing.PricingTemplatesDto; import com.abiquo.server.core.pricing.PricingTierDto; import com.abiquo.server.core.pricing.PricingTiersDto; import com.google.common.collect.ImmutableList; -import org.jclouds.reflect.Invokable; +import com.google.common.reflect.Invokable; /** * Tests annotation parsing of {@code PricingAsyncApi}. diff --git a/labs/abiquo/src/test/java/org/jclouds/abiquo/features/TaskAsyncApiTest.java b/labs/abiquo/src/test/java/org/jclouds/abiquo/features/TaskAsyncApiTest.java index fce66f5b53..b215ddb3fc 100644 --- a/labs/abiquo/src/test/java/org/jclouds/abiquo/features/TaskAsyncApiTest.java +++ b/labs/abiquo/src/test/java/org/jclouds/abiquo/features/TaskAsyncApiTest.java @@ -33,7 +33,7 @@ import com.abiquo.model.transport.SingleResourceTransportDto; import com.abiquo.server.core.task.TaskDto; import com.abiquo.server.core.task.TasksDto; import com.google.common.collect.ImmutableList; -import org.jclouds.reflect.Invokable; +import com.google.common.reflect.Invokable; /** * Tests annotation parsing of {@code TaskAsyncApi} diff --git a/labs/abiquo/src/test/java/org/jclouds/abiquo/features/VirtualMachineTemplateAsyncApiTest.java b/labs/abiquo/src/test/java/org/jclouds/abiquo/features/VirtualMachineTemplateAsyncApiTest.java index e74a07637e..1c0b47562c 100644 --- a/labs/abiquo/src/test/java/org/jclouds/abiquo/features/VirtualMachineTemplateAsyncApiTest.java +++ b/labs/abiquo/src/test/java/org/jclouds/abiquo/features/VirtualMachineTemplateAsyncApiTest.java @@ -43,7 +43,7 @@ import com.abiquo.server.core.appslibrary.VirtualMachineTemplateDto; import com.abiquo.server.core.appslibrary.VirtualMachineTemplatePersistentDto; import com.abiquo.server.core.appslibrary.VirtualMachineTemplatesDto; import com.google.common.collect.ImmutableList; -import org.jclouds.reflect.Invokable; +import com.google.common.reflect.Invokable; /** * Tests annotation parsing of {@code VirtualMachineTemplateAsyncApi} diff --git a/labs/abiquo/src/test/java/org/jclouds/abiquo/rest/internal/AbiquoHttpAsyncClientTest.java b/labs/abiquo/src/test/java/org/jclouds/abiquo/rest/internal/AbiquoHttpAsyncClientTest.java index 68341bcf63..2151e3e204 100644 --- a/labs/abiquo/src/test/java/org/jclouds/abiquo/rest/internal/AbiquoHttpAsyncClientTest.java +++ b/labs/abiquo/src/test/java/org/jclouds/abiquo/rest/internal/AbiquoHttpAsyncClientTest.java @@ -30,7 +30,7 @@ import org.testng.annotations.Test; import com.abiquo.model.rest.RESTLink; import com.abiquo.server.core.infrastructure.DatacentersDto; import com.google.common.collect.ImmutableList; -import org.jclouds.reflect.Invokable; +import com.google.common.reflect.Invokable; /** * Tests annotation parsing of {@code AbiquoHttpAsyncApi}. diff --git a/labs/google-compute/src/main/java/org/jclouds/googlecompute/config/OAuthModuleWithoutTypeAdapters.java b/labs/google-compute/src/main/java/org/jclouds/googlecompute/config/OAuthModuleWithoutTypeAdapters.java index c611e35b18..3c680221b8 100644 --- a/labs/google-compute/src/main/java/org/jclouds/googlecompute/config/OAuthModuleWithoutTypeAdapters.java +++ b/labs/google-compute/src/main/java/org/jclouds/googlecompute/config/OAuthModuleWithoutTypeAdapters.java @@ -45,7 +45,7 @@ public class OAuthModuleWithoutTypeAdapters extends OAuthModule { protected void configure() { bind(new TypeLiteral>() {}).to(SignOrProduceMacForToken.class); bind(new TypeLiteral>() {}).to(OAuthCredentialsSupplier.class); - bind(new TypeLiteral>() {}).to(BuildTokenRequest.class); + bind(new TypeLiteral, TokenRequest>>() {}).to(BuildTokenRequest.class); bind(new TypeLiteral>() {}).to(FetchToken.class); } } diff --git a/labs/google-compute/src/main/java/org/jclouds/googlecompute/functions/internal/BaseToPagedIterable.java b/labs/google-compute/src/main/java/org/jclouds/googlecompute/functions/internal/BaseToPagedIterable.java index c57ab52631..adb429838a 100644 --- a/labs/google-compute/src/main/java/org/jclouds/googlecompute/functions/internal/BaseToPagedIterable.java +++ b/labs/google-compute/src/main/java/org/jclouds/googlecompute/functions/internal/BaseToPagedIterable.java @@ -42,7 +42,7 @@ import com.google.common.base.Optional; public abstract class BaseToPagedIterable> implements Function, PagedIterable>, InvocationContext { - private GeneratedHttpRequest request; + private GeneratedHttpRequest request; @Override public PagedIterable apply(ListPage input) { diff --git a/labs/joyent-cloudapi/src/main/java/org/jclouds/joyent/cloudapi/v6_5/config/DatacentersAreZonesModule.java b/labs/joyent-cloudapi/src/main/java/org/jclouds/joyent/cloudapi/v6_5/config/DatacentersAreZonesModule.java index 9cceb2dea1..eafea1abd9 100644 --- a/labs/joyent-cloudapi/src/main/java/org/jclouds/joyent/cloudapi/v6_5/config/DatacentersAreZonesModule.java +++ b/labs/joyent-cloudapi/src/main/java/org/jclouds/joyent/cloudapi/v6_5/config/DatacentersAreZonesModule.java @@ -18,7 +18,7 @@ */ package org.jclouds.joyent.cloudapi.v6_5.config; -import static org.jclouds.rest.config.BinderUtils.bindClientAndAsyncClient; +import static org.jclouds.rest.config.BinderUtils.bindHttpApi; import org.jclouds.joyent.cloudapi.v6_5.features.DatacenterAsyncApi; import org.jclouds.joyent.cloudapi.v6_5.features.DatacenterApi; @@ -41,7 +41,7 @@ public class DatacentersAreZonesModule extends AbstractModule { @Override protected void configure() { // datacenter api is needed for obtaining zone ids - bindClientAndAsyncClient(binder(), DatacenterApi.class, DatacenterAsyncApi.class); + bindHttpApi(binder(), DatacenterApi.class, DatacenterAsyncApi.class); bind(ImplicitLocationSupplier.class).to(OnlyLocationOrFirstZone.class).in(Scopes.SINGLETON); bind(ZoneIdToURISupplier.class).to(ZoneIdToURIFromDatacentersApi.class).in(Scopes.SINGLETON); bind(ZoneIdsSupplier.class).to(ZoneIdsFromZoneIdToURIKeySet.class).in(Scopes.SINGLETON); diff --git a/labs/oauth/src/main/java/org/jclouds/oauth/v2/config/OAuthAuthenticationModule.java b/labs/oauth/src/main/java/org/jclouds/oauth/v2/config/OAuthAuthenticationModule.java index 7deab11b4e..3a8f712bb0 100644 --- a/labs/oauth/src/main/java/org/jclouds/oauth/v2/config/OAuthAuthenticationModule.java +++ b/labs/oauth/src/main/java/org/jclouds/oauth/v2/config/OAuthAuthenticationModule.java @@ -29,7 +29,7 @@ import javax.inject.Named; import javax.inject.Singleton; import java.net.URI; -import static org.jclouds.rest.config.BinderUtils.bindClientAndAsyncClient; +import static org.jclouds.rest.config.BinderUtils.bindHttpApi; /** * An OAuth module to be used form other providers. @@ -40,7 +40,7 @@ public class OAuthAuthenticationModule extends AbstractModule { @Override protected void configure() { - bindClientAndAsyncClient(binder(), OAuthApi.class, OAuthAsyncApi.class); + bindHttpApi(binder(), OAuthApi.class, OAuthAsyncApi.class); } /** diff --git a/labs/oauth/src/main/java/org/jclouds/oauth/v2/config/OAuthModule.java b/labs/oauth/src/main/java/org/jclouds/oauth/v2/config/OAuthModule.java index fc55a87da8..cec728b26a 100644 --- a/labs/oauth/src/main/java/org/jclouds/oauth/v2/config/OAuthModule.java +++ b/labs/oauth/src/main/java/org/jclouds/oauth/v2/config/OAuthModule.java @@ -63,7 +63,7 @@ public class OAuthModule extends AbstractModule { Header.class, new HeaderTypeAdapter(), ClaimSet.class, new ClaimSetTypeAdapter())); bind(new TypeLiteral>() {}).to(OAuthCredentialsSupplier.class); - bind(new TypeLiteral>() {}).to(BuildTokenRequest.class); + bind(new TypeLiteral, TokenRequest>>() {}).to(BuildTokenRequest.class); bind(new TypeLiteral>() {}).to(FetchToken.class); } diff --git a/labs/oauth/src/main/java/org/jclouds/oauth/v2/filters/OAuthAuthenticator.java b/labs/oauth/src/main/java/org/jclouds/oauth/v2/filters/OAuthAuthenticator.java index 22ba6390fd..cb51291d51 100644 --- a/labs/oauth/src/main/java/org/jclouds/oauth/v2/filters/OAuthAuthenticator.java +++ b/labs/oauth/src/main/java/org/jclouds/oauth/v2/filters/OAuthAuthenticator.java @@ -42,11 +42,11 @@ import static com.google.common.base.Preconditions.checkState; @Singleton public class OAuthAuthenticator implements HttpRequestFilter { - private Function tokenRequestBuilder; + private Function, TokenRequest> tokenRequestBuilder; private Function tokenFetcher; @Inject - OAuthAuthenticator(Function tokenRequestBuilder, LoadingCache, TokenRequest> tokenRequestBuilder, LoadingCache tokenFetcher) { this.tokenRequestBuilder = tokenRequestBuilder; this.tokenFetcher = tokenFetcher; @@ -55,7 +55,7 @@ public class OAuthAuthenticator implements HttpRequestFilter { @Override public HttpRequest filter(HttpRequest request) throws HttpException { checkState(request instanceof GeneratedHttpRequest, "request must be an instance of GeneratedHttpRequest"); - GeneratedHttpRequest generatedHttpRequest = (GeneratedHttpRequest) request; + GeneratedHttpRequest generatedHttpRequest = GeneratedHttpRequest.class.cast(request); TokenRequest tokenRequest = tokenRequestBuilder.apply(generatedHttpRequest); Token token = tokenFetcher.apply(tokenRequest); return request.toBuilder().addHeader("Authorization", String.format("%s %s", diff --git a/labs/oauth/src/main/java/org/jclouds/oauth/v2/functions/BuildTokenRequest.java b/labs/oauth/src/main/java/org/jclouds/oauth/v2/functions/BuildTokenRequest.java index 53e582312a..37827a5a57 100644 --- a/labs/oauth/src/main/java/org/jclouds/oauth/v2/functions/BuildTokenRequest.java +++ b/labs/oauth/src/main/java/org/jclouds/oauth/v2/functions/BuildTokenRequest.java @@ -43,7 +43,7 @@ import com.google.common.base.Joiner; import com.google.common.base.Supplier; import com.google.common.base.Ticker; import com.google.common.collect.ImmutableMap; -import org.jclouds.reflect.Invokable; +import com.google.common.reflect.Invokable; import com.google.inject.Inject; import com.google.inject.name.Named; @@ -57,7 +57,7 @@ import com.google.inject.name.Named; * @author David Alves */ @Singleton -public class BuildTokenRequest implements Function { +public class BuildTokenRequest implements Function, TokenRequest> { private final String assertionTargetDescription; private final String signatureAlgorithm; @@ -90,7 +90,7 @@ public class BuildTokenRequest implements Function request) { long now = TimeUnit.SECONDS.convert(ticker.read(), TimeUnit.NANOSECONDS); // fetch the token @@ -114,11 +114,10 @@ public class BuildTokenRequest implements Function request) { Invokable invokable = request.getInvocation().getInvokable(); - Class interfaceType = invokable.getEnclosingType().getRawType(); - OAuthScopes classScopes = interfaceType.getAnnotation(OAuthScopes.class); + OAuthScopes classScopes = request.getEnclosingType().getRawType().getAnnotation(OAuthScopes.class); OAuthScopes methodScopes = invokable.getAnnotation(OAuthScopes.class); // if no annotations are present the rely on globally set scopes @@ -126,7 +125,7 @@ public class BuildTokenRequest implements Function listOrgs(); /** @@ -74,5 +80,6 @@ public interface VPDCApi { * @return the operating systems that are predefined in the provider * @see */ + @Provides Set listPredefinedOperatingSystems(); } diff --git a/labs/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/config/VPDCRestClientModule.java b/labs/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/config/VPDCRestClientModule.java index e25522e6b2..25b3c10a57 100644 --- a/labs/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/config/VPDCRestClientModule.java +++ b/labs/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/config/VPDCRestClientModule.java @@ -21,7 +21,7 @@ package org.jclouds.savvis.vpdc.config; import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Preconditions.checkState; import static org.jclouds.Constants.PROPERTY_SESSION_INTERVAL; -import static org.jclouds.rest.config.BinderUtils.bindClientAndAsyncClient; +import static org.jclouds.rest.config.BinderUtils.bindHttpApi; import static org.jclouds.savvis.vpdc.reference.VPDCConstants.PROPERTY_VPDC_TIMEOUT_TASK_COMPLETED; import java.io.IOException; @@ -86,7 +86,7 @@ public class VPDCRestClientModule extends RestClientModule processor; private final BlobToAzureBlob blobToBlob; private final BlobToHttpGetOptions blob2HttpGetOptions; @@ -54,17 +53,17 @@ public class AzureBlobRequestSigner implements BlobRequestSigner { private final Invokable createMethod; @Inject - public AzureBlobRequestSigner(RestAnnotationProcessor processor, BlobToAzureBlob blobToBlob, + public AzureBlobRequestSigner(RestAnnotationProcessor processor, BlobToAzureBlob blobToBlob, BlobToHttpGetOptions blob2HttpGetOptions) throws SecurityException, NoSuchMethodException { this.processor = checkNotNull(processor, "processor"); this.blobToBlob = checkNotNull(blobToBlob, "blobToBlob"); this.blob2HttpGetOptions = checkNotNull(blob2HttpGetOptions, "blob2HttpGetOptions"); - this.getMethod = Invokable.from(TypeToken.of(AzureBlobAsyncClient.class), - AzureBlobAsyncClient.class.getMethod("getBlob", String.class, String.class, GetOptions[].class)); - this.deleteMethod = Invokable.from(TypeToken.of(AzureBlobAsyncClient.class), - AzureBlobAsyncClient.class.getMethod("deleteBlob", String.class, String.class)); - this.createMethod = Invokable.from(TypeToken.of(AzureBlobAsyncClient.class), - AzureBlobAsyncClient.class.getMethod("putBlob", String.class, AzureBlob.class)); + this.getMethod = Invokable.from(AzureBlobAsyncClient.class.getMethod("getBlob", String.class, String.class, + GetOptions[].class)); + this.deleteMethod = Invokable + .from(AzureBlobAsyncClient.class.getMethod("deleteBlob", String.class, String.class)); + this.createMethod = Invokable + .from(AzureBlobAsyncClient.class.getMethod("putBlob", String.class, AzureBlob.class)); } @Override diff --git a/providers/azureblob/src/test/java/org/jclouds/azureblob/AzureBlobAsyncClientTest.java b/providers/azureblob/src/test/java/org/jclouds/azureblob/AzureBlobAsyncClientTest.java index 83696e8a38..4327090d90 100644 --- a/providers/azureblob/src/test/java/org/jclouds/azureblob/AzureBlobAsyncClientTest.java +++ b/providers/azureblob/src/test/java/org/jclouds/azureblob/AzureBlobAsyncClientTest.java @@ -45,7 +45,7 @@ import org.jclouds.http.functions.ParseSax; import org.jclouds.http.functions.ReleasePayloadAndReturn; import org.jclouds.http.functions.ReturnTrueIf2xx; import org.jclouds.http.options.GetOptions; -import org.jclouds.reflect.Invokable; +import com.google.common.reflect.Invokable; import org.jclouds.rest.internal.BaseAsyncClientTest; import org.jclouds.rest.internal.GeneratedHttpRequest; import org.testng.annotations.Test; diff --git a/providers/gogrid/src/test/java/org/jclouds/gogrid/services/GridImageAsyncClientTest.java b/providers/gogrid/src/test/java/org/jclouds/gogrid/services/GridImageAsyncClientTest.java index 526f7d97a9..dcc80dc49e 100644 --- a/providers/gogrid/src/test/java/org/jclouds/gogrid/services/GridImageAsyncClientTest.java +++ b/providers/gogrid/src/test/java/org/jclouds/gogrid/services/GridImageAsyncClientTest.java @@ -27,7 +27,7 @@ import org.jclouds.gogrid.functions.ParseImageFromJsonResponse; import org.jclouds.gogrid.functions.ParseImageListFromJsonResponse; import org.jclouds.gogrid.options.GetImageListOptions; import org.jclouds.gogrid.options.SaveImageOptions; -import org.jclouds.reflect.Invokable; +import com.google.common.reflect.Invokable; import org.jclouds.rest.internal.GeneratedHttpRequest; import org.testng.annotations.Test; diff --git a/providers/gogrid/src/test/java/org/jclouds/gogrid/services/GridIpAsyncClientTest.java b/providers/gogrid/src/test/java/org/jclouds/gogrid/services/GridIpAsyncClientTest.java index b2559d666e..3791023a30 100644 --- a/providers/gogrid/src/test/java/org/jclouds/gogrid/services/GridIpAsyncClientTest.java +++ b/providers/gogrid/src/test/java/org/jclouds/gogrid/services/GridIpAsyncClientTest.java @@ -23,7 +23,7 @@ import java.io.IOException; import org.jclouds.gogrid.domain.IpType; import org.jclouds.gogrid.functions.ParseIpListFromJsonResponse; import org.jclouds.gogrid.options.GetIpListOptions; -import org.jclouds.reflect.Invokable; +import com.google.common.reflect.Invokable; import org.jclouds.rest.internal.GeneratedHttpRequest; import org.testng.annotations.Test; diff --git a/providers/gogrid/src/test/java/org/jclouds/gogrid/services/GridJobAsyncClientTest.java b/providers/gogrid/src/test/java/org/jclouds/gogrid/services/GridJobAsyncClientTest.java index b156ec1cf4..a05004417e 100644 --- a/providers/gogrid/src/test/java/org/jclouds/gogrid/services/GridJobAsyncClientTest.java +++ b/providers/gogrid/src/test/java/org/jclouds/gogrid/services/GridJobAsyncClientTest.java @@ -27,7 +27,7 @@ import org.jclouds.gogrid.domain.JobState; import org.jclouds.gogrid.domain.ObjectType; import org.jclouds.gogrid.functions.ParseJobListFromJsonResponse; import org.jclouds.gogrid.options.GetJobListOptions; -import org.jclouds.reflect.Invokable; +import com.google.common.reflect.Invokable; import org.jclouds.rest.internal.GeneratedHttpRequest; import org.testng.annotations.Test; diff --git a/providers/gogrid/src/test/java/org/jclouds/gogrid/services/GridLoadBalancerAsyncClientTest.java b/providers/gogrid/src/test/java/org/jclouds/gogrid/services/GridLoadBalancerAsyncClientTest.java index f097411348..25c2d012f8 100644 --- a/providers/gogrid/src/test/java/org/jclouds/gogrid/services/GridLoadBalancerAsyncClientTest.java +++ b/providers/gogrid/src/test/java/org/jclouds/gogrid/services/GridLoadBalancerAsyncClientTest.java @@ -29,7 +29,7 @@ import org.jclouds.gogrid.functions.ParseLoadBalancerFromJsonResponse; import org.jclouds.gogrid.functions.ParseLoadBalancerListFromJsonResponse; import org.jclouds.gogrid.options.AddLoadBalancerOptions; import org.jclouds.http.HttpRequest; -import org.jclouds.reflect.Invokable; +import com.google.common.reflect.Invokable; import org.jclouds.rest.internal.GeneratedHttpRequest; import org.testng.annotations.Test; diff --git a/providers/gogrid/src/test/java/org/jclouds/gogrid/services/GridServerAsyncClientTest.java b/providers/gogrid/src/test/java/org/jclouds/gogrid/services/GridServerAsyncClientTest.java index f7a2bae531..ad6dc2a57c 100644 --- a/providers/gogrid/src/test/java/org/jclouds/gogrid/services/GridServerAsyncClientTest.java +++ b/providers/gogrid/src/test/java/org/jclouds/gogrid/services/GridServerAsyncClientTest.java @@ -26,7 +26,7 @@ import org.jclouds.gogrid.domain.PowerCommand; import org.jclouds.gogrid.functions.ParseCredentialsFromJsonResponse; import org.jclouds.gogrid.functions.ParseOptionsFromJsonResponse; import org.jclouds.gogrid.options.GetServerListOptions; -import org.jclouds.reflect.Invokable; +import com.google.common.reflect.Invokable; import org.jclouds.rest.internal.GeneratedHttpRequest; import org.testng.annotations.Test; diff --git a/providers/hpcloud-objectstorage/src/main/java/org/jclouds/hpcloud/objectstorage/HPCloudObjectStorageApiMetadata.java b/providers/hpcloud-objectstorage/src/main/java/org/jclouds/hpcloud/objectstorage/HPCloudObjectStorageApiMetadata.java index ef6f03bf40..ac028f59ed 100644 --- a/providers/hpcloud-objectstorage/src/main/java/org/jclouds/hpcloud/objectstorage/HPCloudObjectStorageApiMetadata.java +++ b/providers/hpcloud-objectstorage/src/main/java/org/jclouds/hpcloud/objectstorage/HPCloudObjectStorageApiMetadata.java @@ -18,7 +18,7 @@ */ package org.jclouds.hpcloud.objectstorage; -import static org.jclouds.rest.config.BinderUtils.bindClientAndAsyncClient; +import static org.jclouds.rest.config.BinderUtils.bindHttpApi; import java.net.URI; import java.util.Properties; @@ -107,7 +107,7 @@ public class HPCloudObjectStorageApiMetadata extends SwiftKeystoneApiMetadata { } @Override protected void bindTemporaryUrlKeyApi() { - bindClientAndAsyncClient(binder(), TemporaryUrlKeyApi.class, KeystoneTemporaryUrlKeyAsyncApi.class); + bindHttpApi(binder(), TemporaryUrlKeyApi.class, KeystoneTemporaryUrlKeyAsyncApi.class); } } } diff --git a/providers/hpcloud-objectstorage/src/main/java/org/jclouds/hpcloud/objectstorage/blobstore/HPCloudObjectStorageBlobRequestSigner.java b/providers/hpcloud-objectstorage/src/main/java/org/jclouds/hpcloud/objectstorage/blobstore/HPCloudObjectStorageBlobRequestSigner.java index 2b3b7453e1..3a142b2aa3 100644 --- a/providers/hpcloud-objectstorage/src/main/java/org/jclouds/hpcloud/objectstorage/blobstore/HPCloudObjectStorageBlobRequestSigner.java +++ b/providers/hpcloud-objectstorage/src/main/java/org/jclouds/hpcloud/objectstorage/blobstore/HPCloudObjectStorageBlobRequestSigner.java @@ -50,7 +50,6 @@ import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest; import org.jclouds.openstack.swift.blobstore.functions.BlobToObject; import org.jclouds.openstack.swift.domain.SwiftObject; import org.jclouds.reflect.Invocation; -import org.jclouds.reflect.Invokable; import org.jclouds.rest.annotations.Credential; import org.jclouds.rest.annotations.Identity; import org.jclouds.rest.internal.GeneratedHttpRequest; @@ -60,7 +59,7 @@ import com.google.common.base.Supplier; import com.google.common.base.Throwables; import com.google.common.collect.ImmutableList; import com.google.common.io.ByteProcessor; -import com.google.common.reflect.TypeToken; +import com.google.common.reflect.Invokable; import com.google.inject.Provider; /** @@ -71,7 +70,7 @@ import com.google.inject.Provider; @Singleton public class HPCloudObjectStorageBlobRequestSigner implements BlobRequestSigner { - private final RestAnnotationProcessor processor; + private final RestAnnotationProcessor processor; private final Crypto crypto; private final Provider unixEpochTimestampProvider; @@ -88,10 +87,10 @@ public class HPCloudObjectStorageBlobRequestSigner implements BlobRequestSigner private final Invokable createMethod; @Inject - public HPCloudObjectStorageBlobRequestSigner(RestAnnotationProcessor processor, BlobToObject blobToObject, - BlobToHttpGetOptions blob2HttpGetOptions, Crypto crypto, @TimeStamp Provider unixEpochTimestampProvider, - Supplier access, @Identity String accessKey, @Credential String secretKey) throws SecurityException, - NoSuchMethodException { + public HPCloudObjectStorageBlobRequestSigner(RestAnnotationProcessor processor, + BlobToObject blobToObject, BlobToHttpGetOptions blob2HttpGetOptions, Crypto crypto, + @TimeStamp Provider unixEpochTimestampProvider, Supplier access, @Identity String accessKey, + @Credential String secretKey) throws SecurityException, NoSuchMethodException { this.processor = checkNotNull(processor, "processor"); this.crypto = checkNotNull(crypto, "crypto"); @@ -104,12 +103,12 @@ public class HPCloudObjectStorageBlobRequestSigner implements BlobRequestSigner this.blobToObject = checkNotNull(blobToObject, "blobToObject"); this.blob2HttpGetOptions = checkNotNull(blob2HttpGetOptions, "blob2HttpGetOptions"); - this.getMethod = Invokable.from(TypeToken.of(HPCloudObjectStorageAsyncApi.class), - HPCloudObjectStorageAsyncApi.class.getMethod("getObject", String.class, String.class, GetOptions[].class)); - this.deleteMethod = Invokable.from(TypeToken.of(HPCloudObjectStorageAsyncApi.class), - HPCloudObjectStorageAsyncApi.class.getMethod("removeObject", String.class, String.class)); - this.createMethod = Invokable.from(TypeToken.of(HPCloudObjectStorageAsyncApi.class), - HPCloudObjectStorageAsyncApi.class.getMethod("putObject", String.class, SwiftObject.class)); + this.getMethod = Invokable.from(HPCloudObjectStorageAsyncApi.class.getMethod("getObject", String.class, + String.class, GetOptions[].class)); + this.deleteMethod = Invokable.from(HPCloudObjectStorageAsyncApi.class.getMethod("removeObject", String.class, + String.class)); + this.createMethod = Invokable.from(HPCloudObjectStorageAsyncApi.class.getMethod("putObject", String.class, + SwiftObject.class)); } @PostConstruct @@ -129,7 +128,8 @@ public class HPCloudObjectStorageBlobRequestSigner implements BlobRequestSigner public HttpRequest signGetBlob(String container, String name, long timeInSeconds) { checkNotNull(container, "container"); checkNotNull(name, "name"); - GeneratedHttpRequest request = processor.apply(Invocation.create(getMethod, ImmutableList. of(container, name))); + GeneratedHttpRequest request = processor.apply(Invocation.create(getMethod, + ImmutableList. of(container, name))); return cleanRequest(signForTemporaryAccess(request, timeInSeconds)); } @@ -153,7 +153,7 @@ public class HPCloudObjectStorageBlobRequestSigner implements BlobRequestSigner public HttpRequest signPutBlob(String container, Blob blob, long timeInSeconds) { checkNotNull(container, "container"); checkNotNull(blob, "blob"); - GeneratedHttpRequest request = processor.apply(Invocation.create(createMethod, + GeneratedHttpRequest request = processor.apply(Invocation.create(createMethod, ImmutableList. of(container, blobToObject.apply(blob)))); return cleanRequest(signForTemporaryAccess(request, timeInSeconds)); } diff --git a/providers/softlayer/src/test/java/org/jclouds/softlayer/features/AccountAsyncClientTest.java b/providers/softlayer/src/test/java/org/jclouds/softlayer/features/AccountAsyncClientTest.java index e6cc9e2660..93fe09e067 100644 --- a/providers/softlayer/src/test/java/org/jclouds/softlayer/features/AccountAsyncClientTest.java +++ b/providers/softlayer/src/test/java/org/jclouds/softlayer/features/AccountAsyncClientTest.java @@ -22,7 +22,7 @@ import java.io.IOException; import org.jclouds.Fallbacks.NullOnNotFoundOr404; import org.jclouds.http.functions.ParseJson; -import org.jclouds.reflect.Invokable; +import com.google.common.reflect.Invokable; import org.jclouds.rest.internal.GeneratedHttpRequest; import org.testng.annotations.Test; diff --git a/providers/softlayer/src/test/java/org/jclouds/softlayer/features/DatacenterAsyncClientTest.java b/providers/softlayer/src/test/java/org/jclouds/softlayer/features/DatacenterAsyncClientTest.java index fdfe028137..99a054ad0a 100644 --- a/providers/softlayer/src/test/java/org/jclouds/softlayer/features/DatacenterAsyncClientTest.java +++ b/providers/softlayer/src/test/java/org/jclouds/softlayer/features/DatacenterAsyncClientTest.java @@ -23,7 +23,7 @@ import java.io.IOException; import org.jclouds.Fallbacks.EmptySetOnNotFoundOr404; import org.jclouds.Fallbacks.NullOnNotFoundOr404; import org.jclouds.http.functions.ParseJson; -import org.jclouds.reflect.Invokable; +import com.google.common.reflect.Invokable; import org.jclouds.rest.internal.GeneratedHttpRequest; import org.testng.annotations.Test; diff --git a/providers/softlayer/src/test/java/org/jclouds/softlayer/features/ProductPackageAsyncClientTest.java b/providers/softlayer/src/test/java/org/jclouds/softlayer/features/ProductPackageAsyncClientTest.java index f4b3c2e331..2bb6307b53 100644 --- a/providers/softlayer/src/test/java/org/jclouds/softlayer/features/ProductPackageAsyncClientTest.java +++ b/providers/softlayer/src/test/java/org/jclouds/softlayer/features/ProductPackageAsyncClientTest.java @@ -22,7 +22,7 @@ import java.io.IOException; import org.jclouds.Fallbacks.NullOnNotFoundOr404; import org.jclouds.http.functions.ParseJson; -import org.jclouds.reflect.Invokable; +import com.google.common.reflect.Invokable; import org.jclouds.rest.internal.GeneratedHttpRequest; import org.testng.annotations.Test; diff --git a/providers/softlayer/src/test/java/org/jclouds/softlayer/features/VirtualGuestAsyncClientTest.java b/providers/softlayer/src/test/java/org/jclouds/softlayer/features/VirtualGuestAsyncClientTest.java index 36e22d9290..222f8a62b9 100644 --- a/providers/softlayer/src/test/java/org/jclouds/softlayer/features/VirtualGuestAsyncClientTest.java +++ b/providers/softlayer/src/test/java/org/jclouds/softlayer/features/VirtualGuestAsyncClientTest.java @@ -25,7 +25,7 @@ import org.jclouds.Fallbacks.NullOnNotFoundOr404; import org.jclouds.Fallbacks.VoidOnNotFoundOr404; import org.jclouds.http.functions.ParseJson; import org.jclouds.http.functions.ReleasePayloadAndReturn; -import org.jclouds.reflect.Invokable; +import com.google.common.reflect.Invokable; import org.jclouds.rest.internal.GeneratedHttpRequest; import org.testng.annotations.Test; diff --git a/providers/trmk-ecloud/src/test/java/org/jclouds/trmk/ecloud/TerremarkECloudAsyncClientTest.java b/providers/trmk-ecloud/src/test/java/org/jclouds/trmk/ecloud/TerremarkECloudAsyncClientTest.java index e368de2780..76e1b5ff27 100644 --- a/providers/trmk-ecloud/src/test/java/org/jclouds/trmk/ecloud/TerremarkECloudAsyncClientTest.java +++ b/providers/trmk-ecloud/src/test/java/org/jclouds/trmk/ecloud/TerremarkECloudAsyncClientTest.java @@ -29,7 +29,7 @@ import org.jclouds.Fallbacks.NullOnNotFoundOr404; import org.jclouds.Fallbacks.VoidOnNotFoundOr404; import org.jclouds.http.functions.ParseSax; import org.jclouds.http.functions.ReleasePayloadAndReturn; -import org.jclouds.reflect.Invokable; +import com.google.common.reflect.Invokable; import org.jclouds.rest.ResourceNotFoundException; import org.jclouds.rest.internal.GeneratedHttpRequest; import org.jclouds.trmk.vcloud_0_8.domain.Protocol; diff --git a/providers/trmk-ecloud/src/test/java/org/jclouds/trmk/ecloud/features/DataCenterOperationsAsyncClientTest.java b/providers/trmk-ecloud/src/test/java/org/jclouds/trmk/ecloud/features/DataCenterOperationsAsyncClientTest.java index 73b97c776f..fae8cd6d6a 100644 --- a/providers/trmk-ecloud/src/test/java/org/jclouds/trmk/ecloud/features/DataCenterOperationsAsyncClientTest.java +++ b/providers/trmk-ecloud/src/test/java/org/jclouds/trmk/ecloud/features/DataCenterOperationsAsyncClientTest.java @@ -23,7 +23,7 @@ import java.net.URI; import org.jclouds.Fallbacks.EmptySetOnNotFoundOr404; import org.jclouds.http.functions.ParseSax; -import org.jclouds.reflect.Invokable; +import com.google.common.reflect.Invokable; import org.jclouds.rest.internal.GeneratedHttpRequest; import org.jclouds.trmk.ecloud.BaseTerremarkECloudAsyncClientTest; import org.jclouds.trmk.vcloud_0_8.xml.DataCentersHandler; diff --git a/providers/trmk-ecloud/src/test/java/org/jclouds/trmk/ecloud/features/TagOperationsAsyncClientTest.java b/providers/trmk-ecloud/src/test/java/org/jclouds/trmk/ecloud/features/TagOperationsAsyncClientTest.java index c52fd41ea5..fe7c3c4bc8 100644 --- a/providers/trmk-ecloud/src/test/java/org/jclouds/trmk/ecloud/features/TagOperationsAsyncClientTest.java +++ b/providers/trmk-ecloud/src/test/java/org/jclouds/trmk/ecloud/features/TagOperationsAsyncClientTest.java @@ -23,7 +23,7 @@ import java.net.URI; import org.jclouds.Fallbacks.EmptyMapOnNotFoundOr404; import org.jclouds.http.functions.ParseSax; -import org.jclouds.reflect.Invokable; +import com.google.common.reflect.Invokable; import org.jclouds.rest.internal.GeneratedHttpRequest; import org.jclouds.trmk.ecloud.BaseTerremarkECloudAsyncClientTest; import org.jclouds.trmk.ecloud.xml.TagNameToUsageCountHandler; diff --git a/providers/trmk-vcloudexpress/src/test/java/org/jclouds/trmk/vcloudexpress/TerremarkVCloudExpressAsyncClientTest.java b/providers/trmk-vcloudexpress/src/test/java/org/jclouds/trmk/vcloudexpress/TerremarkVCloudExpressAsyncClientTest.java index 3829a96f79..f1c8b02e9e 100644 --- a/providers/trmk-vcloudexpress/src/test/java/org/jclouds/trmk/vcloudexpress/TerremarkVCloudExpressAsyncClientTest.java +++ b/providers/trmk-vcloudexpress/src/test/java/org/jclouds/trmk/vcloudexpress/TerremarkVCloudExpressAsyncClientTest.java @@ -43,7 +43,7 @@ import org.jclouds.http.HttpRequest; import org.jclouds.http.functions.ParseSax; import org.jclouds.http.functions.ReleasePayloadAndReturn; import org.jclouds.providers.ProviderMetadata; -import org.jclouds.reflect.Invokable; +import com.google.common.reflect.Invokable; import org.jclouds.rest.AuthorizationException; import org.jclouds.rest.ConfiguresRestClient; import org.jclouds.rest.ResourceNotFoundException;