diff --git a/apis/atmos/src/main/java/org/jclouds/atmos/AtmosApiMetadata.java b/apis/atmos/src/main/java/org/jclouds/atmos/AtmosApiMetadata.java index 0cab440b52..8cdc9e5f45 100644 --- a/apis/atmos/src/main/java/org/jclouds/atmos/AtmosApiMetadata.java +++ b/apis/atmos/src/main/java/org/jclouds/atmos/AtmosApiMetadata.java @@ -28,7 +28,6 @@ import org.jclouds.apis.ApiMetadata; import org.jclouds.atmos.blobstore.config.AtmosBlobStoreContextModule; import org.jclouds.atmos.config.AtmosRestClientModule; import org.jclouds.blobstore.BlobStoreContext; -import org.jclouds.rest.RestContext; import org.jclouds.rest.internal.BaseRestApiMetadata; import com.google.common.collect.ImmutableSet; @@ -42,7 +41,12 @@ import com.google.inject.Module; */ public class AtmosApiMetadata extends BaseRestApiMetadata { - public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { + /** + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(AtmosClient.class)} as + * {@link AtmosAsyncClient} interface will be removed in jclouds 1.7. + */ + @Deprecated + public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { private static final long serialVersionUID = 1L; }; @@ -71,6 +75,7 @@ public class AtmosApiMetadata extends BaseRestApiMetadata { } public static class Builder extends BaseRestApiMetadata.Builder { + @SuppressWarnings("deprecation") protected Builder() { super(AtmosClient.class, AtmosAsyncClient.class); id("atmos") diff --git a/apis/atmos/src/main/java/org/jclouds/atmos/AtmosAsyncClient.java b/apis/atmos/src/main/java/org/jclouds/atmos/AtmosAsyncClient.java index 6436c7a92a..62ce574570 100644 --- a/apis/atmos/src/main/java/org/jclouds/atmos/AtmosAsyncClient.java +++ b/apis/atmos/src/main/java/org/jclouds/atmos/AtmosAsyncClient.java @@ -75,7 +75,11 @@ import com.google.inject.Provides; * @see AtmosClient * @see * @author Adrian Cole + * + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(AtmosClient.class)} as + * {@link AtmosAsyncClient} interface will be removed in jclouds 1.7. */ +@Deprecated @RequestFilters(SignRequest.class) @Path("/rest/namespace") public interface AtmosAsyncClient extends Closeable { diff --git a/apis/cloudfiles/src/main/java/org/jclouds/cloudfiles/CloudFilesApiMetadata.java b/apis/cloudfiles/src/main/java/org/jclouds/cloudfiles/CloudFilesApiMetadata.java index 6f92156004..c35b3e0ac3 100644 --- a/apis/cloudfiles/src/main/java/org/jclouds/cloudfiles/CloudFilesApiMetadata.java +++ b/apis/cloudfiles/src/main/java/org/jclouds/cloudfiles/CloudFilesApiMetadata.java @@ -29,7 +29,6 @@ import org.jclouds.cloudfiles.config.CloudFilesRestClientModule.StorageAndCDNMan import org.jclouds.openstack.swift.SwiftApiMetadata; import org.jclouds.openstack.swift.blobstore.SwiftBlobSigner; import org.jclouds.openstack.swift.blobstore.config.TemporaryUrlExtensionModule; -import org.jclouds.rest.RestContext; import com.google.common.collect.ImmutableSet; import com.google.common.reflect.TypeToken; @@ -43,7 +42,12 @@ import com.google.inject.TypeLiteral; */ public class CloudFilesApiMetadata extends SwiftApiMetadata { - public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { + /** + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(CloudFilesClient.class)} as + * {@link CloudFilesAsyncClient} interface will be removed in jclouds 1.7. + */ + @Deprecated + public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { private static final long serialVersionUID = 1L; }; @@ -66,6 +70,7 @@ public class CloudFilesApiMetadata extends SwiftApiMetadata { } public static class Builder extends SwiftApiMetadata.Builder { + @SuppressWarnings("deprecation") protected Builder(){ super(CloudFilesClient.class, CloudFilesAsyncClient.class); id("cloudfiles") diff --git a/apis/cloudfiles/src/main/java/org/jclouds/cloudfiles/CloudFilesAsyncClient.java b/apis/cloudfiles/src/main/java/org/jclouds/cloudfiles/CloudFilesAsyncClient.java index c9cf47fe3b..ba73846789 100644 --- a/apis/cloudfiles/src/main/java/org/jclouds/cloudfiles/CloudFilesAsyncClient.java +++ b/apis/cloudfiles/src/main/java/org/jclouds/cloudfiles/CloudFilesAsyncClient.java @@ -64,7 +64,10 @@ import com.google.common.util.concurrent.ListenableFuture; * @see CloudFilesClient * @see * @author Adrian Cole + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(CloudFilesClient.class)} as + * {@link CloudFilesAsyncClient} interface will be removed in jclouds 1.7. */ +@Deprecated @RequestFilters(AuthenticateRequest.class) @Endpoint(Storage.class) public interface CloudFilesAsyncClient extends SwiftAsyncClient { diff --git a/apis/cloudservers/src/main/java/org/jclouds/cloudservers/CloudServersApiMetadata.java b/apis/cloudservers/src/main/java/org/jclouds/cloudservers/CloudServersApiMetadata.java index 6c93fdb6f8..f81cd37316 100644 --- a/apis/cloudservers/src/main/java/org/jclouds/cloudservers/CloudServersApiMetadata.java +++ b/apis/cloudservers/src/main/java/org/jclouds/cloudservers/CloudServersApiMetadata.java @@ -27,7 +27,6 @@ import org.jclouds.apis.ApiMetadata; import org.jclouds.cloudservers.compute.config.CloudServersComputeServiceContextModule; import org.jclouds.cloudservers.config.CloudServersRestClientModule; import org.jclouds.compute.ComputeServiceContext; -import org.jclouds.rest.RestContext; import org.jclouds.rest.internal.BaseRestApiMetadata; import com.google.common.collect.ImmutableSet; @@ -41,7 +40,12 @@ import com.google.inject.Module; */ public class CloudServersApiMetadata extends BaseRestApiMetadata { - public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { + /** + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(CloudServersClient.class)} as + * {@link CloudServersAsyncClient} interface will be removed in jclouds 1.7. + */ + @Deprecated + public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { private static final long serialVersionUID = 1L; }; @@ -65,6 +69,7 @@ public class CloudServersApiMetadata extends BaseRestApiMetadata { public static class Builder extends BaseRestApiMetadata.Builder { + @SuppressWarnings("deprecation") protected Builder() { super(CloudServersClient.class, CloudServersAsyncClient.class); id("cloudservers") diff --git a/apis/cloudservers/src/main/java/org/jclouds/cloudservers/CloudServersAsyncClient.java b/apis/cloudservers/src/main/java/org/jclouds/cloudservers/CloudServersAsyncClient.java index 742a9fa67d..7042ebd735 100644 --- a/apis/cloudservers/src/main/java/org/jclouds/cloudservers/CloudServersAsyncClient.java +++ b/apis/cloudservers/src/main/java/org/jclouds/cloudservers/CloudServersAsyncClient.java @@ -74,7 +74,10 @@ import com.google.common.util.concurrent.ListenableFuture; * @see CloudServersClient * @see * @author Adrian Cole + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(CloudServersClient.class)} as + * {@link CloudServersAsyncClient} interface will be removed in jclouds 1.7. */ +@Deprecated @RequestFilters({ AuthenticateRequest.class, AddTimestampQuery.class }) @Endpoint(Compute.class) public interface CloudServersAsyncClient extends Closeable { diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/CloudSigmaApiMetadata.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/CloudSigmaApiMetadata.java index b4eb5d82ad..c3e5c13f87 100644 --- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/CloudSigmaApiMetadata.java +++ b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/CloudSigmaApiMetadata.java @@ -28,7 +28,6 @@ import org.jclouds.apis.ApiMetadata; import org.jclouds.cloudsigma.compute.config.CloudSigmaComputeServiceContextModule; import org.jclouds.cloudsigma.config.CloudSigmaRestClientModule; import org.jclouds.compute.ComputeServiceContext; -import org.jclouds.rest.RestContext; import org.jclouds.rest.internal.BaseRestApiMetadata; import com.google.common.collect.ImmutableSet; @@ -42,7 +41,12 @@ import com.google.inject.Module; */ public class CloudSigmaApiMetadata extends BaseRestApiMetadata { - public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { + /** + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(CloudSigmaClient.class)} as + * {@link CloudSigmaAsyncClient} interface will be removed in jclouds 1.7. + */ + @Deprecated + public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { private static final long serialVersionUID = 1L; }; @@ -72,6 +76,7 @@ public class CloudSigmaApiMetadata extends BaseRestApiMetadata { public static class Builder extends BaseRestApiMetadata.Builder { + @SuppressWarnings("deprecation") protected Builder() { super(CloudSigmaClient.class, CloudSigmaAsyncClient.class); id("cloudsigma") diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/CloudSigmaAsyncClient.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/CloudSigmaAsyncClient.java index 0d5b0a877f..e52b77057c 100644 --- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/CloudSigmaAsyncClient.java +++ b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/CloudSigmaAsyncClient.java @@ -73,7 +73,10 @@ import com.google.common.util.concurrent.ListenableFuture; * @see CloudSigmaClient * @see * @author Adrian Cole + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(CloudSigmaClient.class)} as + * {@link CloudSigmaAsyncClient} interface will be removed in jclouds 1.7. */ +@Deprecated @RequestFilters(BasicAuthentication.class) @Consumes(MediaType.TEXT_PLAIN) public interface CloudSigmaAsyncClient extends Closeable { diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/CloudStackApiMetadata.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/CloudStackApiMetadata.java index fd543c2afb..d052822f61 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/CloudStackApiMetadata.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/CloudStackApiMetadata.java @@ -26,7 +26,6 @@ import org.jclouds.apis.ApiMetadata; import org.jclouds.cloudstack.compute.config.CloudStackComputeServiceContextModule; import org.jclouds.cloudstack.config.CloudStackParserModule; import org.jclouds.cloudstack.config.CloudStackRestClientModule; -import org.jclouds.rest.RestContext; import org.jclouds.rest.internal.BaseRestApiMetadata; import com.google.common.collect.ImmutableSet; @@ -39,7 +38,12 @@ import com.google.inject.Module; */ public class CloudStackApiMetadata extends BaseRestApiMetadata { - public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { + /** + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(CloudStackClient.class)} as + * {@link CloudStackAsyncClient} interface will be removed in jclouds 1.7. + */ + @Deprecated + public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { private static final long serialVersionUID = 1L; }; @@ -65,6 +69,7 @@ public class CloudStackApiMetadata extends BaseRestApiMetadata { public static class Builder extends BaseRestApiMetadata.Builder { + @SuppressWarnings("deprecation") protected Builder() { super(CloudStackClient.class, CloudStackAsyncClient.class); id("cloudstack") diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/CloudStackAsyncClient.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/CloudStackAsyncClient.java index 0a983f7e41..2d37938a61 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/CloudStackAsyncClient.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/CloudStackAsyncClient.java @@ -50,7 +50,10 @@ import org.jclouds.rest.annotations.Delegate; * @author Adrian Cole * @see CloudStackClient * @see + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(CloudStackClient.class)} as + * {@link CloudStackAsyncClient} interface will be removed in jclouds 1.7. */ +@Deprecated public interface CloudStackAsyncClient { /** diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/CloudStackDomainAsyncClient.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/CloudStackDomainAsyncClient.java index 941ee5515e..bf561269fe 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/CloudStackDomainAsyncClient.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/CloudStackDomainAsyncClient.java @@ -33,7 +33,10 @@ import org.jclouds.rest.annotations.Delegate; * @see + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(CloudStackDomainClient.class)} as + * {@link CloudStackDomainAsyncClient} interface will be removed in jclouds 1.7. */ +@Deprecated public interface CloudStackDomainAsyncClient extends CloudStackAsyncClient { /** diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/CloudStackGlobalAsyncClient.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/CloudStackGlobalAsyncClient.java index 3c7d9a39ba..980e219114 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/CloudStackGlobalAsyncClient.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/CloudStackGlobalAsyncClient.java @@ -38,11 +38,14 @@ import org.jclouds.rest.annotations.Delegate; *

* * @author Adrian Cole - * @see CloudStackDomainClient + * @see CloudStackGlobalClient * @see + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(CloudStackGlobalClient.class)} as + * {@link CloudStackGlobalAsyncClient} interface will be removed in jclouds 1.7. */ +@Deprecated public interface CloudStackGlobalAsyncClient extends CloudStackDomainAsyncClient { /** diff --git a/apis/cloudwatch/src/main/java/org/jclouds/cloudwatch/CloudWatchApiMetadata.java b/apis/cloudwatch/src/main/java/org/jclouds/cloudwatch/CloudWatchApiMetadata.java index 6215411bbf..77495a8767 100644 --- a/apis/cloudwatch/src/main/java/org/jclouds/cloudwatch/CloudWatchApiMetadata.java +++ b/apis/cloudwatch/src/main/java/org/jclouds/cloudwatch/CloudWatchApiMetadata.java @@ -26,7 +26,6 @@ import java.util.Properties; import org.jclouds.apis.ApiMetadata; import org.jclouds.cloudwatch.config.CloudWatchRestClientModule; -import org.jclouds.rest.RestContext; import org.jclouds.rest.internal.BaseRestApiMetadata; import com.google.common.reflect.TypeToken; @@ -38,7 +37,12 @@ import com.google.common.reflect.TypeToken; */ public class CloudWatchApiMetadata extends BaseRestApiMetadata { - public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { + /** + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(CloudWatchApi.class)} as + * {@link CloudWatchAsyncApi} interface will be removed in jclouds 1.7. + */ + @Deprecated + public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { private static final long serialVersionUID = 1L; }; @@ -47,6 +51,7 @@ public class CloudWatchApiMetadata extends BaseRestApiMetadata { return new Builder(getApi(), getAsyncApi()).fromApiMetadata(this); } + @SuppressWarnings("deprecation") public CloudWatchApiMetadata() { this(new Builder(CloudWatchApi.class, CloudWatchAsyncApi.class)); } diff --git a/apis/cloudwatch/src/main/java/org/jclouds/cloudwatch/CloudWatchAsyncApi.java b/apis/cloudwatch/src/main/java/org/jclouds/cloudwatch/CloudWatchAsyncApi.java index b98745132b..eddb4b636e 100644 --- a/apis/cloudwatch/src/main/java/org/jclouds/cloudwatch/CloudWatchAsyncApi.java +++ b/apis/cloudwatch/src/main/java/org/jclouds/cloudwatch/CloudWatchAsyncApi.java @@ -38,7 +38,10 @@ import com.google.inject.Provides; * href="http://docs.amazonwebservices.com/AmazonCloudWatch/latest/APIReference" * /> * @author Adrian Cole + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(CloudWatchApi.class)} as + * {@link CloudWatchAsyncApi} interface will be removed in jclouds 1.7. */ +@Deprecated public interface CloudWatchAsyncApi extends Closeable { /** * diff --git a/apis/ec2/src/main/java/org/jclouds/ec2/EC2ApiMetadata.java b/apis/ec2/src/main/java/org/jclouds/ec2/EC2ApiMetadata.java index f4db47ba8b..826ad24059 100644 --- a/apis/ec2/src/main/java/org/jclouds/ec2/EC2ApiMetadata.java +++ b/apis/ec2/src/main/java/org/jclouds/ec2/EC2ApiMetadata.java @@ -34,7 +34,6 @@ import org.jclouds.ec2.compute.EC2ComputeServiceContext; import org.jclouds.ec2.compute.config.EC2ComputeServiceContextModule; import org.jclouds.ec2.compute.config.EC2ResolveImagesModule; import org.jclouds.ec2.config.EC2RestClientModule; -import org.jclouds.rest.RestContext; import org.jclouds.rest.internal.BaseRestApiMetadata; import com.google.common.collect.ImmutableSet; @@ -59,8 +58,13 @@ import com.google.inject.Module; * @author Adrian Cole */ public class EC2ApiMetadata extends BaseRestApiMetadata { - - public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { + + /** + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(EC2Client.class)} as + * {@link EC2AsyncClient} interface will be removed in jclouds 1.7. + */ + @Deprecated + public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { private static final long serialVersionUID = 1L; }; @@ -90,6 +94,7 @@ public class EC2ApiMetadata extends BaseRestApiMetadata { } public static abstract class Builder> extends BaseRestApiMetadata.Builder { + @SuppressWarnings("deprecation") protected Builder() { this(EC2Client.class, EC2AsyncClient.class); } @@ -102,7 +107,7 @@ public class EC2ApiMetadata extends BaseRestApiMetadata { .credentialName("Secret Access Key") .defaultEndpoint("https://ec2.us-east-1.amazonaws.com") .documentation(URI.create("http://docs.amazonwebservices.com/AWSEC2/latest/APIReference")) - .version(EC2AsyncClient.VERSION) + .version("2010-06-15") .defaultProperties(EC2ApiMetadata.defaultProperties()) .context(CONTEXT_TOKEN) .view(EC2ComputeServiceContext.class) diff --git a/apis/ec2/src/main/java/org/jclouds/ec2/EC2AsyncClient.java b/apis/ec2/src/main/java/org/jclouds/ec2/EC2AsyncClient.java index cd780b54ec..c60614d8e0 100644 --- a/apis/ec2/src/main/java/org/jclouds/ec2/EC2AsyncClient.java +++ b/apis/ec2/src/main/java/org/jclouds/ec2/EC2AsyncClient.java @@ -32,9 +32,11 @@ import org.jclouds.rest.annotations.Delegate; * Provides asynchronous access to EC2 services. * * @author Adrian Cole + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(EC2Client.class)} as + * {@link EC2AsyncClient} interface will be removed in jclouds 1.7. */ +@Deprecated public interface EC2AsyncClient extends EC2AsyncApi { - public static final String VERSION = "2010-06-15"; /** * Provides asynchronous access to AMI services. diff --git a/apis/elasticstack/src/main/java/org/jclouds/elasticstack/ElasticStackApiMetadata.java b/apis/elasticstack/src/main/java/org/jclouds/elasticstack/ElasticStackApiMetadata.java index 6b5565a486..aee1abb631 100644 --- a/apis/elasticstack/src/main/java/org/jclouds/elasticstack/ElasticStackApiMetadata.java +++ b/apis/elasticstack/src/main/java/org/jclouds/elasticstack/ElasticStackApiMetadata.java @@ -28,7 +28,6 @@ import org.jclouds.apis.ApiMetadata; import org.jclouds.compute.ComputeServiceContext; import org.jclouds.elasticstack.compute.config.ElasticStackComputeServiceContextModule; import org.jclouds.elasticstack.config.ElasticStackRestClientModule; -import org.jclouds.rest.RestContext; import org.jclouds.rest.internal.BaseRestApiMetadata; import com.google.common.collect.ImmutableSet; @@ -42,7 +41,12 @@ import com.google.inject.Module; */ public class ElasticStackApiMetadata extends BaseRestApiMetadata { - public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { + /** + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(ElasticStackClient.class)} as + * {@link ElasticStackAsyncClient} interface will be removed in jclouds 1.7. + */ + @Deprecated + public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { private static final long serialVersionUID = 1L; }; @@ -71,6 +75,7 @@ public class ElasticStackApiMetadata extends BaseRestApiMetadata { public static class Builder extends BaseRestApiMetadata.Builder { + @SuppressWarnings("deprecation") protected Builder() { super(ElasticStackClient.class, ElasticStackAsyncClient.class); id("elasticstack") diff --git a/apis/elasticstack/src/main/java/org/jclouds/elasticstack/ElasticStackAsyncClient.java b/apis/elasticstack/src/main/java/org/jclouds/elasticstack/ElasticStackAsyncClient.java index cdda738e9e..684eac6dfd 100644 --- a/apis/elasticstack/src/main/java/org/jclouds/elasticstack/ElasticStackAsyncClient.java +++ b/apis/elasticstack/src/main/java/org/jclouds/elasticstack/ElasticStackAsyncClient.java @@ -62,7 +62,10 @@ import com.google.common.util.concurrent.ListenableFuture; * @see ElasticStackClient * @see * @author Adrian Cole + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(ElasticStackClient.class)} as + * {@link ElasticStackAsyncClient} interface will be removed in jclouds 1.7. */ +@Deprecated @RequestFilters(BasicAuthentication.class) @Consumes(MediaType.TEXT_PLAIN) public interface ElasticStackAsyncClient extends Closeable { diff --git a/apis/openstack-cinder/src/main/java/org/jclouds/openstack/cinder/v1/CinderApiMetadata.java b/apis/openstack-cinder/src/main/java/org/jclouds/openstack/cinder/v1/CinderApiMetadata.java index 6c47ddb262..581eaf6506 100644 --- a/apis/openstack-cinder/src/main/java/org/jclouds/openstack/cinder/v1/CinderApiMetadata.java +++ b/apis/openstack-cinder/src/main/java/org/jclouds/openstack/cinder/v1/CinderApiMetadata.java @@ -31,7 +31,6 @@ import org.jclouds.openstack.keystone.v2_0.config.CredentialTypes; import org.jclouds.openstack.keystone.v2_0.config.KeystoneAuthenticationModule; import org.jclouds.openstack.keystone.v2_0.config.KeystoneAuthenticationModule.ZoneModule; import org.jclouds.openstack.v2_0.ServiceType; -import org.jclouds.rest.RestContext; import org.jclouds.rest.internal.BaseRestApiMetadata; import com.google.common.collect.ImmutableSet; @@ -45,7 +44,12 @@ import com.google.inject.Module; */ public class CinderApiMetadata extends BaseRestApiMetadata { - public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { + /** + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(CinderApi.class)} as + * {@link CinderAsyncApi} interface will be removed in jclouds 1.7. + */ + @Deprecated + public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { private static final long serialVersionUID = 1L; }; @@ -71,6 +75,7 @@ public class CinderApiMetadata extends BaseRestApiMetadata { public static class Builder extends BaseRestApiMetadata.Builder { + @SuppressWarnings("deprecation") protected Builder() { super(CinderApi.class, CinderAsyncApi.class); id("openstack-cinder") diff --git a/apis/openstack-cinder/src/main/java/org/jclouds/openstack/cinder/v1/CinderAsyncApi.java b/apis/openstack-cinder/src/main/java/org/jclouds/openstack/cinder/v1/CinderAsyncApi.java index 4b1ab3bdcf..a7096afa3a 100644 --- a/apis/openstack-cinder/src/main/java/org/jclouds/openstack/cinder/v1/CinderAsyncApi.java +++ b/apis/openstack-cinder/src/main/java/org/jclouds/openstack/cinder/v1/CinderAsyncApi.java @@ -39,7 +39,10 @@ import com.google.inject.Provides; * @see CinderApi * @see API Doc * @author Everett Toews + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(CinderApi.class)} as + * {@link CinderAsyncApi} interface will be removed in jclouds 1.7. */ +@Deprecated public interface CinderAsyncApi extends Closeable { /** * @return the Zone codes configured diff --git a/apis/openstack-keystone/src/main/java/org/jclouds/openstack/keystone/v2_0/KeystoneApiMetadata.java b/apis/openstack-keystone/src/main/java/org/jclouds/openstack/keystone/v2_0/KeystoneApiMetadata.java index 687e86bdeb..003be876e8 100644 --- a/apis/openstack-keystone/src/main/java/org/jclouds/openstack/keystone/v2_0/KeystoneApiMetadata.java +++ b/apis/openstack-keystone/src/main/java/org/jclouds/openstack/keystone/v2_0/KeystoneApiMetadata.java @@ -30,7 +30,6 @@ import org.jclouds.openstack.keystone.v2_0.config.KeystoneParserModule; import org.jclouds.openstack.keystone.v2_0.config.KeystoneRestClientModule; import org.jclouds.openstack.keystone.v2_0.config.KeystoneRestClientModule.KeystoneAdminURLModule; import org.jclouds.openstack.v2_0.ServiceType; -import org.jclouds.rest.RestContext; import org.jclouds.rest.internal.BaseRestApiMetadata; import com.google.common.collect.ImmutableSet; @@ -44,7 +43,12 @@ import com.google.inject.Module; */ public class KeystoneApiMetadata extends BaseRestApiMetadata { - public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { + /** + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(KeystoneApi.class)} as + * {@link KeystoneAsyncApi} interface will be removed in jclouds 1.7. + */ + @Deprecated + public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { private static final long serialVersionUID = 1L; }; @@ -69,6 +73,7 @@ public class KeystoneApiMetadata extends BaseRestApiMetadata { } public static abstract class Builder> extends BaseRestApiMetadata.Builder { + @SuppressWarnings("deprecation") protected Builder() { this(KeystoneApi.class, KeystoneAsyncApi.class); } diff --git a/apis/openstack-keystone/src/main/java/org/jclouds/openstack/keystone/v2_0/KeystoneAsyncApi.java b/apis/openstack-keystone/src/main/java/org/jclouds/openstack/keystone/v2_0/KeystoneAsyncApi.java index be6573d072..ab46e874ca 100644 --- a/apis/openstack-keystone/src/main/java/org/jclouds/openstack/keystone/v2_0/KeystoneAsyncApi.java +++ b/apis/openstack-keystone/src/main/java/org/jclouds/openstack/keystone/v2_0/KeystoneAsyncApi.java @@ -45,7 +45,10 @@ import com.google.common.util.concurrent.ListenableFuture; * @author Adam Lowe * @see * @see KeystoneApi + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(KeystoneApi.class)} as + * {@link KeystoneAsyncApi} interface will be removed in jclouds 1.7. */ +@Deprecated public interface KeystoneAsyncApi extends Closeable { /** diff --git a/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/features/ServiceApiLiveTest.java b/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/features/ServiceApiLiveTest.java index 5cc242c0ac..417e599ef4 100644 --- a/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/features/ServiceApiLiveTest.java +++ b/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/features/ServiceApiLiveTest.java @@ -36,8 +36,7 @@ import org.testng.annotations.Test; public class ServiceApiLiveTest extends BaseKeystoneApiLiveTest { public void testTenants() { - ServiceApi api = this.api.getServiceApi(); - Set result = api.listTenants(); + Set result = api.getServiceApi().listTenants(); assertNotNull(result); assertFalse(result.isEmpty()); diff --git a/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/features/TenantApiLiveTest.java b/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/features/TenantApiLiveTest.java index aae85f64ee..402789a865 100644 --- a/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/features/TenantApiLiveTest.java +++ b/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/features/TenantApiLiveTest.java @@ -37,15 +37,15 @@ import org.testng.annotations.Test; public class TenantApiLiveTest extends BaseKeystoneApiLiveTest { public void testTenants() { - TenantApi api = this.api.getTenantApi().get(); - Set result = api.list().concat().toSet(); + TenantApi tenantApi = api.getTenantApi().get(); + Set result = tenantApi.list().concat().toSet(); assertNotNull(result); assertFalse(result.isEmpty()); for (Tenant tenant : result) { assertNotNull(tenant.getId()); - Tenant aTenant = api.get(tenant.getId()); + Tenant aTenant = tenantApi.get(tenant.getId()); assertNotNull(aTenant, "get returned null for tenant: " + tenant); assertEquals(aTenant, tenant); @@ -54,10 +54,10 @@ public class TenantApiLiveTest extends BaseKeystoneApiLiveTest { public void testTenantsByName() { - TenantApi api = this.api.getTenantApi().get(); + TenantApi tenantApi = api.getTenantApi().get(); - for (Tenant tenant : api.list().concat()) { - Tenant aTenant = api.getByName(tenant.getName()); + for (Tenant tenant : tenantApi.list().concat()) { + Tenant aTenant = tenantApi.getByName(tenant.getName()); assertNotNull(aTenant, "get returned null for tenant: " + tenant); assertEquals(aTenant, tenant); diff --git a/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/features/TokenApiLiveTest.java b/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/features/TokenApiLiveTest.java index 04a8f93eca..5a86960b81 100644 --- a/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/features/TokenApiLiveTest.java +++ b/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/features/TokenApiLiveTest.java @@ -65,14 +65,14 @@ public class TokenApiLiveTest extends BaseKeystoneApiLiveTest { public void testToken() { - TokenApi api = this.api.getTokenApi().get(); - assertTrue(api.isValid(token)); - Token result = api.get(token); + TokenApi tokenApi = api.getTokenApi().get(); + assertTrue(tokenApi.isValid(token)); + Token result = tokenApi.get(token); assertNotNull(result); assertEquals(result.getId(), token); assertNotNull(result.getTenant()); - User user = api.getUserOfToken(token); + User user = tokenApi.getUserOfToken(token); assertNotNull(user); assertNotNull(user.getId()); assertNotNull(user.getName()); @@ -81,16 +81,16 @@ public class TokenApiLiveTest extends BaseKeystoneApiLiveTest { public void testInvalidToken() { - TokenApi api = this.api.getTokenApi().get(); - assertFalse(api.isValid("thisisnotarealtoken!")); - assertNull(api.get("thisisnotarealtoken!")); + TokenApi tokenApi = api.getTokenApi().get(); + assertFalse(tokenApi.isValid("thisisnotarealtoken!")); + assertNull(tokenApi.get("thisisnotarealtoken!")); } public void testTokenEndpoints() { - TokenApi api = this.api.getTokenApi().get(); - Set endpoints = api.listEndpointsForToken(token); + TokenApi tokenApi = api.getTokenApi().get(); + Set endpoints = tokenApi.listEndpointsForToken(token); assertNotNull(endpoints); assertFalse(endpoints.isEmpty()); @@ -98,8 +98,8 @@ public class TokenApiLiveTest extends BaseKeystoneApiLiveTest { public void testInvalidTokenEndpoints() { - TokenApi api = this.api.getTokenApi().get(); - assertTrue(api.listEndpointsForToken("thisisnotarealtoken!").isEmpty()); + TokenApi tokenApi = api.getTokenApi().get(); + assertTrue(tokenApi.listEndpointsForToken("thisisnotarealtoken!").isEmpty()); } } diff --git a/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/features/UserApiLiveTest.java b/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/features/UserApiLiveTest.java index e4ac7f662a..df48aed032 100644 --- a/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/features/UserApiLiveTest.java +++ b/apis/openstack-keystone/src/test/java/org/jclouds/openstack/keystone/v2_0/features/UserApiLiveTest.java @@ -40,12 +40,12 @@ public class UserApiLiveTest extends BaseKeystoneApiLiveTest { public void testUsers() { - UserApi api = this.api.getUserApi().get(); - Set users = api.list().concat().toSet(); + UserApi userApi = api.getUserApi().get(); + Set users = userApi.list().concat().toSet(); assertNotNull(users); assertFalse(users.isEmpty()); for (User user : users) { - User aUser = api.get(user.getId()); + User aUser = userApi.get(user.getId()); assertEquals(aUser, user); } @@ -53,12 +53,12 @@ public class UserApiLiveTest extends BaseKeystoneApiLiveTest { public void testUserRolesOnTenant() { - UserApi api = this.api.getUserApi().get(); - Set tenants = this.api.getTenantApi().get().list().concat().toSet(); + UserApi userApi = api.getUserApi().get(); + Set tenants = api.getTenantApi().get().list().concat().toSet(); - for (User user : api.list().concat()) { + for (User user : userApi.list().concat()) { for (Tenant tenant : tenants) { - Set roles = api.listRolesOfUserOnTenant(user.getId(), tenant.getId()); + Set roles = userApi.listRolesOfUserOnTenant(user.getId(), tenant.getId()); for (Role role : roles) { assertNotNull(role.getId()); } @@ -69,9 +69,9 @@ public class UserApiLiveTest extends BaseKeystoneApiLiveTest { public void testListRolesOfUser() { - UserApi api = this.api.getUserApi().get(); - for (User user : api.list().concat()) { - Set roles = api.listRolesOfUser(user.getId()); + UserApi userApi = api.getUserApi().get(); + for (User user : userApi.list().concat()) { + Set roles = userApi.listRolesOfUser(user.getId()); for (Role role : roles) { assertNotNull(role.getId()); } @@ -81,9 +81,9 @@ public class UserApiLiveTest extends BaseKeystoneApiLiveTest { public void testUsersByName() { - UserApi api = this.api.getUserApi().get(); - for (User user : api.list().concat()) { - User aUser = api.getByName(user.getName()); + UserApi userApi = api.getUserApi().get(); + for (User user : userApi.list().concat()) { + User aUser = userApi.getByName(user.getName()); assertEquals(aUser, user); } diff --git a/apis/openstack-nova-ec2/src/main/java/org/jclouds/openstack/nova/ec2/NovaEC2ApiMetadata.java b/apis/openstack-nova-ec2/src/main/java/org/jclouds/openstack/nova/ec2/NovaEC2ApiMetadata.java index 3e6ca14e47..aa20f170fb 100644 --- a/apis/openstack-nova-ec2/src/main/java/org/jclouds/openstack/nova/ec2/NovaEC2ApiMetadata.java +++ b/apis/openstack-nova-ec2/src/main/java/org/jclouds/openstack/nova/ec2/NovaEC2ApiMetadata.java @@ -33,7 +33,6 @@ import org.jclouds.ec2.compute.config.EC2ResolveImagesModule; import org.jclouds.openstack.nova.ec2.config.HyphenToNullIso8601Module; import org.jclouds.openstack.nova.ec2.config.NovaEC2ComputeServiceContextModule; import org.jclouds.openstack.nova.ec2.config.NovaEC2RestClientModule; -import org.jclouds.rest.RestContext; import com.google.common.collect.ImmutableSet; import com.google.common.reflect.TypeToken; @@ -46,7 +45,12 @@ import com.google.inject.Module; */ public class NovaEC2ApiMetadata extends EC2ApiMetadata { - public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { + /** + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(NovaEC2Client.class)} as + * {@link NovaEC2AsyncClient} interface will be removed in jclouds 1.7. + */ + @Deprecated + public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { private static final long serialVersionUID = 1L; }; @@ -81,6 +85,7 @@ public class NovaEC2ApiMetadata extends EC2ApiMetadata { } public static class Builder extends EC2ApiMetadata.Builder { + @SuppressWarnings("deprecation") protected Builder(){ super(NovaEC2Client.class, NovaEC2AsyncClient.class); id("openstack-nova-ec2") diff --git a/apis/openstack-nova-ec2/src/main/java/org/jclouds/openstack/nova/ec2/NovaEC2AsyncClient.java b/apis/openstack-nova-ec2/src/main/java/org/jclouds/openstack/nova/ec2/NovaEC2AsyncClient.java index 7d09a25f04..6bc1680f4f 100644 --- a/apis/openstack-nova-ec2/src/main/java/org/jclouds/openstack/nova/ec2/NovaEC2AsyncClient.java +++ b/apis/openstack-nova-ec2/src/main/java/org/jclouds/openstack/nova/ec2/NovaEC2AsyncClient.java @@ -26,7 +26,10 @@ import org.jclouds.rest.annotations.Delegate; * Provides asynchronous access to EC2 services. * * @author Adam Lowe + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(NovaEC2Client.class)} as + * {@link NovaEC2AsyncClient} interface will be removed in jclouds 1.7. */ +@Deprecated public interface NovaEC2AsyncClient extends EC2AsyncClient { /** * {@inheritDoc} diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/NovaApiMetadata.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/NovaApiMetadata.java index e832962941..f5a8a92aee 100644 --- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/NovaApiMetadata.java +++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/NovaApiMetadata.java @@ -38,7 +38,6 @@ import org.jclouds.openstack.nova.v2_0.compute.config.NovaComputeServiceContextM import org.jclouds.openstack.nova.v2_0.config.NovaParserModule; import org.jclouds.openstack.nova.v2_0.config.NovaRestClientModule; import org.jclouds.openstack.v2_0.ServiceType; -import org.jclouds.rest.RestContext; import org.jclouds.rest.internal.BaseRestApiMetadata; import com.google.common.collect.ImmutableSet; @@ -52,7 +51,12 @@ import com.google.inject.Module; */ public class NovaApiMetadata extends BaseRestApiMetadata { - public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { + /** + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(NovaApi.class)} as + * {@link NovaAsyncApi} interface will be removed in jclouds 1.7. + */ + @Deprecated + public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { private static final long serialVersionUID = 1L; }; @@ -88,6 +92,7 @@ public class NovaApiMetadata extends BaseRestApiMetadata { public static class Builder extends BaseRestApiMetadata.Builder { + @SuppressWarnings("deprecation") protected Builder() { super(NovaApi.class, NovaAsyncApi.class); id("openstack-nova") diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/NovaAsyncApi.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/NovaAsyncApi.java index 60804b0fef..e8348446a5 100644 --- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/NovaAsyncApi.java +++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/NovaAsyncApi.java @@ -57,7 +57,10 @@ import com.google.inject.Provides; * @see * @author Adrian Cole + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(NovaApi.class)} as + * {@link NovaAsyncApi} interface will be removed in jclouds 1.7. */ +@Deprecated public interface NovaAsyncApi extends Closeable { /** diff --git a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/KeyPairApiLiveTest.java b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/KeyPairApiLiveTest.java index 9f1f068ecf..84bd2e3aad 100644 --- a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/KeyPairApiLiveTest.java +++ b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/KeyPairApiLiveTest.java @@ -36,8 +36,8 @@ public class KeyPairApiLiveTest extends BaseNovaApiLiveTest { public void testListKeyPairs() throws Exception { for (String zoneId : api.getConfiguredZones()) { - KeyPairApi api = this.api.getKeyPairExtensionForZone(zoneId).get(); - FluentIterable keyPairsList = api.list(); + KeyPairApi keyPairApi = api.getKeyPairExtensionForZone(zoneId).get(); + FluentIterable keyPairsList = keyPairApi.list(); assertNotNull(keyPairsList); } } @@ -45,14 +45,14 @@ public class KeyPairApiLiveTest extends BaseNovaApiLiveTest { public void testCreateAndDeleteKeyPair() throws Exception { final String KEYPAIR_NAME = "testkp"; for (String zoneId : api.getConfiguredZones()) { - KeyPairApi api = this.api.getKeyPairExtensionForZone(zoneId).get(); + KeyPairApi keyPairApi = api.getKeyPairExtensionForZone(zoneId).get(); KeyPair keyPair = null; try { - keyPair = api.create(KEYPAIR_NAME); + keyPair = keyPairApi.create(KEYPAIR_NAME); assertNotNull(keyPair); } finally { if (keyPair != null) { - api.delete(KEYPAIR_NAME); + keyPairApi.delete(KEYPAIR_NAME); } } } @@ -63,14 +63,14 @@ public class KeyPairApiLiveTest extends BaseNovaApiLiveTest { final String PUBLIC_KEY = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCrrBREFxz3002l1HuXz0+UOdJQ/mOYD5DiJwwB/TOybwIKQJPOxJWA9gBoo4k9dthTKBTaEYbzrll7iZcp59E80S6mNiAr3mUgi+x5Y8uyXeJ2Ws+h6peVyFVUu9epkwpcTd1GVfdcVWsTajwDz9+lxCDhl0RZKDFoT0scTxbj/w== nova@nv-aw2az2-api0002"; for (String zoneId : api.getConfiguredZones()) { - KeyPairApi api = this.api.getKeyPairExtensionForZone(zoneId).get(); + KeyPairApi keyPairApi = api.getKeyPairExtensionForZone(zoneId).get(); KeyPair keyPair = null; try { - keyPair = api.createWithPublicKey(KEYPAIR_NAME, PUBLIC_KEY); + keyPair = keyPairApi.createWithPublicKey(KEYPAIR_NAME, PUBLIC_KEY); assertNotNull(keyPair); } finally { if (keyPair != null) { - api.delete(KEYPAIR_NAME); + keyPairApi.delete(KEYPAIR_NAME); } } } diff --git a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/SecurityGroupApiLiveTest.java b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/SecurityGroupApiLiveTest.java index eb699df571..8358afae99 100644 --- a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/SecurityGroupApiLiveTest.java +++ b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/SecurityGroupApiLiveTest.java @@ -43,27 +43,27 @@ public class SecurityGroupApiLiveTest extends BaseNovaApiLiveTest { public void list() throws Exception { for (String zoneId : api.getConfiguredZones()) { - SecurityGroupApi api = this.api.getSecurityGroupExtensionForZone(zoneId).get(); - Set securityGroupsList = api.list().toSet(); + SecurityGroupApi securityGroupApi = api.getSecurityGroupExtensionForZone(zoneId).get(); + Set securityGroupsList = securityGroupApi.list().toSet(); assertNotNull(securityGroupsList); } } public void createGetAndDeleteSecurityGroup() throws Exception { for (String zoneId : api.getConfiguredZones()) { - SecurityGroupApi api = this.api.getSecurityGroupExtensionForZone(zoneId).get(); + SecurityGroupApi securityGroupApi = api.getSecurityGroupExtensionForZone(zoneId).get(); SecurityGroup securityGroup = null; String id; try { - securityGroup = api + securityGroup = securityGroupApi .createWithDescription(SECURITY_GROUP_NAME, "test security group"); assertNotNull(securityGroup); id = securityGroup.getId(); - SecurityGroup theGroup = api.get(id); + SecurityGroup theGroup = securityGroupApi.get(id); assertNotNull(theGroup); } finally { if (securityGroup != null) { - api.delete(securityGroup.getId()); + securityGroupApi.delete(securityGroup.getId()); } } } @@ -71,29 +71,29 @@ public class SecurityGroupApiLiveTest extends BaseNovaApiLiveTest { public void createAndDeleteSecurityGroupRule() throws Exception { for (String zoneId : api.getConfiguredZones()) { - SecurityGroupApi api = this.api.getSecurityGroupExtensionForZone(zoneId).get(); + SecurityGroupApi securityGroupApi = api.getSecurityGroupExtensionForZone(zoneId).get(); SecurityGroup securityGroup = null; try { - securityGroup = api.createWithDescription(SECURITY_GROUP_NAME, "test security group"); + securityGroup = securityGroupApi.createWithDescription(SECURITY_GROUP_NAME, "test security group"); assertNotNull(securityGroup); for (int port : ImmutableSet.of(22, 8080)) { - SecurityGroupRule rule = api.createRuleAllowingCidrBlock(securityGroup.getId(), Ingress + SecurityGroupRule rule = securityGroupApi.createRuleAllowingCidrBlock(securityGroup.getId(), Ingress .builder().ipProtocol(IpProtocol.TCP).fromPort(port).toPort(port).build(), "0.0.0.0/0"); assertNotNull(rule); - SecurityGroupRule rule2 = api.createRuleAllowingSecurityGroupId(securityGroup.getId(), + SecurityGroupRule rule2 = securityGroupApi.createRuleAllowingSecurityGroupId(securityGroup.getId(), Ingress.builder().ipProtocol(IpProtocol.TCP).fromPort(port).toPort(port).build(), securityGroup .getId()); assertNotNull(rule2); } - securityGroup = api.get(securityGroup.getId()); + securityGroup = securityGroupApi.get(securityGroup.getId()); } finally { if (securityGroup != null) { - api.delete(securityGroup.getId()); + securityGroupApi.delete(securityGroup.getId()); } } } diff --git a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/features/ExtensionApiLiveTest.java b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/features/ExtensionApiLiveTest.java index ac9c7bd5e2..04b3433241 100644 --- a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/features/ExtensionApiLiveTest.java +++ b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/features/ExtensionApiLiveTest.java @@ -45,8 +45,8 @@ public class ExtensionApiLiveTest extends BaseNovaApiLiveTest { @Test(description = "GET /v${apiVersion}/{tenantId}/extensions") public void testListExtensions() throws Exception { for (String zoneId : zones) { - ExtensionApi api = this.api.getExtensionApiForZone(zoneId); - Set response = api.list(); + ExtensionApi extensionApi = api.getExtensionApiForZone(zoneId); + Set response = extensionApi.list(); assertNotNull(response); assertFalse(response.isEmpty()); for (Extension extension : response) { @@ -68,10 +68,10 @@ public class ExtensionApiLiveTest extends BaseNovaApiLiveTest { @Test(description = "GET /v${apiVersion}/{tenantId}/extensions/{alias}", dependsOnMethods = { "testListExtensions" }) public void testGetExtensionByAlias() throws Exception { for (String zoneId : zones) { - ExtensionApi api = this.api.getExtensionApiForZone(zoneId); - Set response = api.list(); + ExtensionApi extensionApi = api.getExtensionApiForZone(zoneId); + Set response = extensionApi.list(); for (Extension extension : response) { - Extension details = api.get(extension.getId()); + Extension details = extensionApi.get(extension.getId()); assertNotNull(details); assertEquals(details.getId(), extension.getId()); assertEquals(details.getName(), extension.getName()); diff --git a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/features/FlavorApiLiveTest.java b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/features/FlavorApiLiveTest.java index d6c1b4bd9b..1122d4d396 100644 --- a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/features/FlavorApiLiveTest.java +++ b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/features/FlavorApiLiveTest.java @@ -46,8 +46,8 @@ public class FlavorApiLiveTest extends BaseNovaApiLiveTest { @Test(description = "GET /v${apiVersion}/{tenantId}/flavors") public void testListFlavors() throws Exception { for (String zoneId : zones) { - FlavorApi api = this.api.getFlavorApiForZone(zoneId); - Set response = api.list().concat().toSet(); + FlavorApi flavorApi = api.getFlavorApiForZone(zoneId); + Set response = flavorApi.list().concat().toSet(); assertNotNull(response); assertFalse(response.isEmpty()); for (Resource flavor : response) { @@ -66,8 +66,8 @@ public class FlavorApiLiveTest extends BaseNovaApiLiveTest { @Test(description = "GET /v${apiVersion}/{tenantId}/flavors/detail") public void testListFlavorsInDetail() throws Exception { for (String zoneId : zones) { - FlavorApi api = this.api.getFlavorApiForZone(zoneId); - Set response = api.listInDetail().concat().toSet(); + FlavorApi flavorApi = api.getFlavorApiForZone(zoneId); + Set response = flavorApi.listInDetail().concat().toSet(); assertNotNull(response); assertFalse(response.isEmpty()); for (Flavor flavor : response) { @@ -89,10 +89,10 @@ public class FlavorApiLiveTest extends BaseNovaApiLiveTest { @Test(description = "GET /v${apiVersion}/{tenantId}/flavors/{id}", dependsOnMethods = { "testListFlavorsInDetail" }) public void testGetFlavorById() throws Exception { for (String zoneId : zones) { - FlavorApi api = this.api.getFlavorApiForZone(zoneId); - Set response = api.listInDetail().concat().toSet(); + FlavorApi flavorApi = api.getFlavorApiForZone(zoneId); + Set response = flavorApi.listInDetail().concat().toSet(); for (Flavor flavor : response) { - Flavor details = api.get(flavor.getId()); + Flavor details = flavorApi.get(flavor.getId()); assertNotNull(details); assertEquals(details.getId(), flavor.getId()); assertEquals(details.getName(), flavor.getName()); diff --git a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/features/ImageApiLiveTest.java b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/features/ImageApiLiveTest.java index a821723adf..90586a7463 100644 --- a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/features/ImageApiLiveTest.java +++ b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/features/ImageApiLiveTest.java @@ -41,8 +41,8 @@ public class ImageApiLiveTest extends BaseNovaApiLiveTest { @Test(description = "GET /v${apiVersion}/{tenantId}/images") public void testListImages() throws Exception { for (String zoneId : zones) { - ImageApi api = this.api.getImageApiForZone(zoneId); - Set response = api.list().concat().toSet(); + ImageApi imageApi = api.getImageApiForZone(zoneId); + Set response = imageApi.list().concat().toSet(); assertNotNull(response); assertFalse(response.isEmpty()); for (Resource image : response) { @@ -56,8 +56,8 @@ public class ImageApiLiveTest extends BaseNovaApiLiveTest { @Test(description = "GET /v${apiVersion}/{tenantId}/images/detail") public void testListImagesInDetail() throws Exception { for (String zoneId : api.getConfiguredZones()) { - ImageApi api = this.api.getImageApiForZone(zoneId); - Set response = api.listInDetail().concat().toSet(); + ImageApi imageApi = api.getImageApiForZone(zoneId); + Set response = imageApi.listInDetail().concat().toSet(); assertNotNull(response); assertFalse(response.isEmpty()); for (Image image : response) { @@ -80,10 +80,10 @@ public class ImageApiLiveTest extends BaseNovaApiLiveTest { @Test(description = "GET /v${apiVersion}/{tenantId}/images/{id}", dependsOnMethods = { "testListImagesInDetail" }) public void testGetImageById() throws Exception { for (String zoneId : api.getConfiguredZones()) { - ImageApi api = this.api.getImageApiForZone(zoneId); - Set response = api.listInDetail().concat().toSet(); + ImageApi imageApi = api.getImageApiForZone(zoneId); + Set response = imageApi.listInDetail().concat().toSet(); for (Image image : response) { - Image details = api.get(image.getId()); + Image details = imageApi.get(image.getId()); assertNotNull(details); assertEquals(details.getId(), image.getId()); assertEquals(details.getName(), image.getName()); diff --git a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/features/ServerApiLiveTest.java b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/features/ServerApiLiveTest.java index 8c5fdbf908..190aa42665 100644 --- a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/features/ServerApiLiveTest.java +++ b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/features/ServerApiLiveTest.java @@ -43,8 +43,8 @@ public class ServerApiLiveTest extends BaseNovaApiLiveTest { @Test(description = "GET /v${apiVersion}/{tenantId}/servers") public void testListServers() throws Exception { for (String zoneId : zones) { - ServerApi api = this.api.getServerApiForZone(zoneId); - for (Resource server : api.list().concat()) { + ServerApi serverApi = api.getServerApiForZone(zoneId); + for (Resource server : serverApi.list().concat()) { checkResource(server); } } @@ -53,8 +53,8 @@ public class ServerApiLiveTest extends BaseNovaApiLiveTest { @Test(description = "GET /v${apiVersion}/{tenantId}/servers/detail") public void testListServersInDetail() throws Exception { for (String zoneId : zones) { - ServerApi api = this.api.getServerApiForZone(zoneId); - for (Server server : api.listInDetail().concat()) { + ServerApi serverApi = api.getServerApiForZone(zoneId); + for (Server server : serverApi.listInDetail().concat()) { checkServer(server); } } @@ -63,9 +63,9 @@ public class ServerApiLiveTest extends BaseNovaApiLiveTest { @Test(description = "GET /v${apiVersion}/{tenantId}/servers/{id}", dependsOnMethods = { "testListServersInDetail" }) public void testGetServerById() throws Exception { for (String zoneId : zones) { - ServerApi api = this.api.getServerApiForZone(zoneId); - for (Resource server : api.list().concat()) { - Server details = api.get(server.getId()); + ServerApi serverApi = api.getServerApiForZone(zoneId); + for (Resource server : serverApi.list().concat()) { + Server details = serverApi.get(server.getId()); assertEquals(details.getId(), server.getId()); assertEquals(details.getName(), server.getName()); assertEquals(details.getLinks(), server.getLinks()); diff --git a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/internal/BaseNovaApiLiveTest.java b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/internal/BaseNovaApiLiveTest.java index 5e08e5e8e5..670fd8cc25 100644 --- a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/internal/BaseNovaApiLiveTest.java +++ b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/internal/BaseNovaApiLiveTest.java @@ -62,10 +62,10 @@ public class BaseNovaApiLiveTest extends BaseApiLiveTest { super.setup(); zones = api.getConfiguredZones(); for (String zone : zones){ - ServerApi api = this.api.getServerApiForZone(zone); - for (Resource server : api.list().concat()){ + ServerApi serverApi = api.getServerApiForZone(zone); + for (Resource server : serverApi.list().concat()){ if (server.getName().equals(hostName)) - api.delete(server.getId()); + serverApi.delete(server.getId()); } } } diff --git a/apis/rackspace-cloudidentity/src/main/java/org/jclouds/rackspace/cloudidentity/v2_0/CloudIdentityApiMetadata.java b/apis/rackspace-cloudidentity/src/main/java/org/jclouds/rackspace/cloudidentity/v2_0/CloudIdentityApiMetadata.java index 6c1b2823c5..edf8f4d40d 100644 --- a/apis/rackspace-cloudidentity/src/main/java/org/jclouds/rackspace/cloudidentity/v2_0/CloudIdentityApiMetadata.java +++ b/apis/rackspace-cloudidentity/src/main/java/org/jclouds/rackspace/cloudidentity/v2_0/CloudIdentityApiMetadata.java @@ -33,7 +33,6 @@ import org.jclouds.openstack.keystone.v2_0.config.KeystoneRestClientModule; import org.jclouds.openstack.keystone.v2_0.config.KeystoneRestClientModule.KeystoneAdminURLModule; import org.jclouds.rackspace.cloudidentity.v2_0.config.CloudIdentityAuthenticationModule; import org.jclouds.rackspace.cloudidentity.v2_0.config.CloudIdentityCredentialTypes; -import org.jclouds.rest.RestContext; import com.google.common.collect.ImmutableSet; import com.google.common.reflect.TypeToken; @@ -46,7 +45,12 @@ import com.google.inject.Module; */ public class CloudIdentityApiMetadata extends KeystoneApiMetadata { - public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { + /** + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(KeystoneApi.class)} as + * {@link KeystoneAsyncApi} interface will be removed in jclouds 1.7. + */ + @Deprecated + public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { private static final long serialVersionUID = 1L; }; @@ -70,6 +74,7 @@ public class CloudIdentityApiMetadata extends KeystoneApiMetadata { } public static class Builder extends KeystoneApiMetadata.Builder { + @SuppressWarnings("deprecation") protected Builder(){ super(KeystoneApi.class, KeystoneAsyncApi.class); id("rackspace-cloudidentity") diff --git a/apis/rackspace-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/CloudLoadBalancersApiMetadata.java b/apis/rackspace-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/CloudLoadBalancersApiMetadata.java index 2a0a1b5e72..64a33638f8 100644 --- a/apis/rackspace-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/CloudLoadBalancersApiMetadata.java +++ b/apis/rackspace-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/CloudLoadBalancersApiMetadata.java @@ -32,7 +32,6 @@ import org.jclouds.rackspace.cloudidentity.v2_0.config.CloudIdentityAuthenticati import org.jclouds.rackspace.cloudidentity.v2_0.config.CloudIdentityCredentialTypes; import org.jclouds.rackspace.cloudloadbalancers.v1.config.CloudLoadBalancersRestClientModule; import org.jclouds.rackspace.cloudloadbalancers.v1.loadbalancer.config.CloudLoadBalancersLoadBalancerContextModule; -import org.jclouds.rest.RestContext; import org.jclouds.rest.internal.BaseRestApiMetadata; import com.google.common.collect.ImmutableSet; @@ -45,8 +44,12 @@ import com.google.inject.Module; */ public class CloudLoadBalancersApiMetadata extends BaseRestApiMetadata { - public static final TypeToken> CONTEXT_TOKEN = - new TypeToken>() { + /** + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(CloudLoadBalancersApi.class)} as + * {@link CloudLoadBalancersAsyncApi} interface will be removed in jclouds 1.7. + */ + @Deprecated + public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { private static final long serialVersionUID = 1L; }; @@ -72,6 +75,7 @@ public class CloudLoadBalancersApiMetadata extends BaseRestApiMetadata { public static class Builder extends BaseRestApiMetadata.Builder { + @SuppressWarnings("deprecation") protected Builder() { super(CloudLoadBalancersApi.class, CloudLoadBalancersAsyncApi.class); id("rackspace-cloudloadbalancers") diff --git a/apis/rackspace-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/CloudLoadBalancersAsyncApi.java b/apis/rackspace-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/CloudLoadBalancersAsyncApi.java index 2dc9886661..dca10a6602 100644 --- a/apis/rackspace-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/CloudLoadBalancersAsyncApi.java +++ b/apis/rackspace-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/CloudLoadBalancersAsyncApi.java @@ -49,7 +49,10 @@ import com.google.inject.Provides; * * @see CloudLoadBalancersApi * @author Adrian Cole + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(CloudLoadBalancersApi.class)} as + * {@link CloudLoadBalancersAsyncApi} interface will be removed in jclouds 1.7. */ +@Deprecated public interface CloudLoadBalancersAsyncApi extends Closeable { /** * @return the Zone codes configured diff --git a/apis/route53/src/main/java/org/jclouds/route53/Route53ApiMetadata.java b/apis/route53/src/main/java/org/jclouds/route53/Route53ApiMetadata.java index 8fe759a984..f64443c835 100644 --- a/apis/route53/src/main/java/org/jclouds/route53/Route53ApiMetadata.java +++ b/apis/route53/src/main/java/org/jclouds/route53/Route53ApiMetadata.java @@ -25,7 +25,6 @@ import java.net.URI; import java.util.Properties; import org.jclouds.apis.ApiMetadata; -import org.jclouds.rest.RestContext; import org.jclouds.rest.internal.BaseRestApiMetadata; import org.jclouds.route53.config.Route53RestClientModule; @@ -38,7 +37,12 @@ import com.google.common.reflect.TypeToken; */ public class Route53ApiMetadata extends BaseRestApiMetadata { - public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { + /** + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(Route53Api.class)} as + * {@link Route53AsyncApi} interface will be removed in jclouds 1.7. + */ + @Deprecated + public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { private static final long serialVersionUID = 1L; }; @@ -47,6 +51,7 @@ public class Route53ApiMetadata extends BaseRestApiMetadata { return new Builder(getApi(), getAsyncApi()).fromApiMetadata(this); } + @SuppressWarnings("deprecation") public Route53ApiMetadata() { this(new Builder(Route53Api.class, Route53AsyncApi.class)); } diff --git a/apis/route53/src/main/java/org/jclouds/route53/Route53AsyncApi.java b/apis/route53/src/main/java/org/jclouds/route53/Route53AsyncApi.java index e991bda41b..fac0d408f5 100644 --- a/apis/route53/src/main/java/org/jclouds/route53/Route53AsyncApi.java +++ b/apis/route53/src/main/java/org/jclouds/route53/Route53AsyncApi.java @@ -46,7 +46,10 @@ import com.google.common.util.concurrent.ListenableFuture; * @see * @author Adrian Cole + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(Route53Api.class)} as + * {@link Route53AsyncApi} interface will be removed in jclouds 1.7. */ +@Deprecated @RequestFilters(RestAuthentication.class) @VirtualHost @Path("/{jclouds.api-version}") diff --git a/apis/s3/src/main/java/org/jclouds/s3/S3ApiMetadata.java b/apis/s3/src/main/java/org/jclouds/s3/S3ApiMetadata.java index 17a8508250..884030c4e8 100644 --- a/apis/s3/src/main/java/org/jclouds/s3/S3ApiMetadata.java +++ b/apis/s3/src/main/java/org/jclouds/s3/S3ApiMetadata.java @@ -18,7 +18,6 @@ */ package org.jclouds.s3; -import static org.jclouds.Constants.PROPERTY_API_VERSION; import static org.jclouds.Constants.PROPERTY_RELAX_HOSTNAME; import static org.jclouds.aws.reference.AWSConstants.PROPERTY_AUTH_TAG; import static org.jclouds.aws.reference.AWSConstants.PROPERTY_HEADER_TAG; @@ -32,7 +31,6 @@ import java.net.URI; import java.util.Properties; import org.jclouds.apis.ApiMetadata; -import org.jclouds.rest.RestContext; import org.jclouds.rest.internal.BaseRestApiMetadata; import org.jclouds.s3.blobstore.S3BlobStoreContext; import org.jclouds.s3.blobstore.config.S3BlobStoreContextModule; @@ -62,7 +60,12 @@ import com.google.inject.Module; */ public class S3ApiMetadata extends BaseRestApiMetadata { - public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { + /** + * @deprecated please use {@code org.jclouds.ContextBuilder#buildClient(S3Client.class)} as + * {@link S3AsyncClient} interface will be removed in jclouds 1.7. + */ + @Deprecated + public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { private static final long serialVersionUID = 1L; }; @@ -81,7 +84,6 @@ public class S3ApiMetadata extends BaseRestApiMetadata { public static Properties defaultProperties() { Properties properties = BaseRestApiMetadata.defaultProperties(); - properties.setProperty(PROPERTY_API_VERSION, S3AsyncClient.VERSION); properties.setProperty(PROPERTY_AUTH_TAG, "AWS"); properties.setProperty(PROPERTY_HEADER_TAG, S3Headers.DEFAULT_AMAZON_HEADERTAG); properties.setProperty(PROPERTY_S3_SERVICE_PATH, "/"); @@ -93,6 +95,7 @@ public class S3ApiMetadata extends BaseRestApiMetadata { } public static abstract class Builder> extends BaseRestApiMetadata.Builder { + @SuppressWarnings("deprecation") protected Builder() { this(S3Client.class, S3AsyncClient.class); } @@ -105,7 +108,7 @@ public class S3ApiMetadata extends BaseRestApiMetadata { .credentialName("Secret Access Key") .defaultEndpoint("https://s3.amazonaws.com") .documentation(URI.create("http://docs.amazonwebservices.com/AmazonS3/latest/API")) - .version(S3AsyncClient.VERSION) + .version("2006-03-01") .defaultProperties(S3ApiMetadata.defaultProperties()) .context(CONTEXT_TOKEN) .view(typeToken(S3BlobStoreContext.class)) diff --git a/apis/s3/src/main/java/org/jclouds/s3/S3AsyncClient.java b/apis/s3/src/main/java/org/jclouds/s3/S3AsyncClient.java index 8a2677f252..664539004c 100644 --- a/apis/s3/src/main/java/org/jclouds/s3/S3AsyncClient.java +++ b/apis/s3/src/main/java/org/jclouds/s3/S3AsyncClient.java @@ -104,9 +104,13 @@ import com.google.inject.Provides; * * @author Adrian Cole * @author James Murty - * @see S3Client + * @see AWSS3Client * @see + * @deprecated please use + * {@code org.jclouds.ContextBuilder#buildApi(S3Client.class)} + * as {@link S3AsyncClient} interface will be removed in jclouds 1.7. */ +@Deprecated @RequestFilters(RequestAuthorizeSignature.class) @BlobScope(CONTAINER) public interface S3AsyncClient extends Closeable { diff --git a/apis/sqs/src/main/java/org/jclouds/sqs/SQSApiMetadata.java b/apis/sqs/src/main/java/org/jclouds/sqs/SQSApiMetadata.java index 24b78ceb70..aed5f2687b 100644 --- a/apis/sqs/src/main/java/org/jclouds/sqs/SQSApiMetadata.java +++ b/apis/sqs/src/main/java/org/jclouds/sqs/SQSApiMetadata.java @@ -27,7 +27,6 @@ import java.net.URI; import java.util.Properties; import org.jclouds.apis.ApiMetadata; -import org.jclouds.rest.RestContext; import org.jclouds.rest.internal.BaseRestApiMetadata; import org.jclouds.sqs.config.SQSRestClientModule; @@ -42,7 +41,12 @@ import com.google.inject.Module; */ public class SQSApiMetadata extends BaseRestApiMetadata { - public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { + /** + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(SQSApi.class)} as + * {@link SQSAsyncApi} interface will be removed in jclouds 1.7. + */ + @Deprecated + public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { private static final long serialVersionUID = 1L; }; @@ -51,6 +55,7 @@ public class SQSApiMetadata extends BaseRestApiMetadata { return new Builder(getApi(), getAsyncApi()).fromApiMetadata(this); } + @SuppressWarnings("deprecation") public SQSApiMetadata() { this(new Builder(SQSApi.class, SQSAsyncApi.class)); } diff --git a/apis/sqs/src/main/java/org/jclouds/sqs/SQSAsyncApi.java b/apis/sqs/src/main/java/org/jclouds/sqs/SQSAsyncApi.java index 94cb518e30..82b08f942a 100644 --- a/apis/sqs/src/main/java/org/jclouds/sqs/SQSAsyncApi.java +++ b/apis/sqs/src/main/java/org/jclouds/sqs/SQSAsyncApi.java @@ -45,7 +45,10 @@ import com.google.inject.Provides; * href="http://docs.amazonwebservices.com/AWSSimpleQueueService/2011-10-01/APIReference/Welcome.html">SQS * documentation * @author Adrian Cole + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(SQSApi.class)} as + * {@link SQSAsyncApi} interface will be removed in jclouds 1.7. */ +@Deprecated @Beta @RequestFilters(FormSigner.class) @VirtualHost diff --git a/apis/sqs/src/test/java/org/jclouds/sqs/features/BulkMessageApiLiveTest.java b/apis/sqs/src/test/java/org/jclouds/sqs/features/BulkMessageApiLiveTest.java index 86d4e229c4..b028021388 100644 --- a/apis/sqs/src/test/java/org/jclouds/sqs/features/BulkMessageApiLiveTest.java +++ b/apis/sqs/src/test/java/org/jclouds/sqs/features/BulkMessageApiLiveTest.java @@ -87,9 +87,9 @@ public class BulkMessageApiLiveTest extends BaseSQSApiLiveTest { @Test(dependsOnMethods = "testSendMessages") public void testChangeMessageVisibility() { for (URI queue : queues) { - MessageApi api = this.api.getMessageApiForQueue(queue); + MessageApi messageApi = api.getMessageApiForQueue(queue); - Set messages = collectMessages(api); + Set messages = collectMessages(messageApi); receiptHandles = Iterables.transform(messages, new Function() { @Override @@ -99,14 +99,14 @@ public class BulkMessageApiLiveTest extends BaseSQSApiLiveTest { }); // hidden message, so we can't see it - assertNull(api.receive()); + assertNull(messageApi.receive()); // this should unhide it - BatchResult acks = api.changeVisibility(receiptHandles, 0); + BatchResult acks = messageApi.changeVisibility(receiptHandles, 0); assertEquals(acks.size(), messages.size(), "error changing visibility " + acks); // so we can see it again - assertEquals(collectMessages(api).size(), messages.size()); + assertEquals(collectMessages(messageApi).size(), messages.size()); } } diff --git a/apis/sqs/src/test/java/org/jclouds/sqs/features/MessageApiLiveTest.java b/apis/sqs/src/test/java/org/jclouds/sqs/features/MessageApiLiveTest.java index 7c076cf917..743bfd9181 100644 --- a/apis/sqs/src/test/java/org/jclouds/sqs/features/MessageApiLiveTest.java +++ b/apis/sqs/src/test/java/org/jclouds/sqs/features/MessageApiLiveTest.java @@ -55,14 +55,14 @@ public class MessageApiLiveTest extends BaseSQSApiLiveTest { public void testSendMessage() { for (URI queue : queues) { - assertEquals(api.getMessageApiForQueue(queue).send(message).getMD5(), md5); + assertEquals(api(queue).send(message).getMD5(), md5); } } @Test(dependsOnMethods = "testSendMessage") public void testReceiveMessageWithoutHidingMessage() { for (URI queue : queues) { - assertEquals(api.getMessageApiForQueue(queue).receive(attribute("All").visibilityTimeout(0)).getMD5(), md5); + assertEquals(api(queue).receive(attribute("All").visibilityTimeout(0)).getMD5(), md5); } } @@ -71,24 +71,27 @@ public class MessageApiLiveTest extends BaseSQSApiLiveTest { @Test(dependsOnMethods = "testReceiveMessageWithoutHidingMessage") public void testChangeMessageVisibility() { for (URI queue : queues) { - MessageApi api = this.api.getMessageApiForQueue(queue); + MessageApi messageApi = api(queue); // start hiding it at 5 seconds - receiptHandle = api.receive(attribute("None").visibilityTimeout(5)).getReceiptHandle(); + receiptHandle = messageApi.receive(attribute("None").visibilityTimeout(5)).getReceiptHandle(); // hidden message, so we can't see it - assertNull(api.receive()); + assertNull(messageApi.receive()); // this should unhide it - api.changeVisibility(receiptHandle, 0); + messageApi.changeVisibility(receiptHandle, 0); // so we can see it again - assertEquals(api.receive(attribute("All").visibilityTimeout(0)).getMD5(), md5); + assertEquals(messageApi.receive(attribute("All").visibilityTimeout(0)).getMD5(), md5); } } @Test(dependsOnMethods = "testChangeMessageVisibility") public void testDeleteMessage() throws InterruptedException { for (URI queue : queues) { - api.getMessageApiForQueue(queue).delete(receiptHandle); + api(queue).delete(receiptHandle); assertNoMessages(queue); } } + private MessageApi api(URI queue) { + return api.getMessageApiForQueue(queue); + } } diff --git a/apis/sqs/src/test/java/org/jclouds/sqs/internal/BaseSQSApiLiveTest.java b/apis/sqs/src/test/java/org/jclouds/sqs/internal/BaseSQSApiLiveTest.java index f31a1bca87..23ddbc4a6a 100644 --- a/apis/sqs/src/test/java/org/jclouds/sqs/internal/BaseSQSApiLiveTest.java +++ b/apis/sqs/src/test/java/org/jclouds/sqs/internal/BaseSQSApiLiveTest.java @@ -61,12 +61,12 @@ public class BaseSQSApiLiveTest extends BaseApiLiveTest { } protected String recreateQueueInRegion(String queueName, String region) { - QueueApi api = this.api.getQueueApiForRegion(region); - URI result = api.get(queueName); + QueueApi queueApi = api.getQueueApiForRegion(region); + URI result = queueApi.get(queueName); if (result != null) { - api.delete(result); + queueApi.delete(result); } - URI queue = api.create(queueName); + URI queue = queueApi.create(queueName); assertQueueInList(region, queue); queues.add(queue); return queueName; diff --git a/apis/sts/src/main/java/org/jclouds/sts/STSApiMetadata.java b/apis/sts/src/main/java/org/jclouds/sts/STSApiMetadata.java index d13192bb11..9fc653a480 100644 --- a/apis/sts/src/main/java/org/jclouds/sts/STSApiMetadata.java +++ b/apis/sts/src/main/java/org/jclouds/sts/STSApiMetadata.java @@ -25,7 +25,6 @@ import java.net.URI; import java.util.Properties; import org.jclouds.apis.ApiMetadata; -import org.jclouds.rest.RestContext; import org.jclouds.rest.internal.BaseRestApiMetadata; import org.jclouds.sts.config.STSRestClientModule; @@ -38,7 +37,12 @@ import com.google.common.reflect.TypeToken; */ public class STSApiMetadata extends BaseRestApiMetadata { - public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { + /** + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(STSApi.class)} as + * {@link STSAsyncApi} interface will be removed in jclouds 1.7. + */ + @Deprecated + public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { private static final long serialVersionUID = 1L; }; @@ -47,6 +51,7 @@ public class STSApiMetadata extends BaseRestApiMetadata { return new Builder(getApi(), getAsyncApi()).fromApiMetadata(this); } + @SuppressWarnings("deprecation") public STSApiMetadata() { this(new Builder(STSApi.class, STSAsyncApi.class)); } diff --git a/apis/sts/src/main/java/org/jclouds/sts/STSAsyncApi.java b/apis/sts/src/main/java/org/jclouds/sts/STSAsyncApi.java index b841100107..fdeed7519e 100644 --- a/apis/sts/src/main/java/org/jclouds/sts/STSAsyncApi.java +++ b/apis/sts/src/main/java/org/jclouds/sts/STSAsyncApi.java @@ -46,7 +46,10 @@ import com.google.common.util.concurrent.ListenableFuture; * * @see * @author Adrian Cole + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(STSApi.class)} as + * {@link STSAsyncApi} interface will be removed in jclouds 1.7. */ +@Deprecated @RequestFilters(FormSigner.class) @VirtualHost public interface STSAsyncApi extends Closeable { diff --git a/apis/swift/src/main/java/org/jclouds/openstack/swift/CommonSwiftAsyncClient.java b/apis/swift/src/main/java/org/jclouds/openstack/swift/CommonSwiftAsyncClient.java index e7c744ceaf..0bc53dccd7 100644 --- a/apis/swift/src/main/java/org/jclouds/openstack/swift/CommonSwiftAsyncClient.java +++ b/apis/swift/src/main/java/org/jclouds/openstack/swift/CommonSwiftAsyncClient.java @@ -79,7 +79,10 @@ import com.google.inject.Provides; * @see CommonSwiftClient * @see * @author Adrian Cole + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(CommonSwiftClient.class)} as + * {@link CommonSwiftAsyncClient} interface will be removed in jclouds 1.7. */ +@Deprecated public interface CommonSwiftAsyncClient extends Closeable { @Provides SwiftObject newSwiftObject(); diff --git a/apis/swift/src/main/java/org/jclouds/openstack/swift/SwiftApiMetadata.java b/apis/swift/src/main/java/org/jclouds/openstack/swift/SwiftApiMetadata.java index 86690aa254..78c16ee208 100644 --- a/apis/swift/src/main/java/org/jclouds/openstack/swift/SwiftApiMetadata.java +++ b/apis/swift/src/main/java/org/jclouds/openstack/swift/SwiftApiMetadata.java @@ -32,7 +32,6 @@ import org.jclouds.openstack.swift.blobstore.config.SwiftBlobStoreContextModule; import org.jclouds.openstack.swift.blobstore.config.TemporaryUrlExtensionModule.SwiftTemporaryUrlExtensionModule; import org.jclouds.openstack.swift.config.SwiftRestClientModule; import org.jclouds.openstack.swift.config.SwiftRestClientModule.StorageEndpointModule; -import org.jclouds.rest.RestContext; import org.jclouds.rest.internal.BaseRestApiMetadata; import com.google.common.collect.ImmutableSet; @@ -46,7 +45,12 @@ import com.google.inject.Module; */ public class SwiftApiMetadata extends BaseRestApiMetadata { - public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { + /** + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(SwiftClient.class)} as + * {@link SwiftAsyncClient} interface will be removed in jclouds 1.7. + */ + @Deprecated + public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { private static final long serialVersionUID = 1L; }; @@ -75,6 +79,7 @@ public class SwiftApiMetadata extends BaseRestApiMetadata { } public static abstract class Builder> extends BaseRestApiMetadata.Builder { + @SuppressWarnings("deprecation") protected Builder() { this(SwiftClient.class, SwiftAsyncClient.class); } diff --git a/apis/swift/src/main/java/org/jclouds/openstack/swift/SwiftAsyncClient.java b/apis/swift/src/main/java/org/jclouds/openstack/swift/SwiftAsyncClient.java index a870308818..f20a6fc368 100644 --- a/apis/swift/src/main/java/org/jclouds/openstack/swift/SwiftAsyncClient.java +++ b/apis/swift/src/main/java/org/jclouds/openstack/swift/SwiftAsyncClient.java @@ -26,7 +26,10 @@ import org.jclouds.rest.annotations.RequestFilters; * Functionality that's in Swift, and not in CloudFiles. * * @author Adrian Cole + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(SwiftClient.class)} as + * {@link SwiftAsyncClient} interface will be removed in jclouds 1.7. */ +@Deprecated @RequestFilters(AuthenticateRequest.class) @Endpoint(Storage.class) public interface SwiftAsyncClient extends CommonSwiftAsyncClient { diff --git a/apis/swift/src/main/java/org/jclouds/openstack/swift/SwiftKeystoneApiMetadata.java b/apis/swift/src/main/java/org/jclouds/openstack/swift/SwiftKeystoneApiMetadata.java index c8939979f5..f547168a16 100644 --- a/apis/swift/src/main/java/org/jclouds/openstack/swift/SwiftKeystoneApiMetadata.java +++ b/apis/swift/src/main/java/org/jclouds/openstack/swift/SwiftKeystoneApiMetadata.java @@ -32,7 +32,6 @@ import org.jclouds.openstack.swift.blobstore.config.SwiftBlobStoreContextModule; import org.jclouds.openstack.swift.blobstore.config.TemporaryUrlExtensionModule.SwiftKeystoneTemporaryUrlExtensionModule; import org.jclouds.openstack.swift.config.SwiftKeystoneRestClientModule; import org.jclouds.openstack.swift.config.SwiftRestClientModule.KeystoneStorageEndpointModule; -import org.jclouds.rest.RestContext; import com.google.common.collect.ImmutableSet; import com.google.common.reflect.TypeToken; @@ -45,7 +44,12 @@ import com.google.inject.Module; */ public class SwiftKeystoneApiMetadata extends SwiftApiMetadata { - public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { + /** + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(SwiftKeystoneClient.class)} as + * {@link SwiftKeystoneAsyncClient} interface will be removed in jclouds 1.7. + */ + @Deprecated + public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { private static final long serialVersionUID = 1L; }; diff --git a/apis/swift/src/main/java/org/jclouds/openstack/swift/SwiftKeystoneAsyncClient.java b/apis/swift/src/main/java/org/jclouds/openstack/swift/SwiftKeystoneAsyncClient.java index cd89cc4bb2..06a1bb0e7c 100644 --- a/apis/swift/src/main/java/org/jclouds/openstack/swift/SwiftKeystoneAsyncClient.java +++ b/apis/swift/src/main/java/org/jclouds/openstack/swift/SwiftKeystoneAsyncClient.java @@ -26,7 +26,10 @@ import org.jclouds.rest.annotations.RequestFilters; * Functionality that's in Swift, and not in CloudFiles. * * @author Adrian Cole + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(SwiftKeystoneClient.class)} as + * {@link SwiftKeystoneAsyncClient} interface will be removed in jclouds 1.7. */ +@Deprecated @RequestFilters(AuthenticateRequest.class) @Endpoint(Storage.class) public interface SwiftKeystoneAsyncClient extends SwiftAsyncClient { diff --git a/apis/vcloud/src/main/java/org/jclouds/vcloud/VCloudApiMetadata.java b/apis/vcloud/src/main/java/org/jclouds/vcloud/VCloudApiMetadata.java index 978167de9e..e8f4ba8030 100644 --- a/apis/vcloud/src/main/java/org/jclouds/vcloud/VCloudApiMetadata.java +++ b/apis/vcloud/src/main/java/org/jclouds/vcloud/VCloudApiMetadata.java @@ -31,7 +31,6 @@ import java.util.Properties; import org.jclouds.apis.ApiMetadata; import org.jclouds.compute.ComputeServiceContext; -import org.jclouds.rest.RestContext; import org.jclouds.rest.internal.BaseRestApiMetadata; import org.jclouds.vcloud.compute.config.VCloudComputeServiceContextModule; import org.jclouds.vcloud.config.VCloudRestClientModule; @@ -48,7 +47,12 @@ import com.google.inject.Module; */ public class VCloudApiMetadata extends BaseRestApiMetadata { - public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { + /** + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(VCloudClient.class)} as + * {@link VCloudAsyncClient} interface will be removed in jclouds 1.7. + */ + @Deprecated + public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { private static final long serialVersionUID = 1L; }; @@ -87,6 +91,7 @@ public class VCloudApiMetadata extends BaseRestApiMetadata { public static class Builder extends BaseRestApiMetadata.Builder { + @SuppressWarnings("deprecation") protected Builder() { super(VCloudClient.class, VCloudAsyncClient.class); id("vcloud") diff --git a/apis/vcloud/src/main/java/org/jclouds/vcloud/VCloudAsyncClient.java b/apis/vcloud/src/main/java/org/jclouds/vcloud/VCloudAsyncClient.java index a9f81865ec..fb032ef295 100644 --- a/apis/vcloud/src/main/java/org/jclouds/vcloud/VCloudAsyncClient.java +++ b/apis/vcloud/src/main/java/org/jclouds/vcloud/VCloudAsyncClient.java @@ -39,7 +39,10 @@ import org.jclouds.vcloud.filters.AddVCloudAuthorizationAndCookieToRequest; * @see * @author Adrian Cole + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(VCloudClient.class)} as + * {@link VCloudAsyncClient} interface will be removed in jclouds 1.7. */ +@Deprecated @RequestFilters(AddVCloudAuthorizationAndCookieToRequest.class) public interface VCloudAsyncClient extends Closeable { diff --git a/core/src/main/java/org/jclouds/rest/RestContext.java b/core/src/main/java/org/jclouds/rest/RestContext.java index fe1569980c..b4df730195 100644 --- a/core/src/main/java/org/jclouds/rest/RestContext.java +++ b/core/src/main/java/org/jclouds/rest/RestContext.java @@ -32,7 +32,10 @@ import com.google.inject.ImplementedBy; * * @author Adrian Cole * + * @deprecated please use {@link org.jclouds.ContextBuilder#buildApi()} as + * async interface will be removed in jclouds 1.7. */ +@Deprecated @ImplementedBy(RestContextImpl.class) public interface RestContext extends Context { @@ -40,7 +43,10 @@ public interface RestContext extends Context { * low-level api to the cloud. Threadsafe implementations will return a singleton. * * @return a connection to the cloud where all methods return {@link Future}s + * @deprecated please use {@link org.jclouds.ContextBuilder#buildApi()} as + * async interface will be removed in jclouds 1.7. */ + @Deprecated A getAsyncApi(); /** diff --git a/core/src/main/java/org/jclouds/rest/internal/RestContextImpl.java b/core/src/main/java/org/jclouds/rest/internal/RestContextImpl.java index 84085b4ea5..3698ad1a7f 100644 --- a/core/src/main/java/org/jclouds/rest/internal/RestContextImpl.java +++ b/core/src/main/java/org/jclouds/rest/internal/RestContextImpl.java @@ -39,7 +39,10 @@ import com.google.inject.TypeLiteral; /** * @author Adrian Cole + * @deprecated please use {@link org.jclouds.ContextBuilder#buildApi()} as + * async interface will be removed in jclouds 1.7. */ +@Deprecated @Singleton public class RestContextImpl extends ContextImpl implements RestContext { diff --git a/providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/AWSEC2ApiMetadata.java b/providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/AWSEC2ApiMetadata.java index bc31ff3d96..d66eaa2b21 100644 --- a/providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/AWSEC2ApiMetadata.java +++ b/providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/AWSEC2ApiMetadata.java @@ -28,7 +28,6 @@ import org.jclouds.aws.ec2.compute.config.AWSEC2ComputeServiceContextModule; import org.jclouds.aws.ec2.config.AWSEC2RestClientModule; import org.jclouds.ec2.EC2ApiMetadata; import org.jclouds.ec2.compute.config.EC2ResolveImagesModule; -import org.jclouds.rest.RestContext; import com.google.common.collect.ImmutableSet; import com.google.common.reflect.TypeToken; @@ -40,8 +39,13 @@ import com.google.inject.Module; * @author Adrian Cole */ public class AWSEC2ApiMetadata extends EC2ApiMetadata { - - public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { + + /** + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(AWSEC2Client.class)} as + * {@link AWSEC2AsyncClient} interface will be removed in jclouds 1.7. + */ + @Deprecated + public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { private static final long serialVersionUID = 1L; }; @@ -69,10 +73,11 @@ public class AWSEC2ApiMetadata extends EC2ApiMetadata { } public static class Builder extends EC2ApiMetadata.Builder { + @SuppressWarnings("deprecation") protected Builder(){ super(AWSEC2Client.class, AWSEC2AsyncClient.class); id("aws-ec2") - .version(AWSEC2AsyncClient.VERSION) + .version("2012-06-01") .name("Amazon-specific EC2 API") .view(AWSEC2ComputeServiceContext.class) .context(CONTEXT_TOKEN) diff --git a/providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/AWSEC2AsyncClient.java b/providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/AWSEC2AsyncClient.java index a20a5dc599..54b48aee9a 100644 --- a/providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/AWSEC2AsyncClient.java +++ b/providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/AWSEC2AsyncClient.java @@ -32,9 +32,13 @@ import org.jclouds.rest.annotations.Delegate; * Provides asynchronous access to EC2 services. * * @author Adrian Cole + * + * @deprecated please use + * {@code org.jclouds.ContextBuilder#buildApi(AWSEC2Client.class)} + * as {@link AWSEC2AsyncClient} interface will be removed in jclouds 1.7. */ +@Deprecated public interface AWSEC2AsyncClient extends EC2AsyncClient { - public static final String VERSION = "2012-06-01"; /** * {@inheritDoc} diff --git a/providers/aws-s3/src/main/java/org/jclouds/aws/s3/AWSS3ApiMetadata.java b/providers/aws-s3/src/main/java/org/jclouds/aws/s3/AWSS3ApiMetadata.java index 1a503b8153..05681964a7 100644 --- a/providers/aws-s3/src/main/java/org/jclouds/aws/s3/AWSS3ApiMetadata.java +++ b/providers/aws-s3/src/main/java/org/jclouds/aws/s3/AWSS3ApiMetadata.java @@ -26,7 +26,6 @@ import org.jclouds.apis.ApiMetadata; import org.jclouds.aws.s3.blobstore.AWSS3BlobStoreContext; import org.jclouds.aws.s3.blobstore.config.AWSS3BlobStoreContextModule; import org.jclouds.aws.s3.config.AWSS3RestClientModule; -import org.jclouds.rest.RestContext; import org.jclouds.s3.S3ApiMetadata; import com.google.common.collect.ImmutableSet; @@ -40,7 +39,12 @@ import com.google.inject.Module; */ public class AWSS3ApiMetadata extends S3ApiMetadata { - public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { + /** + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(AWSS3Client.class)} as + * {@link AWSS3AsyncClient} interface will be removed in jclouds 1.7. + */ + @Deprecated + public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { private static final long serialVersionUID = 1L; }; @@ -63,6 +67,7 @@ public class AWSS3ApiMetadata extends S3ApiMetadata { } public static class Builder extends S3ApiMetadata.Builder { + @SuppressWarnings("deprecation") protected Builder(){ super(AWSS3Client.class, AWSS3AsyncClient.class); id("aws-s3") diff --git a/providers/aws-s3/src/main/java/org/jclouds/aws/s3/AWSS3AsyncClient.java b/providers/aws-s3/src/main/java/org/jclouds/aws/s3/AWSS3AsyncClient.java index a8241e30b0..ede4bd0885 100644 --- a/providers/aws-s3/src/main/java/org/jclouds/aws/s3/AWSS3AsyncClient.java +++ b/providers/aws-s3/src/main/java/org/jclouds/aws/s3/AWSS3AsyncClient.java @@ -66,6 +66,9 @@ import com.google.common.util.concurrent.ListenableFuture; * Provides access to amazon-specific S3 features * * @author Adrian Cole, Jeremy Whitlock + * @deprecated please use + * {@code org.jclouds.ContextBuilder#buildApi(AWSS3Client.class)} + * as {@link AWSS3AsyncClient} interface will be removed in jclouds 1.7. */ @RequestFilters(RequestAuthorizeSignature.class) @BlobScope(CONTAINER) diff --git a/providers/azureblob/src/main/java/org/jclouds/azureblob/AzureBlobApiMetadata.java b/providers/azureblob/src/main/java/org/jclouds/azureblob/AzureBlobApiMetadata.java index 12c8ba1cbe..fc8a2dad39 100644 --- a/providers/azureblob/src/main/java/org/jclouds/azureblob/AzureBlobApiMetadata.java +++ b/providers/azureblob/src/main/java/org/jclouds/azureblob/AzureBlobApiMetadata.java @@ -28,7 +28,6 @@ import org.jclouds.apis.ApiMetadata; import org.jclouds.azureblob.blobstore.config.AzureBlobStoreContextModule; import org.jclouds.azureblob.config.AzureBlobRestClientModule; import org.jclouds.blobstore.BlobStoreContext; -import org.jclouds.rest.RestContext; import org.jclouds.rest.internal.BaseRestApiMetadata; import com.google.common.collect.ImmutableSet; @@ -42,7 +41,12 @@ import com.google.inject.Module; */ public class AzureBlobApiMetadata extends BaseRestApiMetadata { - public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { + /** + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(AzureBlobClient.class)} as + * {@link AzureBlobAsyncClient} interface will be removed in jclouds 1.7. + */ + @Deprecated + public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { private static final long serialVersionUID = 1L; }; @@ -70,6 +74,7 @@ public class AzureBlobApiMetadata extends BaseRestApiMetadata { } public static class Builder extends BaseRestApiMetadata.Builder { + @SuppressWarnings("deprecation") protected Builder(){ super(AzureBlobClient.class, AzureBlobAsyncClient.class); id("azureblob") diff --git a/providers/azureblob/src/main/java/org/jclouds/azureblob/AzureBlobAsyncClient.java b/providers/azureblob/src/main/java/org/jclouds/azureblob/AzureBlobAsyncClient.java index a6e7b231ca..c18ea4e77d 100644 --- a/providers/azureblob/src/main/java/org/jclouds/azureblob/AzureBlobAsyncClient.java +++ b/providers/azureblob/src/main/java/org/jclouds/azureblob/AzureBlobAsyncClient.java @@ -84,7 +84,10 @@ import com.google.inject.Provides; * @see * @see AzureBlobClient * @author Adrian Cole + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(AzureBlobClient.class)} as + * {@link AzureBlobAsyncClient} interface will be removed in jclouds 1.7. */ +@Deprecated @RequestFilters(SharedKeyLiteAuthentication.class) @Headers(keys = AzureStorageHeaders.VERSION, values = "2009-09-19") @SkipEncoding({ '/', '$' }) diff --git a/providers/dynect/src/main/java/org/jclouds/dynect/v3/DynECTApiMetadata.java b/providers/dynect/src/main/java/org/jclouds/dynect/v3/DynECTApiMetadata.java index 40920e8ec2..89be1afb5b 100644 --- a/providers/dynect/src/main/java/org/jclouds/dynect/v3/DynECTApiMetadata.java +++ b/providers/dynect/src/main/java/org/jclouds/dynect/v3/DynECTApiMetadata.java @@ -24,11 +24,9 @@ import java.util.Properties; import org.jclouds.apis.ApiMetadata; import org.jclouds.dynect.v3.config.DynECTParserModule; import org.jclouds.dynect.v3.config.DynECTRestClientModule; -import org.jclouds.rest.RestContext; import org.jclouds.rest.internal.BaseRestApiMetadata; import com.google.common.collect.ImmutableSet; -import com.google.common.reflect.TypeToken; import com.google.inject.Module; /** @@ -40,10 +38,6 @@ public class DynECTApiMetadata extends BaseRestApiMetadata { public static final String ANONYMOUS_IDENTITY = "ANONYMOUS"; - public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { - private static final long serialVersionUID = 1L; - }; - @Override public Builder toBuilder() { return new Builder().fromApiMetadata(this); diff --git a/providers/dynect/src/main/java/org/jclouds/dynect/v3/DynECTAsyncApi.java b/providers/dynect/src/main/java/org/jclouds/dynect/v3/DynECTAsyncApi.java index 1c66e71ce9..14f86b234f 100644 --- a/providers/dynect/src/main/java/org/jclouds/dynect/v3/DynECTAsyncApi.java +++ b/providers/dynect/src/main/java/org/jclouds/dynect/v3/DynECTAsyncApi.java @@ -49,7 +49,10 @@ import com.google.common.util.concurrent.ListenableFuture; * @see DynECTApi * @see * @author Adrian Cole + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(DynECTApi.class)} as + * {@link DynECTAsyncApi} interface will be removed in jclouds 1.7. */ + public interface DynECTAsyncApi extends Closeable { /** * @see DynECTApi#getJob diff --git a/providers/glesys/src/main/java/org/jclouds/glesys/GleSYSApiMetadata.java b/providers/glesys/src/main/java/org/jclouds/glesys/GleSYSApiMetadata.java index 26ec7c4929..7719c35734 100644 --- a/providers/glesys/src/main/java/org/jclouds/glesys/GleSYSApiMetadata.java +++ b/providers/glesys/src/main/java/org/jclouds/glesys/GleSYSApiMetadata.java @@ -27,7 +27,6 @@ import org.jclouds.apis.ApiMetadata; import org.jclouds.compute.ComputeServiceContext; import org.jclouds.glesys.compute.config.GleSYSComputeServiceContextModule; import org.jclouds.glesys.config.GleSYSRestClientModule; -import org.jclouds.rest.RestContext; import org.jclouds.rest.internal.BaseRestApiMetadata; import com.google.common.collect.ImmutableSet; @@ -41,7 +40,12 @@ import com.google.inject.Module; */ public class GleSYSApiMetadata extends BaseRestApiMetadata { - public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { + /** + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(GleSYSApi.class)} as + * {@link GleSYSAsyncApi} interface will be removed in jclouds 1.7. + */ + @Deprecated + public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { private static final long serialVersionUID = 1L; }; @@ -67,6 +71,7 @@ public class GleSYSApiMetadata extends BaseRestApiMetadata { public static class Builder extends BaseRestApiMetadata.Builder { + @SuppressWarnings("deprecation") protected Builder() { super(GleSYSApi.class, GleSYSAsyncApi.class); id("glesys") diff --git a/providers/glesys/src/main/java/org/jclouds/glesys/GleSYSAsyncApi.java b/providers/glesys/src/main/java/org/jclouds/glesys/GleSYSAsyncApi.java index 68ee031c53..0cb738cd60 100644 --- a/providers/glesys/src/main/java/org/jclouds/glesys/GleSYSAsyncApi.java +++ b/providers/glesys/src/main/java/org/jclouds/glesys/GleSYSAsyncApi.java @@ -34,7 +34,10 @@ import org.jclouds.rest.annotations.Delegate; * @see GleSYSApi * @see * @author Adrian Cole + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(GleSYSApi.class)} as + * {@link GleSYSAsyncApi} interface will be removed in jclouds 1.7. */ +@Deprecated public interface GleSYSAsyncApi extends Closeable { /** diff --git a/providers/glesys/src/test/java/org/jclouds/glesys/features/ArchiveApiLiveTest.java b/providers/glesys/src/test/java/org/jclouds/glesys/features/ArchiveApiLiveTest.java index d6fc7d12ca..9ac1808bc5 100644 --- a/providers/glesys/src/test/java/org/jclouds/glesys/features/ArchiveApiLiveTest.java +++ b/providers/glesys/src/test/java/org/jclouds/glesys/features/ArchiveApiLiveTest.java @@ -49,7 +49,7 @@ public class ArchiveApiLiveTest extends BaseGleSYSApiLiveTest { archiveUser = identity.toLowerCase() + "_test9"; archiveCounter = retry(new Predicate() { public boolean apply(Integer value) { - return archiveApi.list().size() == value; + return archiveApi.list().size() == value.intValue(); } }, 30, 1, SECONDS); } diff --git a/providers/glesys/src/test/java/org/jclouds/glesys/features/DomainApiLiveTest.java b/providers/glesys/src/test/java/org/jclouds/glesys/features/DomainApiLiveTest.java index 5738036c5c..852722cf48 100644 --- a/providers/glesys/src/test/java/org/jclouds/glesys/features/DomainApiLiveTest.java +++ b/providers/glesys/src/test/java/org/jclouds/glesys/features/DomainApiLiveTest.java @@ -53,12 +53,12 @@ public class DomainApiLiveTest extends BaseGleSYSApiLiveTest { domainApi = api.getDomainApi(); domainCounter = retry(new Predicate() { public boolean apply(Integer value) { - return domainApi.list().size() == value; + return domainApi.list().size() == value.intValue(); } }, 30, 1, SECONDS); recordCounter = retry(new Predicate() { public boolean apply(Integer value) { - return domainApi.listRecords(testDomain).size() == value; + return domainApi.listRecords(testDomain).size() == value.intValue(); } }, 30, 1, SECONDS); diff --git a/providers/glesys/src/test/java/org/jclouds/glesys/features/EmailAccountApiLiveTest.java b/providers/glesys/src/test/java/org/jclouds/glesys/features/EmailAccountApiLiveTest.java index 417459a3b0..fa90347f93 100644 --- a/providers/glesys/src/test/java/org/jclouds/glesys/features/EmailAccountApiLiveTest.java +++ b/providers/glesys/src/test/java/org/jclouds/glesys/features/EmailAccountApiLiveTest.java @@ -63,7 +63,7 @@ public class EmailAccountApiLiveTest extends BaseGleSYSApiLiveTest { emailAccountCounter = retry(new Predicate() { public boolean apply(Integer value) { - return emailAccountApi.listDomain(testDomain).size() == value; + return emailAccountApi.listDomain(testDomain).size() == value.intValue(); } }, 180, 5, SECONDS); diff --git a/providers/glesys/src/test/java/org/jclouds/glesys/internal/BaseGleSYSApiLiveTest.java b/providers/glesys/src/test/java/org/jclouds/glesys/internal/BaseGleSYSApiLiveTest.java index 3ee1cc7efa..cb390940b3 100644 --- a/providers/glesys/src/test/java/org/jclouds/glesys/internal/BaseGleSYSApiLiveTest.java +++ b/providers/glesys/src/test/java/org/jclouds/glesys/internal/BaseGleSYSApiLiveTest.java @@ -43,13 +43,13 @@ public class BaseGleSYSApiLiveTest extends BaseApiLiveTest { } protected void createDomain(String domain) { - final DomainApi api = this.api.getDomainApi(); - int before = api.list().size(); - api.create(domain); + final DomainApi domainApi = api.getDomainApi(); + int before = domainApi.list().size(); + domainApi.create(domain); Predicate result = retry(new Predicate() { public boolean apply(Integer value) { - return api.list().size() == value; + return domainApi.list().size() == value.intValue(); } }, 30, 1, SECONDS); diff --git a/providers/glesys/src/test/java/org/jclouds/glesys/internal/BaseGleSYSApiWithAServerLiveTest.java b/providers/glesys/src/test/java/org/jclouds/glesys/internal/BaseGleSYSApiWithAServerLiveTest.java index 4f50a2a9df..28b8d87222 100644 --- a/providers/glesys/src/test/java/org/jclouds/glesys/internal/BaseGleSYSApiWithAServerLiveTest.java +++ b/providers/glesys/src/test/java/org/jclouds/glesys/internal/BaseGleSYSApiWithAServerLiveTest.java @@ -74,21 +74,21 @@ public class BaseGleSYSApiWithAServerLiveTest extends BaseGleSYSApiLiveTest { } protected void createDomain(String domain) { - final DomainApi api = this.api.getDomainApi(); - int before = api.list().size(); - api.create(domain); + final DomainApi domainApi = api.getDomainApi(); + int before = domainApi.list().size(); + domainApi.create(domain); Predicate result = retry(new Predicate() { public boolean apply(Integer value) { - return api.list().size() == value; + return domainApi.list().size() == value.intValue(); } }, 30, 1, SECONDS); assertTrue(result.apply(before + 1)); } protected Predicate createServer(String hostName) { - final ServerApi api = this.api.getServerApi(); + final ServerApi serverApi = api.getServerApi(); - ServerDetails testServer = api.createWithHostnameAndRootPassword( + ServerDetails testServer = serverApi.createWithHostnameAndRootPassword( ServerSpec.builder().datacenter("Falkenberg").platform("OpenVZ").templateName("Ubuntu 10.04 LTS 32-bit") .diskSizeGB(5).memorySizeMB(512).cpuCores(1).transferGB(50).build(), hostName, UUID.randomUUID() .toString().replace("-","")); @@ -97,7 +97,7 @@ public class BaseGleSYSApiWithAServerLiveTest extends BaseGleSYSApiLiveTest { assertEquals(testServer.getHostname(), hostName); assertFalse(testServer.getIps().isEmpty()); - Predicate statusChecker = statusChecker(api, testServer.getId()); + Predicate statusChecker = statusChecker(serverApi, testServer.getId()); assertTrue(statusChecker.apply(Server.State.RUNNING)); serverId = testServer.getId(); return statusChecker; diff --git a/providers/gogrid/src/main/java/org/jclouds/gogrid/GoGridApiMetadata.java b/providers/gogrid/src/main/java/org/jclouds/gogrid/GoGridApiMetadata.java index 2630ff8e0b..1318780c9a 100644 --- a/providers/gogrid/src/main/java/org/jclouds/gogrid/GoGridApiMetadata.java +++ b/providers/gogrid/src/main/java/org/jclouds/gogrid/GoGridApiMetadata.java @@ -27,7 +27,6 @@ import org.jclouds.apis.ApiMetadata; import org.jclouds.compute.ComputeServiceContext; import org.jclouds.gogrid.compute.config.GoGridComputeServiceContextModule; import org.jclouds.gogrid.config.GoGridRestClientModule; -import org.jclouds.rest.RestContext; import org.jclouds.rest.internal.BaseRestApiMetadata; import com.google.common.collect.ImmutableSet; @@ -41,7 +40,12 @@ import com.google.inject.Module; */ public class GoGridApiMetadata extends BaseRestApiMetadata { - public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { + /** + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(GoGridClient.class)} as + * {@link GoGridAsyncClient} interface will be removed in jclouds 1.7. + */ + @Deprecated + public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { private static final long serialVersionUID = 1L; }; @@ -67,6 +71,7 @@ public class GoGridApiMetadata extends BaseRestApiMetadata { public static class Builder extends BaseRestApiMetadata.Builder { + @SuppressWarnings("deprecation") protected Builder() { super(GoGridClient.class, GoGridAsyncClient.class); id("gogrid") @@ -74,7 +79,7 @@ public class GoGridApiMetadata extends BaseRestApiMetadata { .identityName("API Key") .credentialName("Shared Secret") .documentation(URI.create("https://wiki.gogrid.com/wiki/index.php/API")) - .version(GoGridAsyncClient.VERSION) + .version("1.5") .defaultEndpoint("https://api.gogrid.com/api") .defaultProperties(GoGridApiMetadata.defaultProperties()) .view(typeToken(ComputeServiceContext.class)) diff --git a/providers/gogrid/src/main/java/org/jclouds/gogrid/GoGridAsyncClient.java b/providers/gogrid/src/main/java/org/jclouds/gogrid/GoGridAsyncClient.java index ae118fc1f3..d27c80a931 100644 --- a/providers/gogrid/src/main/java/org/jclouds/gogrid/GoGridAsyncClient.java +++ b/providers/gogrid/src/main/java/org/jclouds/gogrid/GoGridAsyncClient.java @@ -29,9 +29,11 @@ import org.jclouds.rest.annotations.Delegate; /** * @author Oleksiy Yarmula + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(GoGridClient.class)} as + * {@link GoGridAsyncClient} interface will be removed in jclouds 1.7. */ +@Deprecated public interface GoGridAsyncClient extends Closeable { - public static final String VERSION = "1.5"; /** * @see GoGridClient#getServerServices() diff --git a/providers/gogrid/src/main/java/org/jclouds/gogrid/GoGridProviderMetadata.java b/providers/gogrid/src/main/java/org/jclouds/gogrid/GoGridProviderMetadata.java index b371746a58..804069ace7 100644 --- a/providers/gogrid/src/main/java/org/jclouds/gogrid/GoGridProviderMetadata.java +++ b/providers/gogrid/src/main/java/org/jclouds/gogrid/GoGridProviderMetadata.java @@ -18,7 +18,6 @@ */ package org.jclouds.gogrid; -import static org.jclouds.Constants.PROPERTY_API_VERSION; import static org.jclouds.compute.config.ComputeServiceProperties.TEMPLATE; import static org.jclouds.location.reference.LocationConstants.ISO3166_CODES; import static org.jclouds.location.reference.LocationConstants.PROPERTY_ZONE; @@ -59,7 +58,6 @@ public class GoGridProviderMetadata extends BaseProviderMetadata { properties.setProperty(PROPERTY_ZONE + ".1." + ISO3166_CODES, "US-CA"); properties.setProperty(PROPERTY_ZONE + ".2." + ISO3166_CODES, "US-VA"); properties.setProperty(PROPERTY_ZONE + ".3." + ISO3166_CODES, "NL-NH"); - properties.setProperty(PROPERTY_API_VERSION, GoGridAsyncClient.VERSION); properties.setProperty(TEMPLATE, "osFamily=UBUNTU,osVersionMatches=1[012].[01][04],imageNameMatches=.*w/ None.*,locationId=1"); return properties; } diff --git a/providers/gogrid/src/main/java/org/jclouds/gogrid/services/GridImageAsyncClient.java b/providers/gogrid/src/main/java/org/jclouds/gogrid/services/GridImageAsyncClient.java index d689705262..96323565bf 100644 --- a/providers/gogrid/src/main/java/org/jclouds/gogrid/services/GridImageAsyncClient.java +++ b/providers/gogrid/src/main/java/org/jclouds/gogrid/services/GridImageAsyncClient.java @@ -33,7 +33,6 @@ import javax.ws.rs.Path; import javax.ws.rs.QueryParam; import org.jclouds.Fallbacks.NullOnNotFoundOr404; -import org.jclouds.gogrid.GoGridAsyncClient; import org.jclouds.gogrid.binders.BindIdsToQueryParams; import org.jclouds.gogrid.binders.BindNamesToQueryParams; import org.jclouds.gogrid.domain.Option; @@ -56,7 +55,7 @@ import com.google.common.util.concurrent.ListenableFuture; * @author Oleksiy Yarmula */ @RequestFilters(SharedKeyLiteAuthentication.class) -@QueryParams(keys = VERSION, values = GoGridAsyncClient.VERSION) +@QueryParams(keys = VERSION, values = "{jclouds.api-version}") public interface GridImageAsyncClient { /** diff --git a/providers/gogrid/src/main/java/org/jclouds/gogrid/services/GridIpAsyncClient.java b/providers/gogrid/src/main/java/org/jclouds/gogrid/services/GridIpAsyncClient.java index ed2c826d10..bd5d282330 100644 --- a/providers/gogrid/src/main/java/org/jclouds/gogrid/services/GridIpAsyncClient.java +++ b/providers/gogrid/src/main/java/org/jclouds/gogrid/services/GridIpAsyncClient.java @@ -28,7 +28,6 @@ import java.util.Set; import javax.ws.rs.GET; import javax.ws.rs.Path; -import org.jclouds.gogrid.GoGridAsyncClient; import org.jclouds.gogrid.domain.Ip; import org.jclouds.gogrid.domain.Option; import org.jclouds.gogrid.filters.SharedKeyLiteAuthentication; @@ -47,7 +46,7 @@ import com.google.common.util.concurrent.ListenableFuture; * @author Oleksiy Yarmula */ @RequestFilters(SharedKeyLiteAuthentication.class) -@QueryParams(keys = VERSION, values = GoGridAsyncClient.VERSION) +@QueryParams(keys = VERSION, values = "{jclouds.api-version}") public interface GridIpAsyncClient { /** diff --git a/providers/gogrid/src/main/java/org/jclouds/gogrid/services/GridJobAsyncClient.java b/providers/gogrid/src/main/java/org/jclouds/gogrid/services/GridJobAsyncClient.java index b387ddc2ab..c4f881807a 100644 --- a/providers/gogrid/src/main/java/org/jclouds/gogrid/services/GridJobAsyncClient.java +++ b/providers/gogrid/src/main/java/org/jclouds/gogrid/services/GridJobAsyncClient.java @@ -25,7 +25,6 @@ import java.util.Set; import javax.ws.rs.GET; import javax.ws.rs.Path; -import org.jclouds.gogrid.GoGridAsyncClient; import org.jclouds.gogrid.binders.BindIdsToQueryParams; import org.jclouds.gogrid.binders.BindObjectNameToGetJobsRequestQueryParams; import org.jclouds.gogrid.domain.Job; @@ -43,7 +42,7 @@ import com.google.common.util.concurrent.ListenableFuture; * @author Oleksiy Yarmula */ @RequestFilters(SharedKeyLiteAuthentication.class) -@QueryParams(keys = VERSION, values = GoGridAsyncClient.VERSION) +@QueryParams(keys = VERSION, values = "{jclouds.api-version}") public interface GridJobAsyncClient { /** diff --git a/providers/gogrid/src/main/java/org/jclouds/gogrid/services/GridLoadBalancerAsyncClient.java b/providers/gogrid/src/main/java/org/jclouds/gogrid/services/GridLoadBalancerAsyncClient.java index c2bcc5d6b7..3ad9c779d0 100644 --- a/providers/gogrid/src/main/java/org/jclouds/gogrid/services/GridLoadBalancerAsyncClient.java +++ b/providers/gogrid/src/main/java/org/jclouds/gogrid/services/GridLoadBalancerAsyncClient.java @@ -30,7 +30,6 @@ import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.QueryParam; -import org.jclouds.gogrid.GoGridAsyncClient; import org.jclouds.gogrid.binders.BindIdsToQueryParams; import org.jclouds.gogrid.binders.BindNamesToQueryParams; import org.jclouds.gogrid.binders.BindRealIpPortPairsToQueryParams; @@ -54,7 +53,7 @@ import com.google.common.util.concurrent.ListenableFuture; * @author Oleksiy Yarmula */ @RequestFilters(SharedKeyLiteAuthentication.class) -@QueryParams(keys = VERSION, values = GoGridAsyncClient.VERSION) +@QueryParams(keys = VERSION, values = "{jclouds.api-version}") public interface GridLoadBalancerAsyncClient { /** 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 ac028f59ed..4aa072e1e7 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 @@ -33,7 +33,6 @@ import org.jclouds.openstack.swift.blobstore.config.TemporaryUrlExtensionModule; import org.jclouds.openstack.swift.config.SwiftRestClientModule.KeystoneStorageEndpointModule; import org.jclouds.openstack.swift.extensions.KeystoneTemporaryUrlKeyAsyncApi; import org.jclouds.openstack.swift.extensions.TemporaryUrlKeyApi; -import org.jclouds.rest.RestContext; import com.google.common.collect.ImmutableSet; import com.google.common.reflect.TypeToken; @@ -45,7 +44,12 @@ import com.google.inject.Module; */ public class HPCloudObjectStorageApiMetadata extends SwiftKeystoneApiMetadata { - public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { + /** + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(HPCloudObjectStorageApi.class)} as + * {@link HPCloudObjectStorageAsyncApi} interface will be removed in jclouds 1.7. + */ + @Deprecated + public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { private static final long serialVersionUID = 1L; }; @@ -68,6 +72,7 @@ public class HPCloudObjectStorageApiMetadata extends SwiftKeystoneApiMetadata { } public static class Builder extends SwiftKeystoneApiMetadata.Builder { + @SuppressWarnings("deprecation") protected Builder(){ super(HPCloudObjectStorageApi.class, HPCloudObjectStorageAsyncApi.class); id("hpcloud-objectstorage") diff --git a/providers/hpcloud-objectstorage/src/main/java/org/jclouds/hpcloud/objectstorage/HPCloudObjectStorageAsyncApi.java b/providers/hpcloud-objectstorage/src/main/java/org/jclouds/hpcloud/objectstorage/HPCloudObjectStorageAsyncApi.java index fdb2d53d74..273cc42e6f 100644 --- a/providers/hpcloud-objectstorage/src/main/java/org/jclouds/hpcloud/objectstorage/HPCloudObjectStorageAsyncApi.java +++ b/providers/hpcloud-objectstorage/src/main/java/org/jclouds/hpcloud/objectstorage/HPCloudObjectStorageAsyncApi.java @@ -60,7 +60,10 @@ import com.google.inject.Provides; * href="https://api-docs.hpcloud.com/hpcloud-object-storage/1.0/content/ch_object-storage-dev-overview.html">HP * Cloud Object Storage API * @author Jeremy Daggett + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(HPCloudObjectStorageApi.class)} as + * {@link HPCloudObjectStorageAsyncApi} interface will be removed in jclouds 1.7. */ +@Deprecated @RequestFilters(AuthenticateRequest.class) @Endpoint(Storage.class) public interface HPCloudObjectStorageAsyncApi extends CommonSwiftAsyncClient { diff --git a/providers/softlayer/src/main/java/org/jclouds/softlayer/SoftLayerApiMetadata.java b/providers/softlayer/src/main/java/org/jclouds/softlayer/SoftLayerApiMetadata.java index 33a3d99de7..9badca3be7 100644 --- a/providers/softlayer/src/main/java/org/jclouds/softlayer/SoftLayerApiMetadata.java +++ b/providers/softlayer/src/main/java/org/jclouds/softlayer/SoftLayerApiMetadata.java @@ -25,7 +25,6 @@ import java.util.Properties; import org.jclouds.apis.ApiMetadata; import org.jclouds.compute.ComputeServiceContext; -import org.jclouds.rest.RestContext; import org.jclouds.rest.internal.BaseRestApiMetadata; import org.jclouds.softlayer.compute.config.SoftLayerComputeServiceContextModule; import org.jclouds.softlayer.config.SoftLayerRestClientModule; @@ -41,7 +40,12 @@ import com.google.inject.Module; */ public class SoftLayerApiMetadata extends BaseRestApiMetadata { - public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { + /** + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(SoftLayerClient.class)} as + * {@link SoftLayerAsyncClient} interface will be removed in jclouds 1.7. + */ + @Deprecated + public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { private static final long serialVersionUID = 1L; }; @@ -67,6 +71,7 @@ public class SoftLayerApiMetadata extends BaseRestApiMetadata { public static class Builder extends BaseRestApiMetadata.Builder { + @SuppressWarnings("deprecation") protected Builder() { super(SoftLayerClient.class, SoftLayerAsyncClient.class); id("softlayer") diff --git a/providers/softlayer/src/main/java/org/jclouds/softlayer/SoftLayerAsyncClient.java b/providers/softlayer/src/main/java/org/jclouds/softlayer/SoftLayerAsyncClient.java index dec8a607b9..5df44c98f0 100644 --- a/providers/softlayer/src/main/java/org/jclouds/softlayer/SoftLayerAsyncClient.java +++ b/providers/softlayer/src/main/java/org/jclouds/softlayer/SoftLayerAsyncClient.java @@ -33,7 +33,10 @@ import org.jclouds.softlayer.features.VirtualGuestAsyncClient; * @see SoftLayerClient * @see * @author Adrian Cole + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(SoftLayerClient.class)} as + * {@link SoftLayerAsyncClient} interface will be removed in jclouds 1.7. */ +@Deprecated public interface SoftLayerAsyncClient extends Closeable { /** diff --git a/providers/trmk-ecloud/src/main/java/org/jclouds/trmk/ecloud/TerremarkECloudApiMetadata.java b/providers/trmk-ecloud/src/main/java/org/jclouds/trmk/ecloud/TerremarkECloudApiMetadata.java index 41a10f16e3..f11d62eb36 100644 --- a/providers/trmk-ecloud/src/main/java/org/jclouds/trmk/ecloud/TerremarkECloudApiMetadata.java +++ b/providers/trmk-ecloud/src/main/java/org/jclouds/trmk/ecloud/TerremarkECloudApiMetadata.java @@ -7,7 +7,6 @@ import java.net.URI; import java.util.Properties; import org.jclouds.apis.ApiMetadata; -import org.jclouds.rest.RestContext; import org.jclouds.trmk.ecloud.compute.config.TerremarkECloudComputeServiceContextModule; import org.jclouds.trmk.ecloud.config.TerremarkECloudRestClientModule; import org.jclouds.trmk.vcloud_0_8.internal.TerremarkVCloudApiMetadata; @@ -23,7 +22,12 @@ import com.google.inject.Module; */ public class TerremarkECloudApiMetadata extends TerremarkVCloudApiMetadata { - public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { + /** + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(TerremarkECloudClient.class)} as + * {@link TerremarkECloudAsyncClient} interface will be removed in jclouds 1.7. + */ + @Deprecated + public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { private static final long serialVersionUID = 1L; }; @@ -49,6 +53,7 @@ public class TerremarkECloudApiMetadata extends TerremarkVCloudApiMetadata { public static class Builder extends TerremarkVCloudApiMetadata.Builder { + @SuppressWarnings("deprecation") protected Builder() { super(TerremarkECloudClient.class, TerremarkECloudAsyncClient.class); id("trmk-ecloud") diff --git a/providers/trmk-ecloud/src/main/java/org/jclouds/trmk/ecloud/TerremarkECloudAsyncClient.java b/providers/trmk-ecloud/src/main/java/org/jclouds/trmk/ecloud/TerremarkECloudAsyncClient.java index cb7aaa11a0..bd5b765fe0 100644 --- a/providers/trmk-ecloud/src/main/java/org/jclouds/trmk/ecloud/TerremarkECloudAsyncClient.java +++ b/providers/trmk-ecloud/src/main/java/org/jclouds/trmk/ecloud/TerremarkECloudAsyncClient.java @@ -91,7 +91,10 @@ import com.google.common.util.concurrent.ListenableFuture; * "http://support.theenterprisecloud.com/kb/default.asp?id=645&Lang=1&SID=" * /> * @author Adrian Cole + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(TerremarkECloudClient.class)} as + * {@link TerremarkECloudAsyncClient} interface will be removed in jclouds 1.7. */ +@Deprecated @RequestFilters(SetVCloudTokenCookie.class) public interface TerremarkECloudAsyncClient extends TerremarkVCloudAsyncClient { /** diff --git a/providers/trmk-vcloudexpress/src/main/java/org/jclouds/trmk/vcloudexpress/TerremarkVCloudExpressApiMetadata.java b/providers/trmk-vcloudexpress/src/main/java/org/jclouds/trmk/vcloudexpress/TerremarkVCloudExpressApiMetadata.java index 871ffab6e7..f1ef3b5718 100644 --- a/providers/trmk-vcloudexpress/src/main/java/org/jclouds/trmk/vcloudexpress/TerremarkVCloudExpressApiMetadata.java +++ b/providers/trmk-vcloudexpress/src/main/java/org/jclouds/trmk/vcloudexpress/TerremarkVCloudExpressApiMetadata.java @@ -25,7 +25,6 @@ import java.net.URI; import java.util.Properties; import org.jclouds.apis.ApiMetadata; -import org.jclouds.rest.RestContext; import org.jclouds.trmk.vcloud_0_8.internal.TerremarkVCloudApiMetadata; import org.jclouds.trmk.vcloudexpress.compute.TerremarkVCloudExpressComputeServiceContextModule; import org.jclouds.trmk.vcloudexpress.config.TerremarkVCloudExpressRestClientModule; @@ -41,7 +40,12 @@ import com.google.inject.Module; */ public class TerremarkVCloudExpressApiMetadata extends TerremarkVCloudApiMetadata { - public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { + /** + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(TerremarkVCloudExpressClient.class)} as + * {@link TerremarkVCloudExpressAsyncClient} interface will be removed in jclouds 1.7. + */ + @Deprecated + public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { private static final long serialVersionUID = 1L; }; @@ -67,6 +71,7 @@ public class TerremarkVCloudExpressApiMetadata extends TerremarkVCloudApiMetadat public static class Builder extends TerremarkVCloudApiMetadata.Builder { + @SuppressWarnings("deprecation") protected Builder() { super(TerremarkVCloudExpressClient.class, TerremarkVCloudExpressAsyncClient.class); id("trmk-vcloudexpress") diff --git a/providers/trmk-vcloudexpress/src/main/java/org/jclouds/trmk/vcloudexpress/TerremarkVCloudExpressAsyncClient.java b/providers/trmk-vcloudexpress/src/main/java/org/jclouds/trmk/vcloudexpress/TerremarkVCloudExpressAsyncClient.java index 6b4c117aaa..036aba9d99 100644 --- a/providers/trmk-vcloudexpress/src/main/java/org/jclouds/trmk/vcloudexpress/TerremarkVCloudExpressAsyncClient.java +++ b/providers/trmk-vcloudexpress/src/main/java/org/jclouds/trmk/vcloudexpress/TerremarkVCloudExpressAsyncClient.java @@ -63,7 +63,10 @@ import com.google.common.util.concurrent.ListenableFuture; * * @see * @author Adrian Cole + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(TerremarkVCloudExpressClient.class)} as + * {@link TerremarkVCloudExpressAsyncClient} interface will be removed in jclouds 1.7. */ +@Deprecated @RequestFilters(SetVCloudTokenCookie.class) public interface TerremarkVCloudExpressAsyncClient extends TerremarkVCloudAsyncClient { /** diff --git a/providers/ultradns-ws/src/main/java/org/jclouds/ultradns/ws/UltraDNSWSApiMetadata.java b/providers/ultradns-ws/src/main/java/org/jclouds/ultradns/ws/UltraDNSWSApiMetadata.java index 65237b7336..de7127e3a7 100644 --- a/providers/ultradns-ws/src/main/java/org/jclouds/ultradns/ws/UltraDNSWSApiMetadata.java +++ b/providers/ultradns-ws/src/main/java/org/jclouds/ultradns/ws/UltraDNSWSApiMetadata.java @@ -22,12 +22,9 @@ import java.net.URI; import java.util.Properties; import org.jclouds.apis.ApiMetadata; -import org.jclouds.rest.RestContext; import org.jclouds.rest.internal.BaseRestApiMetadata; import org.jclouds.ultradns.ws.config.UltraDNSWSRestClientModule; -import com.google.common.reflect.TypeToken; - /** * Implementation of {@link ApiMetadata} for Neustar's UltraDNSWS api. * @@ -35,10 +32,6 @@ import com.google.common.reflect.TypeToken; */ public class UltraDNSWSApiMetadata extends BaseRestApiMetadata { - public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { - private static final long serialVersionUID = 1L; - }; - @Override public Builder toBuilder() { return new Builder(getApi(), getAsyncApi()).fromApiMetadata(this); diff --git a/providers/ultradns-ws/src/main/java/org/jclouds/ultradns/ws/UltraDNSWSAsyncApi.java b/providers/ultradns-ws/src/main/java/org/jclouds/ultradns/ws/UltraDNSWSAsyncApi.java index 3d56acc85e..fea3f8d684 100644 --- a/providers/ultradns-ws/src/main/java/org/jclouds/ultradns/ws/UltraDNSWSAsyncApi.java +++ b/providers/ultradns-ws/src/main/java/org/jclouds/ultradns/ws/UltraDNSWSAsyncApi.java @@ -47,7 +47,10 @@ import com.google.common.util.concurrent.ListenableFuture; * @see * @see * @author Adrian Cole + * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(UltraDNSWSApi.class)} as + * {@link UltraDNSWSAsyncApi} interface will be removed in jclouds 1.7. */ +@Deprecated @RequestFilters(SOAPWrapWithPasswordAuth.class) @VirtualHost public interface UltraDNSWSAsyncApi extends Closeable {