deprecated all top-level Async apis and clients

This commit is contained in:
adriancole 2013-04-09 00:40:19 -07:00
parent 36dd831b84
commit 053197fe61
92 changed files with 451 additions and 210 deletions

View File

@ -28,7 +28,6 @@ import org.jclouds.apis.ApiMetadata;
import org.jclouds.atmos.blobstore.config.AtmosBlobStoreContextModule; import org.jclouds.atmos.blobstore.config.AtmosBlobStoreContextModule;
import org.jclouds.atmos.config.AtmosRestClientModule; import org.jclouds.atmos.config.AtmosRestClientModule;
import org.jclouds.blobstore.BlobStoreContext; import org.jclouds.blobstore.BlobStoreContext;
import org.jclouds.rest.RestContext;
import org.jclouds.rest.internal.BaseRestApiMetadata; import org.jclouds.rest.internal.BaseRestApiMetadata;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
@ -42,7 +41,12 @@ import com.google.inject.Module;
*/ */
public class AtmosApiMetadata extends BaseRestApiMetadata { public class AtmosApiMetadata extends BaseRestApiMetadata {
public static final TypeToken<RestContext<AtmosClient, AtmosAsyncClient>> CONTEXT_TOKEN = new TypeToken<RestContext<AtmosClient, AtmosAsyncClient>>() { /**
* @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<org.jclouds.rest.RestContext<AtmosClient, AtmosAsyncClient>> CONTEXT_TOKEN = new TypeToken<org.jclouds.rest.RestContext<AtmosClient, AtmosAsyncClient>>() {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
}; };
@ -71,6 +75,7 @@ public class AtmosApiMetadata extends BaseRestApiMetadata {
} }
public static class Builder extends BaseRestApiMetadata.Builder<Builder> { public static class Builder extends BaseRestApiMetadata.Builder<Builder> {
@SuppressWarnings("deprecation")
protected Builder() { protected Builder() {
super(AtmosClient.class, AtmosAsyncClient.class); super(AtmosClient.class, AtmosAsyncClient.class);
id("atmos") id("atmos")

View File

@ -75,7 +75,11 @@ import com.google.inject.Provides;
* @see AtmosClient * @see AtmosClient
* @see <a href="https://community.emc.com/community/labs/atmos_online" /> * @see <a href="https://community.emc.com/community/labs/atmos_online" />
* @author Adrian Cole * @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) @RequestFilters(SignRequest.class)
@Path("/rest/namespace") @Path("/rest/namespace")
public interface AtmosAsyncClient extends Closeable { public interface AtmosAsyncClient extends Closeable {

View File

@ -29,7 +29,6 @@ import org.jclouds.cloudfiles.config.CloudFilesRestClientModule.StorageAndCDNMan
import org.jclouds.openstack.swift.SwiftApiMetadata; import org.jclouds.openstack.swift.SwiftApiMetadata;
import org.jclouds.openstack.swift.blobstore.SwiftBlobSigner; import org.jclouds.openstack.swift.blobstore.SwiftBlobSigner;
import org.jclouds.openstack.swift.blobstore.config.TemporaryUrlExtensionModule; import org.jclouds.openstack.swift.blobstore.config.TemporaryUrlExtensionModule;
import org.jclouds.rest.RestContext;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
import com.google.common.reflect.TypeToken; import com.google.common.reflect.TypeToken;
@ -43,7 +42,12 @@ import com.google.inject.TypeLiteral;
*/ */
public class CloudFilesApiMetadata extends SwiftApiMetadata { public class CloudFilesApiMetadata extends SwiftApiMetadata {
public static final TypeToken<RestContext<CloudFilesClient, CloudFilesAsyncClient>> CONTEXT_TOKEN = new TypeToken<RestContext<CloudFilesClient, CloudFilesAsyncClient>>() { /**
* @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<org.jclouds.rest.RestContext<CloudFilesClient, CloudFilesAsyncClient>> CONTEXT_TOKEN = new TypeToken<org.jclouds.rest.RestContext<CloudFilesClient, CloudFilesAsyncClient>>() {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
}; };
@ -66,6 +70,7 @@ public class CloudFilesApiMetadata extends SwiftApiMetadata {
} }
public static class Builder extends SwiftApiMetadata.Builder<Builder> { public static class Builder extends SwiftApiMetadata.Builder<Builder> {
@SuppressWarnings("deprecation")
protected Builder(){ protected Builder(){
super(CloudFilesClient.class, CloudFilesAsyncClient.class); super(CloudFilesClient.class, CloudFilesAsyncClient.class);
id("cloudfiles") id("cloudfiles")

View File

@ -64,7 +64,10 @@ import com.google.common.util.concurrent.ListenableFuture;
* @see CloudFilesClient * @see CloudFilesClient
* @see <a href="http://www.rackspacecloud.com/cf-devguide-20090812.pdf" /> * @see <a href="http://www.rackspacecloud.com/cf-devguide-20090812.pdf" />
* @author Adrian Cole * @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) @RequestFilters(AuthenticateRequest.class)
@Endpoint(Storage.class) @Endpoint(Storage.class)
public interface CloudFilesAsyncClient extends SwiftAsyncClient { public interface CloudFilesAsyncClient extends SwiftAsyncClient {

View File

@ -27,7 +27,6 @@ import org.jclouds.apis.ApiMetadata;
import org.jclouds.cloudservers.compute.config.CloudServersComputeServiceContextModule; import org.jclouds.cloudservers.compute.config.CloudServersComputeServiceContextModule;
import org.jclouds.cloudservers.config.CloudServersRestClientModule; import org.jclouds.cloudservers.config.CloudServersRestClientModule;
import org.jclouds.compute.ComputeServiceContext; import org.jclouds.compute.ComputeServiceContext;
import org.jclouds.rest.RestContext;
import org.jclouds.rest.internal.BaseRestApiMetadata; import org.jclouds.rest.internal.BaseRestApiMetadata;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
@ -41,7 +40,12 @@ import com.google.inject.Module;
*/ */
public class CloudServersApiMetadata extends BaseRestApiMetadata { public class CloudServersApiMetadata extends BaseRestApiMetadata {
public static final TypeToken<RestContext<CloudServersClient, CloudServersAsyncClient>> CONTEXT_TOKEN = new TypeToken<RestContext<CloudServersClient, CloudServersAsyncClient>>() { /**
* @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<org.jclouds.rest.RestContext<CloudServersClient, CloudServersAsyncClient>> CONTEXT_TOKEN = new TypeToken<org.jclouds.rest.RestContext<CloudServersClient, CloudServersAsyncClient>>() {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
}; };
@ -65,6 +69,7 @@ public class CloudServersApiMetadata extends BaseRestApiMetadata {
public static class Builder extends BaseRestApiMetadata.Builder<Builder> { public static class Builder extends BaseRestApiMetadata.Builder<Builder> {
@SuppressWarnings("deprecation")
protected Builder() { protected Builder() {
super(CloudServersClient.class, CloudServersAsyncClient.class); super(CloudServersClient.class, CloudServersAsyncClient.class);
id("cloudservers") id("cloudservers")

View File

@ -74,7 +74,10 @@ import com.google.common.util.concurrent.ListenableFuture;
* @see CloudServersClient * @see CloudServersClient
* @see <a href="http://docs.rackspacecloud.com/servers/api/cs-devguide-latest.pdf" /> * @see <a href="http://docs.rackspacecloud.com/servers/api/cs-devguide-latest.pdf" />
* @author Adrian Cole * @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 }) @RequestFilters({ AuthenticateRequest.class, AddTimestampQuery.class })
@Endpoint(Compute.class) @Endpoint(Compute.class)
public interface CloudServersAsyncClient extends Closeable { public interface CloudServersAsyncClient extends Closeable {

View File

@ -28,7 +28,6 @@ import org.jclouds.apis.ApiMetadata;
import org.jclouds.cloudsigma.compute.config.CloudSigmaComputeServiceContextModule; import org.jclouds.cloudsigma.compute.config.CloudSigmaComputeServiceContextModule;
import org.jclouds.cloudsigma.config.CloudSigmaRestClientModule; import org.jclouds.cloudsigma.config.CloudSigmaRestClientModule;
import org.jclouds.compute.ComputeServiceContext; import org.jclouds.compute.ComputeServiceContext;
import org.jclouds.rest.RestContext;
import org.jclouds.rest.internal.BaseRestApiMetadata; import org.jclouds.rest.internal.BaseRestApiMetadata;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
@ -42,7 +41,12 @@ import com.google.inject.Module;
*/ */
public class CloudSigmaApiMetadata extends BaseRestApiMetadata { public class CloudSigmaApiMetadata extends BaseRestApiMetadata {
public static final TypeToken<RestContext<CloudSigmaClient, CloudSigmaAsyncClient>> CONTEXT_TOKEN = new TypeToken<RestContext<CloudSigmaClient, CloudSigmaAsyncClient>>() { /**
* @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<org.jclouds.rest.RestContext<CloudSigmaClient, CloudSigmaAsyncClient>> CONTEXT_TOKEN = new TypeToken<org.jclouds.rest.RestContext<CloudSigmaClient, CloudSigmaAsyncClient>>() {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
}; };
@ -72,6 +76,7 @@ public class CloudSigmaApiMetadata extends BaseRestApiMetadata {
public static class Builder extends BaseRestApiMetadata.Builder<Builder> { public static class Builder extends BaseRestApiMetadata.Builder<Builder> {
@SuppressWarnings("deprecation")
protected Builder() { protected Builder() {
super(CloudSigmaClient.class, CloudSigmaAsyncClient.class); super(CloudSigmaClient.class, CloudSigmaAsyncClient.class);
id("cloudsigma") id("cloudsigma")

View File

@ -73,7 +73,10 @@ import com.google.common.util.concurrent.ListenableFuture;
* @see CloudSigmaClient * @see CloudSigmaClient
* @see <a href="http://cloudsigma.com/en/platform-details/the-api" /> * @see <a href="http://cloudsigma.com/en/platform-details/the-api" />
* @author Adrian Cole * @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) @RequestFilters(BasicAuthentication.class)
@Consumes(MediaType.TEXT_PLAIN) @Consumes(MediaType.TEXT_PLAIN)
public interface CloudSigmaAsyncClient extends Closeable { public interface CloudSigmaAsyncClient extends Closeable {

View File

@ -26,7 +26,6 @@ import org.jclouds.apis.ApiMetadata;
import org.jclouds.cloudstack.compute.config.CloudStackComputeServiceContextModule; import org.jclouds.cloudstack.compute.config.CloudStackComputeServiceContextModule;
import org.jclouds.cloudstack.config.CloudStackParserModule; import org.jclouds.cloudstack.config.CloudStackParserModule;
import org.jclouds.cloudstack.config.CloudStackRestClientModule; import org.jclouds.cloudstack.config.CloudStackRestClientModule;
import org.jclouds.rest.RestContext;
import org.jclouds.rest.internal.BaseRestApiMetadata; import org.jclouds.rest.internal.BaseRestApiMetadata;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
@ -39,7 +38,12 @@ import com.google.inject.Module;
*/ */
public class CloudStackApiMetadata extends BaseRestApiMetadata { public class CloudStackApiMetadata extends BaseRestApiMetadata {
public static final TypeToken<RestContext<CloudStackClient, CloudStackAsyncClient>> CONTEXT_TOKEN = new TypeToken<RestContext<CloudStackClient, CloudStackAsyncClient>>() { /**
* @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<org.jclouds.rest.RestContext<CloudStackClient, CloudStackAsyncClient>> CONTEXT_TOKEN = new TypeToken<org.jclouds.rest.RestContext<CloudStackClient, CloudStackAsyncClient>>() {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
}; };
@ -65,6 +69,7 @@ public class CloudStackApiMetadata extends BaseRestApiMetadata {
public static class Builder extends BaseRestApiMetadata.Builder<Builder> { public static class Builder extends BaseRestApiMetadata.Builder<Builder> {
@SuppressWarnings("deprecation")
protected Builder() { protected Builder() {
super(CloudStackClient.class, CloudStackAsyncClient.class); super(CloudStackClient.class, CloudStackAsyncClient.class);
id("cloudstack") id("cloudstack")

View File

@ -50,7 +50,10 @@ import org.jclouds.rest.annotations.Delegate;
* @author Adrian Cole * @author Adrian Cole
* @see CloudStackClient * @see CloudStackClient
* @see <a href="http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_User.html" /> * @see <a href="http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_User.html" />
* @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 { public interface CloudStackAsyncClient {
/** /**

View File

@ -33,7 +33,10 @@ import org.jclouds.rest.annotations.Delegate;
* @see <a href= * @see <a href=
* "http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_Domain_Admin.html" * "http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_Domain_Admin.html"
* /> * />
* @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 { public interface CloudStackDomainAsyncClient extends CloudStackAsyncClient {
/** /**

View File

@ -38,11 +38,14 @@ import org.jclouds.rest.annotations.Delegate;
* <p/> * <p/>
* *
* @author Adrian Cole * @author Adrian Cole
* @see CloudStackDomainClient * @see CloudStackGlobalClient
* @see <a href= * @see <a href=
* "http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_Global_Admin.html" * "http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_Global_Admin.html"
* /> * />
* @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 { public interface CloudStackGlobalAsyncClient extends CloudStackDomainAsyncClient {
/** /**

View File

@ -26,7 +26,6 @@ import java.util.Properties;
import org.jclouds.apis.ApiMetadata; import org.jclouds.apis.ApiMetadata;
import org.jclouds.cloudwatch.config.CloudWatchRestClientModule; import org.jclouds.cloudwatch.config.CloudWatchRestClientModule;
import org.jclouds.rest.RestContext;
import org.jclouds.rest.internal.BaseRestApiMetadata; import org.jclouds.rest.internal.BaseRestApiMetadata;
import com.google.common.reflect.TypeToken; import com.google.common.reflect.TypeToken;
@ -38,7 +37,12 @@ import com.google.common.reflect.TypeToken;
*/ */
public class CloudWatchApiMetadata extends BaseRestApiMetadata { public class CloudWatchApiMetadata extends BaseRestApiMetadata {
public static final TypeToken<RestContext<CloudWatchApi, CloudWatchAsyncApi>> CONTEXT_TOKEN = new TypeToken<RestContext<CloudWatchApi, CloudWatchAsyncApi>>() { /**
* @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(CloudWatchApi.class)} as
* {@link CloudWatchAsyncApi} interface will be removed in jclouds 1.7.
*/
@Deprecated
public static final TypeToken<org.jclouds.rest.RestContext<CloudWatchApi, CloudWatchAsyncApi>> CONTEXT_TOKEN = new TypeToken<org.jclouds.rest.RestContext<CloudWatchApi, CloudWatchAsyncApi>>() {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
}; };
@ -47,6 +51,7 @@ public class CloudWatchApiMetadata extends BaseRestApiMetadata {
return new Builder(getApi(), getAsyncApi()).fromApiMetadata(this); return new Builder(getApi(), getAsyncApi()).fromApiMetadata(this);
} }
@SuppressWarnings("deprecation")
public CloudWatchApiMetadata() { public CloudWatchApiMetadata() {
this(new Builder(CloudWatchApi.class, CloudWatchAsyncApi.class)); this(new Builder(CloudWatchApi.class, CloudWatchAsyncApi.class));
} }

View File

@ -38,7 +38,10 @@ import com.google.inject.Provides;
* href="http://docs.amazonwebservices.com/AmazonCloudWatch/latest/APIReference" * href="http://docs.amazonwebservices.com/AmazonCloudWatch/latest/APIReference"
* /> * />
* @author Adrian Cole * @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 { public interface CloudWatchAsyncApi extends Closeable {
/** /**
* *

View File

@ -34,7 +34,6 @@ import org.jclouds.ec2.compute.EC2ComputeServiceContext;
import org.jclouds.ec2.compute.config.EC2ComputeServiceContextModule; import org.jclouds.ec2.compute.config.EC2ComputeServiceContextModule;
import org.jclouds.ec2.compute.config.EC2ResolveImagesModule; import org.jclouds.ec2.compute.config.EC2ResolveImagesModule;
import org.jclouds.ec2.config.EC2RestClientModule; import org.jclouds.ec2.config.EC2RestClientModule;
import org.jclouds.rest.RestContext;
import org.jclouds.rest.internal.BaseRestApiMetadata; import org.jclouds.rest.internal.BaseRestApiMetadata;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
@ -59,8 +58,13 @@ import com.google.inject.Module;
* @author Adrian Cole * @author Adrian Cole
*/ */
public class EC2ApiMetadata extends BaseRestApiMetadata { public class EC2ApiMetadata extends BaseRestApiMetadata {
public static final TypeToken<RestContext<? extends EC2Client, ? extends EC2AsyncClient>> CONTEXT_TOKEN = new TypeToken<RestContext<? extends EC2Client, ? extends EC2AsyncClient>>() { /**
* @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<org.jclouds.rest.RestContext<? extends EC2Client, ? extends EC2AsyncClient>> CONTEXT_TOKEN = new TypeToken<org.jclouds.rest.RestContext<? extends EC2Client, ? extends EC2AsyncClient>>() {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
}; };
@ -90,6 +94,7 @@ public class EC2ApiMetadata extends BaseRestApiMetadata {
} }
public static abstract class Builder<T extends Builder<T>> extends BaseRestApiMetadata.Builder<T> { public static abstract class Builder<T extends Builder<T>> extends BaseRestApiMetadata.Builder<T> {
@SuppressWarnings("deprecation")
protected Builder() { protected Builder() {
this(EC2Client.class, EC2AsyncClient.class); this(EC2Client.class, EC2AsyncClient.class);
} }
@ -102,7 +107,7 @@ public class EC2ApiMetadata extends BaseRestApiMetadata {
.credentialName("Secret Access Key") .credentialName("Secret Access Key")
.defaultEndpoint("https://ec2.us-east-1.amazonaws.com") .defaultEndpoint("https://ec2.us-east-1.amazonaws.com")
.documentation(URI.create("http://docs.amazonwebservices.com/AWSEC2/latest/APIReference")) .documentation(URI.create("http://docs.amazonwebservices.com/AWSEC2/latest/APIReference"))
.version(EC2AsyncClient.VERSION) .version("2010-06-15")
.defaultProperties(EC2ApiMetadata.defaultProperties()) .defaultProperties(EC2ApiMetadata.defaultProperties())
.context(CONTEXT_TOKEN) .context(CONTEXT_TOKEN)
.view(EC2ComputeServiceContext.class) .view(EC2ComputeServiceContext.class)

View File

@ -32,9 +32,11 @@ import org.jclouds.rest.annotations.Delegate;
* Provides asynchronous access to EC2 services. * Provides asynchronous access to EC2 services.
* *
* @author Adrian Cole * @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 interface EC2AsyncClient extends EC2AsyncApi {
public static final String VERSION = "2010-06-15";
/** /**
* Provides asynchronous access to AMI services. * Provides asynchronous access to AMI services.

View File

@ -28,7 +28,6 @@ import org.jclouds.apis.ApiMetadata;
import org.jclouds.compute.ComputeServiceContext; import org.jclouds.compute.ComputeServiceContext;
import org.jclouds.elasticstack.compute.config.ElasticStackComputeServiceContextModule; import org.jclouds.elasticstack.compute.config.ElasticStackComputeServiceContextModule;
import org.jclouds.elasticstack.config.ElasticStackRestClientModule; import org.jclouds.elasticstack.config.ElasticStackRestClientModule;
import org.jclouds.rest.RestContext;
import org.jclouds.rest.internal.BaseRestApiMetadata; import org.jclouds.rest.internal.BaseRestApiMetadata;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
@ -42,7 +41,12 @@ import com.google.inject.Module;
*/ */
public class ElasticStackApiMetadata extends BaseRestApiMetadata { public class ElasticStackApiMetadata extends BaseRestApiMetadata {
public static final TypeToken<RestContext<ElasticStackClient, ElasticStackAsyncClient>> CONTEXT_TOKEN = new TypeToken<RestContext<ElasticStackClient, ElasticStackAsyncClient>>() { /**
* @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<org.jclouds.rest.RestContext<ElasticStackClient, ElasticStackAsyncClient>> CONTEXT_TOKEN = new TypeToken<org.jclouds.rest.RestContext<ElasticStackClient, ElasticStackAsyncClient>>() {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
}; };
@ -71,6 +75,7 @@ public class ElasticStackApiMetadata extends BaseRestApiMetadata {
public static class Builder extends BaseRestApiMetadata.Builder<Builder> { public static class Builder extends BaseRestApiMetadata.Builder<Builder> {
@SuppressWarnings("deprecation")
protected Builder() { protected Builder() {
super(ElasticStackClient.class, ElasticStackAsyncClient.class); super(ElasticStackClient.class, ElasticStackAsyncClient.class);
id("elasticstack") id("elasticstack")

View File

@ -62,7 +62,10 @@ import com.google.common.util.concurrent.ListenableFuture;
* @see ElasticStackClient * @see ElasticStackClient
* @see <a href="TODO: insert URL of provider documentation" /> * @see <a href="TODO: insert URL of provider documentation" />
* @author Adrian Cole * @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) @RequestFilters(BasicAuthentication.class)
@Consumes(MediaType.TEXT_PLAIN) @Consumes(MediaType.TEXT_PLAIN)
public interface ElasticStackAsyncClient extends Closeable { public interface ElasticStackAsyncClient extends Closeable {

View File

@ -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;
import org.jclouds.openstack.keystone.v2_0.config.KeystoneAuthenticationModule.ZoneModule; import org.jclouds.openstack.keystone.v2_0.config.KeystoneAuthenticationModule.ZoneModule;
import org.jclouds.openstack.v2_0.ServiceType; import org.jclouds.openstack.v2_0.ServiceType;
import org.jclouds.rest.RestContext;
import org.jclouds.rest.internal.BaseRestApiMetadata; import org.jclouds.rest.internal.BaseRestApiMetadata;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
@ -45,7 +44,12 @@ import com.google.inject.Module;
*/ */
public class CinderApiMetadata extends BaseRestApiMetadata { public class CinderApiMetadata extends BaseRestApiMetadata {
public static final TypeToken<RestContext<CinderApi, CinderAsyncApi>> CONTEXT_TOKEN = new TypeToken<RestContext<CinderApi, CinderAsyncApi>>() { /**
* @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<org.jclouds.rest.RestContext<CinderApi, CinderAsyncApi>> CONTEXT_TOKEN = new TypeToken<org.jclouds.rest.RestContext<CinderApi, CinderAsyncApi>>() {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
}; };
@ -71,6 +75,7 @@ public class CinderApiMetadata extends BaseRestApiMetadata {
public static class Builder extends BaseRestApiMetadata.Builder<Builder> { public static class Builder extends BaseRestApiMetadata.Builder<Builder> {
@SuppressWarnings("deprecation")
protected Builder() { protected Builder() {
super(CinderApi.class, CinderAsyncApi.class); super(CinderApi.class, CinderAsyncApi.class);
id("openstack-cinder") id("openstack-cinder")

View File

@ -39,7 +39,10 @@ import com.google.inject.Provides;
* @see CinderApi * @see CinderApi
* @see <a href="http://api.openstack.org/">API Doc</a> * @see <a href="http://api.openstack.org/">API Doc</a>
* @author Everett Toews * @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 { public interface CinderAsyncApi extends Closeable {
/** /**
* @return the Zone codes configured * @return the Zone codes configured

View File

@ -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;
import org.jclouds.openstack.keystone.v2_0.config.KeystoneRestClientModule.KeystoneAdminURLModule; import org.jclouds.openstack.keystone.v2_0.config.KeystoneRestClientModule.KeystoneAdminURLModule;
import org.jclouds.openstack.v2_0.ServiceType; import org.jclouds.openstack.v2_0.ServiceType;
import org.jclouds.rest.RestContext;
import org.jclouds.rest.internal.BaseRestApiMetadata; import org.jclouds.rest.internal.BaseRestApiMetadata;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
@ -44,7 +43,12 @@ import com.google.inject.Module;
*/ */
public class KeystoneApiMetadata extends BaseRestApiMetadata { public class KeystoneApiMetadata extends BaseRestApiMetadata {
public static final TypeToken<RestContext<? extends KeystoneApi,? extends KeystoneAsyncApi>> CONTEXT_TOKEN = new TypeToken<RestContext<? extends KeystoneApi,? extends KeystoneAsyncApi>>() { /**
* @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<org.jclouds.rest.RestContext<KeystoneApi, KeystoneAsyncApi>> CONTEXT_TOKEN = new TypeToken<org.jclouds.rest.RestContext<KeystoneApi, KeystoneAsyncApi>>() {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
}; };
@ -69,6 +73,7 @@ public class KeystoneApiMetadata extends BaseRestApiMetadata {
} }
public static abstract class Builder<T extends Builder<T>> extends BaseRestApiMetadata.Builder<T> { public static abstract class Builder<T extends Builder<T>> extends BaseRestApiMetadata.Builder<T> {
@SuppressWarnings("deprecation")
protected Builder() { protected Builder() {
this(KeystoneApi.class, KeystoneAsyncApi.class); this(KeystoneApi.class, KeystoneAsyncApi.class);
} }

View File

@ -45,7 +45,10 @@ import com.google.common.util.concurrent.ListenableFuture;
* @author Adam Lowe * @author Adam Lowe
* @see <a href="http://keystone.openstack.org/" /> * @see <a href="http://keystone.openstack.org/" />
* @see KeystoneApi * @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 { public interface KeystoneAsyncApi extends Closeable {
/** /**

View File

@ -36,8 +36,7 @@ import org.testng.annotations.Test;
public class ServiceApiLiveTest extends BaseKeystoneApiLiveTest { public class ServiceApiLiveTest extends BaseKeystoneApiLiveTest {
public void testTenants() { public void testTenants() {
ServiceApi api = this.api.getServiceApi(); Set<? extends Tenant> result = api.getServiceApi().listTenants();
Set<? extends Tenant> result = api.listTenants();
assertNotNull(result); assertNotNull(result);
assertFalse(result.isEmpty()); assertFalse(result.isEmpty());

View File

@ -37,15 +37,15 @@ import org.testng.annotations.Test;
public class TenantApiLiveTest extends BaseKeystoneApiLiveTest { public class TenantApiLiveTest extends BaseKeystoneApiLiveTest {
public void testTenants() { public void testTenants() {
TenantApi api = this.api.getTenantApi().get(); TenantApi tenantApi = api.getTenantApi().get();
Set<? extends Tenant> result = api.list().concat().toSet(); Set<? extends Tenant> result = tenantApi.list().concat().toSet();
assertNotNull(result); assertNotNull(result);
assertFalse(result.isEmpty()); assertFalse(result.isEmpty());
for (Tenant tenant : result) { for (Tenant tenant : result) {
assertNotNull(tenant.getId()); assertNotNull(tenant.getId());
Tenant aTenant = api.get(tenant.getId()); Tenant aTenant = tenantApi.get(tenant.getId());
assertNotNull(aTenant, "get returned null for tenant: " + tenant); assertNotNull(aTenant, "get returned null for tenant: " + tenant);
assertEquals(aTenant, tenant); assertEquals(aTenant, tenant);
@ -54,10 +54,10 @@ public class TenantApiLiveTest extends BaseKeystoneApiLiveTest {
public void testTenantsByName() { public void testTenantsByName() {
TenantApi api = this.api.getTenantApi().get(); TenantApi tenantApi = api.getTenantApi().get();
for (Tenant tenant : api.list().concat()) { for (Tenant tenant : tenantApi.list().concat()) {
Tenant aTenant = api.getByName(tenant.getName()); Tenant aTenant = tenantApi.getByName(tenant.getName());
assertNotNull(aTenant, "get returned null for tenant: " + tenant); assertNotNull(aTenant, "get returned null for tenant: " + tenant);
assertEquals(aTenant, tenant); assertEquals(aTenant, tenant);

View File

@ -65,14 +65,14 @@ public class TokenApiLiveTest extends BaseKeystoneApiLiveTest {
public void testToken() { public void testToken() {
TokenApi api = this.api.getTokenApi().get(); TokenApi tokenApi = api.getTokenApi().get();
assertTrue(api.isValid(token)); assertTrue(tokenApi.isValid(token));
Token result = api.get(token); Token result = tokenApi.get(token);
assertNotNull(result); assertNotNull(result);
assertEquals(result.getId(), token); assertEquals(result.getId(), token);
assertNotNull(result.getTenant()); assertNotNull(result.getTenant());
User user = api.getUserOfToken(token); User user = tokenApi.getUserOfToken(token);
assertNotNull(user); assertNotNull(user);
assertNotNull(user.getId()); assertNotNull(user.getId());
assertNotNull(user.getName()); assertNotNull(user.getName());
@ -81,16 +81,16 @@ public class TokenApiLiveTest extends BaseKeystoneApiLiveTest {
public void testInvalidToken() { public void testInvalidToken() {
TokenApi api = this.api.getTokenApi().get(); TokenApi tokenApi = api.getTokenApi().get();
assertFalse(api.isValid("thisisnotarealtoken!")); assertFalse(tokenApi.isValid("thisisnotarealtoken!"));
assertNull(api.get("thisisnotarealtoken!")); assertNull(tokenApi.get("thisisnotarealtoken!"));
} }
public void testTokenEndpoints() { public void testTokenEndpoints() {
TokenApi api = this.api.getTokenApi().get(); TokenApi tokenApi = api.getTokenApi().get();
Set<? extends Endpoint> endpoints = api.listEndpointsForToken(token); Set<? extends Endpoint> endpoints = tokenApi.listEndpointsForToken(token);
assertNotNull(endpoints); assertNotNull(endpoints);
assertFalse(endpoints.isEmpty()); assertFalse(endpoints.isEmpty());
@ -98,8 +98,8 @@ public class TokenApiLiveTest extends BaseKeystoneApiLiveTest {
public void testInvalidTokenEndpoints() { public void testInvalidTokenEndpoints() {
TokenApi api = this.api.getTokenApi().get(); TokenApi tokenApi = api.getTokenApi().get();
assertTrue(api.listEndpointsForToken("thisisnotarealtoken!").isEmpty()); assertTrue(tokenApi.listEndpointsForToken("thisisnotarealtoken!").isEmpty());
} }
} }

View File

@ -40,12 +40,12 @@ public class UserApiLiveTest extends BaseKeystoneApiLiveTest {
public void testUsers() { public void testUsers() {
UserApi api = this.api.getUserApi().get(); UserApi userApi = api.getUserApi().get();
Set<? extends User> users = api.list().concat().toSet(); Set<? extends User> users = userApi.list().concat().toSet();
assertNotNull(users); assertNotNull(users);
assertFalse(users.isEmpty()); assertFalse(users.isEmpty());
for (User user : users) { for (User user : users) {
User aUser = api.get(user.getId()); User aUser = userApi.get(user.getId());
assertEquals(aUser, user); assertEquals(aUser, user);
} }
@ -53,12 +53,12 @@ public class UserApiLiveTest extends BaseKeystoneApiLiveTest {
public void testUserRolesOnTenant() { public void testUserRolesOnTenant() {
UserApi api = this.api.getUserApi().get(); UserApi userApi = api.getUserApi().get();
Set<? extends Tenant> tenants = this.api.getTenantApi().get().list().concat().toSet(); Set<? extends Tenant> tenants = api.getTenantApi().get().list().concat().toSet();
for (User user : api.list().concat()) { for (User user : userApi.list().concat()) {
for (Tenant tenant : tenants) { for (Tenant tenant : tenants) {
Set<? extends Role> roles = api.listRolesOfUserOnTenant(user.getId(), tenant.getId()); Set<? extends Role> roles = userApi.listRolesOfUserOnTenant(user.getId(), tenant.getId());
for (Role role : roles) { for (Role role : roles) {
assertNotNull(role.getId()); assertNotNull(role.getId());
} }
@ -69,9 +69,9 @@ public class UserApiLiveTest extends BaseKeystoneApiLiveTest {
public void testListRolesOfUser() { public void testListRolesOfUser() {
UserApi api = this.api.getUserApi().get(); UserApi userApi = api.getUserApi().get();
for (User user : api.list().concat()) { for (User user : userApi.list().concat()) {
Set<? extends Role> roles = api.listRolesOfUser(user.getId()); Set<? extends Role> roles = userApi.listRolesOfUser(user.getId());
for (Role role : roles) { for (Role role : roles) {
assertNotNull(role.getId()); assertNotNull(role.getId());
} }
@ -81,9 +81,9 @@ public class UserApiLiveTest extends BaseKeystoneApiLiveTest {
public void testUsersByName() { public void testUsersByName() {
UserApi api = this.api.getUserApi().get(); UserApi userApi = api.getUserApi().get();
for (User user : api.list().concat()) { for (User user : userApi.list().concat()) {
User aUser = api.getByName(user.getName()); User aUser = userApi.getByName(user.getName());
assertEquals(aUser, user); assertEquals(aUser, user);
} }

View File

@ -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.HyphenToNullIso8601Module;
import org.jclouds.openstack.nova.ec2.config.NovaEC2ComputeServiceContextModule; import org.jclouds.openstack.nova.ec2.config.NovaEC2ComputeServiceContextModule;
import org.jclouds.openstack.nova.ec2.config.NovaEC2RestClientModule; import org.jclouds.openstack.nova.ec2.config.NovaEC2RestClientModule;
import org.jclouds.rest.RestContext;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
import com.google.common.reflect.TypeToken; import com.google.common.reflect.TypeToken;
@ -46,7 +45,12 @@ import com.google.inject.Module;
*/ */
public class NovaEC2ApiMetadata extends EC2ApiMetadata { public class NovaEC2ApiMetadata extends EC2ApiMetadata {
public static final TypeToken<RestContext<NovaEC2Client, NovaEC2AsyncClient>> CONTEXT_TOKEN = new TypeToken<RestContext<NovaEC2Client, NovaEC2AsyncClient>>() { /**
* @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<org.jclouds.rest.RestContext<NovaEC2Client, NovaEC2AsyncClient>> CONTEXT_TOKEN = new TypeToken<org.jclouds.rest.RestContext<NovaEC2Client, NovaEC2AsyncClient>>() {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
}; };
@ -81,6 +85,7 @@ public class NovaEC2ApiMetadata extends EC2ApiMetadata {
} }
public static class Builder extends EC2ApiMetadata.Builder<Builder> { public static class Builder extends EC2ApiMetadata.Builder<Builder> {
@SuppressWarnings("deprecation")
protected Builder(){ protected Builder(){
super(NovaEC2Client.class, NovaEC2AsyncClient.class); super(NovaEC2Client.class, NovaEC2AsyncClient.class);
id("openstack-nova-ec2") id("openstack-nova-ec2")

View File

@ -26,7 +26,10 @@ import org.jclouds.rest.annotations.Delegate;
* Provides asynchronous access to EC2 services. * Provides asynchronous access to EC2 services.
* *
* @author Adam Lowe * @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 { public interface NovaEC2AsyncClient extends EC2AsyncClient {
/** /**
* {@inheritDoc} * {@inheritDoc}

View File

@ -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.NovaParserModule;
import org.jclouds.openstack.nova.v2_0.config.NovaRestClientModule; import org.jclouds.openstack.nova.v2_0.config.NovaRestClientModule;
import org.jclouds.openstack.v2_0.ServiceType; import org.jclouds.openstack.v2_0.ServiceType;
import org.jclouds.rest.RestContext;
import org.jclouds.rest.internal.BaseRestApiMetadata; import org.jclouds.rest.internal.BaseRestApiMetadata;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
@ -52,7 +51,12 @@ import com.google.inject.Module;
*/ */
public class NovaApiMetadata extends BaseRestApiMetadata { public class NovaApiMetadata extends BaseRestApiMetadata {
public static final TypeToken<RestContext<NovaApi, NovaAsyncApi>> CONTEXT_TOKEN = new TypeToken<RestContext<NovaApi, NovaAsyncApi>>() { /**
* @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<org.jclouds.rest.RestContext<NovaApi, NovaAsyncApi>> CONTEXT_TOKEN = new TypeToken<org.jclouds.rest.RestContext<NovaApi, NovaAsyncApi>>() {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
}; };
@ -88,6 +92,7 @@ public class NovaApiMetadata extends BaseRestApiMetadata {
public static class Builder extends BaseRestApiMetadata.Builder<Builder> { public static class Builder extends BaseRestApiMetadata.Builder<Builder> {
@SuppressWarnings("deprecation")
protected Builder() { protected Builder() {
super(NovaApi.class, NovaAsyncApi.class); super(NovaApi.class, NovaAsyncApi.class);
id("openstack-nova") id("openstack-nova")

View File

@ -57,7 +57,10 @@ import com.google.inject.Provides;
* @see <a href="http://docs.openstack.org/api/openstack-compute/1.1/content/" * @see <a href="http://docs.openstack.org/api/openstack-compute/1.1/content/"
* /> * />
* @author Adrian Cole * @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 { public interface NovaAsyncApi extends Closeable {
/** /**

View File

@ -36,8 +36,8 @@ public class KeyPairApiLiveTest extends BaseNovaApiLiveTest {
public void testListKeyPairs() throws Exception { public void testListKeyPairs() throws Exception {
for (String zoneId : api.getConfiguredZones()) { for (String zoneId : api.getConfiguredZones()) {
KeyPairApi api = this.api.getKeyPairExtensionForZone(zoneId).get(); KeyPairApi keyPairApi = api.getKeyPairExtensionForZone(zoneId).get();
FluentIterable<? extends KeyPair> keyPairsList = api.list(); FluentIterable<? extends KeyPair> keyPairsList = keyPairApi.list();
assertNotNull(keyPairsList); assertNotNull(keyPairsList);
} }
} }
@ -45,14 +45,14 @@ public class KeyPairApiLiveTest extends BaseNovaApiLiveTest {
public void testCreateAndDeleteKeyPair() throws Exception { public void testCreateAndDeleteKeyPair() throws Exception {
final String KEYPAIR_NAME = "testkp"; final String KEYPAIR_NAME = "testkp";
for (String zoneId : api.getConfiguredZones()) { for (String zoneId : api.getConfiguredZones()) {
KeyPairApi api = this.api.getKeyPairExtensionForZone(zoneId).get(); KeyPairApi keyPairApi = api.getKeyPairExtensionForZone(zoneId).get();
KeyPair keyPair = null; KeyPair keyPair = null;
try { try {
keyPair = api.create(KEYPAIR_NAME); keyPair = keyPairApi.create(KEYPAIR_NAME);
assertNotNull(keyPair); assertNotNull(keyPair);
} finally { } finally {
if (keyPair != null) { 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"; final String PUBLIC_KEY = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCrrBREFxz3002l1HuXz0+UOdJQ/mOYD5DiJwwB/TOybwIKQJPOxJWA9gBoo4k9dthTKBTaEYbzrll7iZcp59E80S6mNiAr3mUgi+x5Y8uyXeJ2Ws+h6peVyFVUu9epkwpcTd1GVfdcVWsTajwDz9+lxCDhl0RZKDFoT0scTxbj/w== nova@nv-aw2az2-api0002";
for (String zoneId : api.getConfiguredZones()) { for (String zoneId : api.getConfiguredZones()) {
KeyPairApi api = this.api.getKeyPairExtensionForZone(zoneId).get(); KeyPairApi keyPairApi = api.getKeyPairExtensionForZone(zoneId).get();
KeyPair keyPair = null; KeyPair keyPair = null;
try { try {
keyPair = api.createWithPublicKey(KEYPAIR_NAME, PUBLIC_KEY); keyPair = keyPairApi.createWithPublicKey(KEYPAIR_NAME, PUBLIC_KEY);
assertNotNull(keyPair); assertNotNull(keyPair);
} finally { } finally {
if (keyPair != null) { if (keyPair != null) {
api.delete(KEYPAIR_NAME); keyPairApi.delete(KEYPAIR_NAME);
} }
} }
} }

View File

@ -43,27 +43,27 @@ public class SecurityGroupApiLiveTest extends BaseNovaApiLiveTest {
public void list() throws Exception { public void list() throws Exception {
for (String zoneId : api.getConfiguredZones()) { for (String zoneId : api.getConfiguredZones()) {
SecurityGroupApi api = this.api.getSecurityGroupExtensionForZone(zoneId).get(); SecurityGroupApi securityGroupApi = api.getSecurityGroupExtensionForZone(zoneId).get();
Set<? extends SecurityGroup> securityGroupsList = api.list().toSet(); Set<? extends SecurityGroup> securityGroupsList = securityGroupApi.list().toSet();
assertNotNull(securityGroupsList); assertNotNull(securityGroupsList);
} }
} }
public void createGetAndDeleteSecurityGroup() throws Exception { public void createGetAndDeleteSecurityGroup() throws Exception {
for (String zoneId : api.getConfiguredZones()) { for (String zoneId : api.getConfiguredZones()) {
SecurityGroupApi api = this.api.getSecurityGroupExtensionForZone(zoneId).get(); SecurityGroupApi securityGroupApi = api.getSecurityGroupExtensionForZone(zoneId).get();
SecurityGroup securityGroup = null; SecurityGroup securityGroup = null;
String id; String id;
try { try {
securityGroup = api securityGroup = securityGroupApi
.createWithDescription(SECURITY_GROUP_NAME, "test security group"); .createWithDescription(SECURITY_GROUP_NAME, "test security group");
assertNotNull(securityGroup); assertNotNull(securityGroup);
id = securityGroup.getId(); id = securityGroup.getId();
SecurityGroup theGroup = api.get(id); SecurityGroup theGroup = securityGroupApi.get(id);
assertNotNull(theGroup); assertNotNull(theGroup);
} finally { } finally {
if (securityGroup != null) { 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 { public void createAndDeleteSecurityGroupRule() throws Exception {
for (String zoneId : api.getConfiguredZones()) { for (String zoneId : api.getConfiguredZones()) {
SecurityGroupApi api = this.api.getSecurityGroupExtensionForZone(zoneId).get(); SecurityGroupApi securityGroupApi = api.getSecurityGroupExtensionForZone(zoneId).get();
SecurityGroup securityGroup = null; SecurityGroup securityGroup = null;
try { try {
securityGroup = api.createWithDescription(SECURITY_GROUP_NAME, "test security group"); securityGroup = securityGroupApi.createWithDescription(SECURITY_GROUP_NAME, "test security group");
assertNotNull(securityGroup); assertNotNull(securityGroup);
for (int port : ImmutableSet.of(22, 8080)) { 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"); .builder().ipProtocol(IpProtocol.TCP).fromPort(port).toPort(port).build(), "0.0.0.0/0");
assertNotNull(rule); 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 Ingress.builder().ipProtocol(IpProtocol.TCP).fromPort(port).toPort(port).build(), securityGroup
.getId()); .getId());
assertNotNull(rule2); assertNotNull(rule2);
} }
securityGroup = api.get(securityGroup.getId()); securityGroup = securityGroupApi.get(securityGroup.getId());
} finally { } finally {
if (securityGroup != null) { if (securityGroup != null) {
api.delete(securityGroup.getId()); securityGroupApi.delete(securityGroup.getId());
} }
} }
} }

View File

@ -45,8 +45,8 @@ public class ExtensionApiLiveTest extends BaseNovaApiLiveTest {
@Test(description = "GET /v${apiVersion}/{tenantId}/extensions") @Test(description = "GET /v${apiVersion}/{tenantId}/extensions")
public void testListExtensions() throws Exception { public void testListExtensions() throws Exception {
for (String zoneId : zones) { for (String zoneId : zones) {
ExtensionApi api = this.api.getExtensionApiForZone(zoneId); ExtensionApi extensionApi = api.getExtensionApiForZone(zoneId);
Set<? extends Extension> response = api.list(); Set<? extends Extension> response = extensionApi.list();
assertNotNull(response); assertNotNull(response);
assertFalse(response.isEmpty()); assertFalse(response.isEmpty());
for (Extension extension : response) { for (Extension extension : response) {
@ -68,10 +68,10 @@ public class ExtensionApiLiveTest extends BaseNovaApiLiveTest {
@Test(description = "GET /v${apiVersion}/{tenantId}/extensions/{alias}", dependsOnMethods = { "testListExtensions" }) @Test(description = "GET /v${apiVersion}/{tenantId}/extensions/{alias}", dependsOnMethods = { "testListExtensions" })
public void testGetExtensionByAlias() throws Exception { public void testGetExtensionByAlias() throws Exception {
for (String zoneId : zones) { for (String zoneId : zones) {
ExtensionApi api = this.api.getExtensionApiForZone(zoneId); ExtensionApi extensionApi = api.getExtensionApiForZone(zoneId);
Set<? extends Extension> response = api.list(); Set<? extends Extension> response = extensionApi.list();
for (Extension extension : response) { for (Extension extension : response) {
Extension details = api.get(extension.getId()); Extension details = extensionApi.get(extension.getId());
assertNotNull(details); assertNotNull(details);
assertEquals(details.getId(), extension.getId()); assertEquals(details.getId(), extension.getId());
assertEquals(details.getName(), extension.getName()); assertEquals(details.getName(), extension.getName());

View File

@ -46,8 +46,8 @@ public class FlavorApiLiveTest extends BaseNovaApiLiveTest {
@Test(description = "GET /v${apiVersion}/{tenantId}/flavors") @Test(description = "GET /v${apiVersion}/{tenantId}/flavors")
public void testListFlavors() throws Exception { public void testListFlavors() throws Exception {
for (String zoneId : zones) { for (String zoneId : zones) {
FlavorApi api = this.api.getFlavorApiForZone(zoneId); FlavorApi flavorApi = api.getFlavorApiForZone(zoneId);
Set<? extends Resource> response = api.list().concat().toSet(); Set<? extends Resource> response = flavorApi.list().concat().toSet();
assertNotNull(response); assertNotNull(response);
assertFalse(response.isEmpty()); assertFalse(response.isEmpty());
for (Resource flavor : response) { for (Resource flavor : response) {
@ -66,8 +66,8 @@ public class FlavorApiLiveTest extends BaseNovaApiLiveTest {
@Test(description = "GET /v${apiVersion}/{tenantId}/flavors/detail") @Test(description = "GET /v${apiVersion}/{tenantId}/flavors/detail")
public void testListFlavorsInDetail() throws Exception { public void testListFlavorsInDetail() throws Exception {
for (String zoneId : zones) { for (String zoneId : zones) {
FlavorApi api = this.api.getFlavorApiForZone(zoneId); FlavorApi flavorApi = api.getFlavorApiForZone(zoneId);
Set<? extends Flavor> response = api.listInDetail().concat().toSet(); Set<? extends Flavor> response = flavorApi.listInDetail().concat().toSet();
assertNotNull(response); assertNotNull(response);
assertFalse(response.isEmpty()); assertFalse(response.isEmpty());
for (Flavor flavor : response) { for (Flavor flavor : response) {
@ -89,10 +89,10 @@ public class FlavorApiLiveTest extends BaseNovaApiLiveTest {
@Test(description = "GET /v${apiVersion}/{tenantId}/flavors/{id}", dependsOnMethods = { "testListFlavorsInDetail" }) @Test(description = "GET /v${apiVersion}/{tenantId}/flavors/{id}", dependsOnMethods = { "testListFlavorsInDetail" })
public void testGetFlavorById() throws Exception { public void testGetFlavorById() throws Exception {
for (String zoneId : zones) { for (String zoneId : zones) {
FlavorApi api = this.api.getFlavorApiForZone(zoneId); FlavorApi flavorApi = api.getFlavorApiForZone(zoneId);
Set<? extends Flavor> response = api.listInDetail().concat().toSet(); Set<? extends Flavor> response = flavorApi.listInDetail().concat().toSet();
for (Flavor flavor : response) { for (Flavor flavor : response) {
Flavor details = api.get(flavor.getId()); Flavor details = flavorApi.get(flavor.getId());
assertNotNull(details); assertNotNull(details);
assertEquals(details.getId(), flavor.getId()); assertEquals(details.getId(), flavor.getId());
assertEquals(details.getName(), flavor.getName()); assertEquals(details.getName(), flavor.getName());

View File

@ -41,8 +41,8 @@ public class ImageApiLiveTest extends BaseNovaApiLiveTest {
@Test(description = "GET /v${apiVersion}/{tenantId}/images") @Test(description = "GET /v${apiVersion}/{tenantId}/images")
public void testListImages() throws Exception { public void testListImages() throws Exception {
for (String zoneId : zones) { for (String zoneId : zones) {
ImageApi api = this.api.getImageApiForZone(zoneId); ImageApi imageApi = api.getImageApiForZone(zoneId);
Set<? extends Resource> response = api.list().concat().toSet(); Set<? extends Resource> response = imageApi.list().concat().toSet();
assertNotNull(response); assertNotNull(response);
assertFalse(response.isEmpty()); assertFalse(response.isEmpty());
for (Resource image : response) { for (Resource image : response) {
@ -56,8 +56,8 @@ public class ImageApiLiveTest extends BaseNovaApiLiveTest {
@Test(description = "GET /v${apiVersion}/{tenantId}/images/detail") @Test(description = "GET /v${apiVersion}/{tenantId}/images/detail")
public void testListImagesInDetail() throws Exception { public void testListImagesInDetail() throws Exception {
for (String zoneId : api.getConfiguredZones()) { for (String zoneId : api.getConfiguredZones()) {
ImageApi api = this.api.getImageApiForZone(zoneId); ImageApi imageApi = api.getImageApiForZone(zoneId);
Set<? extends Image> response = api.listInDetail().concat().toSet(); Set<? extends Image> response = imageApi.listInDetail().concat().toSet();
assertNotNull(response); assertNotNull(response);
assertFalse(response.isEmpty()); assertFalse(response.isEmpty());
for (Image image : response) { for (Image image : response) {
@ -80,10 +80,10 @@ public class ImageApiLiveTest extends BaseNovaApiLiveTest {
@Test(description = "GET /v${apiVersion}/{tenantId}/images/{id}", dependsOnMethods = { "testListImagesInDetail" }) @Test(description = "GET /v${apiVersion}/{tenantId}/images/{id}", dependsOnMethods = { "testListImagesInDetail" })
public void testGetImageById() throws Exception { public void testGetImageById() throws Exception {
for (String zoneId : api.getConfiguredZones()) { for (String zoneId : api.getConfiguredZones()) {
ImageApi api = this.api.getImageApiForZone(zoneId); ImageApi imageApi = api.getImageApiForZone(zoneId);
Set<? extends Image> response = api.listInDetail().concat().toSet(); Set<? extends Image> response = imageApi.listInDetail().concat().toSet();
for (Image image : response) { for (Image image : response) {
Image details = api.get(image.getId()); Image details = imageApi.get(image.getId());
assertNotNull(details); assertNotNull(details);
assertEquals(details.getId(), image.getId()); assertEquals(details.getId(), image.getId());
assertEquals(details.getName(), image.getName()); assertEquals(details.getName(), image.getName());

View File

@ -43,8 +43,8 @@ public class ServerApiLiveTest extends BaseNovaApiLiveTest {
@Test(description = "GET /v${apiVersion}/{tenantId}/servers") @Test(description = "GET /v${apiVersion}/{tenantId}/servers")
public void testListServers() throws Exception { public void testListServers() throws Exception {
for (String zoneId : zones) { for (String zoneId : zones) {
ServerApi api = this.api.getServerApiForZone(zoneId); ServerApi serverApi = api.getServerApiForZone(zoneId);
for (Resource server : api.list().concat()) { for (Resource server : serverApi.list().concat()) {
checkResource(server); checkResource(server);
} }
} }
@ -53,8 +53,8 @@ public class ServerApiLiveTest extends BaseNovaApiLiveTest {
@Test(description = "GET /v${apiVersion}/{tenantId}/servers/detail") @Test(description = "GET /v${apiVersion}/{tenantId}/servers/detail")
public void testListServersInDetail() throws Exception { public void testListServersInDetail() throws Exception {
for (String zoneId : zones) { for (String zoneId : zones) {
ServerApi api = this.api.getServerApiForZone(zoneId); ServerApi serverApi = api.getServerApiForZone(zoneId);
for (Server server : api.listInDetail().concat()) { for (Server server : serverApi.listInDetail().concat()) {
checkServer(server); checkServer(server);
} }
} }
@ -63,9 +63,9 @@ public class ServerApiLiveTest extends BaseNovaApiLiveTest {
@Test(description = "GET /v${apiVersion}/{tenantId}/servers/{id}", dependsOnMethods = { "testListServersInDetail" }) @Test(description = "GET /v${apiVersion}/{tenantId}/servers/{id}", dependsOnMethods = { "testListServersInDetail" })
public void testGetServerById() throws Exception { public void testGetServerById() throws Exception {
for (String zoneId : zones) { for (String zoneId : zones) {
ServerApi api = this.api.getServerApiForZone(zoneId); ServerApi serverApi = api.getServerApiForZone(zoneId);
for (Resource server : api.list().concat()) { for (Resource server : serverApi.list().concat()) {
Server details = api.get(server.getId()); Server details = serverApi.get(server.getId());
assertEquals(details.getId(), server.getId()); assertEquals(details.getId(), server.getId());
assertEquals(details.getName(), server.getName()); assertEquals(details.getName(), server.getName());
assertEquals(details.getLinks(), server.getLinks()); assertEquals(details.getLinks(), server.getLinks());

View File

@ -62,10 +62,10 @@ public class BaseNovaApiLiveTest extends BaseApiLiveTest<NovaApi> {
super.setup(); super.setup();
zones = api.getConfiguredZones(); zones = api.getConfiguredZones();
for (String zone : zones){ for (String zone : zones){
ServerApi api = this.api.getServerApiForZone(zone); ServerApi serverApi = api.getServerApiForZone(zone);
for (Resource server : api.list().concat()){ for (Resource server : serverApi.list().concat()){
if (server.getName().equals(hostName)) if (server.getName().equals(hostName))
api.delete(server.getId()); serverApi.delete(server.getId());
} }
} }
} }

View File

@ -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.openstack.keystone.v2_0.config.KeystoneRestClientModule.KeystoneAdminURLModule;
import org.jclouds.rackspace.cloudidentity.v2_0.config.CloudIdentityAuthenticationModule; import org.jclouds.rackspace.cloudidentity.v2_0.config.CloudIdentityAuthenticationModule;
import org.jclouds.rackspace.cloudidentity.v2_0.config.CloudIdentityCredentialTypes; import org.jclouds.rackspace.cloudidentity.v2_0.config.CloudIdentityCredentialTypes;
import org.jclouds.rest.RestContext;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
import com.google.common.reflect.TypeToken; import com.google.common.reflect.TypeToken;
@ -46,7 +45,12 @@ import com.google.inject.Module;
*/ */
public class CloudIdentityApiMetadata extends KeystoneApiMetadata { public class CloudIdentityApiMetadata extends KeystoneApiMetadata {
public static final TypeToken<RestContext<KeystoneApi, KeystoneAsyncApi>> CONTEXT_TOKEN = new TypeToken<RestContext<KeystoneApi, KeystoneAsyncApi>>() { /**
* @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<org.jclouds.rest.RestContext<KeystoneApi, KeystoneAsyncApi>> CONTEXT_TOKEN = new TypeToken<org.jclouds.rest.RestContext<KeystoneApi, KeystoneAsyncApi>>() {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
}; };
@ -70,6 +74,7 @@ public class CloudIdentityApiMetadata extends KeystoneApiMetadata {
} }
public static class Builder extends KeystoneApiMetadata.Builder<Builder> { public static class Builder extends KeystoneApiMetadata.Builder<Builder> {
@SuppressWarnings("deprecation")
protected Builder(){ protected Builder(){
super(KeystoneApi.class, KeystoneAsyncApi.class); super(KeystoneApi.class, KeystoneAsyncApi.class);
id("rackspace-cloudidentity") id("rackspace-cloudidentity")

View File

@ -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.cloudidentity.v2_0.config.CloudIdentityCredentialTypes;
import org.jclouds.rackspace.cloudloadbalancers.v1.config.CloudLoadBalancersRestClientModule; import org.jclouds.rackspace.cloudloadbalancers.v1.config.CloudLoadBalancersRestClientModule;
import org.jclouds.rackspace.cloudloadbalancers.v1.loadbalancer.config.CloudLoadBalancersLoadBalancerContextModule; import org.jclouds.rackspace.cloudloadbalancers.v1.loadbalancer.config.CloudLoadBalancersLoadBalancerContextModule;
import org.jclouds.rest.RestContext;
import org.jclouds.rest.internal.BaseRestApiMetadata; import org.jclouds.rest.internal.BaseRestApiMetadata;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
@ -45,8 +44,12 @@ import com.google.inject.Module;
*/ */
public class CloudLoadBalancersApiMetadata extends BaseRestApiMetadata { public class CloudLoadBalancersApiMetadata extends BaseRestApiMetadata {
public static final TypeToken<RestContext<CloudLoadBalancersApi, CloudLoadBalancersAsyncApi>> CONTEXT_TOKEN = /**
new TypeToken<RestContext<CloudLoadBalancersApi, CloudLoadBalancersAsyncApi>>() { * @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<org.jclouds.rest.RestContext<CloudLoadBalancersApi, CloudLoadBalancersAsyncApi>> CONTEXT_TOKEN = new TypeToken<org.jclouds.rest.RestContext<CloudLoadBalancersApi, CloudLoadBalancersAsyncApi>>() {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
}; };
@ -72,6 +75,7 @@ public class CloudLoadBalancersApiMetadata extends BaseRestApiMetadata {
public static class Builder extends BaseRestApiMetadata.Builder<Builder> { public static class Builder extends BaseRestApiMetadata.Builder<Builder> {
@SuppressWarnings("deprecation")
protected Builder() { protected Builder() {
super(CloudLoadBalancersApi.class, CloudLoadBalancersAsyncApi.class); super(CloudLoadBalancersApi.class, CloudLoadBalancersAsyncApi.class);
id("rackspace-cloudloadbalancers") id("rackspace-cloudloadbalancers")

View File

@ -49,7 +49,10 @@ import com.google.inject.Provides;
* *
* @see CloudLoadBalancersApi * @see CloudLoadBalancersApi
* @author Adrian Cole * @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 { public interface CloudLoadBalancersAsyncApi extends Closeable {
/** /**
* @return the Zone codes configured * @return the Zone codes configured

View File

@ -25,7 +25,6 @@ import java.net.URI;
import java.util.Properties; import java.util.Properties;
import org.jclouds.apis.ApiMetadata; import org.jclouds.apis.ApiMetadata;
import org.jclouds.rest.RestContext;
import org.jclouds.rest.internal.BaseRestApiMetadata; import org.jclouds.rest.internal.BaseRestApiMetadata;
import org.jclouds.route53.config.Route53RestClientModule; import org.jclouds.route53.config.Route53RestClientModule;
@ -38,7 +37,12 @@ import com.google.common.reflect.TypeToken;
*/ */
public class Route53ApiMetadata extends BaseRestApiMetadata { public class Route53ApiMetadata extends BaseRestApiMetadata {
public static final TypeToken<RestContext<? extends Route53Api, ? extends Route53AsyncApi>> CONTEXT_TOKEN = new TypeToken<RestContext<? extends Route53Api, ? extends Route53AsyncApi>>() { /**
* @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<org.jclouds.rest.RestContext<? extends Route53Api, ? extends Route53AsyncApi>> CONTEXT_TOKEN = new TypeToken<org.jclouds.rest.RestContext<? extends Route53Api, ? extends Route53AsyncApi>>() {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
}; };
@ -47,6 +51,7 @@ public class Route53ApiMetadata extends BaseRestApiMetadata {
return new Builder(getApi(), getAsyncApi()).fromApiMetadata(this); return new Builder(getApi(), getAsyncApi()).fromApiMetadata(this);
} }
@SuppressWarnings("deprecation")
public Route53ApiMetadata() { public Route53ApiMetadata() {
this(new Builder(Route53Api.class, Route53AsyncApi.class)); this(new Builder(Route53Api.class, Route53AsyncApi.class));
} }

View File

@ -46,7 +46,10 @@ import com.google.common.util.concurrent.ListenableFuture;
* @see <a href="http://docs.amazonwebservices.com/Route53/latest/APIReference" * @see <a href="http://docs.amazonwebservices.com/Route53/latest/APIReference"
* /> * />
* @author Adrian Cole * @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) @RequestFilters(RestAuthentication.class)
@VirtualHost @VirtualHost
@Path("/{jclouds.api-version}") @Path("/{jclouds.api-version}")

View File

@ -18,7 +18,6 @@
*/ */
package org.jclouds.s3; package org.jclouds.s3;
import static org.jclouds.Constants.PROPERTY_API_VERSION;
import static org.jclouds.Constants.PROPERTY_RELAX_HOSTNAME; 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_AUTH_TAG;
import static org.jclouds.aws.reference.AWSConstants.PROPERTY_HEADER_TAG; import static org.jclouds.aws.reference.AWSConstants.PROPERTY_HEADER_TAG;
@ -32,7 +31,6 @@ import java.net.URI;
import java.util.Properties; import java.util.Properties;
import org.jclouds.apis.ApiMetadata; import org.jclouds.apis.ApiMetadata;
import org.jclouds.rest.RestContext;
import org.jclouds.rest.internal.BaseRestApiMetadata; import org.jclouds.rest.internal.BaseRestApiMetadata;
import org.jclouds.s3.blobstore.S3BlobStoreContext; import org.jclouds.s3.blobstore.S3BlobStoreContext;
import org.jclouds.s3.blobstore.config.S3BlobStoreContextModule; import org.jclouds.s3.blobstore.config.S3BlobStoreContextModule;
@ -62,7 +60,12 @@ import com.google.inject.Module;
*/ */
public class S3ApiMetadata extends BaseRestApiMetadata { public class S3ApiMetadata extends BaseRestApiMetadata {
public static final TypeToken<RestContext<? extends S3Client,? extends S3AsyncClient>> CONTEXT_TOKEN = new TypeToken<RestContext<? extends S3Client,? extends S3AsyncClient>>() { /**
* @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<org.jclouds.rest.RestContext<? extends S3Client, ? extends S3AsyncClient>> CONTEXT_TOKEN = new TypeToken<org.jclouds.rest.RestContext<? extends S3Client, ? extends S3AsyncClient>>() {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
}; };
@ -81,7 +84,6 @@ public class S3ApiMetadata extends BaseRestApiMetadata {
public static Properties defaultProperties() { public static Properties defaultProperties() {
Properties properties = BaseRestApiMetadata.defaultProperties(); Properties properties = BaseRestApiMetadata.defaultProperties();
properties.setProperty(PROPERTY_API_VERSION, S3AsyncClient.VERSION);
properties.setProperty(PROPERTY_AUTH_TAG, "AWS"); properties.setProperty(PROPERTY_AUTH_TAG, "AWS");
properties.setProperty(PROPERTY_HEADER_TAG, S3Headers.DEFAULT_AMAZON_HEADERTAG); properties.setProperty(PROPERTY_HEADER_TAG, S3Headers.DEFAULT_AMAZON_HEADERTAG);
properties.setProperty(PROPERTY_S3_SERVICE_PATH, "/"); properties.setProperty(PROPERTY_S3_SERVICE_PATH, "/");
@ -93,6 +95,7 @@ public class S3ApiMetadata extends BaseRestApiMetadata {
} }
public static abstract class Builder<T extends Builder<T>> extends BaseRestApiMetadata.Builder<T> { public static abstract class Builder<T extends Builder<T>> extends BaseRestApiMetadata.Builder<T> {
@SuppressWarnings("deprecation")
protected Builder() { protected Builder() {
this(S3Client.class, S3AsyncClient.class); this(S3Client.class, S3AsyncClient.class);
} }
@ -105,7 +108,7 @@ public class S3ApiMetadata extends BaseRestApiMetadata {
.credentialName("Secret Access Key") .credentialName("Secret Access Key")
.defaultEndpoint("https://s3.amazonaws.com") .defaultEndpoint("https://s3.amazonaws.com")
.documentation(URI.create("http://docs.amazonwebservices.com/AmazonS3/latest/API")) .documentation(URI.create("http://docs.amazonwebservices.com/AmazonS3/latest/API"))
.version(S3AsyncClient.VERSION) .version("2006-03-01")
.defaultProperties(S3ApiMetadata.defaultProperties()) .defaultProperties(S3ApiMetadata.defaultProperties())
.context(CONTEXT_TOKEN) .context(CONTEXT_TOKEN)
.view(typeToken(S3BlobStoreContext.class)) .view(typeToken(S3BlobStoreContext.class))

View File

@ -104,9 +104,13 @@ import com.google.inject.Provides;
* *
* @author Adrian Cole * @author Adrian Cole
* @author James Murty * @author James Murty
* @see S3Client * @see AWSS3Client
* @see <a href="http://docs.amazonwebservices.com/AmazonS3/2006-03-01/RESTAPI.html" /> * @see <a href="http://docs.amazonwebservices.com/AmazonS3/2006-03-01/RESTAPI.html" />
* @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) @RequestFilters(RequestAuthorizeSignature.class)
@BlobScope(CONTAINER) @BlobScope(CONTAINER)
public interface S3AsyncClient extends Closeable { public interface S3AsyncClient extends Closeable {

View File

@ -27,7 +27,6 @@ import java.net.URI;
import java.util.Properties; import java.util.Properties;
import org.jclouds.apis.ApiMetadata; import org.jclouds.apis.ApiMetadata;
import org.jclouds.rest.RestContext;
import org.jclouds.rest.internal.BaseRestApiMetadata; import org.jclouds.rest.internal.BaseRestApiMetadata;
import org.jclouds.sqs.config.SQSRestClientModule; import org.jclouds.sqs.config.SQSRestClientModule;
@ -42,7 +41,12 @@ import com.google.inject.Module;
*/ */
public class SQSApiMetadata extends BaseRestApiMetadata { public class SQSApiMetadata extends BaseRestApiMetadata {
public static final TypeToken<RestContext<SQSApi, SQSAsyncApi>> CONTEXT_TOKEN = new TypeToken<RestContext<SQSApi, SQSAsyncApi>>() { /**
* @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(SQSApi.class)} as
* {@link SQSAsyncApi} interface will be removed in jclouds 1.7.
*/
@Deprecated
public static final TypeToken<org.jclouds.rest.RestContext<SQSApi, SQSAsyncApi>> CONTEXT_TOKEN = new TypeToken<org.jclouds.rest.RestContext<SQSApi, SQSAsyncApi>>() {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
}; };
@ -51,6 +55,7 @@ public class SQSApiMetadata extends BaseRestApiMetadata {
return new Builder(getApi(), getAsyncApi()).fromApiMetadata(this); return new Builder(getApi(), getAsyncApi()).fromApiMetadata(this);
} }
@SuppressWarnings("deprecation")
public SQSApiMetadata() { public SQSApiMetadata() {
this(new Builder(SQSApi.class, SQSAsyncApi.class)); this(new Builder(SQSApi.class, SQSAsyncApi.class));
} }

View File

@ -45,7 +45,10 @@ import com.google.inject.Provides;
* href="http://docs.amazonwebservices.com/AWSSimpleQueueService/2011-10-01/APIReference/Welcome.html">SQS * href="http://docs.amazonwebservices.com/AWSSimpleQueueService/2011-10-01/APIReference/Welcome.html">SQS
* documentation</a> * documentation</a>
* @author Adrian Cole * @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 @Beta
@RequestFilters(FormSigner.class) @RequestFilters(FormSigner.class)
@VirtualHost @VirtualHost

View File

@ -87,9 +87,9 @@ public class BulkMessageApiLiveTest extends BaseSQSApiLiveTest {
@Test(dependsOnMethods = "testSendMessages") @Test(dependsOnMethods = "testSendMessages")
public void testChangeMessageVisibility() { public void testChangeMessageVisibility() {
for (URI queue : queues) { for (URI queue : queues) {
MessageApi api = this.api.getMessageApiForQueue(queue); MessageApi messageApi = api.getMessageApiForQueue(queue);
Set<Message> messages = collectMessages(api); Set<Message> messages = collectMessages(messageApi);
receiptHandles = Iterables.transform(messages, new Function<Message, String>() { receiptHandles = Iterables.transform(messages, new Function<Message, String>() {
@Override @Override
@ -99,14 +99,14 @@ public class BulkMessageApiLiveTest extends BaseSQSApiLiveTest {
}); });
// hidden message, so we can't see it // hidden message, so we can't see it
assertNull(api.receive()); assertNull(messageApi.receive());
// this should unhide it // this should unhide it
BatchResult<String> acks = api.changeVisibility(receiptHandles, 0); BatchResult<String> acks = messageApi.changeVisibility(receiptHandles, 0);
assertEquals(acks.size(), messages.size(), "error changing visibility " + acks); assertEquals(acks.size(), messages.size(), "error changing visibility " + acks);
// so we can see it again // so we can see it again
assertEquals(collectMessages(api).size(), messages.size()); assertEquals(collectMessages(messageApi).size(), messages.size());
} }
} }

View File

@ -55,14 +55,14 @@ public class MessageApiLiveTest extends BaseSQSApiLiveTest {
public void testSendMessage() { public void testSendMessage() {
for (URI queue : queues) { for (URI queue : queues) {
assertEquals(api.getMessageApiForQueue(queue).send(message).getMD5(), md5); assertEquals(api(queue).send(message).getMD5(), md5);
} }
} }
@Test(dependsOnMethods = "testSendMessage") @Test(dependsOnMethods = "testSendMessage")
public void testReceiveMessageWithoutHidingMessage() { public void testReceiveMessageWithoutHidingMessage() {
for (URI queue : queues) { 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") @Test(dependsOnMethods = "testReceiveMessageWithoutHidingMessage")
public void testChangeMessageVisibility() { public void testChangeMessageVisibility() {
for (URI queue : queues) { for (URI queue : queues) {
MessageApi api = this.api.getMessageApiForQueue(queue); MessageApi messageApi = api(queue);
// start hiding it at 5 seconds // 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 // hidden message, so we can't see it
assertNull(api.receive()); assertNull(messageApi.receive());
// this should unhide it // this should unhide it
api.changeVisibility(receiptHandle, 0); messageApi.changeVisibility(receiptHandle, 0);
// so we can see it again // 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") @Test(dependsOnMethods = "testChangeMessageVisibility")
public void testDeleteMessage() throws InterruptedException { public void testDeleteMessage() throws InterruptedException {
for (URI queue : queues) { for (URI queue : queues) {
api.getMessageApiForQueue(queue).delete(receiptHandle); api(queue).delete(receiptHandle);
assertNoMessages(queue); assertNoMessages(queue);
} }
} }
private MessageApi api(URI queue) {
return api.getMessageApiForQueue(queue);
}
} }

View File

@ -61,12 +61,12 @@ public class BaseSQSApiLiveTest extends BaseApiLiveTest<SQSApi> {
} }
protected String recreateQueueInRegion(String queueName, String region) { protected String recreateQueueInRegion(String queueName, String region) {
QueueApi api = this.api.getQueueApiForRegion(region); QueueApi queueApi = api.getQueueApiForRegion(region);
URI result = api.get(queueName); URI result = queueApi.get(queueName);
if (result != null) { if (result != null) {
api.delete(result); queueApi.delete(result);
} }
URI queue = api.create(queueName); URI queue = queueApi.create(queueName);
assertQueueInList(region, queue); assertQueueInList(region, queue);
queues.add(queue); queues.add(queue);
return queueName; return queueName;

View File

@ -25,7 +25,6 @@ import java.net.URI;
import java.util.Properties; import java.util.Properties;
import org.jclouds.apis.ApiMetadata; import org.jclouds.apis.ApiMetadata;
import org.jclouds.rest.RestContext;
import org.jclouds.rest.internal.BaseRestApiMetadata; import org.jclouds.rest.internal.BaseRestApiMetadata;
import org.jclouds.sts.config.STSRestClientModule; import org.jclouds.sts.config.STSRestClientModule;
@ -38,7 +37,12 @@ import com.google.common.reflect.TypeToken;
*/ */
public class STSApiMetadata extends BaseRestApiMetadata { public class STSApiMetadata extends BaseRestApiMetadata {
public static final TypeToken<RestContext<? extends STSApi, ? extends STSAsyncApi>> CONTEXT_TOKEN = new TypeToken<RestContext<? extends STSApi, ? extends STSAsyncApi>>() { /**
* @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<org.jclouds.rest.RestContext<STSApi, STSAsyncApi>> CONTEXT_TOKEN = new TypeToken<org.jclouds.rest.RestContext<STSApi, STSAsyncApi>>() {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
}; };
@ -47,6 +51,7 @@ public class STSApiMetadata extends BaseRestApiMetadata {
return new Builder(getApi(), getAsyncApi()).fromApiMetadata(this); return new Builder(getApi(), getAsyncApi()).fromApiMetadata(this);
} }
@SuppressWarnings("deprecation")
public STSApiMetadata() { public STSApiMetadata() {
this(new Builder(STSApi.class, STSAsyncApi.class)); this(new Builder(STSApi.class, STSAsyncApi.class));
} }

View File

@ -46,7 +46,10 @@ import com.google.common.util.concurrent.ListenableFuture;
* *
* @see <a href="http://docs.amazonwebservices.com/STS/latest/APIReference" /> * @see <a href="http://docs.amazonwebservices.com/STS/latest/APIReference" />
* @author Adrian Cole * @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) @RequestFilters(FormSigner.class)
@VirtualHost @VirtualHost
public interface STSAsyncApi extends Closeable { public interface STSAsyncApi extends Closeable {

View File

@ -79,7 +79,10 @@ import com.google.inject.Provides;
* @see CommonSwiftClient * @see CommonSwiftClient
* @see <a href="http://www.rackspacecloud.com/cf-devguide-20090812.pdf" /> * @see <a href="http://www.rackspacecloud.com/cf-devguide-20090812.pdf" />
* @author Adrian Cole * @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 { public interface CommonSwiftAsyncClient extends Closeable {
@Provides @Provides
SwiftObject newSwiftObject(); SwiftObject newSwiftObject();

View File

@ -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.blobstore.config.TemporaryUrlExtensionModule.SwiftTemporaryUrlExtensionModule;
import org.jclouds.openstack.swift.config.SwiftRestClientModule; import org.jclouds.openstack.swift.config.SwiftRestClientModule;
import org.jclouds.openstack.swift.config.SwiftRestClientModule.StorageEndpointModule; import org.jclouds.openstack.swift.config.SwiftRestClientModule.StorageEndpointModule;
import org.jclouds.rest.RestContext;
import org.jclouds.rest.internal.BaseRestApiMetadata; import org.jclouds.rest.internal.BaseRestApiMetadata;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
@ -46,7 +45,12 @@ import com.google.inject.Module;
*/ */
public class SwiftApiMetadata extends BaseRestApiMetadata { public class SwiftApiMetadata extends BaseRestApiMetadata {
public static final TypeToken<RestContext<? extends SwiftClient, ? extends SwiftAsyncClient>> CONTEXT_TOKEN = new TypeToken<RestContext<? extends SwiftClient, ? extends SwiftAsyncClient>>() { /**
* @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<org.jclouds.rest.RestContext<? extends SwiftClient, ? extends SwiftAsyncClient>> CONTEXT_TOKEN = new TypeToken<org.jclouds.rest.RestContext<? extends SwiftClient, ? extends SwiftAsyncClient>>() {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
}; };
@ -75,6 +79,7 @@ public class SwiftApiMetadata extends BaseRestApiMetadata {
} }
public static abstract class Builder<T extends Builder<T>> extends BaseRestApiMetadata.Builder<T> { public static abstract class Builder<T extends Builder<T>> extends BaseRestApiMetadata.Builder<T> {
@SuppressWarnings("deprecation")
protected Builder() { protected Builder() {
this(SwiftClient.class, SwiftAsyncClient.class); this(SwiftClient.class, SwiftAsyncClient.class);
} }

View File

@ -26,7 +26,10 @@ import org.jclouds.rest.annotations.RequestFilters;
* Functionality that's in Swift, and not in CloudFiles. * Functionality that's in Swift, and not in CloudFiles.
* *
* @author Adrian Cole * @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) @RequestFilters(AuthenticateRequest.class)
@Endpoint(Storage.class) @Endpoint(Storage.class)
public interface SwiftAsyncClient extends CommonSwiftAsyncClient { public interface SwiftAsyncClient extends CommonSwiftAsyncClient {

View File

@ -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.blobstore.config.TemporaryUrlExtensionModule.SwiftKeystoneTemporaryUrlExtensionModule;
import org.jclouds.openstack.swift.config.SwiftKeystoneRestClientModule; import org.jclouds.openstack.swift.config.SwiftKeystoneRestClientModule;
import org.jclouds.openstack.swift.config.SwiftRestClientModule.KeystoneStorageEndpointModule; import org.jclouds.openstack.swift.config.SwiftRestClientModule.KeystoneStorageEndpointModule;
import org.jclouds.rest.RestContext;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
import com.google.common.reflect.TypeToken; import com.google.common.reflect.TypeToken;
@ -45,7 +44,12 @@ import com.google.inject.Module;
*/ */
public class SwiftKeystoneApiMetadata extends SwiftApiMetadata { public class SwiftKeystoneApiMetadata extends SwiftApiMetadata {
public static final TypeToken<RestContext<SwiftKeystoneClient, SwiftKeystoneAsyncClient>> CONTEXT_TOKEN = new TypeToken<RestContext<SwiftKeystoneClient, SwiftKeystoneAsyncClient>>() { /**
* @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<org.jclouds.rest.RestContext<SwiftKeystoneClient, SwiftKeystoneAsyncClient>> CONTEXT_TOKEN = new TypeToken<org.jclouds.rest.RestContext<SwiftKeystoneClient, SwiftKeystoneAsyncClient>>() {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
}; };

View File

@ -26,7 +26,10 @@ import org.jclouds.rest.annotations.RequestFilters;
* Functionality that's in Swift, and not in CloudFiles. * Functionality that's in Swift, and not in CloudFiles.
* *
* @author Adrian Cole * @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) @RequestFilters(AuthenticateRequest.class)
@Endpoint(Storage.class) @Endpoint(Storage.class)
public interface SwiftKeystoneAsyncClient extends SwiftAsyncClient { public interface SwiftKeystoneAsyncClient extends SwiftAsyncClient {

View File

@ -31,7 +31,6 @@ import java.util.Properties;
import org.jclouds.apis.ApiMetadata; import org.jclouds.apis.ApiMetadata;
import org.jclouds.compute.ComputeServiceContext; import org.jclouds.compute.ComputeServiceContext;
import org.jclouds.rest.RestContext;
import org.jclouds.rest.internal.BaseRestApiMetadata; import org.jclouds.rest.internal.BaseRestApiMetadata;
import org.jclouds.vcloud.compute.config.VCloudComputeServiceContextModule; import org.jclouds.vcloud.compute.config.VCloudComputeServiceContextModule;
import org.jclouds.vcloud.config.VCloudRestClientModule; import org.jclouds.vcloud.config.VCloudRestClientModule;
@ -48,7 +47,12 @@ import com.google.inject.Module;
*/ */
public class VCloudApiMetadata extends BaseRestApiMetadata { public class VCloudApiMetadata extends BaseRestApiMetadata {
public static final TypeToken<RestContext<VCloudClient, VCloudAsyncClient>> CONTEXT_TOKEN = new TypeToken<RestContext<VCloudClient, VCloudAsyncClient>>() { /**
* @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<org.jclouds.rest.RestContext<VCloudClient, VCloudAsyncClient>> CONTEXT_TOKEN = new TypeToken<org.jclouds.rest.RestContext<VCloudClient, VCloudAsyncClient>>() {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
}; };
@ -87,6 +91,7 @@ public class VCloudApiMetadata extends BaseRestApiMetadata {
public static class Builder extends BaseRestApiMetadata.Builder<Builder> { public static class Builder extends BaseRestApiMetadata.Builder<Builder> {
@SuppressWarnings("deprecation")
protected Builder() { protected Builder() {
super(VCloudClient.class, VCloudAsyncClient.class); super(VCloudClient.class, VCloudAsyncClient.class);
id("vcloud") id("vcloud")

View File

@ -39,7 +39,10 @@ import org.jclouds.vcloud.filters.AddVCloudAuthorizationAndCookieToRequest;
* @see <a href= "https://community.vcloudexpress.terremark.com/en-us/discussion_forums/f/60.aspx" * @see <a href= "https://community.vcloudexpress.terremark.com/en-us/discussion_forums/f/60.aspx"
* /> * />
* @author Adrian Cole * @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) @RequestFilters(AddVCloudAuthorizationAndCookieToRequest.class)
public interface VCloudAsyncClient extends Closeable { public interface VCloudAsyncClient extends Closeable {

View File

@ -32,7 +32,10 @@ import com.google.inject.ImplementedBy;
* *
* @author Adrian Cole * @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) @ImplementedBy(RestContextImpl.class)
public interface RestContext<S, A> extends Context { public interface RestContext<S, A> extends Context {
@ -40,7 +43,10 @@ public interface RestContext<S, A> extends Context {
* low-level api to the cloud. Threadsafe implementations will return a singleton. * 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 * @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(); A getAsyncApi();
/** /**

View File

@ -39,7 +39,10 @@ import com.google.inject.TypeLiteral;
/** /**
* @author Adrian Cole * @author Adrian Cole
* @deprecated please use {@link org.jclouds.ContextBuilder#buildApi()} as
* async interface will be removed in jclouds 1.7.
*/ */
@Deprecated
@Singleton @Singleton
public class RestContextImpl<S, A> extends ContextImpl implements RestContext<S, A> { public class RestContextImpl<S, A> extends ContextImpl implements RestContext<S, A> {

View File

@ -28,7 +28,6 @@ import org.jclouds.aws.ec2.compute.config.AWSEC2ComputeServiceContextModule;
import org.jclouds.aws.ec2.config.AWSEC2RestClientModule; import org.jclouds.aws.ec2.config.AWSEC2RestClientModule;
import org.jclouds.ec2.EC2ApiMetadata; import org.jclouds.ec2.EC2ApiMetadata;
import org.jclouds.ec2.compute.config.EC2ResolveImagesModule; import org.jclouds.ec2.compute.config.EC2ResolveImagesModule;
import org.jclouds.rest.RestContext;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
import com.google.common.reflect.TypeToken; import com.google.common.reflect.TypeToken;
@ -40,8 +39,13 @@ import com.google.inject.Module;
* @author Adrian Cole * @author Adrian Cole
*/ */
public class AWSEC2ApiMetadata extends EC2ApiMetadata { public class AWSEC2ApiMetadata extends EC2ApiMetadata {
public static final TypeToken<RestContext<AWSEC2Client, AWSEC2AsyncClient>> CONTEXT_TOKEN = new TypeToken<RestContext<AWSEC2Client, AWSEC2AsyncClient>>() { /**
* @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<org.jclouds.rest.RestContext<AWSEC2Client, AWSEC2AsyncClient>> CONTEXT_TOKEN = new TypeToken<org.jclouds.rest.RestContext<AWSEC2Client, AWSEC2AsyncClient>>() {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
}; };
@ -69,10 +73,11 @@ public class AWSEC2ApiMetadata extends EC2ApiMetadata {
} }
public static class Builder extends EC2ApiMetadata.Builder<Builder> { public static class Builder extends EC2ApiMetadata.Builder<Builder> {
@SuppressWarnings("deprecation")
protected Builder(){ protected Builder(){
super(AWSEC2Client.class, AWSEC2AsyncClient.class); super(AWSEC2Client.class, AWSEC2AsyncClient.class);
id("aws-ec2") id("aws-ec2")
.version(AWSEC2AsyncClient.VERSION) .version("2012-06-01")
.name("Amazon-specific EC2 API") .name("Amazon-specific EC2 API")
.view(AWSEC2ComputeServiceContext.class) .view(AWSEC2ComputeServiceContext.class)
.context(CONTEXT_TOKEN) .context(CONTEXT_TOKEN)

View File

@ -32,9 +32,13 @@ import org.jclouds.rest.annotations.Delegate;
* Provides asynchronous access to EC2 services. * Provides asynchronous access to EC2 services.
* *
* @author Adrian Cole * @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 interface AWSEC2AsyncClient extends EC2AsyncClient {
public static final String VERSION = "2012-06-01";
/** /**
* {@inheritDoc} * {@inheritDoc}

View File

@ -26,7 +26,6 @@ import org.jclouds.apis.ApiMetadata;
import org.jclouds.aws.s3.blobstore.AWSS3BlobStoreContext; import org.jclouds.aws.s3.blobstore.AWSS3BlobStoreContext;
import org.jclouds.aws.s3.blobstore.config.AWSS3BlobStoreContextModule; import org.jclouds.aws.s3.blobstore.config.AWSS3BlobStoreContextModule;
import org.jclouds.aws.s3.config.AWSS3RestClientModule; import org.jclouds.aws.s3.config.AWSS3RestClientModule;
import org.jclouds.rest.RestContext;
import org.jclouds.s3.S3ApiMetadata; import org.jclouds.s3.S3ApiMetadata;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
@ -40,7 +39,12 @@ import com.google.inject.Module;
*/ */
public class AWSS3ApiMetadata extends S3ApiMetadata { public class AWSS3ApiMetadata extends S3ApiMetadata {
public static final TypeToken<RestContext<AWSS3Client, AWSS3AsyncClient>> CONTEXT_TOKEN = new TypeToken<RestContext<AWSS3Client, AWSS3AsyncClient>>() { /**
* @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<org.jclouds.rest.RestContext<AWSS3Client, AWSS3AsyncClient>> CONTEXT_TOKEN = new TypeToken<org.jclouds.rest.RestContext<AWSS3Client, AWSS3AsyncClient>>() {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
}; };
@ -63,6 +67,7 @@ public class AWSS3ApiMetadata extends S3ApiMetadata {
} }
public static class Builder extends S3ApiMetadata.Builder<Builder> { public static class Builder extends S3ApiMetadata.Builder<Builder> {
@SuppressWarnings("deprecation")
protected Builder(){ protected Builder(){
super(AWSS3Client.class, AWSS3AsyncClient.class); super(AWSS3Client.class, AWSS3AsyncClient.class);
id("aws-s3") id("aws-s3")

View File

@ -66,6 +66,9 @@ import com.google.common.util.concurrent.ListenableFuture;
* Provides access to amazon-specific S3 features * Provides access to amazon-specific S3 features
* *
* @author Adrian Cole, Jeremy Whitlock * @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) @RequestFilters(RequestAuthorizeSignature.class)
@BlobScope(CONTAINER) @BlobScope(CONTAINER)

View File

@ -28,7 +28,6 @@ import org.jclouds.apis.ApiMetadata;
import org.jclouds.azureblob.blobstore.config.AzureBlobStoreContextModule; import org.jclouds.azureblob.blobstore.config.AzureBlobStoreContextModule;
import org.jclouds.azureblob.config.AzureBlobRestClientModule; import org.jclouds.azureblob.config.AzureBlobRestClientModule;
import org.jclouds.blobstore.BlobStoreContext; import org.jclouds.blobstore.BlobStoreContext;
import org.jclouds.rest.RestContext;
import org.jclouds.rest.internal.BaseRestApiMetadata; import org.jclouds.rest.internal.BaseRestApiMetadata;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
@ -42,7 +41,12 @@ import com.google.inject.Module;
*/ */
public class AzureBlobApiMetadata extends BaseRestApiMetadata { public class AzureBlobApiMetadata extends BaseRestApiMetadata {
public static final TypeToken<RestContext<AzureBlobClient, AzureBlobAsyncClient>> CONTEXT_TOKEN = new TypeToken<RestContext<AzureBlobClient, AzureBlobAsyncClient>>() { /**
* @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<org.jclouds.rest.RestContext<AzureBlobClient, AzureBlobAsyncClient>> CONTEXT_TOKEN = new TypeToken<org.jclouds.rest.RestContext<AzureBlobClient, AzureBlobAsyncClient>>() {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
}; };
@ -70,6 +74,7 @@ public class AzureBlobApiMetadata extends BaseRestApiMetadata {
} }
public static class Builder extends BaseRestApiMetadata.Builder<Builder> { public static class Builder extends BaseRestApiMetadata.Builder<Builder> {
@SuppressWarnings("deprecation")
protected Builder(){ protected Builder(){
super(AzureBlobClient.class, AzureBlobAsyncClient.class); super(AzureBlobClient.class, AzureBlobAsyncClient.class);
id("azureblob") id("azureblob")

View File

@ -84,7 +84,10 @@ import com.google.inject.Provides;
* @see <a href="http://msdn.microsoft.com/en-us/library/dd135733.aspx" /> * @see <a href="http://msdn.microsoft.com/en-us/library/dd135733.aspx" />
* @see AzureBlobClient * @see AzureBlobClient
* @author Adrian Cole * @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) @RequestFilters(SharedKeyLiteAuthentication.class)
@Headers(keys = AzureStorageHeaders.VERSION, values = "2009-09-19") @Headers(keys = AzureStorageHeaders.VERSION, values = "2009-09-19")
@SkipEncoding({ '/', '$' }) @SkipEncoding({ '/', '$' })

View File

@ -24,11 +24,9 @@ import java.util.Properties;
import org.jclouds.apis.ApiMetadata; import org.jclouds.apis.ApiMetadata;
import org.jclouds.dynect.v3.config.DynECTParserModule; import org.jclouds.dynect.v3.config.DynECTParserModule;
import org.jclouds.dynect.v3.config.DynECTRestClientModule; import org.jclouds.dynect.v3.config.DynECTRestClientModule;
import org.jclouds.rest.RestContext;
import org.jclouds.rest.internal.BaseRestApiMetadata; import org.jclouds.rest.internal.BaseRestApiMetadata;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
import com.google.common.reflect.TypeToken;
import com.google.inject.Module; import com.google.inject.Module;
/** /**
@ -40,10 +38,6 @@ public class DynECTApiMetadata extends BaseRestApiMetadata {
public static final String ANONYMOUS_IDENTITY = "ANONYMOUS"; public static final String ANONYMOUS_IDENTITY = "ANONYMOUS";
public static final TypeToken<RestContext<DynECTApi, DynECTAsyncApi>> CONTEXT_TOKEN = new TypeToken<RestContext<DynECTApi, DynECTAsyncApi>>() {
private static final long serialVersionUID = 1L;
};
@Override @Override
public Builder toBuilder() { public Builder toBuilder() {
return new Builder().fromApiMetadata(this); return new Builder().fromApiMetadata(this);

View File

@ -49,7 +49,10 @@ import com.google.common.util.concurrent.ListenableFuture;
* @see DynECTApi * @see DynECTApi
* @see <a href="https://manage.dynect.net/help/docs/api2/rest/" /> * @see <a href="https://manage.dynect.net/help/docs/api2/rest/" />
* @author Adrian Cole * @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 { public interface DynECTAsyncApi extends Closeable {
/** /**
* @see DynECTApi#getJob * @see DynECTApi#getJob

View File

@ -27,7 +27,6 @@ import org.jclouds.apis.ApiMetadata;
import org.jclouds.compute.ComputeServiceContext; import org.jclouds.compute.ComputeServiceContext;
import org.jclouds.glesys.compute.config.GleSYSComputeServiceContextModule; import org.jclouds.glesys.compute.config.GleSYSComputeServiceContextModule;
import org.jclouds.glesys.config.GleSYSRestClientModule; import org.jclouds.glesys.config.GleSYSRestClientModule;
import org.jclouds.rest.RestContext;
import org.jclouds.rest.internal.BaseRestApiMetadata; import org.jclouds.rest.internal.BaseRestApiMetadata;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
@ -41,7 +40,12 @@ import com.google.inject.Module;
*/ */
public class GleSYSApiMetadata extends BaseRestApiMetadata { public class GleSYSApiMetadata extends BaseRestApiMetadata {
public static final TypeToken<RestContext<GleSYSApi, GleSYSAsyncApi>> CONTEXT_TOKEN = new TypeToken<RestContext<GleSYSApi, GleSYSAsyncApi>>() { /**
* @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<org.jclouds.rest.RestContext<GleSYSApi, GleSYSAsyncApi>> CONTEXT_TOKEN = new TypeToken<org.jclouds.rest.RestContext<GleSYSApi, GleSYSAsyncApi>>() {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
}; };
@ -67,6 +71,7 @@ public class GleSYSApiMetadata extends BaseRestApiMetadata {
public static class Builder extends BaseRestApiMetadata.Builder<Builder> { public static class Builder extends BaseRestApiMetadata.Builder<Builder> {
@SuppressWarnings("deprecation")
protected Builder() { protected Builder() {
super(GleSYSApi.class, GleSYSAsyncApi.class); super(GleSYSApi.class, GleSYSAsyncApi.class);
id("glesys") id("glesys")

View File

@ -34,7 +34,10 @@ import org.jclouds.rest.annotations.Delegate;
* @see GleSYSApi * @see GleSYSApi
* @see <a href="https://customer.glesys.com/api.php" /> * @see <a href="https://customer.glesys.com/api.php" />
* @author Adrian Cole * @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 { public interface GleSYSAsyncApi extends Closeable {
/** /**

View File

@ -49,7 +49,7 @@ public class ArchiveApiLiveTest extends BaseGleSYSApiLiveTest {
archiveUser = identity.toLowerCase() + "_test9"; archiveUser = identity.toLowerCase() + "_test9";
archiveCounter = retry(new Predicate<Integer>() { archiveCounter = retry(new Predicate<Integer>() {
public boolean apply(Integer value) { public boolean apply(Integer value) {
return archiveApi.list().size() == value; return archiveApi.list().size() == value.intValue();
} }
}, 30, 1, SECONDS); }, 30, 1, SECONDS);
} }

View File

@ -53,12 +53,12 @@ public class DomainApiLiveTest extends BaseGleSYSApiLiveTest {
domainApi = api.getDomainApi(); domainApi = api.getDomainApi();
domainCounter = retry(new Predicate<Integer>() { domainCounter = retry(new Predicate<Integer>() {
public boolean apply(Integer value) { public boolean apply(Integer value) {
return domainApi.list().size() == value; return domainApi.list().size() == value.intValue();
} }
}, 30, 1, SECONDS); }, 30, 1, SECONDS);
recordCounter = retry(new Predicate<Integer>() { recordCounter = retry(new Predicate<Integer>() {
public boolean apply(Integer value) { public boolean apply(Integer value) {
return domainApi.listRecords(testDomain).size() == value; return domainApi.listRecords(testDomain).size() == value.intValue();
} }
}, 30, 1, SECONDS); }, 30, 1, SECONDS);

View File

@ -63,7 +63,7 @@ public class EmailAccountApiLiveTest extends BaseGleSYSApiLiveTest {
emailAccountCounter = retry(new Predicate<Integer>() { emailAccountCounter = retry(new Predicate<Integer>() {
public boolean apply(Integer value) { public boolean apply(Integer value) {
return emailAccountApi.listDomain(testDomain).size() == value; return emailAccountApi.listDomain(testDomain).size() == value.intValue();
} }
}, 180, 5, SECONDS); }, 180, 5, SECONDS);

View File

@ -43,13 +43,13 @@ public class BaseGleSYSApiLiveTest extends BaseApiLiveTest<GleSYSApi> {
} }
protected void createDomain(String domain) { protected void createDomain(String domain) {
final DomainApi api = this.api.getDomainApi(); final DomainApi domainApi = api.getDomainApi();
int before = api.list().size(); int before = domainApi.list().size();
api.create(domain); domainApi.create(domain);
Predicate<Integer> result = retry(new Predicate<Integer>() { Predicate<Integer> result = retry(new Predicate<Integer>() {
public boolean apply(Integer value) { public boolean apply(Integer value) {
return api.list().size() == value; return domainApi.list().size() == value.intValue();
} }
}, 30, 1, SECONDS); }, 30, 1, SECONDS);

View File

@ -74,21 +74,21 @@ public class BaseGleSYSApiWithAServerLiveTest extends BaseGleSYSApiLiveTest {
} }
protected void createDomain(String domain) { protected void createDomain(String domain) {
final DomainApi api = this.api.getDomainApi(); final DomainApi domainApi = api.getDomainApi();
int before = api.list().size(); int before = domainApi.list().size();
api.create(domain); domainApi.create(domain);
Predicate<Integer> result = retry(new Predicate<Integer>() { Predicate<Integer> result = retry(new Predicate<Integer>() {
public boolean apply(Integer value) { public boolean apply(Integer value) {
return api.list().size() == value; return domainApi.list().size() == value.intValue();
} }
}, 30, 1, SECONDS); }, 30, 1, SECONDS);
assertTrue(result.apply(before + 1)); assertTrue(result.apply(before + 1));
} }
protected Predicate<State> createServer(String hostName) { protected Predicate<State> 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") 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() .diskSizeGB(5).memorySizeMB(512).cpuCores(1).transferGB(50).build(), hostName, UUID.randomUUID()
.toString().replace("-","")); .toString().replace("-",""));
@ -97,7 +97,7 @@ public class BaseGleSYSApiWithAServerLiveTest extends BaseGleSYSApiLiveTest {
assertEquals(testServer.getHostname(), hostName); assertEquals(testServer.getHostname(), hostName);
assertFalse(testServer.getIps().isEmpty()); assertFalse(testServer.getIps().isEmpty());
Predicate<State> statusChecker = statusChecker(api, testServer.getId()); Predicate<State> statusChecker = statusChecker(serverApi, testServer.getId());
assertTrue(statusChecker.apply(Server.State.RUNNING)); assertTrue(statusChecker.apply(Server.State.RUNNING));
serverId = testServer.getId(); serverId = testServer.getId();
return statusChecker; return statusChecker;

View File

@ -27,7 +27,6 @@ import org.jclouds.apis.ApiMetadata;
import org.jclouds.compute.ComputeServiceContext; import org.jclouds.compute.ComputeServiceContext;
import org.jclouds.gogrid.compute.config.GoGridComputeServiceContextModule; import org.jclouds.gogrid.compute.config.GoGridComputeServiceContextModule;
import org.jclouds.gogrid.config.GoGridRestClientModule; import org.jclouds.gogrid.config.GoGridRestClientModule;
import org.jclouds.rest.RestContext;
import org.jclouds.rest.internal.BaseRestApiMetadata; import org.jclouds.rest.internal.BaseRestApiMetadata;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
@ -41,7 +40,12 @@ import com.google.inject.Module;
*/ */
public class GoGridApiMetadata extends BaseRestApiMetadata { public class GoGridApiMetadata extends BaseRestApiMetadata {
public static final TypeToken<RestContext<GoGridClient, GoGridAsyncClient>> CONTEXT_TOKEN = new TypeToken<RestContext<GoGridClient, GoGridAsyncClient>>() { /**
* @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<org.jclouds.rest.RestContext<GoGridClient, GoGridAsyncClient>> CONTEXT_TOKEN = new TypeToken<org.jclouds.rest.RestContext<GoGridClient, GoGridAsyncClient>>() {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
}; };
@ -67,6 +71,7 @@ public class GoGridApiMetadata extends BaseRestApiMetadata {
public static class Builder extends BaseRestApiMetadata.Builder<Builder> { public static class Builder extends BaseRestApiMetadata.Builder<Builder> {
@SuppressWarnings("deprecation")
protected Builder() { protected Builder() {
super(GoGridClient.class, GoGridAsyncClient.class); super(GoGridClient.class, GoGridAsyncClient.class);
id("gogrid") id("gogrid")
@ -74,7 +79,7 @@ public class GoGridApiMetadata extends BaseRestApiMetadata {
.identityName("API Key") .identityName("API Key")
.credentialName("Shared Secret") .credentialName("Shared Secret")
.documentation(URI.create("https://wiki.gogrid.com/wiki/index.php/API")) .documentation(URI.create("https://wiki.gogrid.com/wiki/index.php/API"))
.version(GoGridAsyncClient.VERSION) .version("1.5")
.defaultEndpoint("https://api.gogrid.com/api") .defaultEndpoint("https://api.gogrid.com/api")
.defaultProperties(GoGridApiMetadata.defaultProperties()) .defaultProperties(GoGridApiMetadata.defaultProperties())
.view(typeToken(ComputeServiceContext.class)) .view(typeToken(ComputeServiceContext.class))

View File

@ -29,9 +29,11 @@ import org.jclouds.rest.annotations.Delegate;
/** /**
* @author Oleksiy Yarmula * @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 interface GoGridAsyncClient extends Closeable {
public static final String VERSION = "1.5";
/** /**
* @see GoGridClient#getServerServices() * @see GoGridClient#getServerServices()

View File

@ -18,7 +18,6 @@
*/ */
package org.jclouds.gogrid; package org.jclouds.gogrid;
import static org.jclouds.Constants.PROPERTY_API_VERSION;
import static org.jclouds.compute.config.ComputeServiceProperties.TEMPLATE; import static org.jclouds.compute.config.ComputeServiceProperties.TEMPLATE;
import static org.jclouds.location.reference.LocationConstants.ISO3166_CODES; import static org.jclouds.location.reference.LocationConstants.ISO3166_CODES;
import static org.jclouds.location.reference.LocationConstants.PROPERTY_ZONE; 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 + ".1." + ISO3166_CODES, "US-CA");
properties.setProperty(PROPERTY_ZONE + ".2." + ISO3166_CODES, "US-VA"); properties.setProperty(PROPERTY_ZONE + ".2." + ISO3166_CODES, "US-VA");
properties.setProperty(PROPERTY_ZONE + ".3." + ISO3166_CODES, "NL-NH"); 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"); properties.setProperty(TEMPLATE, "osFamily=UBUNTU,osVersionMatches=1[012].[01][04],imageNameMatches=.*w/ None.*,locationId=1");
return properties; return properties;
} }

View File

@ -33,7 +33,6 @@ import javax.ws.rs.Path;
import javax.ws.rs.QueryParam; import javax.ws.rs.QueryParam;
import org.jclouds.Fallbacks.NullOnNotFoundOr404; import org.jclouds.Fallbacks.NullOnNotFoundOr404;
import org.jclouds.gogrid.GoGridAsyncClient;
import org.jclouds.gogrid.binders.BindIdsToQueryParams; import org.jclouds.gogrid.binders.BindIdsToQueryParams;
import org.jclouds.gogrid.binders.BindNamesToQueryParams; import org.jclouds.gogrid.binders.BindNamesToQueryParams;
import org.jclouds.gogrid.domain.Option; import org.jclouds.gogrid.domain.Option;
@ -56,7 +55,7 @@ import com.google.common.util.concurrent.ListenableFuture;
* @author Oleksiy Yarmula * @author Oleksiy Yarmula
*/ */
@RequestFilters(SharedKeyLiteAuthentication.class) @RequestFilters(SharedKeyLiteAuthentication.class)
@QueryParams(keys = VERSION, values = GoGridAsyncClient.VERSION) @QueryParams(keys = VERSION, values = "{jclouds.api-version}")
public interface GridImageAsyncClient { public interface GridImageAsyncClient {
/** /**

View File

@ -28,7 +28,6 @@ import java.util.Set;
import javax.ws.rs.GET; import javax.ws.rs.GET;
import javax.ws.rs.Path; import javax.ws.rs.Path;
import org.jclouds.gogrid.GoGridAsyncClient;
import org.jclouds.gogrid.domain.Ip; import org.jclouds.gogrid.domain.Ip;
import org.jclouds.gogrid.domain.Option; import org.jclouds.gogrid.domain.Option;
import org.jclouds.gogrid.filters.SharedKeyLiteAuthentication; import org.jclouds.gogrid.filters.SharedKeyLiteAuthentication;
@ -47,7 +46,7 @@ import com.google.common.util.concurrent.ListenableFuture;
* @author Oleksiy Yarmula * @author Oleksiy Yarmula
*/ */
@RequestFilters(SharedKeyLiteAuthentication.class) @RequestFilters(SharedKeyLiteAuthentication.class)
@QueryParams(keys = VERSION, values = GoGridAsyncClient.VERSION) @QueryParams(keys = VERSION, values = "{jclouds.api-version}")
public interface GridIpAsyncClient { public interface GridIpAsyncClient {
/** /**

View File

@ -25,7 +25,6 @@ import java.util.Set;
import javax.ws.rs.GET; import javax.ws.rs.GET;
import javax.ws.rs.Path; import javax.ws.rs.Path;
import org.jclouds.gogrid.GoGridAsyncClient;
import org.jclouds.gogrid.binders.BindIdsToQueryParams; import org.jclouds.gogrid.binders.BindIdsToQueryParams;
import org.jclouds.gogrid.binders.BindObjectNameToGetJobsRequestQueryParams; import org.jclouds.gogrid.binders.BindObjectNameToGetJobsRequestQueryParams;
import org.jclouds.gogrid.domain.Job; import org.jclouds.gogrid.domain.Job;
@ -43,7 +42,7 @@ import com.google.common.util.concurrent.ListenableFuture;
* @author Oleksiy Yarmula * @author Oleksiy Yarmula
*/ */
@RequestFilters(SharedKeyLiteAuthentication.class) @RequestFilters(SharedKeyLiteAuthentication.class)
@QueryParams(keys = VERSION, values = GoGridAsyncClient.VERSION) @QueryParams(keys = VERSION, values = "{jclouds.api-version}")
public interface GridJobAsyncClient { public interface GridJobAsyncClient {
/** /**

View File

@ -30,7 +30,6 @@ import javax.ws.rs.GET;
import javax.ws.rs.Path; import javax.ws.rs.Path;
import javax.ws.rs.QueryParam; import javax.ws.rs.QueryParam;
import org.jclouds.gogrid.GoGridAsyncClient;
import org.jclouds.gogrid.binders.BindIdsToQueryParams; import org.jclouds.gogrid.binders.BindIdsToQueryParams;
import org.jclouds.gogrid.binders.BindNamesToQueryParams; import org.jclouds.gogrid.binders.BindNamesToQueryParams;
import org.jclouds.gogrid.binders.BindRealIpPortPairsToQueryParams; import org.jclouds.gogrid.binders.BindRealIpPortPairsToQueryParams;
@ -54,7 +53,7 @@ import com.google.common.util.concurrent.ListenableFuture;
* @author Oleksiy Yarmula * @author Oleksiy Yarmula
*/ */
@RequestFilters(SharedKeyLiteAuthentication.class) @RequestFilters(SharedKeyLiteAuthentication.class)
@QueryParams(keys = VERSION, values = GoGridAsyncClient.VERSION) @QueryParams(keys = VERSION, values = "{jclouds.api-version}")
public interface GridLoadBalancerAsyncClient { public interface GridLoadBalancerAsyncClient {
/** /**

View File

@ -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.config.SwiftRestClientModule.KeystoneStorageEndpointModule;
import org.jclouds.openstack.swift.extensions.KeystoneTemporaryUrlKeyAsyncApi; import org.jclouds.openstack.swift.extensions.KeystoneTemporaryUrlKeyAsyncApi;
import org.jclouds.openstack.swift.extensions.TemporaryUrlKeyApi; import org.jclouds.openstack.swift.extensions.TemporaryUrlKeyApi;
import org.jclouds.rest.RestContext;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
import com.google.common.reflect.TypeToken; import com.google.common.reflect.TypeToken;
@ -45,7 +44,12 @@ import com.google.inject.Module;
*/ */
public class HPCloudObjectStorageApiMetadata extends SwiftKeystoneApiMetadata { public class HPCloudObjectStorageApiMetadata extends SwiftKeystoneApiMetadata {
public static final TypeToken<RestContext<HPCloudObjectStorageApi, HPCloudObjectStorageAsyncApi>> CONTEXT_TOKEN = new TypeToken<RestContext<HPCloudObjectStorageApi, HPCloudObjectStorageAsyncApi>>() { /**
* @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<org.jclouds.rest.RestContext<HPCloudObjectStorageApi, HPCloudObjectStorageAsyncApi>> CONTEXT_TOKEN = new TypeToken<org.jclouds.rest.RestContext<HPCloudObjectStorageApi, HPCloudObjectStorageAsyncApi>>() {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
}; };
@ -68,6 +72,7 @@ public class HPCloudObjectStorageApiMetadata extends SwiftKeystoneApiMetadata {
} }
public static class Builder extends SwiftKeystoneApiMetadata.Builder<Builder> { public static class Builder extends SwiftKeystoneApiMetadata.Builder<Builder> {
@SuppressWarnings("deprecation")
protected Builder(){ protected Builder(){
super(HPCloudObjectStorageApi.class, HPCloudObjectStorageAsyncApi.class); super(HPCloudObjectStorageApi.class, HPCloudObjectStorageAsyncApi.class);
id("hpcloud-objectstorage") id("hpcloud-objectstorage")

View File

@ -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 * href="https://api-docs.hpcloud.com/hpcloud-object-storage/1.0/content/ch_object-storage-dev-overview.html">HP
* Cloud Object Storage API</a> * Cloud Object Storage API</a>
* @author Jeremy Daggett * @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) @RequestFilters(AuthenticateRequest.class)
@Endpoint(Storage.class) @Endpoint(Storage.class)
public interface HPCloudObjectStorageAsyncApi extends CommonSwiftAsyncClient { public interface HPCloudObjectStorageAsyncApi extends CommonSwiftAsyncClient {

View File

@ -25,7 +25,6 @@ import java.util.Properties;
import org.jclouds.apis.ApiMetadata; import org.jclouds.apis.ApiMetadata;
import org.jclouds.compute.ComputeServiceContext; import org.jclouds.compute.ComputeServiceContext;
import org.jclouds.rest.RestContext;
import org.jclouds.rest.internal.BaseRestApiMetadata; import org.jclouds.rest.internal.BaseRestApiMetadata;
import org.jclouds.softlayer.compute.config.SoftLayerComputeServiceContextModule; import org.jclouds.softlayer.compute.config.SoftLayerComputeServiceContextModule;
import org.jclouds.softlayer.config.SoftLayerRestClientModule; import org.jclouds.softlayer.config.SoftLayerRestClientModule;
@ -41,7 +40,12 @@ import com.google.inject.Module;
*/ */
public class SoftLayerApiMetadata extends BaseRestApiMetadata { public class SoftLayerApiMetadata extends BaseRestApiMetadata {
public static final TypeToken<RestContext<SoftLayerClient, SoftLayerAsyncClient>> CONTEXT_TOKEN = new TypeToken<RestContext<SoftLayerClient, SoftLayerAsyncClient>>() { /**
* @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<org.jclouds.rest.RestContext<SoftLayerClient, SoftLayerAsyncClient>> CONTEXT_TOKEN = new TypeToken<org.jclouds.rest.RestContext<SoftLayerClient, SoftLayerAsyncClient>>() {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
}; };
@ -67,6 +71,7 @@ public class SoftLayerApiMetadata extends BaseRestApiMetadata {
public static class Builder extends BaseRestApiMetadata.Builder<Builder> { public static class Builder extends BaseRestApiMetadata.Builder<Builder> {
@SuppressWarnings("deprecation")
protected Builder() { protected Builder() {
super(SoftLayerClient.class, SoftLayerAsyncClient.class); super(SoftLayerClient.class, SoftLayerAsyncClient.class);
id("softlayer") id("softlayer")

View File

@ -33,7 +33,10 @@ import org.jclouds.softlayer.features.VirtualGuestAsyncClient;
* @see SoftLayerClient * @see SoftLayerClient
* @see <a href="http://sldn.softlayer.com/article/REST" /> * @see <a href="http://sldn.softlayer.com/article/REST" />
* @author Adrian Cole * @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 { public interface SoftLayerAsyncClient extends Closeable {
/** /**

View File

@ -7,7 +7,6 @@ import java.net.URI;
import java.util.Properties; import java.util.Properties;
import org.jclouds.apis.ApiMetadata; import org.jclouds.apis.ApiMetadata;
import org.jclouds.rest.RestContext;
import org.jclouds.trmk.ecloud.compute.config.TerremarkECloudComputeServiceContextModule; import org.jclouds.trmk.ecloud.compute.config.TerremarkECloudComputeServiceContextModule;
import org.jclouds.trmk.ecloud.config.TerremarkECloudRestClientModule; import org.jclouds.trmk.ecloud.config.TerremarkECloudRestClientModule;
import org.jclouds.trmk.vcloud_0_8.internal.TerremarkVCloudApiMetadata; import org.jclouds.trmk.vcloud_0_8.internal.TerremarkVCloudApiMetadata;
@ -23,7 +22,12 @@ import com.google.inject.Module;
*/ */
public class TerremarkECloudApiMetadata extends TerremarkVCloudApiMetadata { public class TerremarkECloudApiMetadata extends TerremarkVCloudApiMetadata {
public static final TypeToken<RestContext<TerremarkECloudClient, TerremarkECloudAsyncClient>> CONTEXT_TOKEN = new TypeToken<RestContext<TerremarkECloudClient, TerremarkECloudAsyncClient>>() { /**
* @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<org.jclouds.rest.RestContext<TerremarkECloudClient, TerremarkECloudAsyncClient>> CONTEXT_TOKEN = new TypeToken<org.jclouds.rest.RestContext<TerremarkECloudClient, TerremarkECloudAsyncClient>>() {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
}; };
@ -49,6 +53,7 @@ public class TerremarkECloudApiMetadata extends TerremarkVCloudApiMetadata {
public static class Builder extends TerremarkVCloudApiMetadata.Builder<Builder> { public static class Builder extends TerremarkVCloudApiMetadata.Builder<Builder> {
@SuppressWarnings("deprecation")
protected Builder() { protected Builder() {
super(TerremarkECloudClient.class, TerremarkECloudAsyncClient.class); super(TerremarkECloudClient.class, TerremarkECloudAsyncClient.class);
id("trmk-ecloud") id("trmk-ecloud")

View File

@ -91,7 +91,10 @@ import com.google.common.util.concurrent.ListenableFuture;
* "http://support.theenterprisecloud.com/kb/default.asp?id=645&Lang=1&SID=" * "http://support.theenterprisecloud.com/kb/default.asp?id=645&Lang=1&SID="
* /> * />
* @author Adrian Cole * @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) @RequestFilters(SetVCloudTokenCookie.class)
public interface TerremarkECloudAsyncClient extends TerremarkVCloudAsyncClient { public interface TerremarkECloudAsyncClient extends TerremarkVCloudAsyncClient {
/** /**

View File

@ -25,7 +25,6 @@ import java.net.URI;
import java.util.Properties; import java.util.Properties;
import org.jclouds.apis.ApiMetadata; import org.jclouds.apis.ApiMetadata;
import org.jclouds.rest.RestContext;
import org.jclouds.trmk.vcloud_0_8.internal.TerremarkVCloudApiMetadata; import org.jclouds.trmk.vcloud_0_8.internal.TerremarkVCloudApiMetadata;
import org.jclouds.trmk.vcloudexpress.compute.TerremarkVCloudExpressComputeServiceContextModule; import org.jclouds.trmk.vcloudexpress.compute.TerremarkVCloudExpressComputeServiceContextModule;
import org.jclouds.trmk.vcloudexpress.config.TerremarkVCloudExpressRestClientModule; import org.jclouds.trmk.vcloudexpress.config.TerremarkVCloudExpressRestClientModule;
@ -41,7 +40,12 @@ import com.google.inject.Module;
*/ */
public class TerremarkVCloudExpressApiMetadata extends TerremarkVCloudApiMetadata { public class TerremarkVCloudExpressApiMetadata extends TerremarkVCloudApiMetadata {
public static final TypeToken<RestContext<TerremarkVCloudExpressClient, TerremarkVCloudExpressAsyncClient>> CONTEXT_TOKEN = new TypeToken<RestContext<TerremarkVCloudExpressClient, TerremarkVCloudExpressAsyncClient>>() { /**
* @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<org.jclouds.rest.RestContext<TerremarkVCloudExpressClient, TerremarkVCloudExpressAsyncClient>> CONTEXT_TOKEN = new TypeToken<org.jclouds.rest.RestContext<TerremarkVCloudExpressClient, TerremarkVCloudExpressAsyncClient>>() {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
}; };
@ -67,6 +71,7 @@ public class TerremarkVCloudExpressApiMetadata extends TerremarkVCloudApiMetadat
public static class Builder extends TerremarkVCloudApiMetadata.Builder<Builder> { public static class Builder extends TerremarkVCloudApiMetadata.Builder<Builder> {
@SuppressWarnings("deprecation")
protected Builder() { protected Builder() {
super(TerremarkVCloudExpressClient.class, TerremarkVCloudExpressAsyncClient.class); super(TerremarkVCloudExpressClient.class, TerremarkVCloudExpressAsyncClient.class);
id("trmk-vcloudexpress") id("trmk-vcloudexpress")

View File

@ -63,7 +63,10 @@ import com.google.common.util.concurrent.ListenableFuture;
* *
* @see <a href="https://community.vcloudexpress.terremark.com/en-us/discussion_forums/f/60.aspx" /> * @see <a href="https://community.vcloudexpress.terremark.com/en-us/discussion_forums/f/60.aspx" />
* @author Adrian Cole * @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) @RequestFilters(SetVCloudTokenCookie.class)
public interface TerremarkVCloudExpressAsyncClient extends TerremarkVCloudAsyncClient { public interface TerremarkVCloudExpressAsyncClient extends TerremarkVCloudAsyncClient {
/** /**

View File

@ -22,12 +22,9 @@ import java.net.URI;
import java.util.Properties; import java.util.Properties;
import org.jclouds.apis.ApiMetadata; import org.jclouds.apis.ApiMetadata;
import org.jclouds.rest.RestContext;
import org.jclouds.rest.internal.BaseRestApiMetadata; import org.jclouds.rest.internal.BaseRestApiMetadata;
import org.jclouds.ultradns.ws.config.UltraDNSWSRestClientModule; import org.jclouds.ultradns.ws.config.UltraDNSWSRestClientModule;
import com.google.common.reflect.TypeToken;
/** /**
* Implementation of {@link ApiMetadata} for Neustar's UltraDNSWS api. * 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 class UltraDNSWSApiMetadata extends BaseRestApiMetadata {
public static final TypeToken<RestContext<UltraDNSWSApi, UltraDNSWSAsyncApi>> CONTEXT_TOKEN = new TypeToken<RestContext<UltraDNSWSApi, UltraDNSWSAsyncApi>>() {
private static final long serialVersionUID = 1L;
};
@Override @Override
public Builder toBuilder() { public Builder toBuilder() {
return new Builder(getApi(), getAsyncApi()).fromApiMetadata(this); return new Builder(getApi(), getAsyncApi()).fromApiMetadata(this);

View File

@ -47,7 +47,10 @@ import com.google.common.util.concurrent.ListenableFuture;
* @see <a href="https://ultra-api.ultradns.com:8443/UltraDNS_WS/v01?wsdl" /> * @see <a href="https://ultra-api.ultradns.com:8443/UltraDNS_WS/v01?wsdl" />
* @see <a href="https://www.ultradns.net/api/NUS_API_XML_SOAP.pdf" /> * @see <a href="https://www.ultradns.net/api/NUS_API_XML_SOAP.pdf" />
* @author Adrian Cole * @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) @RequestFilters(SOAPWrapWithPasswordAuth.class)
@VirtualHost @VirtualHost
public interface UltraDNSWSAsyncApi extends Closeable { public interface UltraDNSWSAsyncApi extends Closeable {