From 25ab7814e46edaacf4058e4fde6fd46d169a7497 Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Thu, 12 Jul 2012 10:07:33 -0700 Subject: [PATCH] Issue 1022: updated aws-elb aws-iam aws-rds iam elb rds to new naming conventions --- .../aws/elb/AWSELBProviderMetadata.java | 2 +- .../jclouds/aws/elb/AWSELBProviderTest.java | 2 +- ...va => AWSAvailabilityZoneApiLiveTest.java} | 8 +-- ...eTest.java => AWSInstanceApiLiveTest.java} | 8 +-- ...t.java => AWSLoadBalancerApiLiveTest.java} | 8 +-- ...iveTest.java => AWSPolicyApiLiveTest.java} | 8 +-- .../aws/iam/AWSIAMProviderMetadata.java | 2 +- ...ntLiveTest.java => AWSIAMApiLiveTest.java} | 10 ++-- ...tLiveTest.java => AWSUserApiLiveTest.java} | 8 +-- ...eTest.java => AWSInstanceApiLiveTest.java} | 8 +-- ....java => AWSSecurityGroupApiLiveTest.java} | 8 +-- ...st.java => AWSSubnetGroupApiLiveTest.java} | 8 +-- .../src/main/java/org/jclouds/elb/ELB.java | 16 ++--- .../elb/{ELBClient.java => ELBApi.java} | 28 ++++----- .../java/org/jclouds/elb/ELBApiMetadata.java | 10 ++-- .../{ELBAsyncClient.java => ELBAsyncApi.java} | 26 ++++---- .../elb/config/ELBRestClientModule.java | 32 +++++----- .../java/org/jclouds/elb/domain/Listener.java | 2 +- .../java/org/jclouds/elb/domain/Scheme.java | 2 +- ...neClient.java => AvailabilityZoneApi.java} | 18 +++--- ...ent.java => AvailabilityZoneAsyncApi.java} | 12 ++-- .../{InstanceClient.java => InstanceApi.java} | 24 ++++---- ...AsyncClient.java => InstanceAsyncApi.java} | 16 ++--- ...lancerClient.java => LoadBalancerApi.java} | 10 ++-- ...cClient.java => LoadBalancerAsyncApi.java} | 20 +++---- .../{PolicyClient.java => PolicyApi.java} | 2 +- ...cyAsyncClient.java => PolicyAsyncApi.java} | 16 ++--- .../ELBBindLoadBalancerStrategiesByClass.java | 2 +- .../LoadBalancerToLoadBalancerMetadata.java | 2 +- .../ELBDestroyLoadBalancerStrategy.java | 10 ++-- .../ELBGetLoadBalancerMetadataStrategy.java | 12 ++-- .../ELBListLoadBalancersStrategy.java | 10 ++-- .../strategy/ELBLoadBalanceNodesStrategy.java | 22 +++---- .../test/java/org/jclouds/elb/ELBTest.java | 20 +++---- ...ava => AvailabilityZoneApiExpectTest.java} | 42 ++++++------- ....java => AvailabilityZoneApiLiveTest.java} | 10 ++-- ...ctTest.java => InstanceApiExpectTest.java} | 50 ++++++++-------- ...LiveTest.java => InstanceApiLiveTest.java} | 16 ++--- ...st.java => LoadBalancerApiExpectTest.java} | 38 ++++++------ ...Test.java => LoadBalancerApiLiveTest.java} | 16 ++--- ...pectTest.java => PolicyApiExpectTest.java} | 50 ++++++++-------- ...ntLiveTest.java => PolicyApiLiveTest.java} | 20 +++---- ...ectTest.java => BaseELBApiExpectTest.java} | 4 +- ...tLiveTest.java => BaseELBApiLiveTest.java} | 10 ++-- ...st.java => BaseELBAsyncApiExpectTest.java} | 8 +-- .../elb/internal/BaseELBExpectTest.java | 4 +- .../ELBLoadBalancerServiceLiveTest.java | 10 ++-- .../src/main/java/org/jclouds/iam/IAM.java | 12 ++-- .../iam/{IAMClient.java => IAMApi.java} | 6 +- .../java/org/jclouds/iam/IAMApiMetadata.java | 10 ++-- .../{IAMAsyncClient.java => IAMAsyncApi.java} | 8 +-- .../iam/config/IAMRestClientModule.java | 14 ++--- .../{UserClient.java => UserApi.java} | 2 +- ...UserAsyncClient.java => UserAsyncApi.java} | 10 ++-- ...lientLiveTest.java => IAMApiLiveTest.java} | 12 ++-- .../test/java/org/jclouds/iam/IAMTest.java | 20 +++---- ...ExpectTest.java => UserApiExpectTest.java} | 34 +++++------ ...ientLiveTest.java => UserApiLiveTest.java} | 18 +++--- ...ectTest.java => BaseIAMApiExpectTest.java} | 4 +- ...tLiveTest.java => BaseIAMApiLiveTest.java} | 12 ++-- ...st.java => BaseIAMAsyncApiExpectTest.java} | 8 +-- .../iam/internal/BaseIAMExpectTest.java | 4 +- .../src/main/java/org/jclouds/rds/RDS.java | 48 +++++++-------- .../rds/{RDSClient.java => RDSApi.java} | 22 +++---- .../java/org/jclouds/rds/RDSApiMetadata.java | 8 +-- .../{RDSAsyncClient.java => RDSAsyncApi.java} | 20 +++---- .../rds/config/RDSRestClientModule.java | 26 ++++---- .../java/org/jclouds/rds/domain/Instance.java | 2 +- .../{InstanceClient.java => InstanceApi.java} | 4 +- ...AsyncClient.java => InstanceAsyncApi.java} | 12 ++-- ...GroupClient.java => SecurityGroupApi.java} | 4 +- ...Client.java => SecurityGroupAsyncApi.java} | 12 ++-- ...etGroupClient.java => SubnetGroupApi.java} | 4 +- ...ncClient.java => SubnetGroupAsyncApi.java} | 12 ++-- .../test/java/org/jclouds/rds/RDSTest.java | 60 +++++++++---------- ...ctTest.java => InstanceApiExpectTest.java} | 38 ++++++------ ...LiveTest.java => InstanceApiLiveTest.java} | 18 +++--- ...t.java => SecurityGroupApiExpectTest.java} | 38 ++++++------ ...est.java => SecurityGroupApiLiveTest.java} | 16 ++--- ...est.java => SubnetGroupApiExpectTest.java} | 38 ++++++------ ...eTest.java => SubnetGroupApiLiveTest.java} | 16 ++--- ...ectTest.java => BaseRDSApiExpectTest.java} | 4 +- ...tLiveTest.java => BaseRDSApiLiveTest.java} | 10 ++-- ...st.java => BaseRDSAsyncApiExpectTest.java} | 8 +-- .../rds/internal/BaseRDSExpectTest.java | 4 +- 85 files changed, 634 insertions(+), 634 deletions(-) rename labs/aws-elb/src/test/java/org/jclouds/aws/elb/features/{AWSAvailabilityZoneClientLiveTest.java => AWSAvailabilityZoneApiLiveTest.java} (77%) rename labs/aws-elb/src/test/java/org/jclouds/aws/elb/features/{AWSPolicyClientLiveTest.java => AWSInstanceApiLiveTest.java} (81%) rename labs/aws-elb/src/test/java/org/jclouds/aws/elb/features/{AWSLoadBalancerClientLiveTest.java => AWSLoadBalancerApiLiveTest.java} (78%) rename labs/aws-elb/src/test/java/org/jclouds/aws/elb/features/{AWSInstanceClientLiveTest.java => AWSPolicyApiLiveTest.java} (80%) rename labs/aws-iam/src/test/java/org/jclouds/aws/iam/{AWSIAMClientLiveTest.java => AWSIAMApiLiveTest.java} (83%) rename labs/aws-iam/src/test/java/org/jclouds/aws/iam/features/{AWSUserClientLiveTest.java => AWSUserApiLiveTest.java} (81%) rename labs/aws-rds/src/test/java/org/jclouds/aws/rds/features/{AWSSubnetGroupClientLiveTest.java => AWSInstanceApiLiveTest.java} (79%) rename labs/aws-rds/src/test/java/org/jclouds/aws/rds/features/{AWSSecurityGroupClientLiveTest.java => AWSSecurityGroupApiLiveTest.java} (78%) rename labs/aws-rds/src/test/java/org/jclouds/aws/rds/features/{AWSInstanceClientLiveTest.java => AWSSubnetGroupApiLiveTest.java} (81%) rename labs/elb/src/main/java/org/jclouds/elb/{ELBClient.java => ELBApi.java} (78%) rename labs/elb/src/main/java/org/jclouds/elb/{ELBAsyncClient.java => ELBAsyncApi.java} (78%) rename labs/elb/src/main/java/org/jclouds/elb/features/{AvailabilityZoneClient.java => AvailabilityZoneApi.java} (85%) rename labs/elb/src/main/java/org/jclouds/elb/features/{AvailabilityZoneAsyncClient.java => AvailabilityZoneAsyncApi.java} (90%) rename labs/elb/src/main/java/org/jclouds/elb/features/{InstanceClient.java => InstanceApi.java} (86%) rename labs/elb/src/main/java/org/jclouds/elb/features/{InstanceAsyncClient.java => InstanceAsyncApi.java} (90%) rename labs/elb/src/main/java/org/jclouds/elb/features/{LoadBalancerClient.java => LoadBalancerApi.java} (90%) rename labs/elb/src/main/java/org/jclouds/elb/features/{LoadBalancerAsyncClient.java => LoadBalancerAsyncApi.java} (90%) rename labs/elb/src/main/java/org/jclouds/elb/features/{PolicyClient.java => PolicyApi.java} (99%) rename labs/elb/src/main/java/org/jclouds/elb/features/{PolicyAsyncClient.java => PolicyAsyncApi.java} (93%) rename labs/elb/src/test/java/org/jclouds/elb/features/{AvailabilityZoneClientExpectTest.java => AvailabilityZoneApiExpectTest.java} (81%) rename labs/elb/src/test/java/org/jclouds/elb/features/{AvailabilityZoneClientLiveTest.java => AvailabilityZoneApiLiveTest.java} (74%) rename labs/elb/src/test/java/org/jclouds/elb/features/{InstanceClientExpectTest.java => InstanceApiExpectTest.java} (82%) rename labs/elb/src/test/java/org/jclouds/elb/features/{InstanceClientLiveTest.java => InstanceApiLiveTest.java} (79%) rename labs/elb/src/test/java/org/jclouds/elb/features/{LoadBalancerClientExpectTest.java => LoadBalancerApiExpectTest.java} (85%) rename labs/elb/src/test/java/org/jclouds/elb/features/{LoadBalancerClientLiveTest.java => LoadBalancerApiLiveTest.java} (88%) rename labs/elb/src/test/java/org/jclouds/elb/features/{PolicyClientExpectTest.java => PolicyApiExpectTest.java} (86%) rename labs/elb/src/test/java/org/jclouds/elb/features/{PolicyClientLiveTest.java => PolicyApiLiveTest.java} (85%) rename labs/elb/src/test/java/org/jclouds/elb/internal/{BaseELBClientExpectTest.java => BaseELBApiExpectTest.java} (88%) rename labs/elb/src/test/java/org/jclouds/elb/internal/{BaseELBClientLiveTest.java => BaseELBApiLiveTest.java} (80%) rename labs/elb/src/test/java/org/jclouds/elb/internal/{BaseELBAsyncClientExpectTest.java => BaseELBAsyncApiExpectTest.java} (81%) rename labs/iam/src/main/java/org/jclouds/iam/{IAMClient.java => IAMApi.java} (93%) rename labs/iam/src/main/java/org/jclouds/iam/{IAMAsyncClient.java => IAMAsyncApi.java} (91%) rename labs/iam/src/main/java/org/jclouds/iam/features/{UserClient.java => UserApi.java} (98%) rename labs/iam/src/main/java/org/jclouds/iam/features/{UserAsyncClient.java => UserAsyncApi.java} (93%) rename labs/iam/src/test/java/org/jclouds/iam/{IAMClientLiveTest.java => IAMApiLiveTest.java} (79%) rename labs/iam/src/test/java/org/jclouds/iam/features/{UserClientExpectTest.java => UserApiExpectTest.java} (87%) rename labs/iam/src/test/java/org/jclouds/iam/features/{UserClientLiveTest.java => UserApiLiveTest.java} (79%) rename labs/iam/src/test/java/org/jclouds/iam/internal/{BaseIAMClientExpectTest.java => BaseIAMApiExpectTest.java} (88%) rename labs/iam/src/test/java/org/jclouds/iam/internal/{BaseIAMClientLiveTest.java => BaseIAMApiLiveTest.java} (77%) rename labs/iam/src/test/java/org/jclouds/iam/internal/{BaseIAMAsyncClientExpectTest.java => BaseIAMAsyncApiExpectTest.java} (81%) rename labs/rds/src/main/java/org/jclouds/rds/{RDSClient.java => RDSApi.java} (81%) rename labs/rds/src/main/java/org/jclouds/rds/{RDSAsyncClient.java => RDSAsyncApi.java} (81%) rename labs/rds/src/main/java/org/jclouds/rds/features/{InstanceClient.java => InstanceApi.java} (97%) rename labs/rds/src/main/java/org/jclouds/rds/features/{InstanceAsyncClient.java => InstanceAsyncApi.java} (93%) rename labs/rds/src/main/java/org/jclouds/rds/features/{SecurityGroupClient.java => SecurityGroupApi.java} (97%) rename labs/rds/src/main/java/org/jclouds/rds/features/{SecurityGroupAsyncClient.java => SecurityGroupAsyncApi.java} (92%) rename labs/rds/src/main/java/org/jclouds/rds/features/{SubnetGroupClient.java => SubnetGroupApi.java} (97%) rename labs/rds/src/main/java/org/jclouds/rds/features/{SubnetGroupAsyncClient.java => SubnetGroupAsyncApi.java} (92%) rename labs/rds/src/test/java/org/jclouds/rds/features/{InstanceClientExpectTest.java => InstanceApiExpectTest.java} (85%) rename labs/rds/src/test/java/org/jclouds/rds/features/{InstanceClientLiveTest.java => InstanceApiLiveTest.java} (78%) rename labs/rds/src/test/java/org/jclouds/rds/features/{SecurityGroupClientExpectTest.java => SecurityGroupApiExpectTest.java} (85%) rename labs/rds/src/test/java/org/jclouds/rds/features/{SecurityGroupClientLiveTest.java => SecurityGroupApiLiveTest.java} (83%) rename labs/rds/src/test/java/org/jclouds/rds/features/{SubnetGroupClientExpectTest.java => SubnetGroupApiExpectTest.java} (85%) rename labs/rds/src/test/java/org/jclouds/rds/features/{SubnetGroupClientLiveTest.java => SubnetGroupApiLiveTest.java} (83%) rename labs/rds/src/test/java/org/jclouds/rds/internal/{BaseRDSClientExpectTest.java => BaseRDSApiExpectTest.java} (88%) rename labs/rds/src/test/java/org/jclouds/rds/internal/{BaseRDSClientLiveTest.java => BaseRDSApiLiveTest.java} (80%) rename labs/rds/src/test/java/org/jclouds/rds/internal/{BaseRDSAsyncClientExpectTest.java => BaseRDSAsyncApiExpectTest.java} (81%) diff --git a/labs/aws-elb/src/main/java/org/jclouds/aws/elb/AWSELBProviderMetadata.java b/labs/aws-elb/src/main/java/org/jclouds/aws/elb/AWSELBProviderMetadata.java index 5acb74a98a..c59d004974 100644 --- a/labs/aws-elb/src/main/java/org/jclouds/aws/elb/AWSELBProviderMetadata.java +++ b/labs/aws-elb/src/main/java/org/jclouds/aws/elb/AWSELBProviderMetadata.java @@ -106,4 +106,4 @@ public class AWSELBProviderMetadata extends BaseProviderMetadata { return this; } } -} \ No newline at end of file +} diff --git a/labs/aws-elb/src/test/java/org/jclouds/aws/elb/AWSELBProviderTest.java b/labs/aws-elb/src/test/java/org/jclouds/aws/elb/AWSELBProviderTest.java index 0eac0f13b0..2d1f4e9df6 100644 --- a/labs/aws-elb/src/test/java/org/jclouds/aws/elb/AWSELBProviderTest.java +++ b/labs/aws-elb/src/test/java/org/jclouds/aws/elb/AWSELBProviderTest.java @@ -33,4 +33,4 @@ public class AWSELBProviderTest extends BaseProviderMetadataTest { public AWSELBProviderTest() { super(new AWSELBProviderMetadata(), new ELBApiMetadata()); } -} \ No newline at end of file +} diff --git a/labs/aws-elb/src/test/java/org/jclouds/aws/elb/features/AWSAvailabilityZoneClientLiveTest.java b/labs/aws-elb/src/test/java/org/jclouds/aws/elb/features/AWSAvailabilityZoneApiLiveTest.java similarity index 77% rename from labs/aws-elb/src/test/java/org/jclouds/aws/elb/features/AWSAvailabilityZoneClientLiveTest.java rename to labs/aws-elb/src/test/java/org/jclouds/aws/elb/features/AWSAvailabilityZoneApiLiveTest.java index f8f667ae97..77f3b92e89 100644 --- a/labs/aws-elb/src/test/java/org/jclouds/aws/elb/features/AWSAvailabilityZoneClientLiveTest.java +++ b/labs/aws-elb/src/test/java/org/jclouds/aws/elb/features/AWSAvailabilityZoneApiLiveTest.java @@ -18,17 +18,17 @@ */ package org.jclouds.aws.elb.features; -import org.jclouds.elb.features.AvailabilityZoneClientLiveTest; +import org.jclouds.elb.features.AvailabilityZoneApiLiveTest; import org.testng.annotations.Test; /** * * @author Adrian Cole */ -@Test(groups = "live", testName = "AWSAvailabilityZoneClientLiveTest") -public class AWSAvailabilityZoneClientLiveTest extends AvailabilityZoneClientLiveTest { +@Test(groups = "live", testName = "AWSAvailabilityZoneApiLiveTest") +public class AWSAvailabilityZoneApiLiveTest extends AvailabilityZoneApiLiveTest { - public AWSAvailabilityZoneClientLiveTest() { + public AWSAvailabilityZoneApiLiveTest() { provider = "aws-elb"; } diff --git a/labs/aws-elb/src/test/java/org/jclouds/aws/elb/features/AWSPolicyClientLiveTest.java b/labs/aws-elb/src/test/java/org/jclouds/aws/elb/features/AWSInstanceApiLiveTest.java similarity index 81% rename from labs/aws-elb/src/test/java/org/jclouds/aws/elb/features/AWSPolicyClientLiveTest.java rename to labs/aws-elb/src/test/java/org/jclouds/aws/elb/features/AWSInstanceApiLiveTest.java index bb269bdc32..5f6a7942c0 100644 --- a/labs/aws-elb/src/test/java/org/jclouds/aws/elb/features/AWSPolicyClientLiveTest.java +++ b/labs/aws-elb/src/test/java/org/jclouds/aws/elb/features/AWSInstanceApiLiveTest.java @@ -18,17 +18,17 @@ */ package org.jclouds.aws.elb.features; -import org.jclouds.elb.features.PolicyClientLiveTest; +import org.jclouds.elb.features.InstanceApiLiveTest; import org.testng.annotations.Test; /** * * @author Adrian Cole */ -@Test(groups = "live", testName = "AWSPolicyClientLiveTest") -public class AWSPolicyClientLiveTest extends PolicyClientLiveTest { +@Test(groups = "live", testName = "AWSInstanceApiLiveTest") +public class AWSInstanceApiLiveTest extends InstanceApiLiveTest { - public AWSPolicyClientLiveTest() { + public AWSInstanceApiLiveTest() { provider = "aws-elb"; } diff --git a/labs/aws-elb/src/test/java/org/jclouds/aws/elb/features/AWSLoadBalancerClientLiveTest.java b/labs/aws-elb/src/test/java/org/jclouds/aws/elb/features/AWSLoadBalancerApiLiveTest.java similarity index 78% rename from labs/aws-elb/src/test/java/org/jclouds/aws/elb/features/AWSLoadBalancerClientLiveTest.java rename to labs/aws-elb/src/test/java/org/jclouds/aws/elb/features/AWSLoadBalancerApiLiveTest.java index 698cea0ebe..b6ab3f3c58 100644 --- a/labs/aws-elb/src/test/java/org/jclouds/aws/elb/features/AWSLoadBalancerClientLiveTest.java +++ b/labs/aws-elb/src/test/java/org/jclouds/aws/elb/features/AWSLoadBalancerApiLiveTest.java @@ -18,17 +18,17 @@ */ package org.jclouds.aws.elb.features; -import org.jclouds.elb.features.LoadBalancerClientLiveTest; +import org.jclouds.elb.features.LoadBalancerApiLiveTest; import org.testng.annotations.Test; /** * * @author Adrian Cole */ -@Test(groups = "live", testName = "AWSLoadBalancerClientLiveTest") -public class AWSLoadBalancerClientLiveTest extends LoadBalancerClientLiveTest { +@Test(groups = "live", testName = "AWSLoadBalancerApiLiveTest") +public class AWSLoadBalancerApiLiveTest extends LoadBalancerApiLiveTest { - public AWSLoadBalancerClientLiveTest() { + public AWSLoadBalancerApiLiveTest() { provider = "aws-elb"; } diff --git a/labs/aws-elb/src/test/java/org/jclouds/aws/elb/features/AWSInstanceClientLiveTest.java b/labs/aws-elb/src/test/java/org/jclouds/aws/elb/features/AWSPolicyApiLiveTest.java similarity index 80% rename from labs/aws-elb/src/test/java/org/jclouds/aws/elb/features/AWSInstanceClientLiveTest.java rename to labs/aws-elb/src/test/java/org/jclouds/aws/elb/features/AWSPolicyApiLiveTest.java index eebd4eeeea..f1bc7429c4 100644 --- a/labs/aws-elb/src/test/java/org/jclouds/aws/elb/features/AWSInstanceClientLiveTest.java +++ b/labs/aws-elb/src/test/java/org/jclouds/aws/elb/features/AWSPolicyApiLiveTest.java @@ -18,17 +18,17 @@ */ package org.jclouds.aws.elb.features; -import org.jclouds.elb.features.InstanceClientLiveTest; +import org.jclouds.elb.features.PolicyApiLiveTest; import org.testng.annotations.Test; /** * * @author Adrian Cole */ -@Test(groups = "live", testName = "AWSInstanceClientLiveTest") -public class AWSInstanceClientLiveTest extends InstanceClientLiveTest { +@Test(groups = "live", testName = "AWSPolicyApiLiveTest") +public class AWSPolicyApiLiveTest extends PolicyApiLiveTest { - public AWSInstanceClientLiveTest() { + public AWSPolicyApiLiveTest() { provider = "aws-elb"; } diff --git a/labs/aws-iam/src/main/java/org/jclouds/aws/iam/AWSIAMProviderMetadata.java b/labs/aws-iam/src/main/java/org/jclouds/aws/iam/AWSIAMProviderMetadata.java index 8ed144436e..349990532f 100644 --- a/labs/aws-iam/src/main/java/org/jclouds/aws/iam/AWSIAMProviderMetadata.java +++ b/labs/aws-iam/src/main/java/org/jclouds/aws/iam/AWSIAMProviderMetadata.java @@ -84,4 +84,4 @@ public class AWSIAMProviderMetadata extends BaseProviderMetadata { } } -} \ No newline at end of file +} diff --git a/labs/aws-iam/src/test/java/org/jclouds/aws/iam/AWSIAMClientLiveTest.java b/labs/aws-iam/src/test/java/org/jclouds/aws/iam/AWSIAMApiLiveTest.java similarity index 83% rename from labs/aws-iam/src/test/java/org/jclouds/aws/iam/AWSIAMClientLiveTest.java rename to labs/aws-iam/src/test/java/org/jclouds/aws/iam/AWSIAMApiLiveTest.java index c31f58f6e5..bb7e73455c 100644 --- a/labs/aws-iam/src/test/java/org/jclouds/aws/iam/AWSIAMClientLiveTest.java +++ b/labs/aws-iam/src/test/java/org/jclouds/aws/iam/AWSIAMApiLiveTest.java @@ -18,17 +18,17 @@ */ package org.jclouds.aws.iam; -import org.jclouds.iam.IAMClientLiveTest; +import org.jclouds.iam.IAMApiLiveTest; import org.testng.annotations.Test; /** - * Tests behavior of {@code IAMClient} + * Tests behavior of {@code IAMApi} * * @author Adrian Cole */ -@Test(groups = "live", singleThreaded = true, testName = "AWSIAMClientLiveTest") -public class AWSIAMClientLiveTest extends IAMClientLiveTest { - public AWSIAMClientLiveTest() { +@Test(groups = "live", singleThreaded = true, testName = "AWSIAMApiLiveTest") +public class AWSIAMApiLiveTest extends IAMApiLiveTest { + public AWSIAMApiLiveTest() { provider = "aws-iam"; } diff --git a/labs/aws-iam/src/test/java/org/jclouds/aws/iam/features/AWSUserClientLiveTest.java b/labs/aws-iam/src/test/java/org/jclouds/aws/iam/features/AWSUserApiLiveTest.java similarity index 81% rename from labs/aws-iam/src/test/java/org/jclouds/aws/iam/features/AWSUserClientLiveTest.java rename to labs/aws-iam/src/test/java/org/jclouds/aws/iam/features/AWSUserApiLiveTest.java index d298f7b012..0b9bca7451 100644 --- a/labs/aws-iam/src/test/java/org/jclouds/aws/iam/features/AWSUserClientLiveTest.java +++ b/labs/aws-iam/src/test/java/org/jclouds/aws/iam/features/AWSUserApiLiveTest.java @@ -18,15 +18,15 @@ */ package org.jclouds.aws.iam.features; -import org.jclouds.iam.features.UserClientLiveTest; +import org.jclouds.iam.features.UserApiLiveTest; import org.testng.annotations.Test; /** * @author Adrian Cole */ -@Test(groups = "live", testName = "AWSUserClientLiveTest") -public class AWSUserClientLiveTest extends UserClientLiveTest { - public AWSUserClientLiveTest() { +@Test(groups = "live", testName = "AWSUserApiLiveTest") +public class AWSUserApiLiveTest extends UserApiLiveTest { + public AWSUserApiLiveTest() { provider = "aws-iam"; } } diff --git a/labs/aws-rds/src/test/java/org/jclouds/aws/rds/features/AWSSubnetGroupClientLiveTest.java b/labs/aws-rds/src/test/java/org/jclouds/aws/rds/features/AWSInstanceApiLiveTest.java similarity index 79% rename from labs/aws-rds/src/test/java/org/jclouds/aws/rds/features/AWSSubnetGroupClientLiveTest.java rename to labs/aws-rds/src/test/java/org/jclouds/aws/rds/features/AWSInstanceApiLiveTest.java index d1ed871322..b26c2d0541 100644 --- a/labs/aws-rds/src/test/java/org/jclouds/aws/rds/features/AWSSubnetGroupClientLiveTest.java +++ b/labs/aws-rds/src/test/java/org/jclouds/aws/rds/features/AWSInstanceApiLiveTest.java @@ -18,17 +18,17 @@ */ package org.jclouds.aws.rds.features; -import org.jclouds.rds.features.SubnetGroupClientLiveTest; +import org.jclouds.rds.features.InstanceApiLiveTest; import org.testng.annotations.Test; /** * * @author Adrian Cole */ -@Test(groups = "live", testName = "AWSSubnetGroupClientLiveTest") -public class AWSSubnetGroupClientLiveTest extends SubnetGroupClientLiveTest { +@Test(groups = "live", testName = "AWSInstanceApiLiveTest") +public class AWSInstanceApiLiveTest extends InstanceApiLiveTest { - public AWSSubnetGroupClientLiveTest() { + public AWSInstanceApiLiveTest() { provider = "aws-rds"; } diff --git a/labs/aws-rds/src/test/java/org/jclouds/aws/rds/features/AWSSecurityGroupClientLiveTest.java b/labs/aws-rds/src/test/java/org/jclouds/aws/rds/features/AWSSecurityGroupApiLiveTest.java similarity index 78% rename from labs/aws-rds/src/test/java/org/jclouds/aws/rds/features/AWSSecurityGroupClientLiveTest.java rename to labs/aws-rds/src/test/java/org/jclouds/aws/rds/features/AWSSecurityGroupApiLiveTest.java index db892fbdf4..00da537b0f 100644 --- a/labs/aws-rds/src/test/java/org/jclouds/aws/rds/features/AWSSecurityGroupClientLiveTest.java +++ b/labs/aws-rds/src/test/java/org/jclouds/aws/rds/features/AWSSecurityGroupApiLiveTest.java @@ -18,17 +18,17 @@ */ package org.jclouds.aws.rds.features; -import org.jclouds.rds.features.SecurityGroupClientLiveTest; +import org.jclouds.rds.features.SecurityGroupApiLiveTest; import org.testng.annotations.Test; /** * * @author Adrian Cole */ -@Test(groups = "live", testName = "AWSSecurityGroupClientLiveTest") -public class AWSSecurityGroupClientLiveTest extends SecurityGroupClientLiveTest { +@Test(groups = "live", testName = "AWSSecurityGroupApiLiveTest") +public class AWSSecurityGroupApiLiveTest extends SecurityGroupApiLiveTest { - public AWSSecurityGroupClientLiveTest() { + public AWSSecurityGroupApiLiveTest() { provider = "aws-rds"; } diff --git a/labs/aws-rds/src/test/java/org/jclouds/aws/rds/features/AWSInstanceClientLiveTest.java b/labs/aws-rds/src/test/java/org/jclouds/aws/rds/features/AWSSubnetGroupApiLiveTest.java similarity index 81% rename from labs/aws-rds/src/test/java/org/jclouds/aws/rds/features/AWSInstanceClientLiveTest.java rename to labs/aws-rds/src/test/java/org/jclouds/aws/rds/features/AWSSubnetGroupApiLiveTest.java index 9211511cc4..7db1c61ced 100644 --- a/labs/aws-rds/src/test/java/org/jclouds/aws/rds/features/AWSInstanceClientLiveTest.java +++ b/labs/aws-rds/src/test/java/org/jclouds/aws/rds/features/AWSSubnetGroupApiLiveTest.java @@ -18,17 +18,17 @@ */ package org.jclouds.aws.rds.features; -import org.jclouds.rds.features.InstanceClientLiveTest; +import org.jclouds.rds.features.SubnetGroupApiLiveTest; import org.testng.annotations.Test; /** * * @author Adrian Cole */ -@Test(groups = "live", testName = "AWSInstanceClientLiveTest") -public class AWSInstanceClientLiveTest extends InstanceClientLiveTest { +@Test(groups = "live", testName = "AWSSubnetGroupApiLiveTest") +public class AWSSubnetGroupApiLiveTest extends SubnetGroupApiLiveTest { - public AWSInstanceClientLiveTest() { + public AWSSubnetGroupApiLiveTest() { provider = "aws-rds"; } diff --git a/labs/elb/src/main/java/org/jclouds/elb/ELB.java b/labs/elb/src/main/java/org/jclouds/elb/ELB.java index 10e977f4a9..b419125665 100644 --- a/labs/elb/src/main/java/org/jclouds/elb/ELB.java +++ b/labs/elb/src/main/java/org/jclouds/elb/ELB.java @@ -3,7 +3,7 @@ package org.jclouds.elb; import org.jclouds.collect.PaginatedIterable; import org.jclouds.collect.PaginatedIterables; import org.jclouds.elb.domain.LoadBalancer; -import org.jclouds.elb.features.LoadBalancerClient; +import org.jclouds.elb.features.LoadBalancerApi; import org.jclouds.elb.options.ListLoadBalancersOptions; import com.google.common.base.Function; @@ -18,19 +18,19 @@ public class ELB { /** * List loadBalancers based on the criteria in the {@link ListLoadBalancersOptions} passed in. * - * @param loadBalancerClient - * the {@link LoadBalancerClient} to use for the request + * @param loadBalancerApi + * the {@link LoadBalancerApi} to use for the request * @param options * the {@link ListLoadBalancersOptions} describing the ListLoadBalancers request * * @return iterable of loadBalancers fitting the criteria */ - public static Iterable listLoadBalancers(final LoadBalancerClient loadBalancerClient, final ListLoadBalancersOptions options) { - return PaginatedIterables.lazyContinue(loadBalancerClient.list(options), new Function>() { + public static Iterable listLoadBalancers(final LoadBalancerApi loadBalancerApi, final ListLoadBalancersOptions options) { + return PaginatedIterables.lazyContinue(loadBalancerApi.list(options), new Function>() { @Override public PaginatedIterable apply(Object input) { - return loadBalancerClient.list(options.clone().afterMarker(input)); + return loadBalancerApi.list(options.clone().afterMarker(input)); } @Override @@ -40,8 +40,8 @@ public class ELB { }); } - public static Iterable listLoadBalancers(LoadBalancerClient loadBalancerClient) { - return listLoadBalancers(loadBalancerClient, new ListLoadBalancersOptions()); + public static Iterable listLoadBalancers(LoadBalancerApi loadBalancerApi) { + return listLoadBalancers(loadBalancerApi, new ListLoadBalancersOptions()); } } diff --git a/labs/elb/src/main/java/org/jclouds/elb/ELBClient.java b/labs/elb/src/main/java/org/jclouds/elb/ELBApi.java similarity index 78% rename from labs/elb/src/main/java/org/jclouds/elb/ELBClient.java rename to labs/elb/src/main/java/org/jclouds/elb/ELBApi.java index 5016c1269c..804eba5069 100644 --- a/labs/elb/src/main/java/org/jclouds/elb/ELBClient.java +++ b/labs/elb/src/main/java/org/jclouds/elb/ELBApi.java @@ -24,10 +24,10 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Nullable; import org.jclouds.concurrent.Timeout; -import org.jclouds.elb.features.InstanceClient; -import org.jclouds.elb.features.LoadBalancerClient; -import org.jclouds.elb.features.PolicyClient; -import org.jclouds.elb.features.AvailabilityZoneClient; +import org.jclouds.elb.features.InstanceApi; +import org.jclouds.elb.features.LoadBalancerApi; +import org.jclouds.elb.features.PolicyApi; +import org.jclouds.elb.features.AvailabilityZoneApi; import org.jclouds.location.Region; import org.jclouds.location.functions.RegionToEndpointOrProviderIfNull; import org.jclouds.rest.annotations.Delegate; @@ -41,11 +41,11 @@ import com.google.inject.Provides; *

* * @author Adrian Cole - * @see ELBAsyncClient + * @see ELBAsyncApi */ @Beta @Timeout(duration = 30, timeUnit = TimeUnit.SECONDS) -public interface ELBClient { +public interface ELBApi { /** * * @return the Region codes configured @@ -58,40 +58,40 @@ public interface ELBClient { * Provides synchronous access to LoadBalancer features. */ @Delegate - LoadBalancerClient getLoadBalancerClient(); + LoadBalancerApi getLoadBalancerApi(); @Delegate - LoadBalancerClient getLoadBalancerClientForRegion( + LoadBalancerApi getLoadBalancerApiForRegion( @EndpointParam(parser = RegionToEndpointOrProviderIfNull.class) @Nullable String region); /** * Provides synchronous access to Policy features. */ @Delegate - PolicyClient getPolicyClient(); + PolicyApi getPolicyApi(); @Delegate - PolicyClient getPolicyClientForRegion( + PolicyApi getPolicyApiForRegion( @EndpointParam(parser = RegionToEndpointOrProviderIfNull.class) @Nullable String region); /** * Provides synchronous access to Instance features. */ @Delegate - InstanceClient getInstanceClient(); + InstanceApi getInstanceApi(); @Delegate - InstanceClient getInstanceClientForRegion( + InstanceApi getInstanceApiForRegion( @EndpointParam(parser = RegionToEndpointOrProviderIfNull.class) @Nullable String region); /** * Provides synchronous access to Zone features. */ @Delegate - AvailabilityZoneClient getAvailabilityZoneClient(); + AvailabilityZoneApi getAvailabilityZoneApi(); @Delegate - AvailabilityZoneClient getAvailabilityZoneClientForRegion( + AvailabilityZoneApi getAvailabilityZoneApiForRegion( @EndpointParam(parser = RegionToEndpointOrProviderIfNull.class) @Nullable String region); } diff --git a/labs/elb/src/main/java/org/jclouds/elb/ELBApiMetadata.java b/labs/elb/src/main/java/org/jclouds/elb/ELBApiMetadata.java index a57395d0a7..e1ee3725bd 100644 --- a/labs/elb/src/main/java/org/jclouds/elb/ELBApiMetadata.java +++ b/labs/elb/src/main/java/org/jclouds/elb/ELBApiMetadata.java @@ -45,7 +45,7 @@ public class ELBApiMetadata extends BaseRestApiMetadata { /** The serialVersionUID */ private static final long serialVersionUID = -7077953935392202824L; - public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { + public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { private static final long serialVersionUID = -5070937833892503232L; }; @@ -55,7 +55,7 @@ public class ELBApiMetadata extends BaseRestApiMetadata { } public ELBApiMetadata() { - this(new Builder(ELBClient.class, ELBAsyncClient.class)); + this(new Builder(ELBApi.class, ELBAsyncApi.class)); } protected ELBApiMetadata(Builder builder) { @@ -71,8 +71,8 @@ public class ELBApiMetadata extends BaseRestApiMetadata { public static class Builder extends BaseRestApiMetadata.Builder { - protected Builder(Class client, Class asyncClient) { - super(client, asyncClient); + protected Builder(Class api, Class asyncApi) { + super(api, asyncApi); id("elb") .name("Amazon Elastic Load Balancing Api") .identityName("Access Key ID") @@ -97,4 +97,4 @@ public class ELBApiMetadata extends BaseRestApiMetadata { } } -} \ No newline at end of file +} diff --git a/labs/elb/src/main/java/org/jclouds/elb/ELBAsyncClient.java b/labs/elb/src/main/java/org/jclouds/elb/ELBAsyncApi.java similarity index 78% rename from labs/elb/src/main/java/org/jclouds/elb/ELBAsyncClient.java rename to labs/elb/src/main/java/org/jclouds/elb/ELBAsyncApi.java index 7f8fa980b3..9a910ab6be 100644 --- a/labs/elb/src/main/java/org/jclouds/elb/ELBAsyncClient.java +++ b/labs/elb/src/main/java/org/jclouds/elb/ELBAsyncApi.java @@ -23,10 +23,10 @@ import java.util.Set; import javax.annotation.Nullable; import org.jclouds.aws.filters.FormSigner; -import org.jclouds.elb.features.InstanceAsyncClient; -import org.jclouds.elb.features.LoadBalancerAsyncClient; -import org.jclouds.elb.features.PolicyAsyncClient; -import org.jclouds.elb.features.AvailabilityZoneAsyncClient; +import org.jclouds.elb.features.InstanceAsyncApi; +import org.jclouds.elb.features.LoadBalancerAsyncApi; +import org.jclouds.elb.features.PolicyAsyncApi; +import org.jclouds.elb.features.AvailabilityZoneAsyncApi; import org.jclouds.location.Region; import org.jclouds.location.functions.RegionToEndpointOrProviderIfNull; import org.jclouds.rest.annotations.Delegate; @@ -48,7 +48,7 @@ import com.google.inject.Provides; @Beta @RequestFilters(FormSigner.class) @VirtualHost -public interface ELBAsyncClient { +public interface ELBAsyncApi { /** * * @return the Region codes configured @@ -61,40 +61,40 @@ public interface ELBAsyncClient { * Provides asynchronous access to LoadBalancer features. */ @Delegate - LoadBalancerAsyncClient getLoadBalancerClient(); + LoadBalancerAsyncApi getLoadBalancerApi(); @Delegate - LoadBalancerAsyncClient getLoadBalancerClientForRegion( + LoadBalancerAsyncApi getLoadBalancerApiForRegion( @EndpointParam(parser = RegionToEndpointOrProviderIfNull.class) @Nullable String region); /** * Provides asynchronous access to Policy features. */ @Delegate - PolicyAsyncClient getPolicyClient(); + PolicyAsyncApi getPolicyApi(); @Delegate - PolicyAsyncClient getPolicyClientForRegion( + PolicyAsyncApi getPolicyApiForRegion( @EndpointParam(parser = RegionToEndpointOrProviderIfNull.class) @Nullable String region); /** * Provides asynchronous access to Instance features. */ @Delegate - InstanceAsyncClient getInstanceClient(); + InstanceAsyncApi getInstanceApi(); @Delegate - InstanceAsyncClient getInstanceClientForRegion( + InstanceAsyncApi getInstanceApiForRegion( @EndpointParam(parser = RegionToEndpointOrProviderIfNull.class) @Nullable String region); /** * Provides asynchronous access to AvailabilityZone features. */ @Delegate - AvailabilityZoneAsyncClient getAvailabilityZoneClient(); + AvailabilityZoneAsyncApi getAvailabilityZoneApi(); @Delegate - AvailabilityZoneAsyncClient getAvailabilityZoneClientForRegion( + AvailabilityZoneAsyncApi getAvailabilityZoneApiForRegion( @EndpointParam(parser = RegionToEndpointOrProviderIfNull.class) @Nullable String region); } diff --git a/labs/elb/src/main/java/org/jclouds/elb/config/ELBRestClientModule.java b/labs/elb/src/main/java/org/jclouds/elb/config/ELBRestClientModule.java index 97136c2c77..b63b1f4500 100644 --- a/labs/elb/src/main/java/org/jclouds/elb/config/ELBRestClientModule.java +++ b/labs/elb/src/main/java/org/jclouds/elb/config/ELBRestClientModule.java @@ -21,16 +21,16 @@ package org.jclouds.elb.config; import java.util.Map; import org.jclouds.aws.config.FormSigningRestClientModule; -import org.jclouds.elb.ELBAsyncClient; -import org.jclouds.elb.ELBClient; -import org.jclouds.elb.features.InstanceAsyncClient; -import org.jclouds.elb.features.InstanceClient; -import org.jclouds.elb.features.LoadBalancerAsyncClient; -import org.jclouds.elb.features.LoadBalancerClient; -import org.jclouds.elb.features.PolicyAsyncClient; -import org.jclouds.elb.features.PolicyClient; -import org.jclouds.elb.features.AvailabilityZoneAsyncClient; -import org.jclouds.elb.features.AvailabilityZoneClient; +import org.jclouds.elb.ELBAsyncApi; +import org.jclouds.elb.ELBApi; +import org.jclouds.elb.features.InstanceAsyncApi; +import org.jclouds.elb.features.InstanceApi; +import org.jclouds.elb.features.LoadBalancerAsyncApi; +import org.jclouds.elb.features.LoadBalancerApi; +import org.jclouds.elb.features.PolicyAsyncApi; +import org.jclouds.elb.features.PolicyApi; +import org.jclouds.elb.features.AvailabilityZoneAsyncApi; +import org.jclouds.elb.features.AvailabilityZoneApi; import org.jclouds.rest.ConfiguresRestClient; import com.google.common.collect.ImmutableMap; @@ -42,15 +42,15 @@ import com.google.common.reflect.TypeToken; * @author Adrian Cole */ @ConfiguresRestClient -public class ELBRestClientModule extends FormSigningRestClientModule { +public class ELBRestClientModule extends FormSigningRestClientModule { public static final Map, Class> DELEGATE_MAP = ImmutableMap., Class> builder()// - .put(LoadBalancerClient.class, LoadBalancerAsyncClient.class) - .put(PolicyClient.class, PolicyAsyncClient.class) - .put(InstanceClient.class, InstanceAsyncClient.class) - .put(AvailabilityZoneClient.class, AvailabilityZoneAsyncClient.class) + .put(LoadBalancerApi.class, LoadBalancerAsyncApi.class) + .put(PolicyApi.class, PolicyAsyncApi.class) + .put(InstanceApi.class, InstanceAsyncApi.class) + .put(AvailabilityZoneApi.class, AvailabilityZoneAsyncApi.class) .build(); public ELBRestClientModule() { - super(TypeToken.of(ELBClient.class), TypeToken.of(ELBAsyncClient.class), DELEGATE_MAP); + super(TypeToken.of(ELBApi.class), TypeToken.of(ELBAsyncApi.class), DELEGATE_MAP); } } diff --git a/labs/elb/src/main/java/org/jclouds/elb/domain/Listener.java b/labs/elb/src/main/java/org/jclouds/elb/domain/Listener.java index 6c4f312034..f6612ce7a9 100644 --- a/labs/elb/src/main/java/org/jclouds/elb/domain/Listener.java +++ b/labs/elb/src/main/java/org/jclouds/elb/domain/Listener.java @@ -26,7 +26,7 @@ import com.google.common.base.Optional; import com.google.common.base.Objects.ToStringHelper; /** - * Listener is a process that listens for client connection requests. It is configured with a + * Listener is a process that listens for api connection requests. It is configured with a * protocol and a port number for front-end (Load Balancer) and back-end (Back-end instance) * connections. * diff --git a/labs/elb/src/main/java/org/jclouds/elb/domain/Scheme.java b/labs/elb/src/main/java/org/jclouds/elb/domain/Scheme.java index c0e659e609..b57412f014 100644 --- a/labs/elb/src/main/java/org/jclouds/elb/domain/Scheme.java +++ b/labs/elb/src/main/java/org/jclouds/elb/domain/Scheme.java @@ -59,4 +59,4 @@ public enum Scheme { return UNRECOGNIZED; } } -} \ No newline at end of file +} diff --git a/labs/elb/src/main/java/org/jclouds/elb/features/AvailabilityZoneClient.java b/labs/elb/src/main/java/org/jclouds/elb/features/AvailabilityZoneApi.java similarity index 85% rename from labs/elb/src/main/java/org/jclouds/elb/features/AvailabilityZoneClient.java rename to labs/elb/src/main/java/org/jclouds/elb/features/AvailabilityZoneApi.java index 6939f2513e..b2e3865b96 100644 --- a/labs/elb/src/main/java/org/jclouds/elb/features/AvailabilityZoneClient.java +++ b/labs/elb/src/main/java/org/jclouds/elb/features/AvailabilityZoneApi.java @@ -28,17 +28,17 @@ import org.jclouds.concurrent.Timeout; *

* * @see - * @see AvailabilityZoneAsyncClient + * @see AvailabilityZoneAsyncApi * @author Adrian Cole */ @Timeout(duration = 30, timeUnit = TimeUnit.SECONDS) -public interface AvailabilityZoneClient { +public interface AvailabilityZoneApi { /** * Adds one or more EC2 Availability Zones to the LoadBalancer. * * The LoadBalancer evenly distributes requests across all its registered Availability Zones that - * contain instances. As a result, the client must ensure that its LoadBalancer is appropriately + * contain instances. As a result, the api must ensure that its LoadBalancer is appropriately * scaled for each registered Availability Zone. * *

Note

@@ -51,7 +51,7 @@ public interface AvailabilityZoneClient { * be in the same Region as the LoadBalancer. * * @param loadBalancerName - * The name associated with the LoadBalancer. The name must be unique within the client + * The name associated with the LoadBalancer. The name must be unique within the api * AWS account. * * @return An updated list of Availability Zones for the LoadBalancer. @@ -66,7 +66,7 @@ public interface AvailabilityZoneClient { * * * There must be at least one Availability Zone registered with a LoadBalancer at all times. A - * client cannot remove all the Availability Zones from a LoadBalancer. Once an Availability Zone + * api cannot remove all the Availability Zones from a LoadBalancer. Once an Availability Zone * is removed, all the instances registered with the LoadBalancer that are in the removed * Availability Zone go into the OutOfService state. Upon Availability Zone removal, the * LoadBalancer attempts to equally balance the traffic among its remaining usable Availability @@ -75,8 +75,8 @@ public interface AvailabilityZoneClient { * *

Note

* - * In order for this call to be successful, the client must have created the LoadBalancer. The - * client must provide the same account credentials as those that were used to create the + * In order for this call to be successful, the api must have created the LoadBalancer. The + * api must provide the same account credentials as those that were used to create the * LoadBalancer. * * @param zones @@ -85,12 +85,12 @@ public interface AvailabilityZoneClient { *

Note

* * There must be at least one Availability Zone registered with a LoadBalancer at all - * times. The client cannot remove all the Availability Zones from a LoadBalancer. + * times. The api cannot remove all the Availability Zones from a LoadBalancer. * Specified Availability Zones must be in the same Region. * * * @param loadBalancerName - * The name associated with the LoadBalancer. The name must be unique within the client + * The name associated with the LoadBalancer. The name must be unique within the api * AWS account. * * @return A list of updated Availability Zones for the LoadBalancer. diff --git a/labs/elb/src/main/java/org/jclouds/elb/features/AvailabilityZoneAsyncClient.java b/labs/elb/src/main/java/org/jclouds/elb/features/AvailabilityZoneAsyncApi.java similarity index 90% rename from labs/elb/src/main/java/org/jclouds/elb/features/AvailabilityZoneAsyncClient.java rename to labs/elb/src/main/java/org/jclouds/elb/features/AvailabilityZoneAsyncApi.java index f2d8eb4461..9c7601473c 100644 --- a/labs/elb/src/main/java/org/jclouds/elb/features/AvailabilityZoneAsyncClient.java +++ b/labs/elb/src/main/java/org/jclouds/elb/features/AvailabilityZoneAsyncApi.java @@ -43,15 +43,15 @@ import com.google.common.util.concurrent.ListenableFuture; * * @see
doc - * @see AvailabilityZoneClient + * @see AvailabilityZoneApi * @author Adrian Cole */ @RequestFilters(FormSigner.class) @VirtualHost -public interface AvailabilityZoneAsyncClient { +public interface AvailabilityZoneAsyncApi { /** - * @see AvailabilityZoneClient#addAvailabilityZonesToLoadBalancer + * @see AvailabilityZoneApi#addAvailabilityZonesToLoadBalancer */ @POST @Path("/") @@ -63,7 +63,7 @@ public interface AvailabilityZoneAsyncClient { /** - * @see AvailabilityZoneClient#addAvailabilityZoneToLoadBalancer + * @see AvailabilityZoneApi#addAvailabilityZoneToLoadBalancer */ @POST @Path("/") @@ -74,7 +74,7 @@ public interface AvailabilityZoneAsyncClient { @FormParam("LoadBalancerName") String loadBalancerName); /** - * @see AvailabilityZoneClient#removeAvailabilityZonesFromLoadBalancer + * @see AvailabilityZoneApi#removeAvailabilityZonesFromLoadBalancer */ @POST @Path("/") @@ -85,7 +85,7 @@ public interface AvailabilityZoneAsyncClient { @FormParam("LoadBalancerName") String loadBalancerName); /** - * @see AvailabilityZoneClient#removeAvailabilityZoneFromLoadBalancer + * @see AvailabilityZoneApi#removeAvailabilityZoneFromLoadBalancer */ @POST @Path("/") diff --git a/labs/elb/src/main/java/org/jclouds/elb/features/InstanceClient.java b/labs/elb/src/main/java/org/jclouds/elb/features/InstanceApi.java similarity index 86% rename from labs/elb/src/main/java/org/jclouds/elb/features/InstanceClient.java rename to labs/elb/src/main/java/org/jclouds/elb/features/InstanceApi.java index f532dbfb12..96af8942bc 100644 --- a/labs/elb/src/main/java/org/jclouds/elb/features/InstanceClient.java +++ b/labs/elb/src/main/java/org/jclouds/elb/features/InstanceApi.java @@ -29,23 +29,23 @@ import org.jclouds.elb.domain.InstanceHealth; *

* * @see - * @see InstanceAsyncClient + * @see InstanceAsyncApi * @author Adrian Cole */ @Timeout(duration = 30, timeUnit = TimeUnit.SECONDS) -public interface InstanceClient { +public interface InstanceApi { /** * Returns the current state of the instances of the specified LoadBalancer. * *

Note

* - * The client must have created the specified input LoadBalancer in order to retrieve this - * information; the client must provide the same account credentials as those that were used to + * The api must have created the specified input LoadBalancer in order to retrieve this + * information; the api must provide the same account credentials as those that were used to * create the LoadBalancer. * * @param loadBalancerName - * The name associated with the LoadBalancer. The name must be unique within the client + * The name associated with the LoadBalancer. The name must be unique within the api * AWS account. * * @return state of all instances of the load balancer @@ -57,14 +57,14 @@ public interface InstanceClient { * *

Note

* - * The client must have created the specified input LoadBalancer in order to retrieve this - * information; the client must provide the same account credentials as those that were used to + * The api must have created the specified input LoadBalancer in order to retrieve this + * information; the api must provide the same account credentials as those that were used to * create the LoadBalancer. * * @param instanceIds * A list of instance IDs whose states are being queried. * @param loadBalancerName - * The name associated with the LoadBalancer. The name must be unique within the client + * The name associated with the LoadBalancer. The name must be unique within the api * AWS account. * * @return state of all instances of the load balancer @@ -81,8 +81,8 @@ public interface InstanceClient { * *

Note

* - * In order for this call to be successful, the client must have created the LoadBalancer. The - * client must provide the same account credentials as those that were used to create the + * In order for this call to be successful, the api must have created the LoadBalancer. The + * api must provide the same account credentials as those that were used to create the * LoadBalancer. * *

Note

@@ -105,7 +105,7 @@ public interface InstanceClient { * * * @param loadBalancerName - * The name associated with the LoadBalancer. The name must be unique within the client + * The name associated with the LoadBalancer. The name must be unique within the api * AWS account. * * @return instanceIds registered with load balancer @@ -125,7 +125,7 @@ public interface InstanceClient { * A list of EC2 instance IDs consisting of all instances to be deregistered. * * @param loadBalancerName - * The name associated with the LoadBalancer. The name must be unique within the client + * The name associated with the LoadBalancer. The name must be unique within the api * AWS account. * * @return instanceIds still registered with load balancer diff --git a/labs/elb/src/main/java/org/jclouds/elb/features/InstanceAsyncClient.java b/labs/elb/src/main/java/org/jclouds/elb/features/InstanceAsyncApi.java similarity index 90% rename from labs/elb/src/main/java/org/jclouds/elb/features/InstanceAsyncClient.java rename to labs/elb/src/main/java/org/jclouds/elb/features/InstanceAsyncApi.java index fbd25f79e0..972b0a17a5 100644 --- a/labs/elb/src/main/java/org/jclouds/elb/features/InstanceAsyncClient.java +++ b/labs/elb/src/main/java/org/jclouds/elb/features/InstanceAsyncApi.java @@ -47,15 +47,15 @@ import com.google.common.util.concurrent.ListenableFuture; * * @see
doc - * @see InstanceClient + * @see InstanceApi * @author Adrian Cole */ @RequestFilters(FormSigner.class) @VirtualHost -public interface InstanceAsyncClient { +public interface InstanceAsyncApi { /** - * @see InstanceClient#getHealthOfInstancesOfLoadBalancer(String) + * @see InstanceApi#getHealthOfInstancesOfLoadBalancer(String) */ @POST @Path("/") @@ -66,7 +66,7 @@ public interface InstanceAsyncClient { @FormParam("LoadBalancerName") String loadBalancerName); /** - * @see InstanceClient#getHealthOfInstancesOfLoadBalancer(Iterable, String) + * @see InstanceApi#getHealthOfInstancesOfLoadBalancer(Iterable, String) */ @POST @Path("/") @@ -79,7 +79,7 @@ public interface InstanceAsyncClient { /** - * @see InstanceClient#registerInstancesWithLoadBalancer + * @see InstanceApi#registerInstancesWithLoadBalancer */ @POST @Path("/") @@ -91,7 +91,7 @@ public interface InstanceAsyncClient { /** - * @see InstanceClient#registerInstanceWithLoadBalancer + * @see InstanceApi#registerInstanceWithLoadBalancer */ @POST @Path("/") @@ -102,7 +102,7 @@ public interface InstanceAsyncClient { @FormParam("LoadBalancerName") String loadBalancerName); /** - * @see InstanceClient#deregisterInstancesFromLoadBalancer + * @see InstanceApi#deregisterInstancesFromLoadBalancer */ @POST @Path("/") @@ -113,7 +113,7 @@ public interface InstanceAsyncClient { @FormParam("LoadBalancerName") String loadBalancerName); /** - * @see InstanceClient#deregisterInstanceFromLoadBalancer + * @see InstanceApi#deregisterInstanceFromLoadBalancer */ @POST @Path("/") diff --git a/labs/elb/src/main/java/org/jclouds/elb/features/LoadBalancerClient.java b/labs/elb/src/main/java/org/jclouds/elb/features/LoadBalancerApi.java similarity index 90% rename from labs/elb/src/main/java/org/jclouds/elb/features/LoadBalancerClient.java rename to labs/elb/src/main/java/org/jclouds/elb/features/LoadBalancerApi.java index 2186c32298..8da655f52b 100644 --- a/labs/elb/src/main/java/org/jclouds/elb/features/LoadBalancerClient.java +++ b/labs/elb/src/main/java/org/jclouds/elb/features/LoadBalancerApi.java @@ -32,11 +32,11 @@ import org.jclouds.javax.annotation.Nullable; *

* * @see doc - * @see LoadBalancerAsyncClient + * @see LoadBalancerAsyncApi * @author Adrian Cole */ @Timeout(duration = 30, timeUnit = TimeUnit.SECONDS) -public interface LoadBalancerClient { +public interface LoadBalancerApi { String createLoadBalancerListeningInAvailabilityZones(String name, Iterable listeners, Iterable availabilityZones); @@ -86,14 +86,14 @@ public interface LoadBalancerClient { * Deletes the specified LoadBalancer. * *

- * If attempting to recreate the LoadBalancer, the client must reconfigure all the settings. The + * If attempting to recreate the LoadBalancer, the api must reconfigure all the settings. The * DNS name associated with a deleted LoadBalancer will no longer be usable. Once deleted, the * name and associated DNS record of the LoadBalancer no longer exist and traffic sent to any of - * its IP addresses will no longer be delivered to client instances. The client will not receive + * its IP addresses will no longer be delivered to api instances. The api will not receive * the same DNS name even if a new LoadBalancer with same LoadBalancerName is created. * *

- * To successfully call this API, the client must provide the same account credentials as were + * To successfully call this API, the api must provide the same account credentials as were * used to create the LoadBalancer. * *

Note

diff --git a/labs/elb/src/main/java/org/jclouds/elb/features/LoadBalancerAsyncClient.java b/labs/elb/src/main/java/org/jclouds/elb/features/LoadBalancerAsyncApi.java similarity index 90% rename from labs/elb/src/main/java/org/jclouds/elb/features/LoadBalancerAsyncClient.java rename to labs/elb/src/main/java/org/jclouds/elb/features/LoadBalancerAsyncApi.java index dc5e530c36..cf7b614890 100644 --- a/labs/elb/src/main/java/org/jclouds/elb/features/LoadBalancerAsyncClient.java +++ b/labs/elb/src/main/java/org/jclouds/elb/features/LoadBalancerAsyncApi.java @@ -53,14 +53,14 @@ import com.google.common.util.concurrent.ListenableFuture; * * @see doc - * @see LoadBalancerClient + * @see LoadBalancerApi * @author Adrian Cole */ @RequestFilters(FormSigner.class) @VirtualHost -public interface LoadBalancerAsyncClient { +public interface LoadBalancerAsyncApi { /** - * @see LoadBalancerClient#createLoadBalancerListeningInAvailabilityZones() + * @see LoadBalancerApi#createLoadBalancerListeningInAvailabilityZones() */ @POST @Path("/") @@ -71,7 +71,7 @@ public interface LoadBalancerAsyncClient { @BinderParam(BindAvailabilityZonesToIndexedFormParams.class) Iterable availabilityZones); /** - * @see LoadBalancerClient#createLoadBalancerListeningInAvailabilityZones() + * @see LoadBalancerApi#createLoadBalancerListeningInAvailabilityZones() */ @POST @Path("/") @@ -82,7 +82,7 @@ public interface LoadBalancerAsyncClient { @BinderParam(BindAvailabilityZonesToIndexedFormParams.class) Iterable availabilityZones); /** - * @see LoadBalancerClient#createLoadBalancerListeningInSubnetAssignedToSecurityGroups() + * @see LoadBalancerApi#createLoadBalancerListeningInSubnetAssignedToSecurityGroups() */ @POST @Path("/") @@ -94,7 +94,7 @@ public interface LoadBalancerAsyncClient { @BinderParam(BindSecurityGroupsToIndexedFormParams.class) Iterable securityGroupIds); /** - * @see LoadBalancerClient#createLoadBalancerListeningInSubnetsAssignedToSecurityGroups() + * @see LoadBalancerApi#createLoadBalancerListeningInSubnetsAssignedToSecurityGroups() */ @POST @Path("/") @@ -106,7 +106,7 @@ public interface LoadBalancerAsyncClient { @BinderParam(BindSecurityGroupsToIndexedFormParams.class) Iterable securityGroupIds); /** - * @see LoadBalancerClient#get() + * @see LoadBalancerApi#get() */ @POST @Path("/") @@ -116,7 +116,7 @@ public interface LoadBalancerAsyncClient { ListenableFuture get(@FormParam("LoadBalancerNames.member.1") String name); /** - * @see LoadBalancerClient#list() + * @see LoadBalancerApi#list() */ @POST @Path("/") @@ -125,7 +125,7 @@ public interface LoadBalancerAsyncClient { ListenableFuture> list(); /** - * @see LoadBalancerClient#list(ListLoadBalancersOptions) + * @see LoadBalancerApi#list(ListLoadBalancersOptions) */ @POST @Path("/") @@ -134,7 +134,7 @@ public interface LoadBalancerAsyncClient { ListenableFuture> list(ListLoadBalancersOptions options); /** - * @see LoadBalancerClient#delete() + * @see LoadBalancerApi#delete() */ @POST @Path("/") diff --git a/labs/elb/src/main/java/org/jclouds/elb/features/PolicyClient.java b/labs/elb/src/main/java/org/jclouds/elb/features/PolicyApi.java similarity index 99% rename from labs/elb/src/main/java/org/jclouds/elb/features/PolicyClient.java rename to labs/elb/src/main/java/org/jclouds/elb/features/PolicyApi.java index 64da46edfb..d84f1b7e78 100644 --- a/labs/elb/src/main/java/org/jclouds/elb/features/PolicyClient.java +++ b/labs/elb/src/main/java/org/jclouds/elb/features/PolicyApi.java @@ -35,7 +35,7 @@ import org.jclouds.javax.annotation.Nullable; * @author Adrian Cole */ @Timeout(duration = 30, timeUnit = TimeUnit.SECONDS) -public interface PolicyClient { +public interface PolicyApi { /** * Retrieves information about the specified policy. diff --git a/labs/elb/src/main/java/org/jclouds/elb/features/PolicyAsyncClient.java b/labs/elb/src/main/java/org/jclouds/elb/features/PolicyAsyncApi.java similarity index 93% rename from labs/elb/src/main/java/org/jclouds/elb/features/PolicyAsyncClient.java rename to labs/elb/src/main/java/org/jclouds/elb/features/PolicyAsyncApi.java index 83858a46d9..ba79e7d215 100644 --- a/labs/elb/src/main/java/org/jclouds/elb/features/PolicyAsyncClient.java +++ b/labs/elb/src/main/java/org/jclouds/elb/features/PolicyAsyncApi.java @@ -49,15 +49,15 @@ import com.google.common.util.concurrent.ListenableFuture; *

* * @see doc - * @see PolicyClient + * @see PolicyApi * @author Adrian Cole */ @RequestFilters(FormSigner.class) @VirtualHost -public interface PolicyAsyncClient { +public interface PolicyAsyncApi { /** - * @see PolicyClient#get() + * @see PolicyApi#get() */ @POST @Path("/") @@ -67,7 +67,7 @@ public interface PolicyAsyncClient { ListenableFuture get(@FormParam("PolicyNames.member.1") String name); /** - * @see PolicyClient#list() + * @see PolicyApi#list() */ @POST @Path("/") @@ -77,7 +77,7 @@ public interface PolicyAsyncClient { ListenableFuture> list(); /** - * @see PolicyClient#list(ListPoliciesOptions) + * @see PolicyApi#list(ListPoliciesOptions) */ @POST @Path("/") @@ -88,7 +88,7 @@ public interface PolicyAsyncClient { /** - * @see PolicyClient#getType() + * @see PolicyApi#getType() */ @POST @Path("/") @@ -98,7 +98,7 @@ public interface PolicyAsyncClient { ListenableFuture getType(@FormParam("PolicyTypeNames.member.1") String name); /** - * @see PolicyClient#listTypes() + * @see PolicyApi#listTypes() */ @POST @Path("/") @@ -108,7 +108,7 @@ public interface PolicyAsyncClient { ListenableFuture> listTypes(); /** - * @see PolicyClient#listTypes(Iterable) + * @see PolicyApi#listTypes(Iterable) */ @POST @Path("/") diff --git a/labs/elb/src/main/java/org/jclouds/elb/loadbalancer/config/ELBBindLoadBalancerStrategiesByClass.java b/labs/elb/src/main/java/org/jclouds/elb/loadbalancer/config/ELBBindLoadBalancerStrategiesByClass.java index c039b387a5..d7d87b9620 100644 --- a/labs/elb/src/main/java/org/jclouds/elb/loadbalancer/config/ELBBindLoadBalancerStrategiesByClass.java +++ b/labs/elb/src/main/java/org/jclouds/elb/loadbalancer/config/ELBBindLoadBalancerStrategiesByClass.java @@ -52,4 +52,4 @@ public class ELBBindLoadBalancerStrategiesByClass extends BindLoadBalancerStrate protected Class defineListLoadBalancersStrategy() { return ELBListLoadBalancersStrategy.class; } -} \ No newline at end of file +} diff --git a/labs/elb/src/main/java/org/jclouds/elb/loadbalancer/functions/LoadBalancerToLoadBalancerMetadata.java b/labs/elb/src/main/java/org/jclouds/elb/loadbalancer/functions/LoadBalancerToLoadBalancerMetadata.java index 61d9463d08..4ee5f77132 100644 --- a/labs/elb/src/main/java/org/jclouds/elb/loadbalancer/functions/LoadBalancerToLoadBalancerMetadata.java +++ b/labs/elb/src/main/java/org/jclouds/elb/loadbalancer/functions/LoadBalancerToLoadBalancerMetadata.java @@ -72,4 +72,4 @@ public class LoadBalancerToLoadBalancerMetadata implements Function converter; @Inject - protected ELBGetLoadBalancerMetadataStrategy(ELBClient client, + protected ELBGetLoadBalancerMetadataStrategy(ELBApi api, Function converter) { - this.client = checkNotNull(client, "client"); + this.api = checkNotNull(api, "api"); this.converter = checkNotNull(converter, "converter"); } @@ -54,8 +54,8 @@ public class ELBGetLoadBalancerMetadataStrategy implements GetLoadBalancerMetada String[] parts = parseHandle(id); String region = parts[0]; String name = parts[1]; - LoadBalancer input = client.getLoadBalancerClientForRegion(region).get(name); + LoadBalancer input = api.getLoadBalancerApiForRegion(region).get(name); return input != null ? converter.apply(new LoadBalancerInRegion(input, region)) : null; } -} \ No newline at end of file +} diff --git a/labs/elb/src/main/java/org/jclouds/elb/loadbalancer/strategy/ELBListLoadBalancersStrategy.java b/labs/elb/src/main/java/org/jclouds/elb/loadbalancer/strategy/ELBListLoadBalancersStrategy.java index ecdbe105bb..cd02acebbe 100644 --- a/labs/elb/src/main/java/org/jclouds/elb/loadbalancer/strategy/ELBListLoadBalancersStrategy.java +++ b/labs/elb/src/main/java/org/jclouds/elb/loadbalancer/strategy/ELBListLoadBalancersStrategy.java @@ -34,7 +34,7 @@ import javax.inject.Singleton; import org.jclouds.Constants; import org.jclouds.concurrent.Futures; -import org.jclouds.elb.ELBAsyncClient; +import org.jclouds.elb.ELBAsyncApi; import org.jclouds.elb.domain.LoadBalancer; import org.jclouds.elb.domain.regionscoped.LoadBalancerInRegion; import org.jclouds.loadbalancer.domain.LoadBalancerMetadata; @@ -58,16 +58,16 @@ public class ELBListLoadBalancersStrategy implements ListLoadBalancersStrategy { @Named(LoadBalancerConstants.LOADBALANCER_LOGGER) protected Logger logger = Logger.NULL; - private final ELBAsyncClient aclient; + private final ELBAsyncApi aapi; private final Function converter; private final ExecutorService executor; private final Supplier> regions; @Inject - protected ELBListLoadBalancersStrategy(ELBAsyncClient aclient, + protected ELBListLoadBalancersStrategy(ELBAsyncApi aapi, Function converter, @Named(Constants.PROPERTY_USER_THREADS) ExecutorService executor, @Region Supplier> regions) { - this.aclient = checkNotNull(aclient, "aclient"); + this.aapi = checkNotNull(aapi, "aapi"); this.regions = checkNotNull(regions, "regions"); this.converter = checkNotNull(converter, "converter"); this.executor = checkNotNull(executor, "executor"); @@ -82,7 +82,7 @@ public class ELBListLoadBalancersStrategy implements ListLoadBalancersStrategy { @Override public ListenableFuture> apply(final String from) { // TODO: ELB.listLoadBalancers - return Futures.compose(aclient.getLoadBalancerClientForRegion(from).list(), + return Futures.compose(aapi.getLoadBalancerApiForRegion(from).list(), new Function, Iterable>() { @Override diff --git a/labs/elb/src/main/java/org/jclouds/elb/loadbalancer/strategy/ELBLoadBalanceNodesStrategy.java b/labs/elb/src/main/java/org/jclouds/elb/loadbalancer/strategy/ELBLoadBalanceNodesStrategy.java index d53184f745..e7f901c34b 100644 --- a/labs/elb/src/main/java/org/jclouds/elb/loadbalancer/strategy/ELBLoadBalanceNodesStrategy.java +++ b/labs/elb/src/main/java/org/jclouds/elb/loadbalancer/strategy/ELBLoadBalanceNodesStrategy.java @@ -34,7 +34,7 @@ import javax.inject.Singleton; import org.jclouds.compute.domain.NodeMetadata; import org.jclouds.domain.Location; -import org.jclouds.elb.ELBClient; +import org.jclouds.elb.ELBApi; import org.jclouds.elb.domain.Listener; import org.jclouds.elb.domain.Protocol; import org.jclouds.elb.domain.regionscoped.LoadBalancerInRegion; @@ -56,13 +56,13 @@ public class ELBLoadBalanceNodesStrategy implements LoadBalanceNodesStrategy { @Resource @Named(LoadBalancerConstants.LOADBALANCER_LOGGER) protected Logger logger = Logger.NULL; - protected final ELBClient client; + protected final ELBApi api; protected final Function converter; @Inject - protected ELBLoadBalanceNodesStrategy(ELBClient client, + protected ELBLoadBalanceNodesStrategy(ELBApi api, Function converter) { - this.client = checkNotNull(client, "client"); + this.api = checkNotNull(api, "api"); this.converter = checkNotNull(converter, "converter"); } @@ -82,20 +82,20 @@ public class ELBLoadBalanceNodesStrategy implements LoadBalanceNodesStrategy { logger.debug(">> creating loadBalancer(%s) in zones(%s)", name, zonesDesired); try { - String dnsName = client.getLoadBalancerClientForRegion(region).createLoadBalancerListeningInAvailabilityZones( + String dnsName = api.getLoadBalancerApiForRegion(region).createLoadBalancerListeningInAvailabilityZones( name, ImmutableSet.of(Listener.builder().port(loadBalancerPort).instancePort(instancePort) .protocol(Protocol.valueOf(protocol)).build()), zonesDesired); logger.debug("<< created loadBalancer(%s) dnsName(%s)", name, dnsName); } catch (IllegalStateException e) { logger.debug("<< converging zones(%s) in loadBalancer(%s)", zonesDesired, name); - Set currentZones = client.getLoadBalancerClient().get(name).getAvailabilityZones(); + Set currentZones = api.getLoadBalancerApi().get(name).getAvailabilityZones(); Set zonesToAdd = Sets.difference(zonesDesired, currentZones); if (zonesToAdd.size() > 0) - currentZones = client.getAvailabilityZoneClient().addAvailabilityZonesToLoadBalancer(zonesToAdd, name); + currentZones = api.getAvailabilityZoneApi().addAvailabilityZonesToLoadBalancer(zonesToAdd, name); Set zonesToRemove = Sets.difference(currentZones, zonesDesired); if (zonesToRemove.size() > 0) - client.getAvailabilityZoneClient().removeAvailabilityZonesFromLoadBalancer(zonesToRemove, name); + api.getAvailabilityZoneApi().removeAvailabilityZonesFromLoadBalancer(zonesToRemove, name); } Set instanceIds = ImmutableSet.copyOf(transform(nodes, new Function() { @@ -107,16 +107,16 @@ public class ELBLoadBalanceNodesStrategy implements LoadBalanceNodesStrategy { })); logger.debug(">> converging loadBalancer(%s) to instances(%s)", name, instanceIds); - Set registeredInstanceIds = client.getInstanceClientForRegion(region).registerInstancesWithLoadBalancer( + Set registeredInstanceIds = api.getInstanceApiForRegion(region).registerInstancesWithLoadBalancer( instanceIds, name); Set instancesToRemove = filter(registeredInstanceIds, not(in(instanceIds))); if (instancesToRemove.size() > 0) { logger.debug(">> deregistering instances(%s) from loadBalancer(%s)", instancesToRemove, name); - client.getInstanceClientForRegion(region).deregisterInstancesFromLoadBalancer(instancesToRemove, name); + api.getInstanceApiForRegion(region).deregisterInstancesFromLoadBalancer(instancesToRemove, name); } logger.debug("<< converged loadBalancer(%s) ", name); - return converter.apply(new LoadBalancerInRegion(client.getLoadBalancerClientForRegion(region).get(name), region)); + return converter.apply(new LoadBalancerInRegion(api.getLoadBalancerApiForRegion(region).get(name), region)); } } diff --git a/labs/elb/src/test/java/org/jclouds/elb/ELBTest.java b/labs/elb/src/test/java/org/jclouds/elb/ELBTest.java index afba771cef..fb71584ece 100644 --- a/labs/elb/src/test/java/org/jclouds/elb/ELBTest.java +++ b/labs/elb/src/test/java/org/jclouds/elb/ELBTest.java @@ -8,7 +8,7 @@ import org.easymock.EasyMock; import org.jclouds.collect.PaginatedIterable; import org.jclouds.collect.PaginatedIterables; import org.jclouds.elb.domain.LoadBalancer; -import org.jclouds.elb.features.LoadBalancerClient; +import org.jclouds.elb.features.LoadBalancerApi; import org.jclouds.elb.options.ListLoadBalancersOptions; import org.testng.Assert; import org.testng.annotations.Test; @@ -27,37 +27,37 @@ public class ELBTest { @Test public void testSinglePageResult() throws Exception { - LoadBalancerClient loadBalancerClient = createMock(LoadBalancerClient.class); + LoadBalancerApi loadBalancerApi = createMock(LoadBalancerApi.class); ListLoadBalancersOptions options = new ListLoadBalancersOptions(); PaginatedIterable response = PaginatedIterables.forward(ImmutableSet.of(createMock(LoadBalancer.class))); - expect(loadBalancerClient.list(options)) + expect(loadBalancerApi.list(options)) .andReturn(response) .once(); - EasyMock.replay(loadBalancerClient); + EasyMock.replay(loadBalancerApi); - Assert.assertEquals(1, Iterables.size(ELB.listLoadBalancers(loadBalancerClient, options))); + Assert.assertEquals(1, Iterables.size(ELB.listLoadBalancers(loadBalancerApi, options))); } @Test public void testMultiPageResult() throws Exception { - LoadBalancerClient loadBalancerClient = createMock(LoadBalancerClient.class); + LoadBalancerApi loadBalancerApi = createMock(LoadBalancerApi.class); ListLoadBalancersOptions options = new ListLoadBalancersOptions(); PaginatedIterable response1 = PaginatedIterables.forwardWithMarker(ImmutableSet.of(createMock(LoadBalancer.class)), "NEXTTOKEN"); PaginatedIterable response2 = PaginatedIterables.forward(ImmutableSet.of(createMock(LoadBalancer.class))); - expect(loadBalancerClient.list(anyObject(ListLoadBalancersOptions.class))) + expect(loadBalancerApi.list(anyObject(ListLoadBalancersOptions.class))) .andReturn(response1) .once(); - expect(loadBalancerClient.list(anyObject(ListLoadBalancersOptions.class))) + expect(loadBalancerApi.list(anyObject(ListLoadBalancersOptions.class))) .andReturn(response2) .once(); - EasyMock.replay(loadBalancerClient); + EasyMock.replay(loadBalancerApi); - Assert.assertEquals(2, Iterables.size(ELB.listLoadBalancers(loadBalancerClient, options))); + Assert.assertEquals(2, Iterables.size(ELB.listLoadBalancers(loadBalancerApi, options))); } } diff --git a/labs/elb/src/test/java/org/jclouds/elb/features/AvailabilityZoneClientExpectTest.java b/labs/elb/src/test/java/org/jclouds/elb/features/AvailabilityZoneApiExpectTest.java similarity index 81% rename from labs/elb/src/test/java/org/jclouds/elb/features/AvailabilityZoneClientExpectTest.java rename to labs/elb/src/test/java/org/jclouds/elb/features/AvailabilityZoneApiExpectTest.java index 3993f4a9b3..57bd05282b 100644 --- a/labs/elb/src/test/java/org/jclouds/elb/features/AvailabilityZoneClientExpectTest.java +++ b/labs/elb/src/test/java/org/jclouds/elb/features/AvailabilityZoneApiExpectTest.java @@ -23,8 +23,8 @@ import static org.testng.Assert.assertEquals; import java.net.URI; import java.util.TimeZone; -import org.jclouds.elb.ELBClient; -import org.jclouds.elb.internal.BaseELBClientExpectTest; +import org.jclouds.elb.ELBApi; +import org.jclouds.elb.internal.BaseELBApiExpectTest; import org.jclouds.elb.parse.AvailabilityZonesResultHandlerTest; import org.jclouds.http.HttpRequest; import org.jclouds.http.HttpResponse; @@ -37,10 +37,10 @@ import com.google.common.collect.ImmutableSet; /** * @author Adrian Cole */ -@Test(groups = "unit", testName = "AvailabilityZoneClientExpectTest") -public class AvailabilityZoneClientExpectTest extends BaseELBClientExpectTest { +@Test(groups = "unit", testName = "AvailabilityZoneApiExpectTest") +public class AvailabilityZoneApiExpectTest extends BaseELBApiExpectTest { - public AvailabilityZoneClientExpectTest() { + public AvailabilityZoneApiExpectTest() { TimeZone.setDefault(TimeZone.getTimeZone("America/Los_Angeles")); } @@ -70,10 +70,10 @@ public class AvailabilityZoneClientExpectTest extends BaseELBClientExpectTest { HttpResponse getResponse = HttpResponse.builder().statusCode(200) .payload(payloadFromResourceWithContentType("/zones.xml", "text/xml")).build(); - ELBClient clientWhenExist = requestSendsResponse( + ELBApi apiWhenExist = requestSendsResponse( addZoneToLoadBalancer, getResponse); - assertEquals(clientWhenExist.getAvailabilityZoneClient().addAvailabilityZoneToLoadBalancer("us-east-1a", "name").toString(), new AvailabilityZonesResultHandlerTest().expected().toString()); + assertEquals(apiWhenExist.getAvailabilityZoneApi().addAvailabilityZoneToLoadBalancer("us-east-1a", "name").toString(), new AvailabilityZonesResultHandlerTest().expected().toString()); } @Test(expectedExceptions = ResourceNotFoundException.class) @@ -81,10 +81,10 @@ public class AvailabilityZoneClientExpectTest extends BaseELBClientExpectTest { HttpResponse getResponse = HttpResponse.builder().statusCode(404).build(); - ELBClient clientWhenDontExist = requestSendsResponse( + ELBApi apiWhenDontExist = requestSendsResponse( addZoneToLoadBalancer, getResponse); - clientWhenDontExist.getAvailabilityZoneClient().addAvailabilityZoneToLoadBalancer("us-east-1a", "name"); + apiWhenDontExist.getAvailabilityZoneApi().addAvailabilityZoneToLoadBalancer("us-east-1a", "name"); } HttpRequest addZonesToLoadBalancer = HttpRequest.builder() @@ -114,10 +114,10 @@ public class AvailabilityZoneClientExpectTest extends BaseELBClientExpectTest { HttpResponse getResponse = HttpResponse.builder().statusCode(200) .payload(payloadFromResourceWithContentType("/zones.xml", "text/xml")).build(); - ELBClient clientWhenExist = requestSendsResponse(addZonesToLoadBalancer, getResponse); + ELBApi apiWhenExist = requestSendsResponse(addZonesToLoadBalancer, getResponse); assertEquals( - clientWhenExist.getAvailabilityZoneClient().addAvailabilityZonesToLoadBalancer(ImmutableSet.of("us-east-1a", "us-east-1b"), "name") + apiWhenExist.getAvailabilityZoneApi().addAvailabilityZonesToLoadBalancer(ImmutableSet.of("us-east-1a", "us-east-1b"), "name") .toString(), new AvailabilityZonesResultHandlerTest().expected().toString()); } @@ -126,9 +126,9 @@ public class AvailabilityZoneClientExpectTest extends BaseELBClientExpectTest { HttpResponse getResponse = HttpResponse.builder().statusCode(404).build(); - ELBClient clientWhenDontExist = requestSendsResponse(addZonesToLoadBalancer, getResponse); + ELBApi apiWhenDontExist = requestSendsResponse(addZonesToLoadBalancer, getResponse); - clientWhenDontExist.getAvailabilityZoneClient().addAvailabilityZonesToLoadBalancer(ImmutableSet.of("us-east-1a", "us-east-1b"), "name"); + apiWhenDontExist.getAvailabilityZoneApi().addAvailabilityZonesToLoadBalancer(ImmutableSet.of("us-east-1a", "us-east-1b"), "name"); } @@ -158,10 +158,10 @@ public class AvailabilityZoneClientExpectTest extends BaseELBClientExpectTest { HttpResponse getResponse = HttpResponse.builder().statusCode(200) .payload(payloadFromResourceWithContentType("/zones.xml", "text/xml")).build(); - ELBClient clientWhenExist = requestSendsResponse( + ELBApi apiWhenExist = requestSendsResponse( removeZoneFromLoadBalancer, getResponse); - assertEquals(clientWhenExist.getAvailabilityZoneClient().removeAvailabilityZoneFromLoadBalancer("us-east-1a", "name").toString(), new AvailabilityZonesResultHandlerTest().expected().toString()); + assertEquals(apiWhenExist.getAvailabilityZoneApi().removeAvailabilityZoneFromLoadBalancer("us-east-1a", "name").toString(), new AvailabilityZonesResultHandlerTest().expected().toString()); } @Test(expectedExceptions = ResourceNotFoundException.class) @@ -169,10 +169,10 @@ public class AvailabilityZoneClientExpectTest extends BaseELBClientExpectTest { HttpResponse getResponse = HttpResponse.builder().statusCode(404).build(); - ELBClient clientWhenDontExist = requestSendsResponse( + ELBApi apiWhenDontExist = requestSendsResponse( removeZoneFromLoadBalancer, getResponse); - clientWhenDontExist.getAvailabilityZoneClient().removeAvailabilityZoneFromLoadBalancer("us-east-1a", "name"); + apiWhenDontExist.getAvailabilityZoneApi().removeAvailabilityZoneFromLoadBalancer("us-east-1a", "name"); } HttpRequest removeZonesFromLoadBalancer = HttpRequest.builder() @@ -202,10 +202,10 @@ public class AvailabilityZoneClientExpectTest extends BaseELBClientExpectTest { HttpResponse getResponse = HttpResponse.builder().statusCode(200) .payload(payloadFromResourceWithContentType("/zones.xml", "text/xml")).build(); - ELBClient clientWhenExist = requestSendsResponse(removeZonesFromLoadBalancer, getResponse); + ELBApi apiWhenExist = requestSendsResponse(removeZonesFromLoadBalancer, getResponse); assertEquals( - clientWhenExist.getAvailabilityZoneClient().removeAvailabilityZonesFromLoadBalancer(ImmutableSet.of("us-east-1a", "us-east-1b"), "name") + apiWhenExist.getAvailabilityZoneApi().removeAvailabilityZonesFromLoadBalancer(ImmutableSet.of("us-east-1a", "us-east-1b"), "name") .toString(), new AvailabilityZonesResultHandlerTest().expected().toString()); } @@ -214,8 +214,8 @@ public class AvailabilityZoneClientExpectTest extends BaseELBClientExpectTest { HttpResponse getResponse = HttpResponse.builder().statusCode(404).build(); - ELBClient clientWhenDontExist = requestSendsResponse(removeZonesFromLoadBalancer, getResponse); + ELBApi apiWhenDontExist = requestSendsResponse(removeZonesFromLoadBalancer, getResponse); - clientWhenDontExist.getAvailabilityZoneClient().removeAvailabilityZonesFromLoadBalancer(ImmutableSet.of("us-east-1a", "us-east-1b"), "name"); + apiWhenDontExist.getAvailabilityZoneApi().removeAvailabilityZonesFromLoadBalancer(ImmutableSet.of("us-east-1a", "us-east-1b"), "name"); } } diff --git a/labs/elb/src/test/java/org/jclouds/elb/features/AvailabilityZoneClientLiveTest.java b/labs/elb/src/test/java/org/jclouds/elb/features/AvailabilityZoneApiLiveTest.java similarity index 74% rename from labs/elb/src/test/java/org/jclouds/elb/features/AvailabilityZoneClientLiveTest.java rename to labs/elb/src/test/java/org/jclouds/elb/features/AvailabilityZoneApiLiveTest.java index e8668bd5ae..0674cf171d 100644 --- a/labs/elb/src/test/java/org/jclouds/elb/features/AvailabilityZoneClientLiveTest.java +++ b/labs/elb/src/test/java/org/jclouds/elb/features/AvailabilityZoneApiLiveTest.java @@ -18,16 +18,16 @@ */ package org.jclouds.elb.features; -import org.jclouds.elb.internal.BaseELBClientLiveTest; +import org.jclouds.elb.internal.BaseELBApiLiveTest; import org.testng.annotations.Test; /** * @author Adrian Cole */ -@Test(groups = "live", testName = "AvailabilityZoneClientLiveTest") -public class AvailabilityZoneClientLiveTest extends BaseELBClientLiveTest { +@Test(groups = "live", testName = "AvailabilityZoneApiLiveTest") +public class AvailabilityZoneApiLiveTest extends BaseELBApiLiveTest { - protected AvailabilityZoneClient client() { - return context.getApi().getAvailabilityZoneClient(); + protected AvailabilityZoneApi api() { + return context.getApi().getAvailabilityZoneApi(); } } diff --git a/labs/elb/src/test/java/org/jclouds/elb/features/InstanceClientExpectTest.java b/labs/elb/src/test/java/org/jclouds/elb/features/InstanceApiExpectTest.java similarity index 82% rename from labs/elb/src/test/java/org/jclouds/elb/features/InstanceClientExpectTest.java rename to labs/elb/src/test/java/org/jclouds/elb/features/InstanceApiExpectTest.java index 4773ca70d6..691c47486a 100644 --- a/labs/elb/src/test/java/org/jclouds/elb/features/InstanceClientExpectTest.java +++ b/labs/elb/src/test/java/org/jclouds/elb/features/InstanceApiExpectTest.java @@ -23,8 +23,8 @@ import static org.testng.Assert.assertEquals; import java.net.URI; import java.util.TimeZone; -import org.jclouds.elb.ELBClient; -import org.jclouds.elb.internal.BaseELBClientExpectTest; +import org.jclouds.elb.ELBApi; +import org.jclouds.elb.internal.BaseELBApiExpectTest; import org.jclouds.elb.parse.DescribeInstanceHealthResponseTest; import org.jclouds.elb.parse.InstancesResultHandlerTest; import org.jclouds.http.HttpRequest; @@ -38,10 +38,10 @@ import com.google.common.collect.ImmutableSet; /** * @author Adrian Cole */ -@Test(groups = "unit", testName = "InstanceClientExpectTest") -public class InstanceClientExpectTest extends BaseELBClientExpectTest { +@Test(groups = "unit", testName = "InstanceApiExpectTest") +public class InstanceApiExpectTest extends BaseELBApiExpectTest { - public InstanceClientExpectTest() { + public InstanceApiExpectTest() { TimeZone.setDefault(TimeZone.getTimeZone("America/Los_Angeles")); } @@ -70,20 +70,20 @@ public class InstanceClientExpectTest extends BaseELBClientExpectTest { HttpResponse getResponse = HttpResponse.builder().statusCode(200) .payload(payloadFromResourceWithContentType("/describe_instancehealth.xml", "text/xml")).build(); - ELBClient clientWhenExist = requestSendsResponse( + ELBApi apiWhenExist = requestSendsResponse( get, getResponse); - assertEquals(clientWhenExist.getInstanceClient().getHealthOfInstancesOfLoadBalancer("name").toString(), new DescribeInstanceHealthResponseTest().expected().toString()); + assertEquals(apiWhenExist.getInstanceApi().getHealthOfInstancesOfLoadBalancer("name").toString(), new DescribeInstanceHealthResponseTest().expected().toString()); } public void testGetHealthOfInstancesOfLoadBalancerWhenResponseIs404() throws Exception { HttpResponse getResponse = HttpResponse.builder().statusCode(404).build(); - ELBClient clientWhenDontExist = requestSendsResponse( + ELBApi apiWhenDontExist = requestSendsResponse( get, getResponse); - assertEquals(clientWhenDontExist.getInstanceClient().getHealthOfInstancesOfLoadBalancer("name"), ImmutableSet.of()); + assertEquals(apiWhenDontExist.getInstanceApi().getHealthOfInstancesOfLoadBalancer("name"), ImmutableSet.of()); } HttpRequest registerInstanceWithLoadBalancer = HttpRequest.builder() @@ -112,10 +112,10 @@ public class InstanceClientExpectTest extends BaseELBClientExpectTest { HttpResponse getResponse = HttpResponse.builder().statusCode(200) .payload(payloadFromResourceWithContentType("/instances.xml", "text/xml")).build(); - ELBClient clientWhenExist = requestSendsResponse( + ELBApi apiWhenExist = requestSendsResponse( registerInstanceWithLoadBalancer, getResponse); - assertEquals(clientWhenExist.getInstanceClient().registerInstanceWithLoadBalancer("i-6055fa09", "name").toString(), new InstancesResultHandlerTest().expected().toString()); + assertEquals(apiWhenExist.getInstanceApi().registerInstanceWithLoadBalancer("i-6055fa09", "name").toString(), new InstancesResultHandlerTest().expected().toString()); } @Test(expectedExceptions = ResourceNotFoundException.class) @@ -123,10 +123,10 @@ public class InstanceClientExpectTest extends BaseELBClientExpectTest { HttpResponse getResponse = HttpResponse.builder().statusCode(404).build(); - ELBClient clientWhenDontExist = requestSendsResponse( + ELBApi apiWhenDontExist = requestSendsResponse( registerInstanceWithLoadBalancer, getResponse); - clientWhenDontExist.getInstanceClient().registerInstanceWithLoadBalancer("i-6055fa09", "name"); + apiWhenDontExist.getInstanceApi().registerInstanceWithLoadBalancer("i-6055fa09", "name"); } HttpRequest registerInstancesWithLoadBalancer = HttpRequest.builder() @@ -156,10 +156,10 @@ public class InstanceClientExpectTest extends BaseELBClientExpectTest { HttpResponse getResponse = HttpResponse.builder().statusCode(200) .payload(payloadFromResourceWithContentType("/instances.xml", "text/xml")).build(); - ELBClient clientWhenExist = requestSendsResponse(registerInstancesWithLoadBalancer, getResponse); + ELBApi apiWhenExist = requestSendsResponse(registerInstancesWithLoadBalancer, getResponse); assertEquals( - clientWhenExist.getInstanceClient().registerInstancesWithLoadBalancer(ImmutableSet.of("i-6055fa09", "i-9055fa55"), "name") + apiWhenExist.getInstanceApi().registerInstancesWithLoadBalancer(ImmutableSet.of("i-6055fa09", "i-9055fa55"), "name") .toString(), new InstancesResultHandlerTest().expected().toString()); } @@ -168,9 +168,9 @@ public class InstanceClientExpectTest extends BaseELBClientExpectTest { HttpResponse getResponse = HttpResponse.builder().statusCode(404).build(); - ELBClient clientWhenDontExist = requestSendsResponse(registerInstancesWithLoadBalancer, getResponse); + ELBApi apiWhenDontExist = requestSendsResponse(registerInstancesWithLoadBalancer, getResponse); - clientWhenDontExist.getInstanceClient().registerInstancesWithLoadBalancer(ImmutableSet.of("i-6055fa09", "i-9055fa55"), "name"); + apiWhenDontExist.getInstanceApi().registerInstancesWithLoadBalancer(ImmutableSet.of("i-6055fa09", "i-9055fa55"), "name"); } @@ -200,10 +200,10 @@ public class InstanceClientExpectTest extends BaseELBClientExpectTest { HttpResponse getResponse = HttpResponse.builder().statusCode(200) .payload(payloadFromResourceWithContentType("/instances.xml", "text/xml")).build(); - ELBClient clientWhenExist = requestSendsResponse( + ELBApi apiWhenExist = requestSendsResponse( deregisterInstanceFromLoadBalancer, getResponse); - assertEquals(clientWhenExist.getInstanceClient().deregisterInstanceFromLoadBalancer("i-6055fa09", "name").toString(), new InstancesResultHandlerTest().expected().toString()); + assertEquals(apiWhenExist.getInstanceApi().deregisterInstanceFromLoadBalancer("i-6055fa09", "name").toString(), new InstancesResultHandlerTest().expected().toString()); } @Test(expectedExceptions = ResourceNotFoundException.class) @@ -211,10 +211,10 @@ public class InstanceClientExpectTest extends BaseELBClientExpectTest { HttpResponse getResponse = HttpResponse.builder().statusCode(404).build(); - ELBClient clientWhenDontExist = requestSendsResponse( + ELBApi apiWhenDontExist = requestSendsResponse( deregisterInstanceFromLoadBalancer, getResponse); - clientWhenDontExist.getInstanceClient().deregisterInstanceFromLoadBalancer("i-6055fa09", "name"); + apiWhenDontExist.getInstanceApi().deregisterInstanceFromLoadBalancer("i-6055fa09", "name"); } HttpRequest deregisterInstancesFromLoadBalancer = HttpRequest.builder() @@ -244,10 +244,10 @@ public class InstanceClientExpectTest extends BaseELBClientExpectTest { HttpResponse getResponse = HttpResponse.builder().statusCode(200) .payload(payloadFromResourceWithContentType("/instances.xml", "text/xml")).build(); - ELBClient clientWhenExist = requestSendsResponse(deregisterInstancesFromLoadBalancer, getResponse); + ELBApi apiWhenExist = requestSendsResponse(deregisterInstancesFromLoadBalancer, getResponse); assertEquals( - clientWhenExist.getInstanceClient().deregisterInstancesFromLoadBalancer(ImmutableSet.of("i-6055fa09", "i-9055fa55"), "name") + apiWhenExist.getInstanceApi().deregisterInstancesFromLoadBalancer(ImmutableSet.of("i-6055fa09", "i-9055fa55"), "name") .toString(), new InstancesResultHandlerTest().expected().toString()); } @@ -256,8 +256,8 @@ public class InstanceClientExpectTest extends BaseELBClientExpectTest { HttpResponse getResponse = HttpResponse.builder().statusCode(404).build(); - ELBClient clientWhenDontExist = requestSendsResponse(deregisterInstancesFromLoadBalancer, getResponse); + ELBApi apiWhenDontExist = requestSendsResponse(deregisterInstancesFromLoadBalancer, getResponse); - clientWhenDontExist.getInstanceClient().deregisterInstancesFromLoadBalancer(ImmutableSet.of("i-6055fa09", "i-9055fa55"), "name"); + apiWhenDontExist.getInstanceApi().deregisterInstancesFromLoadBalancer(ImmutableSet.of("i-6055fa09", "i-9055fa55"), "name"); } } diff --git a/labs/elb/src/test/java/org/jclouds/elb/features/InstanceClientLiveTest.java b/labs/elb/src/test/java/org/jclouds/elb/features/InstanceApiLiveTest.java similarity index 79% rename from labs/elb/src/test/java/org/jclouds/elb/features/InstanceClientLiveTest.java rename to labs/elb/src/test/java/org/jclouds/elb/features/InstanceApiLiveTest.java index dc6e689a2c..5e37bf9528 100644 --- a/labs/elb/src/test/java/org/jclouds/elb/features/InstanceClientLiveTest.java +++ b/labs/elb/src/test/java/org/jclouds/elb/features/InstanceApiLiveTest.java @@ -24,7 +24,7 @@ import java.util.Set; import org.jclouds.elb.domain.InstanceHealth; import org.jclouds.elb.domain.LoadBalancer; -import org.jclouds.elb.internal.BaseELBClientLiveTest; +import org.jclouds.elb.internal.BaseELBApiLiveTest; import org.testng.Assert; import org.testng.annotations.Test; @@ -33,8 +33,8 @@ import com.google.common.collect.ImmutableSet; /** * @author Adrian Cole */ -@Test(groups = "live", testName = "InstanceClientLiveTest") -public class InstanceClientLiveTest extends BaseELBClientLiveTest { +@Test(groups = "live", testName = "InstanceApiLiveTest") +public class InstanceApiLiveTest extends BaseELBApiLiveTest { private void checkInstanceState(InstanceHealth instanceState) { checkNotNull(instanceState.getDescription(), "Description cannot be null for InstanceState"); @@ -46,8 +46,8 @@ public class InstanceClientLiveTest extends BaseELBClientLiveTest { @Test protected void testListInstanceStates() { - for (LoadBalancer loadBalancer : context.getApi().getLoadBalancerClient().list()) { - Set response = client().getHealthOfInstancesOfLoadBalancer(loadBalancer.getName()); + for (LoadBalancer loadBalancer : context.getApi().getLoadBalancerApi().list()) { + Set response = api().getHealthOfInstancesOfLoadBalancer(loadBalancer.getName()); for (InstanceHealth instanceState : response) { checkInstanceState(instanceState); @@ -56,14 +56,14 @@ public class InstanceClientLiveTest extends BaseELBClientLiveTest { if (response.size() > 0) { InstanceHealth instanceState = response.iterator().next(); Assert.assertEquals( - ImmutableSet.of(client().getHealthOfInstancesOfLoadBalancer(ImmutableSet.of(instanceState.getInstanceId()), + ImmutableSet.of(api().getHealthOfInstancesOfLoadBalancer(ImmutableSet.of(instanceState.getInstanceId()), loadBalancer.getName())), instanceState); } } } - protected InstanceClient client() { - return context.getApi().getInstanceClient(); + protected InstanceApi api() { + return context.getApi().getInstanceApi(); } } diff --git a/labs/elb/src/test/java/org/jclouds/elb/features/LoadBalancerClientExpectTest.java b/labs/elb/src/test/java/org/jclouds/elb/features/LoadBalancerApiExpectTest.java similarity index 85% rename from labs/elb/src/test/java/org/jclouds/elb/features/LoadBalancerClientExpectTest.java rename to labs/elb/src/test/java/org/jclouds/elb/features/LoadBalancerApiExpectTest.java index 3e0d4c68fc..3db8442222 100644 --- a/labs/elb/src/test/java/org/jclouds/elb/features/LoadBalancerClientExpectTest.java +++ b/labs/elb/src/test/java/org/jclouds/elb/features/LoadBalancerApiExpectTest.java @@ -25,8 +25,8 @@ import static org.testng.Assert.assertNull; import java.net.URI; import java.util.TimeZone; -import org.jclouds.elb.ELBClient; -import org.jclouds.elb.internal.BaseELBClientExpectTest; +import org.jclouds.elb.ELBApi; +import org.jclouds.elb.internal.BaseELBApiExpectTest; import org.jclouds.elb.parse.DescribeLoadBalancersResponseTest; import org.jclouds.elb.parse.GetLoadBalancerResponseTest; import org.jclouds.http.HttpRequest; @@ -39,10 +39,10 @@ import com.google.common.collect.ImmutableMultimap; /** * @author Adrian Cole */ -@Test(groups = "unit", testName = "LoadBalancerClientExpectTest") -public class LoadBalancerClientExpectTest extends BaseELBClientExpectTest { +@Test(groups = "unit", testName = "LoadBalancerApiExpectTest") +public class LoadBalancerApiExpectTest extends BaseELBApiExpectTest { - public LoadBalancerClientExpectTest() { + public LoadBalancerApiExpectTest() { TimeZone.setDefault(TimeZone.getTimeZone("America/Los_Angeles")); } @@ -71,20 +71,20 @@ public class LoadBalancerClientExpectTest extends BaseELBClientExpectTest { HttpResponse getResponse = HttpResponse.builder().statusCode(200) .payload(payloadFromResourceWithContentType("/describe_loadbalancers.xml", "text/xml")).build(); - ELBClient clientWhenExist = requestSendsResponse( + ELBApi apiWhenExist = requestSendsResponse( get, getResponse); - assertEquals(clientWhenExist.getLoadBalancerClient().get("name").toString(), new GetLoadBalancerResponseTest().expected().toString()); + assertEquals(apiWhenExist.getLoadBalancerApi().get("name").toString(), new GetLoadBalancerResponseTest().expected().toString()); } public void testGetWhenResponseIs404() throws Exception { HttpResponse getResponse = HttpResponse.builder().statusCode(404).build(); - ELBClient clientWhenDontExist = requestSendsResponse( + ELBApi apiWhenDontExist = requestSendsResponse( get, getResponse); - assertNull(clientWhenDontExist.getLoadBalancerClient().get("name")); + assertNull(apiWhenDontExist.getLoadBalancerApi().get("name")); } HttpRequest list = HttpRequest.builder() @@ -110,10 +110,10 @@ public class LoadBalancerClientExpectTest extends BaseELBClientExpectTest { HttpResponse listResponse = HttpResponse.builder().statusCode(200) .payload(payloadFromResourceWithContentType("/describe_loadbalancers.xml", "text/xml")).build(); - ELBClient clientWhenExist = requestSendsResponse( + ELBApi apiWhenExist = requestSendsResponse( list, listResponse); - assertEquals(clientWhenExist.getLoadBalancerClient().list().toString(), new DescribeLoadBalancersResponseTest().expected().toString()); + assertEquals(apiWhenExist.getLoadBalancerApi().list().toString(), new DescribeLoadBalancersResponseTest().expected().toString()); } // TODO: this should really be an empty set @@ -122,10 +122,10 @@ public class LoadBalancerClientExpectTest extends BaseELBClientExpectTest { HttpResponse listResponse = HttpResponse.builder().statusCode(404).build(); - ELBClient clientWhenDontExist = requestSendsResponse( + ELBApi apiWhenDontExist = requestSendsResponse( list, listResponse); - clientWhenDontExist.getLoadBalancerClient().list(); + apiWhenDontExist.getLoadBalancerApi().list(); } public void testListWithOptionsWhenResponseIs2xx() throws Exception { @@ -151,10 +151,10 @@ public class LoadBalancerClientExpectTest extends BaseELBClientExpectTest { HttpResponse listWithOptionsResponse = HttpResponse.builder().statusCode(200) .payload(payloadFromResourceWithContentType("/describe_loadbalancers.xml", "text/xml")).build(); - ELBClient clientWhenWithOptionsExist = requestSendsResponse(listWithOptions, + ELBApi apiWhenWithOptionsExist = requestSendsResponse(listWithOptions, listWithOptionsResponse); - assertEquals(clientWhenWithOptionsExist.getLoadBalancerClient().list(afterMarker("MARKER")).toString(), + assertEquals(apiWhenWithOptionsExist.getLoadBalancerApi().list(afterMarker("MARKER")).toString(), new DescribeLoadBalancersResponseTest().expected().toString()); } @@ -181,17 +181,17 @@ public class LoadBalancerClientExpectTest extends BaseELBClientExpectTest { HttpResponse deleteResponse = HttpResponse.builder().statusCode(200).build(); - ELBClient clientWhenExist = requestSendsResponse(delete, deleteResponse); + ELBApi apiWhenExist = requestSendsResponse(delete, deleteResponse); - clientWhenExist.getLoadBalancerClient().delete("name"); + apiWhenExist.getLoadBalancerApi().delete("name"); } public void testDeleteWhenResponseIs404() throws Exception { HttpResponse deleteResponse = HttpResponse.builder().statusCode(404).build(); - ELBClient clientWhenDontExist = requestSendsResponse(delete, deleteResponse); + ELBApi apiWhenDontExist = requestSendsResponse(delete, deleteResponse); - clientWhenDontExist.getLoadBalancerClient().delete("name"); + apiWhenDontExist.getLoadBalancerApi().delete("name"); } } diff --git a/labs/elb/src/test/java/org/jclouds/elb/features/LoadBalancerClientLiveTest.java b/labs/elb/src/test/java/org/jclouds/elb/features/LoadBalancerApiLiveTest.java similarity index 88% rename from labs/elb/src/test/java/org/jclouds/elb/features/LoadBalancerClientLiveTest.java rename to labs/elb/src/test/java/org/jclouds/elb/features/LoadBalancerApiLiveTest.java index cbacc919e1..80cf28c444 100644 --- a/labs/elb/src/test/java/org/jclouds/elb/features/LoadBalancerClientLiveTest.java +++ b/labs/elb/src/test/java/org/jclouds/elb/features/LoadBalancerApiLiveTest.java @@ -24,7 +24,7 @@ import static com.google.common.base.Preconditions.checkState; import org.jclouds.collect.PaginatedIterable; import org.jclouds.elb.domain.ListenerWithPolicies; import org.jclouds.elb.domain.LoadBalancer; -import org.jclouds.elb.internal.BaseELBClientLiveTest; +import org.jclouds.elb.internal.BaseELBApiLiveTest; import org.jclouds.elb.options.ListLoadBalancersOptions; import org.testng.Assert; import org.testng.annotations.Test; @@ -34,8 +34,8 @@ import com.google.common.collect.Iterables; /** * @author Adrian Cole */ -@Test(groups = "live", testName = "LoadBalancerClientLiveTest") -public class LoadBalancerClientLiveTest extends BaseELBClientLiveTest { +@Test(groups = "live", testName = "LoadBalancerApiLiveTest") +public class LoadBalancerApiLiveTest extends BaseELBApiLiveTest { private void checkLoadBalancer(LoadBalancer loadBalancer) { checkNotNull(loadBalancer.getName(), "While Name can be null for a LoadBalancer, its Optional wrapper cannot: %s", loadBalancer); @@ -72,7 +72,7 @@ public class LoadBalancerClientLiveTest extends BaseELBClientLiveTest { @Test protected void testDescribeLoadBalancers() { - PaginatedIterable response = client().list(); + PaginatedIterable response = api().list(); for (LoadBalancer loadBalancer : response) { checkLoadBalancer(loadBalancer); @@ -83,17 +83,17 @@ public class LoadBalancerClientLiveTest extends BaseELBClientLiveTest { if (Iterables.size(response) > 0) { LoadBalancer loadBalancer = response.iterator().next(); - Assert.assertEquals(client().get(loadBalancer.getName()), loadBalancer); + Assert.assertEquals(api().get(loadBalancer.getName()), loadBalancer); } // Test with a Marker, even if it's null - response = client().list(ListLoadBalancersOptions.Builder.afterMarker(response.getNextMarker())); + response = api().list(ListLoadBalancersOptions.Builder.afterMarker(response.getNextMarker())); for (LoadBalancer loadBalancer : response) { checkLoadBalancer(loadBalancer); } } - protected LoadBalancerClient client() { - return context.getApi().getLoadBalancerClient(); + protected LoadBalancerApi api() { + return context.getApi().getLoadBalancerApi(); } } diff --git a/labs/elb/src/test/java/org/jclouds/elb/features/PolicyClientExpectTest.java b/labs/elb/src/test/java/org/jclouds/elb/features/PolicyApiExpectTest.java similarity index 86% rename from labs/elb/src/test/java/org/jclouds/elb/features/PolicyClientExpectTest.java rename to labs/elb/src/test/java/org/jclouds/elb/features/PolicyApiExpectTest.java index 545f2dca4a..4519f8598b 100644 --- a/labs/elb/src/test/java/org/jclouds/elb/features/PolicyClientExpectTest.java +++ b/labs/elb/src/test/java/org/jclouds/elb/features/PolicyApiExpectTest.java @@ -25,8 +25,8 @@ import static org.testng.Assert.assertNull; import java.net.URI; import java.util.TimeZone; -import org.jclouds.elb.ELBClient; -import org.jclouds.elb.internal.BaseELBClientExpectTest; +import org.jclouds.elb.ELBApi; +import org.jclouds.elb.internal.BaseELBApiExpectTest; import org.jclouds.elb.parse.DescribeLoadBalancerPoliciesResponseTest; import org.jclouds.elb.parse.DescribeLoadBalancerPolicyTypesResponseTest; import org.jclouds.elb.parse.GetPolicyResponseTest; @@ -41,10 +41,10 @@ import com.google.common.collect.ImmutableSet; /** * @author Adrian Cole */ -@Test(groups = "unit", testName = "PolicyClientExpectTest") -public class PolicyClientExpectTest extends BaseELBClientExpectTest { +@Test(groups = "unit", testName = "PolicyApiExpectTest") +public class PolicyApiExpectTest extends BaseELBApiExpectTest { - public PolicyClientExpectTest() { + public PolicyApiExpectTest() { TimeZone.setDefault(TimeZone.getTimeZone("America/Los_Angeles")); } @@ -73,20 +73,20 @@ public class PolicyClientExpectTest extends BaseELBClientExpectTest { HttpResponse getResponse = HttpResponse.builder().statusCode(200) .payload(payloadFromResourceWithContentType("/describe_policy.xml", "text/xml")).build(); - ELBClient clientWhenExist = requestSendsResponse( + ELBApi apiWhenExist = requestSendsResponse( get, getResponse); - assertEquals(clientWhenExist.getPolicyClient().get("name").toString(), new GetPolicyResponseTest().expected().toString()); + assertEquals(apiWhenExist.getPolicyApi().get("name").toString(), new GetPolicyResponseTest().expected().toString()); } public void testGetWhenResponseIs404() throws Exception { HttpResponse getResponse = HttpResponse.builder().statusCode(404).build(); - ELBClient clientWhenDontExist = requestSendsResponse( + ELBApi apiWhenDontExist = requestSendsResponse( get, getResponse); - assertNull(clientWhenDontExist.getPolicyClient().get("name")); + assertNull(apiWhenDontExist.getPolicyApi().get("name")); } HttpRequest list = HttpRequest.builder() @@ -112,20 +112,20 @@ public class PolicyClientExpectTest extends BaseELBClientExpectTest { HttpResponse listResponse = HttpResponse.builder().statusCode(200) .payload(payloadFromResourceWithContentType("/describe_policies.xml", "text/xml")).build(); - ELBClient clientWhenExist = requestSendsResponse( + ELBApi apiWhenExist = requestSendsResponse( list, listResponse); - assertEquals(clientWhenExist.getPolicyClient().list().toString(), new DescribeLoadBalancerPoliciesResponseTest().expected().toString()); + assertEquals(apiWhenExist.getPolicyApi().list().toString(), new DescribeLoadBalancerPoliciesResponseTest().expected().toString()); } public void testListWhenResponseIs404() throws Exception { HttpResponse listResponse = HttpResponse.builder().statusCode(404).build(); - ELBClient clientWhenDontExist = requestSendsResponse( + ELBApi apiWhenDontExist = requestSendsResponse( list, listResponse); - clientWhenDontExist.getPolicyClient().list(); + apiWhenDontExist.getPolicyApi().list(); } public void testListWithOptionsWhenResponseIs2xx() throws Exception { @@ -151,10 +151,10 @@ public class PolicyClientExpectTest extends BaseELBClientExpectTest { HttpResponse listWithOptionsResponse = HttpResponse.builder().statusCode(200) .payload(payloadFromResourceWithContentType("/describe_policies.xml", "text/xml")).build(); - ELBClient clientWhenWithOptionsExist = requestSendsResponse(listWithOptions, + ELBApi apiWhenWithOptionsExist = requestSendsResponse(listWithOptions, listWithOptionsResponse); - assertEquals(clientWhenWithOptionsExist.getPolicyClient().list(loadBalancerName("moo")).toString(), + assertEquals(apiWhenWithOptionsExist.getPolicyApi().list(loadBalancerName("moo")).toString(), new DescribeLoadBalancerPoliciesResponseTest().expected().toString()); } @@ -184,20 +184,20 @@ public class PolicyClientExpectTest extends BaseELBClientExpectTest { HttpResponse getResponse = HttpResponse.builder().statusCode(200) .payload(payloadFromResourceWithContentType("/describe_policy_type.xml", "text/xml")).build(); - ELBClient clientWhenExist = requestSendsResponse( + ELBApi apiWhenExist = requestSendsResponse( getType, getResponse); - assertEquals(clientWhenExist.getPolicyClient().getType("name").toString(), new GetPolicyTypeResponseTest().expected().toString()); + assertEquals(apiWhenExist.getPolicyApi().getType("name").toString(), new GetPolicyTypeResponseTest().expected().toString()); } public void testGetTypeWhenResponseIs404() throws Exception { HttpResponse getResponse = HttpResponse.builder().statusCode(404).build(); - ELBClient clientWhenDontExist = requestSendsResponse( + ELBApi apiWhenDontExist = requestSendsResponse( getType, getResponse); - assertNull(clientWhenDontExist.getPolicyClient().getType("name")); + assertNull(apiWhenDontExist.getPolicyApi().getType("name")); } HttpRequest listTypes = HttpRequest.builder() @@ -223,20 +223,20 @@ public class PolicyClientExpectTest extends BaseELBClientExpectTest { HttpResponse listResponse = HttpResponse.builder().statusCode(200) .payload(payloadFromResourceWithContentType("/describe_policy_types.xml", "text/xml")).build(); - ELBClient clientWhenExist = requestSendsResponse( + ELBApi apiWhenExist = requestSendsResponse( listTypes, listResponse); - assertEquals(clientWhenExist.getPolicyClient().listTypes().toString(), new DescribeLoadBalancerPolicyTypesResponseTest().expected().toString()); + assertEquals(apiWhenExist.getPolicyApi().listTypes().toString(), new DescribeLoadBalancerPolicyTypesResponseTest().expected().toString()); } public void testListTypesWhenResponseIs404() throws Exception { HttpResponse listResponse = HttpResponse.builder().statusCode(404).build(); - ELBClient clientWhenDontExist = requestSendsResponse( + ELBApi apiWhenDontExist = requestSendsResponse( listTypes, listResponse); - clientWhenDontExist.getPolicyClient().listTypes(); + apiWhenDontExist.getPolicyApi().listTypes(); } public void testListTypesByNamesWhenResponseIs2xx() throws Exception { @@ -262,10 +262,10 @@ public class PolicyClientExpectTest extends BaseELBClientExpectTest { HttpResponse listWithOptionsResponse = HttpResponse.builder().statusCode(200) .payload(payloadFromResourceWithContentType("/describe_policy_types.xml", "text/xml")).build(); - ELBClient clientWhenWithOptionsExist = requestSendsResponse(listWithOptions, + ELBApi apiWhenWithOptionsExist = requestSendsResponse(listWithOptions, listWithOptionsResponse); - assertEquals(clientWhenWithOptionsExist.getPolicyClient().listTypes(ImmutableSet.of("moo")).toString(), + assertEquals(apiWhenWithOptionsExist.getPolicyApi().listTypes(ImmutableSet.of("moo")).toString(), new DescribeLoadBalancerPolicyTypesResponseTest().expected().toString()); } } diff --git a/labs/elb/src/test/java/org/jclouds/elb/features/PolicyClientLiveTest.java b/labs/elb/src/test/java/org/jclouds/elb/features/PolicyApiLiveTest.java similarity index 85% rename from labs/elb/src/test/java/org/jclouds/elb/features/PolicyClientLiveTest.java rename to labs/elb/src/test/java/org/jclouds/elb/features/PolicyApiLiveTest.java index bae7efd696..50c5cd905f 100644 --- a/labs/elb/src/test/java/org/jclouds/elb/features/PolicyClientLiveTest.java +++ b/labs/elb/src/test/java/org/jclouds/elb/features/PolicyApiLiveTest.java @@ -27,7 +27,7 @@ import javax.annotation.Nullable; import org.jclouds.elb.domain.AttributeMetadata; import org.jclouds.elb.domain.Policy; import org.jclouds.elb.domain.PolicyType; -import org.jclouds.elb.internal.BaseELBClientLiveTest; +import org.jclouds.elb.internal.BaseELBApiLiveTest; import org.testng.Assert; import org.testng.annotations.Test; @@ -37,8 +37,8 @@ import com.google.common.collect.Iterables; /** * @author Adrian Cole */ -@Test(groups = "live", testName = "PolicyClientLiveTest") -public class PolicyClientLiveTest extends BaseELBClientLiveTest { +@Test(groups = "live", testName = "PolicyApiLiveTest") +public class PolicyApiLiveTest extends BaseELBApiLiveTest { private void checkPolicy(Policy policy) { checkNotNull(policy.getName(), "Name cannot be null for a Policy."); @@ -48,7 +48,7 @@ public class PolicyClientLiveTest extends BaseELBClientLiveTest { @Test protected void testDescribePolicies() { - Set response = client().list(); + Set response = api().list(); for (Policy policy : response) { checkPolicy(policy); @@ -56,7 +56,7 @@ public class PolicyClientLiveTest extends BaseELBClientLiveTest { if (response.size() > 0) { Policy policy = response.iterator().next(); - Assert.assertEquals(client().get(policy.getName()), policy); + Assert.assertEquals(api().get(policy.getName()), policy); } } @@ -80,7 +80,7 @@ public class PolicyClientLiveTest extends BaseELBClientLiveTest { @Test protected void testDescribePolicyTypes() { - Set response = client().listTypes(); + Set response = api().listTypes(); for (PolicyType policyType : response) { checkPolicyType(policyType); @@ -88,7 +88,7 @@ public class PolicyClientLiveTest extends BaseELBClientLiveTest { if (response.size() > 0) { PolicyType policyType = response.iterator().next(); - Assert.assertEquals(client().getType(policyType.getName()), policyType); + Assert.assertEquals(api().getType(policyType.getName()), policyType); } if (response.size() > 0) { @@ -100,11 +100,11 @@ public class PolicyClientLiveTest extends BaseELBClientLiveTest { } }); - Assert.assertEquals(client().listTypes(names), response); + Assert.assertEquals(api().listTypes(names), response); } } - protected PolicyClient client() { - return context.getApi().getPolicyClient(); + protected PolicyApi api() { + return context.getApi().getPolicyApi(); } } diff --git a/labs/elb/src/test/java/org/jclouds/elb/internal/BaseELBClientExpectTest.java b/labs/elb/src/test/java/org/jclouds/elb/internal/BaseELBApiExpectTest.java similarity index 88% rename from labs/elb/src/test/java/org/jclouds/elb/internal/BaseELBClientExpectTest.java rename to labs/elb/src/test/java/org/jclouds/elb/internal/BaseELBApiExpectTest.java index c713868c70..2f358efd17 100644 --- a/labs/elb/src/test/java/org/jclouds/elb/internal/BaseELBClientExpectTest.java +++ b/labs/elb/src/test/java/org/jclouds/elb/internal/BaseELBApiExpectTest.java @@ -18,13 +18,13 @@ */ package org.jclouds.elb.internal; -import org.jclouds.elb.ELBClient; +import org.jclouds.elb.ELBApi; /** * * @author Adrian Cole */ -public class BaseELBClientExpectTest extends BaseELBExpectTest { +public class BaseELBApiExpectTest extends BaseELBExpectTest { } diff --git a/labs/elb/src/test/java/org/jclouds/elb/internal/BaseELBClientLiveTest.java b/labs/elb/src/test/java/org/jclouds/elb/internal/BaseELBApiLiveTest.java similarity index 80% rename from labs/elb/src/test/java/org/jclouds/elb/internal/BaseELBClientLiveTest.java rename to labs/elb/src/test/java/org/jclouds/elb/internal/BaseELBApiLiveTest.java index 95c757d8b2..c27a05a5f1 100644 --- a/labs/elb/src/test/java/org/jclouds/elb/internal/BaseELBClientLiveTest.java +++ b/labs/elb/src/test/java/org/jclouds/elb/internal/BaseELBApiLiveTest.java @@ -20,8 +20,8 @@ package org.jclouds.elb.internal; import org.jclouds.apis.BaseContextLiveTest; import org.jclouds.elb.ELBApiMetadata; -import org.jclouds.elb.ELBAsyncClient; -import org.jclouds.elb.ELBClient; +import org.jclouds.elb.ELBAsyncApi; +import org.jclouds.elb.ELBApi; import org.jclouds.rest.RestContext; import org.testng.annotations.Test; @@ -32,14 +32,14 @@ import com.google.common.reflect.TypeToken; * @author Adrian Cole */ @Test(groups = "live") -public class BaseELBClientLiveTest extends BaseContextLiveTest> { +public class BaseELBApiLiveTest extends BaseContextLiveTest> { - public BaseELBClientLiveTest() { + public BaseELBApiLiveTest() { provider = "elb"; } @Override - protected TypeToken> contextType() { + protected TypeToken> contextType() { return ELBApiMetadata.CONTEXT_TOKEN; } diff --git a/labs/elb/src/test/java/org/jclouds/elb/internal/BaseELBAsyncClientExpectTest.java b/labs/elb/src/test/java/org/jclouds/elb/internal/BaseELBAsyncApiExpectTest.java similarity index 81% rename from labs/elb/src/test/java/org/jclouds/elb/internal/BaseELBAsyncClientExpectTest.java rename to labs/elb/src/test/java/org/jclouds/elb/internal/BaseELBAsyncApiExpectTest.java index df56165a5d..0130bc6739 100644 --- a/labs/elb/src/test/java/org/jclouds/elb/internal/BaseELBAsyncClientExpectTest.java +++ b/labs/elb/src/test/java/org/jclouds/elb/internal/BaseELBAsyncApiExpectTest.java @@ -20,7 +20,7 @@ package org.jclouds.elb.internal; import java.util.Properties; -import org.jclouds.elb.ELBAsyncClient; +import org.jclouds.elb.ELBAsyncApi; import org.jclouds.http.HttpRequest; import org.jclouds.http.HttpResponse; @@ -31,8 +31,8 @@ import com.google.inject.Module; * * @author Adrian Cole */ -public class BaseELBAsyncClientExpectTest extends BaseELBExpectTest { - public ELBAsyncClient createClient(Function fn, Module module, Properties props) { - return createInjector(fn, module, props).getInstance(ELBAsyncClient.class); +public class BaseELBAsyncApiExpectTest extends BaseELBExpectTest { + public ELBAsyncApi createApi(Function fn, Module module, Properties props) { + return createInjector(fn, module, props).getInstance(ELBAsyncApi.class); } } diff --git a/labs/elb/src/test/java/org/jclouds/elb/internal/BaseELBExpectTest.java b/labs/elb/src/test/java/org/jclouds/elb/internal/BaseELBExpectTest.java index 9da28ef956..dd08cb8784 100644 --- a/labs/elb/src/test/java/org/jclouds/elb/internal/BaseELBExpectTest.java +++ b/labs/elb/src/test/java/org/jclouds/elb/internal/BaseELBExpectTest.java @@ -29,7 +29,7 @@ import org.jclouds.elb.config.ELBRestClientModule; import org.jclouds.location.config.LocationModule; import org.jclouds.location.suppliers.RegionIdToURISupplier; import org.jclouds.rest.ConfiguresRestClient; -import org.jclouds.rest.internal.BaseRestClientExpectTest; +import org.jclouds.rest.internal.BaseRestApiExpectTest; import org.jclouds.util.Suppliers2; import com.google.common.base.Supplier; @@ -40,7 +40,7 @@ import com.google.inject.Module; * * @author Adrian Cole */ -public class BaseELBExpectTest extends BaseRestClientExpectTest { +public class BaseELBExpectTest extends BaseRestApiExpectTest { public BaseELBExpectTest() { provider = "elb"; diff --git a/labs/elb/src/test/java/org/jclouds/elb/loadbalancer/ELBLoadBalancerServiceLiveTest.java b/labs/elb/src/test/java/org/jclouds/elb/loadbalancer/ELBLoadBalancerServiceLiveTest.java index b1f3e1678b..2dd6e78e61 100644 --- a/labs/elb/src/test/java/org/jclouds/elb/loadbalancer/ELBLoadBalancerServiceLiveTest.java +++ b/labs/elb/src/test/java/org/jclouds/elb/loadbalancer/ELBLoadBalancerServiceLiveTest.java @@ -22,8 +22,8 @@ import static org.testng.Assert.assertEquals; import org.jclouds.collect.PaginatedIterable; import org.jclouds.compute.domain.NodeMetadata; -import org.jclouds.elb.ELBAsyncClient; -import org.jclouds.elb.ELBClient; +import org.jclouds.elb.ELBAsyncApi; +import org.jclouds.elb.ELBApi; import org.jclouds.elb.domain.LoadBalancer; import org.jclouds.loadbalancer.BaseLoadBalancerServiceLiveTest; import org.jclouds.rest.RestContext; @@ -50,17 +50,17 @@ public class ELBLoadBalancerServiceLiveTest extends BaseLoadBalancerServiceLiveT @Override protected void validateNodesInLoadBalancer() { - RestContext elbContext = view.unwrap(); + RestContext elbContext = view.unwrap(); // TODO create a LoadBalancer object and an appropriate list method so that this // does not have to be EC2 specific code - ELBClient elbClient = elbContext.getApi(); + ELBApi elbApi = elbContext.getApi(); Builder instanceIds = ImmutableSet. builder(); for (NodeMetadata node : nodes) { instanceIds.add(node.getProviderId()); } - PaginatedIterable elbs = elbClient.getLoadBalancerClient().list(); + PaginatedIterable elbs = elbApi.getLoadBalancerApi().list(); for (LoadBalancer elb : elbs) { if (elb.getName().equals(group)) assertEquals(elb.getInstanceIds(), instanceIds.build()); diff --git a/labs/iam/src/main/java/org/jclouds/iam/IAM.java b/labs/iam/src/main/java/org/jclouds/iam/IAM.java index ebac69c46f..97e59f23cd 100644 --- a/labs/iam/src/main/java/org/jclouds/iam/IAM.java +++ b/labs/iam/src/main/java/org/jclouds/iam/IAM.java @@ -3,7 +3,7 @@ package org.jclouds.iam; import org.jclouds.collect.PaginatedIterable; import org.jclouds.collect.PaginatedIterables; import org.jclouds.iam.domain.User; -import org.jclouds.iam.features.UserClient; +import org.jclouds.iam.features.UserApi; import org.jclouds.iam.options.ListUsersOptions; import com.google.common.base.Function; @@ -18,19 +18,19 @@ public class IAM { /** * List users based on the criteria in the {@link ListUsersOptions} passed in. * - * @param userClient - * the {@link UserClient} to use for the request + * @param userApi + * the {@link UserApi} to use for the request * @param options * the {@link ListUsersOptions} describing the ListUsers request * * @return iterable of users fitting the criteria */ - public static Iterable list(final UserClient userClient, final ListUsersOptions options) { - return PaginatedIterables.lazyContinue(userClient.list(options), new Function>() { + public static Iterable list(final UserApi userApi, final ListUsersOptions options) { + return PaginatedIterables.lazyContinue(userApi.list(options), new Function>() { @Override public PaginatedIterable apply(Object input) { - return userClient.list(options.clone().afterMarker(input)); + return userApi.list(options.clone().afterMarker(input)); } @Override diff --git a/labs/iam/src/main/java/org/jclouds/iam/IAMClient.java b/labs/iam/src/main/java/org/jclouds/iam/IAMApi.java similarity index 93% rename from labs/iam/src/main/java/org/jclouds/iam/IAMClient.java rename to labs/iam/src/main/java/org/jclouds/iam/IAMApi.java index 1a8ee42b8c..eb338a618a 100644 --- a/labs/iam/src/main/java/org/jclouds/iam/IAMClient.java +++ b/labs/iam/src/main/java/org/jclouds/iam/IAMApi.java @@ -22,7 +22,7 @@ import java.util.concurrent.TimeUnit; import org.jclouds.concurrent.Timeout; import org.jclouds.iam.domain.User; -import org.jclouds.iam.features.UserClient; +import org.jclouds.iam.features.UserApi; import org.jclouds.rest.annotations.Delegate; /** @@ -35,7 +35,7 @@ import org.jclouds.rest.annotations.Delegate; * @author Adrian Cole */ @Timeout(duration = 30, timeUnit = TimeUnit.SECONDS) -public interface IAMClient { +public interface IAMApi { /** * Retrieves information about the current user, including the user's path, GUID, and ARN. */ @@ -45,5 +45,5 @@ public interface IAMClient { * Provides synchronous access to User features. */ @Delegate - UserClient getUserClient(); + UserApi getUserApi(); } diff --git a/labs/iam/src/main/java/org/jclouds/iam/IAMApiMetadata.java b/labs/iam/src/main/java/org/jclouds/iam/IAMApiMetadata.java index 639a6eb259..0ebac547c8 100644 --- a/labs/iam/src/main/java/org/jclouds/iam/IAMApiMetadata.java +++ b/labs/iam/src/main/java/org/jclouds/iam/IAMApiMetadata.java @@ -41,7 +41,7 @@ public class IAMApiMetadata extends BaseRestApiMetadata { /** The serialVersionUID */ private static final long serialVersionUID = 3450830053589179249L; - public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { + public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { private static final long serialVersionUID = -5070937833892503232L; }; @@ -51,7 +51,7 @@ public class IAMApiMetadata extends BaseRestApiMetadata { } public IAMApiMetadata() { - this(new Builder(IAMClient.class, IAMAsyncClient.class)); + this(new Builder(IAMApi.class, IAMAsyncApi.class)); } protected IAMApiMetadata(Builder builder) { @@ -67,8 +67,8 @@ public class IAMApiMetadata extends BaseRestApiMetadata { public static class Builder extends BaseRestApiMetadata.Builder { - protected Builder(Class client, Class asyncClient) { - super(client, asyncClient); + protected Builder(Class api, Class asyncApi) { + super(api, asyncApi); id("iam") .name("Amazon IAM Api") .identityName("Access Key ID") @@ -92,4 +92,4 @@ public class IAMApiMetadata extends BaseRestApiMetadata { } } -} \ No newline at end of file +} diff --git a/labs/iam/src/main/java/org/jclouds/iam/IAMAsyncClient.java b/labs/iam/src/main/java/org/jclouds/iam/IAMAsyncApi.java similarity index 91% rename from labs/iam/src/main/java/org/jclouds/iam/IAMAsyncClient.java rename to labs/iam/src/main/java/org/jclouds/iam/IAMAsyncApi.java index a1be67c615..b772273ecc 100644 --- a/labs/iam/src/main/java/org/jclouds/iam/IAMAsyncClient.java +++ b/labs/iam/src/main/java/org/jclouds/iam/IAMAsyncApi.java @@ -23,7 +23,7 @@ import javax.ws.rs.Path; import org.jclouds.aws.filters.FormSigner; import org.jclouds.iam.domain.User; -import org.jclouds.iam.features.UserAsyncClient; +import org.jclouds.iam.features.UserAsyncApi; import org.jclouds.iam.xml.UserHandler; import org.jclouds.rest.annotations.Delegate; import org.jclouds.rest.annotations.FormParams; @@ -44,10 +44,10 @@ import com.google.common.util.concurrent.ListenableFuture; */ @RequestFilters(FormSigner.class) @VirtualHost -public interface IAMAsyncClient { +public interface IAMAsyncApi { /** - * @see IAMClient#getCurrentUser() + * @see IAMApi#getCurrentUser() */ @POST @Path("/") @@ -59,6 +59,6 @@ public interface IAMAsyncClient { * Provides asynchronous access to User features. */ @Delegate - UserAsyncClient getUserClient(); + UserAsyncApi getUserApi(); } diff --git a/labs/iam/src/main/java/org/jclouds/iam/config/IAMRestClientModule.java b/labs/iam/src/main/java/org/jclouds/iam/config/IAMRestClientModule.java index c570fec38c..25e0c165e2 100644 --- a/labs/iam/src/main/java/org/jclouds/iam/config/IAMRestClientModule.java +++ b/labs/iam/src/main/java/org/jclouds/iam/config/IAMRestClientModule.java @@ -21,10 +21,10 @@ package org.jclouds.iam.config; import java.util.Map; import org.jclouds.aws.config.FormSigningRestClientModule; -import org.jclouds.iam.IAMAsyncClient; -import org.jclouds.iam.IAMClient; -import org.jclouds.iam.features.UserAsyncClient; -import org.jclouds.iam.features.UserClient; +import org.jclouds.iam.IAMAsyncApi; +import org.jclouds.iam.IAMApi; +import org.jclouds.iam.features.UserAsyncApi; +import org.jclouds.iam.features.UserApi; import org.jclouds.rest.ConfiguresRestClient; import com.google.common.collect.ImmutableMap; @@ -36,13 +36,13 @@ import com.google.common.reflect.TypeToken; * @author Adrian Cole */ @ConfiguresRestClient -public class IAMRestClientModule extends FormSigningRestClientModule { +public class IAMRestClientModule extends FormSigningRestClientModule { public static final Map, Class> DELEGATE_MAP = ImmutableMap., Class> builder()// - .put(UserClient.class, UserAsyncClient.class) + .put(UserApi.class, UserAsyncApi.class) .build(); public IAMRestClientModule() { - super(TypeToken.of(IAMClient.class), TypeToken.of(IAMAsyncClient.class), DELEGATE_MAP); + super(TypeToken.of(IAMApi.class), TypeToken.of(IAMAsyncApi.class), DELEGATE_MAP); } } diff --git a/labs/iam/src/main/java/org/jclouds/iam/features/UserClient.java b/labs/iam/src/main/java/org/jclouds/iam/features/UserApi.java similarity index 98% rename from labs/iam/src/main/java/org/jclouds/iam/features/UserClient.java rename to labs/iam/src/main/java/org/jclouds/iam/features/UserApi.java index 2938bba932..162d68dca0 100644 --- a/labs/iam/src/main/java/org/jclouds/iam/features/UserClient.java +++ b/labs/iam/src/main/java/org/jclouds/iam/features/UserApi.java @@ -34,7 +34,7 @@ import org.jclouds.javax.annotation.Nullable; * @author Adrian Cole */ @Timeout(duration = 30, timeUnit = TimeUnit.SECONDS) -public interface UserClient { +public interface UserApi { /** * Retrieves information about the current user, including the user's path, GUID, and ARN. */ diff --git a/labs/iam/src/main/java/org/jclouds/iam/features/UserAsyncClient.java b/labs/iam/src/main/java/org/jclouds/iam/features/UserAsyncApi.java similarity index 93% rename from labs/iam/src/main/java/org/jclouds/iam/features/UserAsyncClient.java rename to labs/iam/src/main/java/org/jclouds/iam/features/UserAsyncApi.java index 989687f256..081d524863 100644 --- a/labs/iam/src/main/java/org/jclouds/iam/features/UserAsyncClient.java +++ b/labs/iam/src/main/java/org/jclouds/iam/features/UserAsyncApi.java @@ -46,10 +46,10 @@ import com.google.common.util.concurrent.ListenableFuture; */ @RequestFilters(FormSigner.class) @VirtualHost -public interface UserAsyncClient { +public interface UserAsyncApi { /** - * @see UserClient#getCurrent() + * @see UserApi#getCurrent() */ @POST @Path("/") @@ -58,7 +58,7 @@ public interface UserAsyncClient { ListenableFuture getCurrent(); /** - * @see UserClient#get() + * @see UserApi#get() */ @POST @Path("/") @@ -68,7 +68,7 @@ public interface UserAsyncClient { ListenableFuture get(@FormParam("UserName") String name); /** - * @see UserClient#list() + * @see UserApi#list() */ @POST @Path("/") @@ -77,7 +77,7 @@ public interface UserAsyncClient { ListenableFuture> list(); /** - * @see UserClient#list(ListUsersOptions) + * @see UserApi#list(ListUsersOptions) */ @POST @Path("/") diff --git a/labs/iam/src/test/java/org/jclouds/iam/IAMClientLiveTest.java b/labs/iam/src/test/java/org/jclouds/iam/IAMApiLiveTest.java similarity index 79% rename from labs/iam/src/test/java/org/jclouds/iam/IAMClientLiveTest.java rename to labs/iam/src/test/java/org/jclouds/iam/IAMApiLiveTest.java index 46678dd54c..3f964785d1 100644 --- a/labs/iam/src/test/java/org/jclouds/iam/IAMClientLiveTest.java +++ b/labs/iam/src/test/java/org/jclouds/iam/IAMApiLiveTest.java @@ -30,29 +30,29 @@ import com.google.common.reflect.TypeToken; * * @author Adrian Cole */ -public class IAMClientLiveTest extends BaseContextLiveTest> { +public class IAMApiLiveTest extends BaseContextLiveTest> { - public IAMClientLiveTest() { + public IAMApiLiveTest() { provider = "iam"; } - private IAMClient client; + private IAMApi api; @Override @BeforeClass(groups = { "integration", "live" }) public void setupContext() { super.setupContext(); - client = context.getApi(); + api = context.getApi(); } @Override - protected TypeToken> contextType() { + protected TypeToken> contextType() { return IAMApiMetadata.CONTEXT_TOKEN; } @Test protected void testWired() { - client.getCurrentUser(); + api.getCurrentUser(); } } diff --git a/labs/iam/src/test/java/org/jclouds/iam/IAMTest.java b/labs/iam/src/test/java/org/jclouds/iam/IAMTest.java index 91fe5d32c8..35f36fbb67 100644 --- a/labs/iam/src/test/java/org/jclouds/iam/IAMTest.java +++ b/labs/iam/src/test/java/org/jclouds/iam/IAMTest.java @@ -8,7 +8,7 @@ import org.easymock.EasyMock; import org.jclouds.collect.PaginatedIterable; import org.jclouds.collect.PaginatedIterables; import org.jclouds.iam.domain.User; -import org.jclouds.iam.features.UserClient; +import org.jclouds.iam.features.UserApi; import org.jclouds.iam.options.ListUsersOptions; import org.testng.Assert; import org.testng.annotations.Test; @@ -27,37 +27,37 @@ public class IAMTest { @Test public void testSinglePageResult() throws Exception { - UserClient userClient = createMock(UserClient.class); + UserApi userApi = createMock(UserApi.class); ListUsersOptions options = new ListUsersOptions(); PaginatedIterable response = PaginatedIterables.forward(ImmutableSet.of(createMock(User.class))); - expect(userClient.list(options)) + expect(userApi.list(options)) .andReturn(response) .once(); - EasyMock.replay(userClient); + EasyMock.replay(userApi); - Assert.assertEquals(1, Iterables.size(IAM.list(userClient, options))); + Assert.assertEquals(1, Iterables.size(IAM.list(userApi, options))); } @Test public void testMultiPageResult() throws Exception { - UserClient userClient = createMock(UserClient.class); + UserApi userApi = createMock(UserApi.class); ListUsersOptions options = new ListUsersOptions(); PaginatedIterable response1 = PaginatedIterables.forwardWithMarker(ImmutableSet.of(createMock(User.class)), "NEXTTOKEN"); PaginatedIterable response2 = PaginatedIterables.forward(ImmutableSet.of(createMock(User.class))); - expect(userClient.list(anyObject(ListUsersOptions.class))) + expect(userApi.list(anyObject(ListUsersOptions.class))) .andReturn(response1) .once(); - expect(userClient.list(anyObject(ListUsersOptions.class))) + expect(userApi.list(anyObject(ListUsersOptions.class))) .andReturn(response2) .once(); - EasyMock.replay(userClient); + EasyMock.replay(userApi); - Assert.assertEquals(2, Iterables.size(IAM.list(userClient, options))); + Assert.assertEquals(2, Iterables.size(IAM.list(userApi, options))); } } diff --git a/labs/iam/src/test/java/org/jclouds/iam/features/UserClientExpectTest.java b/labs/iam/src/test/java/org/jclouds/iam/features/UserApiExpectTest.java similarity index 87% rename from labs/iam/src/test/java/org/jclouds/iam/features/UserClientExpectTest.java rename to labs/iam/src/test/java/org/jclouds/iam/features/UserApiExpectTest.java index 8e591b86e4..267f5a8fc0 100644 --- a/labs/iam/src/test/java/org/jclouds/iam/features/UserClientExpectTest.java +++ b/labs/iam/src/test/java/org/jclouds/iam/features/UserApiExpectTest.java @@ -27,8 +27,8 @@ import java.util.TimeZone; import org.jclouds.http.HttpRequest; import org.jclouds.http.HttpResponse; -import org.jclouds.iam.IAMClient; -import org.jclouds.iam.internal.BaseIAMClientExpectTest; +import org.jclouds.iam.IAMApi; +import org.jclouds.iam.internal.BaseIAMApiExpectTest; import org.jclouds.iam.parse.GetUserResponseTest; import org.jclouds.iam.parse.ListUsersResponseTest; import org.jclouds.rest.ResourceNotFoundException; @@ -39,10 +39,10 @@ import com.google.common.collect.ImmutableMultimap; /** * @author Adrian Cole */ -@Test(groups = "unit", testName = "UserClientExpectTest") -public class UserClientExpectTest extends BaseIAMClientExpectTest { +@Test(groups = "unit", testName = "UserApiExpectTest") +public class UserApiExpectTest extends BaseIAMApiExpectTest { - public UserClientExpectTest() { + public UserApiExpectTest() { TimeZone.setDefault(TimeZone.getTimeZone("America/Los_Angeles")); } @@ -67,10 +67,10 @@ public class UserClientExpectTest extends BaseIAMClientExpectTest { HttpResponse getResponse = HttpResponse.builder().statusCode(200) .payload(payloadFromResourceWithContentType("/get_user.xml", "text/xml")).build(); - IAMClient clientWhenExist = requestSendsResponse( + IAMApi apiWhenExist = requestSendsResponse( get, getResponse); - assertEquals(clientWhenExist.getUserClient().getCurrent().toString(), new GetUserResponseTest().expected().toString()); + assertEquals(apiWhenExist.getUserApi().getCurrent().toString(), new GetUserResponseTest().expected().toString()); } HttpRequest get = HttpRequest.builder() @@ -98,20 +98,20 @@ public class UserClientExpectTest extends BaseIAMClientExpectTest { HttpResponse getResponse = HttpResponse.builder().statusCode(200) .payload(payloadFromResourceWithContentType("/get_user.xml", "text/xml")).build(); - IAMClient clientWhenExist = requestSendsResponse( + IAMApi apiWhenExist = requestSendsResponse( get, getResponse); - assertEquals(clientWhenExist.getUserClient().get("name").toString(), new GetUserResponseTest().expected().toString()); + assertEquals(apiWhenExist.getUserApi().get("name").toString(), new GetUserResponseTest().expected().toString()); } public void testGetWhenResponseIs404() throws Exception { HttpResponse getResponse = HttpResponse.builder().statusCode(404).build(); - IAMClient clientWhenDontExist = requestSendsResponse( + IAMApi apiWhenDontExist = requestSendsResponse( get, getResponse); - assertNull(clientWhenDontExist.getUserClient().get("name")); + assertNull(apiWhenDontExist.getUserApi().get("name")); } HttpRequest list = HttpRequest.builder() @@ -137,10 +137,10 @@ public class UserClientExpectTest extends BaseIAMClientExpectTest { HttpResponse listResponse = HttpResponse.builder().statusCode(200) .payload(payloadFromResourceWithContentType("/list_users.xml", "text/xml")).build(); - IAMClient clientWhenExist = requestSendsResponse( + IAMApi apiWhenExist = requestSendsResponse( list, listResponse); - assertEquals(clientWhenExist.getUserClient().list().toString(), new ListUsersResponseTest().expected().toString()); + assertEquals(apiWhenExist.getUserApi().list().toString(), new ListUsersResponseTest().expected().toString()); } // TODO: this should really be an empty set @@ -149,10 +149,10 @@ public class UserClientExpectTest extends BaseIAMClientExpectTest { HttpResponse listResponse = HttpResponse.builder().statusCode(404).build(); - IAMClient clientWhenDontExist = requestSendsResponse( + IAMApi apiWhenDontExist = requestSendsResponse( list, listResponse); - clientWhenDontExist.getUserClient().list(); + apiWhenDontExist.getUserApi().list(); } public void testListWithOptionsWhenResponseIs2xx() throws Exception { @@ -179,10 +179,10 @@ public class UserClientExpectTest extends BaseIAMClientExpectTest { HttpResponse listWithOptionsResponse = HttpResponse.builder().statusCode(200) .payload(payloadFromResourceWithContentType("/list_users.xml", "text/xml")).build(); - IAMClient clientWhenWithOptionsExist = requestSendsResponse(listWithOptions, + IAMApi apiWhenWithOptionsExist = requestSendsResponse(listWithOptions, listWithOptionsResponse); - assertEquals(clientWhenWithOptionsExist.getUserClient().list(pathPrefix("/foo").afterMarker("MARKER")).toString(), + assertEquals(apiWhenWithOptionsExist.getUserApi().list(pathPrefix("/foo").afterMarker("MARKER")).toString(), new ListUsersResponseTest().expected().toString()); } } diff --git a/labs/iam/src/test/java/org/jclouds/iam/features/UserClientLiveTest.java b/labs/iam/src/test/java/org/jclouds/iam/features/UserApiLiveTest.java similarity index 79% rename from labs/iam/src/test/java/org/jclouds/iam/features/UserClientLiveTest.java rename to labs/iam/src/test/java/org/jclouds/iam/features/UserApiLiveTest.java index 72ff85ba5c..04c83decbe 100644 --- a/labs/iam/src/test/java/org/jclouds/iam/features/UserClientLiveTest.java +++ b/labs/iam/src/test/java/org/jclouds/iam/features/UserApiLiveTest.java @@ -22,7 +22,7 @@ import static com.google.common.base.Preconditions.checkNotNull; import org.jclouds.collect.PaginatedIterable; import org.jclouds.iam.domain.User; -import org.jclouds.iam.internal.BaseIAMClientLiveTest; +import org.jclouds.iam.internal.BaseIAMApiLiveTest; import org.jclouds.iam.options.ListUsersOptions; import org.testng.Assert; import org.testng.annotations.Test; @@ -32,12 +32,12 @@ import com.google.common.collect.Iterables; /** * @author Adrian Cole */ -@Test(groups = "live", testName = "UserClientLiveTest") -public class UserClientLiveTest extends BaseIAMClientLiveTest { +@Test(groups = "live", testName = "UserApiLiveTest") +public class UserApiLiveTest extends BaseIAMApiLiveTest { @Test protected void testGetCurrentUser() { - User user = client().getCurrent(); + User user = api().getCurrent(); checkUser(user); } @@ -51,7 +51,7 @@ public class UserClientLiveTest extends BaseIAMClientLiveTest { @Test protected void testListUsers() { - PaginatedIterable response = client().list(); + PaginatedIterable response = api().list(); for (User user : response) { checkUser(user); @@ -59,17 +59,17 @@ public class UserClientLiveTest extends BaseIAMClientLiveTest { if (Iterables.size(response) > 0) { User user = response.iterator().next(); - Assert.assertEquals(client().get(user.getName().get()), user); + Assert.assertEquals(api().get(user.getName().get()), user); } // Test with a Marker, even if it's null - response = client().list(ListUsersOptions.Builder.afterMarker(response.getNextMarker())); + response = api().list(ListUsersOptions.Builder.afterMarker(response.getNextMarker())); for (User user : response) { checkUser(user); } } - protected UserClient client() { - return context.getApi().getUserClient(); + protected UserApi api() { + return context.getApi().getUserApi(); } } diff --git a/labs/iam/src/test/java/org/jclouds/iam/internal/BaseIAMClientExpectTest.java b/labs/iam/src/test/java/org/jclouds/iam/internal/BaseIAMApiExpectTest.java similarity index 88% rename from labs/iam/src/test/java/org/jclouds/iam/internal/BaseIAMClientExpectTest.java rename to labs/iam/src/test/java/org/jclouds/iam/internal/BaseIAMApiExpectTest.java index 6e8dd28cb9..8be851b555 100644 --- a/labs/iam/src/test/java/org/jclouds/iam/internal/BaseIAMClientExpectTest.java +++ b/labs/iam/src/test/java/org/jclouds/iam/internal/BaseIAMApiExpectTest.java @@ -18,12 +18,12 @@ */ package org.jclouds.iam.internal; -import org.jclouds.iam.IAMClient; +import org.jclouds.iam.IAMApi; /** * * @author Adrian Cole */ -public class BaseIAMClientExpectTest extends BaseIAMExpectTest { +public class BaseIAMApiExpectTest extends BaseIAMExpectTest { } diff --git a/labs/iam/src/test/java/org/jclouds/iam/internal/BaseIAMClientLiveTest.java b/labs/iam/src/test/java/org/jclouds/iam/internal/BaseIAMApiLiveTest.java similarity index 77% rename from labs/iam/src/test/java/org/jclouds/iam/internal/BaseIAMClientLiveTest.java rename to labs/iam/src/test/java/org/jclouds/iam/internal/BaseIAMApiLiveTest.java index 617f7f2cf4..d6b989f7a1 100644 --- a/labs/iam/src/test/java/org/jclouds/iam/internal/BaseIAMClientLiveTest.java +++ b/labs/iam/src/test/java/org/jclouds/iam/internal/BaseIAMApiLiveTest.java @@ -20,8 +20,8 @@ package org.jclouds.iam.internal; import org.jclouds.apis.BaseContextLiveTest; import org.jclouds.iam.IAMApiMetadata; -import org.jclouds.iam.IAMAsyncClient; -import org.jclouds.iam.IAMClient; +import org.jclouds.iam.IAMAsyncApi; +import org.jclouds.iam.IAMApi; import org.jclouds.rest.RestContext; import org.testng.annotations.Test; @@ -32,15 +32,15 @@ import com.google.common.reflect.TypeToken; * @author Adrian Cole */ @Test(groups = "live") -public class BaseIAMClientLiveTest extends - BaseContextLiveTest> { +public class BaseIAMApiLiveTest extends + BaseContextLiveTest> { - public BaseIAMClientLiveTest() { + public BaseIAMApiLiveTest() { provider = "iam"; } @Override - protected TypeToken> contextType() { + protected TypeToken> contextType() { return IAMApiMetadata.CONTEXT_TOKEN; } diff --git a/labs/iam/src/test/java/org/jclouds/iam/internal/BaseIAMAsyncClientExpectTest.java b/labs/iam/src/test/java/org/jclouds/iam/internal/BaseIAMAsyncApiExpectTest.java similarity index 81% rename from labs/iam/src/test/java/org/jclouds/iam/internal/BaseIAMAsyncClientExpectTest.java rename to labs/iam/src/test/java/org/jclouds/iam/internal/BaseIAMAsyncApiExpectTest.java index daa3407fd9..39b46d2406 100644 --- a/labs/iam/src/test/java/org/jclouds/iam/internal/BaseIAMAsyncClientExpectTest.java +++ b/labs/iam/src/test/java/org/jclouds/iam/internal/BaseIAMAsyncApiExpectTest.java @@ -22,7 +22,7 @@ import java.util.Properties; import org.jclouds.http.HttpRequest; import org.jclouds.http.HttpResponse; -import org.jclouds.iam.IAMAsyncClient; +import org.jclouds.iam.IAMAsyncApi; import com.google.common.base.Function; import com.google.inject.Module; @@ -31,8 +31,8 @@ import com.google.inject.Module; * * @author Adrian Cole */ -public class BaseIAMAsyncClientExpectTest extends BaseIAMExpectTest { - public IAMAsyncClient createClient(Function fn, Module module, Properties props) { - return createInjector(fn, module, props).getInstance(IAMAsyncClient.class); +public class BaseIAMAsyncApiExpectTest extends BaseIAMExpectTest { + public IAMAsyncApi createApi(Function fn, Module module, Properties props) { + return createInjector(fn, module, props).getInstance(IAMAsyncApi.class); } } diff --git a/labs/iam/src/test/java/org/jclouds/iam/internal/BaseIAMExpectTest.java b/labs/iam/src/test/java/org/jclouds/iam/internal/BaseIAMExpectTest.java index da0b890ccc..4fbb7e684d 100644 --- a/labs/iam/src/test/java/org/jclouds/iam/internal/BaseIAMExpectTest.java +++ b/labs/iam/src/test/java/org/jclouds/iam/internal/BaseIAMExpectTest.java @@ -21,7 +21,7 @@ package org.jclouds.iam.internal; import org.jclouds.date.DateService; import org.jclouds.iam.config.IAMRestClientModule; import org.jclouds.rest.ConfiguresRestClient; -import org.jclouds.rest.internal.BaseRestClientExpectTest; +import org.jclouds.rest.internal.BaseRestApiExpectTest; import com.google.inject.Module; @@ -29,7 +29,7 @@ import com.google.inject.Module; * * @author Adrian Cole */ -public class BaseIAMExpectTest extends BaseRestClientExpectTest { +public class BaseIAMExpectTest extends BaseRestApiExpectTest { public BaseIAMExpectTest() { provider = "iam"; diff --git a/labs/rds/src/main/java/org/jclouds/rds/RDS.java b/labs/rds/src/main/java/org/jclouds/rds/RDS.java index b6d72e9199..519e9c7d14 100644 --- a/labs/rds/src/main/java/org/jclouds/rds/RDS.java +++ b/labs/rds/src/main/java/org/jclouds/rds/RDS.java @@ -5,9 +5,9 @@ import org.jclouds.collect.PaginatedIterables; import org.jclouds.rds.domain.Instance; import org.jclouds.rds.domain.SecurityGroup; import org.jclouds.rds.domain.SubnetGroup; -import org.jclouds.rds.features.InstanceClient; -import org.jclouds.rds.features.SecurityGroupClient; -import org.jclouds.rds.features.SubnetGroupClient; +import org.jclouds.rds.features.InstanceApi; +import org.jclouds.rds.features.SecurityGroupApi; +import org.jclouds.rds.features.SubnetGroupApi; import org.jclouds.rds.options.ListInstancesOptions; import org.jclouds.rds.options.ListSecurityGroupsOptions; import org.jclouds.rds.options.ListSubnetGroupsOptions; @@ -24,21 +24,21 @@ public class RDS { /** * List instances based on the criteria in the {@link ListInstancesOptions} passed in. * - * @param instanceClient - * the {@link InstanceClient} to use for the request + * @param instanceApi + * the {@link InstanceApi} to use for the request * @param options * the {@link ListInstancesOptions} describing the ListInstances request * * @return iterable of instances fitting the criteria */ - public static Iterable listInstances(final InstanceClient instanceClient, + public static Iterable listInstances(final InstanceApi instanceApi, final ListInstancesOptions options) { - return PaginatedIterables.lazyContinue(instanceClient.list(options), + return PaginatedIterables.lazyContinue(instanceApi.list(options), new Function>() { @Override public PaginatedIterable apply(Object input) { - return instanceClient.list(options.clone().afterMarker(input)); + return instanceApi.list(options.clone().afterMarker(input)); } @Override @@ -48,28 +48,28 @@ public class RDS { }); } - public static Iterable listInstances(InstanceClient instanceClient) { - return listInstances(instanceClient, new ListInstancesOptions()); + public static Iterable listInstances(InstanceApi instanceApi) { + return listInstances(instanceApi, new ListInstancesOptions()); } /** * List securityGroups based on the criteria in the {@link ListSecurityGroupsOptions} passed in. * - * @param securityGroupClient - * the {@link SecurityGroupClient} to use for the request + * @param securityGroupApi + * the {@link SecurityGroupApi} to use for the request * @param options * the {@link ListSecurityGroupsOptions} describing the ListSecurityGroups request * * @return iterable of securityGroups fitting the criteria */ - public static Iterable listSecurityGroups(final SecurityGroupClient securityGroupClient, + public static Iterable listSecurityGroups(final SecurityGroupApi securityGroupApi, final ListSecurityGroupsOptions options) { - return PaginatedIterables.lazyContinue(securityGroupClient.list(options), + return PaginatedIterables.lazyContinue(securityGroupApi.list(options), new Function>() { @Override public PaginatedIterable apply(Object input) { - return securityGroupClient.list(options.clone().afterMarker(input)); + return securityGroupApi.list(options.clone().afterMarker(input)); } @Override @@ -79,28 +79,28 @@ public class RDS { }); } - public static Iterable listSecurityGroups(SecurityGroupClient securityGroupClient) { - return listSecurityGroups(securityGroupClient, new ListSecurityGroupsOptions()); + public static Iterable listSecurityGroups(SecurityGroupApi securityGroupApi) { + return listSecurityGroups(securityGroupApi, new ListSecurityGroupsOptions()); } /** * List subnetGroups based on the criteria in the {@link ListSubnetGroupsOptions} passed in. * - * @param subnetGroupClient - * the {@link SubnetGroupClient} to use for the request + * @param subnetGroupApi + * the {@link SubnetGroupApi} to use for the request * @param options * the {@link ListSubnetGroupsOptions} describing the ListSubnetGroups request * * @return iterable of subnetGroups fitting the criteria */ - public static Iterable listSubnetGroups(final SubnetGroupClient subnetGroupClient, + public static Iterable listSubnetGroups(final SubnetGroupApi subnetGroupApi, final ListSubnetGroupsOptions options) { - return PaginatedIterables.lazyContinue(subnetGroupClient.list(options), + return PaginatedIterables.lazyContinue(subnetGroupApi.list(options), new Function>() { @Override public PaginatedIterable apply(Object input) { - return subnetGroupClient.list(options.clone().afterMarker(input)); + return subnetGroupApi.list(options.clone().afterMarker(input)); } @Override @@ -110,8 +110,8 @@ public class RDS { }); } - public static Iterable listSubnetGroups(SubnetGroupClient subnetGroupClient) { - return listSubnetGroups(subnetGroupClient, new ListSubnetGroupsOptions()); + public static Iterable listSubnetGroups(SubnetGroupApi subnetGroupApi) { + return listSubnetGroups(subnetGroupApi, new ListSubnetGroupsOptions()); } } diff --git a/labs/rds/src/main/java/org/jclouds/rds/RDSClient.java b/labs/rds/src/main/java/org/jclouds/rds/RDSApi.java similarity index 81% rename from labs/rds/src/main/java/org/jclouds/rds/RDSClient.java rename to labs/rds/src/main/java/org/jclouds/rds/RDSApi.java index a2d557b5b9..1e548b9a14 100644 --- a/labs/rds/src/main/java/org/jclouds/rds/RDSClient.java +++ b/labs/rds/src/main/java/org/jclouds/rds/RDSApi.java @@ -26,9 +26,9 @@ import javax.annotation.Nullable; import org.jclouds.concurrent.Timeout; import org.jclouds.location.Region; import org.jclouds.location.functions.RegionToEndpointOrProviderIfNull; -import org.jclouds.rds.features.InstanceClient; -import org.jclouds.rds.features.SecurityGroupClient; -import org.jclouds.rds.features.SubnetGroupClient; +import org.jclouds.rds.features.InstanceApi; +import org.jclouds.rds.features.SecurityGroupApi; +import org.jclouds.rds.features.SubnetGroupApi; import org.jclouds.rest.annotations.Delegate; import org.jclouds.rest.annotations.EndpointParam; @@ -40,11 +40,11 @@ import com.google.inject.Provides; *

* * @author Adrian Cole - * @see RDSAsyncClient + * @see RDSAsyncApi */ @Beta @Timeout(duration = 30, timeUnit = TimeUnit.SECONDS) -public interface RDSClient { +public interface RDSApi { /** * * @return the Region codes configured @@ -57,30 +57,30 @@ public interface RDSClient { * Provides synchronous access to Instance features. */ @Delegate - InstanceClient getInstanceClient(); + InstanceApi getInstanceApi(); @Delegate - InstanceClient getInstanceClientForRegion( + InstanceApi getInstanceApiForRegion( @EndpointParam(parser = RegionToEndpointOrProviderIfNull.class) @Nullable String region); /** * Provides synchronous access to SecurityGroup features. */ @Delegate - SecurityGroupClient getSecurityGroupClient(); + SecurityGroupApi getSecurityGroupApi(); @Delegate - SecurityGroupClient getSecurityGroupClientForRegion( + SecurityGroupApi getSecurityGroupApiForRegion( @EndpointParam(parser = RegionToEndpointOrProviderIfNull.class) @Nullable String region); /** * Provides synchronous access to SubnetGroup features. */ @Delegate - SubnetGroupClient getSubnetGroupClient(); + SubnetGroupApi getSubnetGroupApi(); @Delegate - SubnetGroupClient getSubnetGroupClientForRegion( + SubnetGroupApi getSubnetGroupApiForRegion( @EndpointParam(parser = RegionToEndpointOrProviderIfNull.class) @Nullable String region); } diff --git a/labs/rds/src/main/java/org/jclouds/rds/RDSApiMetadata.java b/labs/rds/src/main/java/org/jclouds/rds/RDSApiMetadata.java index 8b148968fc..90c4d7266d 100644 --- a/labs/rds/src/main/java/org/jclouds/rds/RDSApiMetadata.java +++ b/labs/rds/src/main/java/org/jclouds/rds/RDSApiMetadata.java @@ -43,7 +43,7 @@ public class RDSApiMetadata extends BaseRestApiMetadata { /** The serialVersionUID */ private static final long serialVersionUID = -7077953935392202824L; - public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { + public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { private static final long serialVersionUID = -5070937833892503232L; }; @@ -53,7 +53,7 @@ public class RDSApiMetadata extends BaseRestApiMetadata { } public RDSApiMetadata() { - this(new Builder(RDSClient.class, RDSAsyncClient.class)); + this(new Builder(RDSApi.class, RDSAsyncApi.class)); } protected RDSApiMetadata(Builder builder) { @@ -69,8 +69,8 @@ public class RDSApiMetadata extends BaseRestApiMetadata { public static class Builder extends BaseRestApiMetadata.Builder { - protected Builder(Class client, Class asyncClient) { - super(client, asyncClient); + protected Builder(Class api, Class asyncApi) { + super(api, asyncApi); id("rds") .name("Amazon Relational Database Service Api") .identityName("Access Key ID") diff --git a/labs/rds/src/main/java/org/jclouds/rds/RDSAsyncClient.java b/labs/rds/src/main/java/org/jclouds/rds/RDSAsyncApi.java similarity index 81% rename from labs/rds/src/main/java/org/jclouds/rds/RDSAsyncClient.java rename to labs/rds/src/main/java/org/jclouds/rds/RDSAsyncApi.java index 8ca159a664..b61cb914d3 100644 --- a/labs/rds/src/main/java/org/jclouds/rds/RDSAsyncClient.java +++ b/labs/rds/src/main/java/org/jclouds/rds/RDSAsyncApi.java @@ -25,9 +25,9 @@ import javax.annotation.Nullable; import org.jclouds.aws.filters.FormSigner; import org.jclouds.location.Region; import org.jclouds.location.functions.RegionToEndpointOrProviderIfNull; -import org.jclouds.rds.features.InstanceAsyncClient; -import org.jclouds.rds.features.SecurityGroupAsyncClient; -import org.jclouds.rds.features.SubnetGroupAsyncClient; +import org.jclouds.rds.features.InstanceAsyncApi; +import org.jclouds.rds.features.SecurityGroupAsyncApi; +import org.jclouds.rds.features.SubnetGroupAsyncApi; import org.jclouds.rest.annotations.Delegate; import org.jclouds.rest.annotations.EndpointParam; import org.jclouds.rest.annotations.RequestFilters; @@ -47,7 +47,7 @@ import com.google.inject.Provides; @Beta @RequestFilters(FormSigner.class) @VirtualHost -public interface RDSAsyncClient { +public interface RDSAsyncApi { /** * * @return the Region codes configured @@ -60,30 +60,30 @@ public interface RDSAsyncClient { * Provides asynchronous access to Instance features. */ @Delegate - InstanceAsyncClient getInstanceClient(); + InstanceAsyncApi getInstanceApi(); @Delegate - InstanceAsyncClient getInstanceClientForRegion( + InstanceAsyncApi getInstanceApiForRegion( @EndpointParam(parser = RegionToEndpointOrProviderIfNull.class) @Nullable String region); /** * Provides asynchronous access to SecurityGroup features. */ @Delegate - SecurityGroupAsyncClient getSecurityGroupClient(); + SecurityGroupAsyncApi getSecurityGroupApi(); @Delegate - SecurityGroupAsyncClient getSecurityGroupClientForRegion( + SecurityGroupAsyncApi getSecurityGroupApiForRegion( @EndpointParam(parser = RegionToEndpointOrProviderIfNull.class) @Nullable String region); /** * Provides asynchronous access to SubnetGroup features. */ @Delegate - SubnetGroupAsyncClient getSubnetGroupClient(); + SubnetGroupAsyncApi getSubnetGroupApi(); @Delegate - SubnetGroupAsyncClient getSubnetGroupClientForRegion( + SubnetGroupAsyncApi getSubnetGroupApiForRegion( @EndpointParam(parser = RegionToEndpointOrProviderIfNull.class) @Nullable String region); } diff --git a/labs/rds/src/main/java/org/jclouds/rds/config/RDSRestClientModule.java b/labs/rds/src/main/java/org/jclouds/rds/config/RDSRestClientModule.java index 83b561f5dc..617981b96f 100644 --- a/labs/rds/src/main/java/org/jclouds/rds/config/RDSRestClientModule.java +++ b/labs/rds/src/main/java/org/jclouds/rds/config/RDSRestClientModule.java @@ -21,14 +21,14 @@ package org.jclouds.rds.config; import java.util.Map; import org.jclouds.aws.config.FormSigningRestClientModule; -import org.jclouds.rds.RDSAsyncClient; -import org.jclouds.rds.RDSClient; -import org.jclouds.rds.features.InstanceAsyncClient; -import org.jclouds.rds.features.InstanceClient; -import org.jclouds.rds.features.SecurityGroupAsyncClient; -import org.jclouds.rds.features.SecurityGroupClient; -import org.jclouds.rds.features.SubnetGroupAsyncClient; -import org.jclouds.rds.features.SubnetGroupClient; +import org.jclouds.rds.RDSAsyncApi; +import org.jclouds.rds.RDSApi; +import org.jclouds.rds.features.InstanceAsyncApi; +import org.jclouds.rds.features.InstanceApi; +import org.jclouds.rds.features.SecurityGroupAsyncApi; +import org.jclouds.rds.features.SecurityGroupApi; +import org.jclouds.rds.features.SubnetGroupAsyncApi; +import org.jclouds.rds.features.SubnetGroupApi; import org.jclouds.rest.ConfiguresRestClient; import com.google.common.collect.ImmutableMap; @@ -40,14 +40,14 @@ import com.google.common.reflect.TypeToken; * @author Adrian Cole */ @ConfiguresRestClient -public class RDSRestClientModule extends FormSigningRestClientModule { +public class RDSRestClientModule extends FormSigningRestClientModule { public static final Map, Class> DELEGATE_MAP = ImmutableMap., Class> builder()// - .put(InstanceClient.class, InstanceAsyncClient.class) - .put(SecurityGroupClient.class, SecurityGroupAsyncClient.class) - .put(SubnetGroupClient.class, SubnetGroupAsyncClient.class) + .put(InstanceApi.class, InstanceAsyncApi.class) + .put(SecurityGroupApi.class, SecurityGroupAsyncApi.class) + .put(SubnetGroupApi.class, SubnetGroupAsyncApi.class) .build(); public RDSRestClientModule() { - super(TypeToken.of(RDSClient.class), TypeToken.of(RDSAsyncClient.class), DELEGATE_MAP); + super(TypeToken.of(RDSApi.class), TypeToken.of(RDSAsyncApi.class), DELEGATE_MAP); } } diff --git a/labs/rds/src/main/java/org/jclouds/rds/domain/Instance.java b/labs/rds/src/main/java/org/jclouds/rds/domain/Instance.java index bd2716cdc6..1fe7a28c86 100644 --- a/labs/rds/src/main/java/org/jclouds/rds/domain/Instance.java +++ b/labs/rds/src/main/java/org/jclouds/rds/domain/Instance.java @@ -36,7 +36,7 @@ import com.google.common.net.HostAndPort; * *

Note

* - * Amazon RDS supports access from any standard SQL client application. Amazon RDS does not allow + * Amazon RDS supports access from any standard SQL api application. Amazon RDS does not allow * direct host access via Telnet, Secure Shell (SSH), or Windows Remote Desktop Connection. * * diff --git a/labs/rds/src/main/java/org/jclouds/rds/features/InstanceClient.java b/labs/rds/src/main/java/org/jclouds/rds/features/InstanceApi.java similarity index 97% rename from labs/rds/src/main/java/org/jclouds/rds/features/InstanceClient.java rename to labs/rds/src/main/java/org/jclouds/rds/features/InstanceApi.java index 11cdf040fc..1a63d76a8d 100644 --- a/labs/rds/src/main/java/org/jclouds/rds/features/InstanceClient.java +++ b/labs/rds/src/main/java/org/jclouds/rds/features/InstanceApi.java @@ -31,11 +31,11 @@ import org.jclouds.rds.options.ListInstancesOptions; *

* * @see doc - * @see InstanceAsyncClient + * @see InstanceAsyncApi * @author Adrian Cole */ @Timeout(duration = 30, timeUnit = TimeUnit.SECONDS) -public interface InstanceClient { +public interface InstanceApi { /** * Retrieves information about the specified instance. diff --git a/labs/rds/src/main/java/org/jclouds/rds/features/InstanceAsyncClient.java b/labs/rds/src/main/java/org/jclouds/rds/features/InstanceAsyncApi.java similarity index 93% rename from labs/rds/src/main/java/org/jclouds/rds/features/InstanceAsyncClient.java rename to labs/rds/src/main/java/org/jclouds/rds/features/InstanceAsyncApi.java index c32aedf191..7ce9c284fc 100644 --- a/labs/rds/src/main/java/org/jclouds/rds/features/InstanceAsyncClient.java +++ b/labs/rds/src/main/java/org/jclouds/rds/features/InstanceAsyncApi.java @@ -46,15 +46,15 @@ import com.google.common.util.concurrent.ListenableFuture; * * @see doc - * @see InstanceClient + * @see InstanceApi * @author Adrian Cole */ @RequestFilters(FormSigner.class) @VirtualHost -public interface InstanceAsyncClient { +public interface InstanceAsyncApi { /** - * @see InstanceClient#get() + * @see InstanceApi#get() */ @POST @Path("/") @@ -64,7 +64,7 @@ public interface InstanceAsyncClient { ListenableFuture get(@FormParam("DBInstanceIdentifier") String id); /** - * @see InstanceClient#list() + * @see InstanceApi#list() */ @POST @Path("/") @@ -73,7 +73,7 @@ public interface InstanceAsyncClient { ListenableFuture> list(); /** - * @see InstanceClient#list(ListInstancesOptions) + * @see InstanceApi#list(ListInstancesOptions) */ @POST @Path("/") @@ -82,7 +82,7 @@ public interface InstanceAsyncClient { ListenableFuture> list(ListInstancesOptions options); /** - * @see InstanceClient#delete() + * @see InstanceApi#delete() */ @POST @Path("/") diff --git a/labs/rds/src/main/java/org/jclouds/rds/features/SecurityGroupClient.java b/labs/rds/src/main/java/org/jclouds/rds/features/SecurityGroupApi.java similarity index 97% rename from labs/rds/src/main/java/org/jclouds/rds/features/SecurityGroupClient.java rename to labs/rds/src/main/java/org/jclouds/rds/features/SecurityGroupApi.java index 699b7507f4..cc1798dabe 100644 --- a/labs/rds/src/main/java/org/jclouds/rds/features/SecurityGroupClient.java +++ b/labs/rds/src/main/java/org/jclouds/rds/features/SecurityGroupApi.java @@ -31,11 +31,11 @@ import org.jclouds.rds.options.ListSecurityGroupsOptions; *

* * @see doc - * @see SecurityGroupAsyncClient + * @see SecurityGroupAsyncApi * @author Adrian Cole */ @Timeout(duration = 30, timeUnit = TimeUnit.SECONDS) -public interface SecurityGroupClient { +public interface SecurityGroupApi { /** * Retrieves information about the specified {@link SecurityGroup}. diff --git a/labs/rds/src/main/java/org/jclouds/rds/features/SecurityGroupAsyncClient.java b/labs/rds/src/main/java/org/jclouds/rds/features/SecurityGroupAsyncApi.java similarity index 92% rename from labs/rds/src/main/java/org/jclouds/rds/features/SecurityGroupAsyncClient.java rename to labs/rds/src/main/java/org/jclouds/rds/features/SecurityGroupAsyncApi.java index d906f9eff9..e1091980f4 100644 --- a/labs/rds/src/main/java/org/jclouds/rds/features/SecurityGroupAsyncClient.java +++ b/labs/rds/src/main/java/org/jclouds/rds/features/SecurityGroupAsyncApi.java @@ -46,15 +46,15 @@ import com.google.common.util.concurrent.ListenableFuture; * * @see doc - * @see SecurityGroupClient + * @see SecurityGroupApi * @author Adrian Cole */ @RequestFilters(FormSigner.class) @VirtualHost -public interface SecurityGroupAsyncClient { +public interface SecurityGroupAsyncApi { /** - * @see SecurityGroupClient#get() + * @see SecurityGroupApi#get() */ @POST @Path("/") @@ -64,7 +64,7 @@ public interface SecurityGroupAsyncClient { ListenableFuture get(@FormParam("DBSecurityGroupName") String name); /** - * @see SecurityGroupClient#list() + * @see SecurityGroupApi#list() */ @POST @Path("/") @@ -73,7 +73,7 @@ public interface SecurityGroupAsyncClient { ListenableFuture> list(); /** - * @see SecurityGroupClient#list(ListSecurityGroupsOptions) + * @see SecurityGroupApi#list(ListSecurityGroupsOptions) */ @POST @Path("/") @@ -82,7 +82,7 @@ public interface SecurityGroupAsyncClient { ListenableFuture> list(ListSecurityGroupsOptions options); /** - * @see SecurityGroupClient#delete() + * @see SecurityGroupApi#delete() */ @POST @Path("/") diff --git a/labs/rds/src/main/java/org/jclouds/rds/features/SubnetGroupClient.java b/labs/rds/src/main/java/org/jclouds/rds/features/SubnetGroupApi.java similarity index 97% rename from labs/rds/src/main/java/org/jclouds/rds/features/SubnetGroupClient.java rename to labs/rds/src/main/java/org/jclouds/rds/features/SubnetGroupApi.java index 1960e6b9d5..cc8ee4da51 100644 --- a/labs/rds/src/main/java/org/jclouds/rds/features/SubnetGroupClient.java +++ b/labs/rds/src/main/java/org/jclouds/rds/features/SubnetGroupApi.java @@ -31,11 +31,11 @@ import org.jclouds.rds.options.ListSubnetGroupsOptions; *

* * @see doc - * @see SubnetGroupAsyncClient + * @see SubnetGroupAsyncApi * @author Adrian Cole */ @Timeout(duration = 30, timeUnit = TimeUnit.SECONDS) -public interface SubnetGroupClient { +public interface SubnetGroupApi { /** * Retrieves information about the specified {@link SubnetGroup}. diff --git a/labs/rds/src/main/java/org/jclouds/rds/features/SubnetGroupAsyncClient.java b/labs/rds/src/main/java/org/jclouds/rds/features/SubnetGroupAsyncApi.java similarity index 92% rename from labs/rds/src/main/java/org/jclouds/rds/features/SubnetGroupAsyncClient.java rename to labs/rds/src/main/java/org/jclouds/rds/features/SubnetGroupAsyncApi.java index 63a70023a6..54a671411c 100644 --- a/labs/rds/src/main/java/org/jclouds/rds/features/SubnetGroupAsyncClient.java +++ b/labs/rds/src/main/java/org/jclouds/rds/features/SubnetGroupAsyncApi.java @@ -46,15 +46,15 @@ import com.google.common.util.concurrent.ListenableFuture; * * @see doc - * @see SubnetGroupClient + * @see SubnetGroupApi * @author Adrian Cole */ @RequestFilters(FormSigner.class) @VirtualHost -public interface SubnetGroupAsyncClient { +public interface SubnetGroupAsyncApi { /** - * @see SubnetGroupClient#get() + * @see SubnetGroupApi#get() */ @POST @Path("/") @@ -64,7 +64,7 @@ public interface SubnetGroupAsyncClient { ListenableFuture get(@FormParam("DBSubnetGroupName") String name); /** - * @see SubnetGroupClient#list() + * @see SubnetGroupApi#list() */ @POST @Path("/") @@ -73,7 +73,7 @@ public interface SubnetGroupAsyncClient { ListenableFuture> list(); /** - * @see SubnetGroupClient#list(ListSubnetGroupsOptions) + * @see SubnetGroupApi#list(ListSubnetGroupsOptions) */ @POST @Path("/") @@ -82,7 +82,7 @@ public interface SubnetGroupAsyncClient { ListenableFuture> list(ListSubnetGroupsOptions options); /** - * @see SubnetGroupClient#delete() + * @see SubnetGroupApi#delete() */ @POST @Path("/") diff --git a/labs/rds/src/test/java/org/jclouds/rds/RDSTest.java b/labs/rds/src/test/java/org/jclouds/rds/RDSTest.java index 75cc251f7b..c9eb12d957 100644 --- a/labs/rds/src/test/java/org/jclouds/rds/RDSTest.java +++ b/labs/rds/src/test/java/org/jclouds/rds/RDSTest.java @@ -10,9 +10,9 @@ import org.jclouds.collect.PaginatedIterables; import org.jclouds.rds.domain.Instance; import org.jclouds.rds.domain.SecurityGroup; import org.jclouds.rds.domain.SubnetGroup; -import org.jclouds.rds.features.InstanceClient; -import org.jclouds.rds.features.SecurityGroupClient; -import org.jclouds.rds.features.SubnetGroupClient; +import org.jclouds.rds.features.InstanceApi; +import org.jclouds.rds.features.SecurityGroupApi; +import org.jclouds.rds.features.SubnetGroupApi; import org.jclouds.rds.options.ListInstancesOptions; import org.jclouds.rds.options.ListSecurityGroupsOptions; import org.jclouds.rds.options.ListSubnetGroupsOptions; @@ -32,93 +32,93 @@ public class RDSTest { @Test public void testSinglePageResultInstance() throws Exception { - InstanceClient instanceClient = createMock(InstanceClient.class); + InstanceApi instanceApi = createMock(InstanceApi.class); ListInstancesOptions options = new ListInstancesOptions(); PaginatedIterable response = PaginatedIterables.forward(ImmutableSet.of(createMock(Instance.class))); - expect(instanceClient.list(options)).andReturn(response).once(); + expect(instanceApi.list(options)).andReturn(response).once(); - EasyMock.replay(instanceClient); + EasyMock.replay(instanceApi); - Assert.assertEquals(1, Iterables.size(RDS.listInstances(instanceClient, options))); + Assert.assertEquals(1, Iterables.size(RDS.listInstances(instanceApi, options))); } @Test public void testMultiPageResultInstance() throws Exception { - InstanceClient instanceClient = createMock(InstanceClient.class); + InstanceApi instanceApi = createMock(InstanceApi.class); ListInstancesOptions options = new ListInstancesOptions(); PaginatedIterable response1 = PaginatedIterables.forwardWithMarker( ImmutableSet.of(createMock(Instance.class)), "NEXTTOKEN"); PaginatedIterable response2 = PaginatedIterables.forward(ImmutableSet.of(createMock(Instance.class))); - expect(instanceClient.list(anyObject(ListInstancesOptions.class))).andReturn(response1).once(); - expect(instanceClient.list(anyObject(ListInstancesOptions.class))).andReturn(response2).once(); + expect(instanceApi.list(anyObject(ListInstancesOptions.class))).andReturn(response1).once(); + expect(instanceApi.list(anyObject(ListInstancesOptions.class))).andReturn(response2).once(); - EasyMock.replay(instanceClient); + EasyMock.replay(instanceApi); - Assert.assertEquals(2, Iterables.size(RDS.listInstances(instanceClient, options))); + Assert.assertEquals(2, Iterables.size(RDS.listInstances(instanceApi, options))); } @Test public void testSinglePageResultSubnetGroup() throws Exception { - SubnetGroupClient subnetGroupClient = createMock(SubnetGroupClient.class); + SubnetGroupApi subnetGroupApi = createMock(SubnetGroupApi.class); ListSubnetGroupsOptions options = new ListSubnetGroupsOptions(); PaginatedIterable response = PaginatedIterables.forward(ImmutableSet .of(createMock(SubnetGroup.class))); - expect(subnetGroupClient.list(options)).andReturn(response).once(); + expect(subnetGroupApi.list(options)).andReturn(response).once(); - EasyMock.replay(subnetGroupClient); + EasyMock.replay(subnetGroupApi); - Assert.assertEquals(1, Iterables.size(RDS.listSubnetGroups(subnetGroupClient, options))); + Assert.assertEquals(1, Iterables.size(RDS.listSubnetGroups(subnetGroupApi, options))); } @Test public void testMultiPageResultSubnetGroup() throws Exception { - SubnetGroupClient subnetGroupClient = createMock(SubnetGroupClient.class); + SubnetGroupApi subnetGroupApi = createMock(SubnetGroupApi.class); ListSubnetGroupsOptions options = new ListSubnetGroupsOptions(); PaginatedIterable response1 = PaginatedIterables.forwardWithMarker( ImmutableSet.of(createMock(SubnetGroup.class)), "NEXTTOKEN"); PaginatedIterable response2 = PaginatedIterables.forward(ImmutableSet .of(createMock(SubnetGroup.class))); - expect(subnetGroupClient.list(anyObject(ListSubnetGroupsOptions.class))).andReturn(response1).once(); - expect(subnetGroupClient.list(anyObject(ListSubnetGroupsOptions.class))).andReturn(response2).once(); + expect(subnetGroupApi.list(anyObject(ListSubnetGroupsOptions.class))).andReturn(response1).once(); + expect(subnetGroupApi.list(anyObject(ListSubnetGroupsOptions.class))).andReturn(response2).once(); - EasyMock.replay(subnetGroupClient); + EasyMock.replay(subnetGroupApi); - Assert.assertEquals(2, Iterables.size(RDS.listSubnetGroups(subnetGroupClient, options))); + Assert.assertEquals(2, Iterables.size(RDS.listSubnetGroups(subnetGroupApi, options))); } @Test public void testSinglePageResultSecurityGroup() throws Exception { - SecurityGroupClient securityGroupClient = createMock(SecurityGroupClient.class); + SecurityGroupApi securityGroupApi = createMock(SecurityGroupApi.class); ListSecurityGroupsOptions options = new ListSecurityGroupsOptions(); PaginatedIterable response = PaginatedIterables.forward(ImmutableSet .of(createMock(SecurityGroup.class))); - expect(securityGroupClient.list(options)).andReturn(response).once(); + expect(securityGroupApi.list(options)).andReturn(response).once(); - EasyMock.replay(securityGroupClient); + EasyMock.replay(securityGroupApi); - Assert.assertEquals(1, Iterables.size(RDS.listSecurityGroups(securityGroupClient, options))); + Assert.assertEquals(1, Iterables.size(RDS.listSecurityGroups(securityGroupApi, options))); } @Test public void testMultiPageResultSecurityGroup() throws Exception { - SecurityGroupClient securityGroupClient = createMock(SecurityGroupClient.class); + SecurityGroupApi securityGroupApi = createMock(SecurityGroupApi.class); ListSecurityGroupsOptions options = new ListSecurityGroupsOptions(); PaginatedIterable response1 = PaginatedIterables.forwardWithMarker( ImmutableSet.of(createMock(SecurityGroup.class)), "NEXTTOKEN"); PaginatedIterable response2 = PaginatedIterables.forward(ImmutableSet .of(createMock(SecurityGroup.class))); - expect(securityGroupClient.list(anyObject(ListSecurityGroupsOptions.class))).andReturn(response1).once(); - expect(securityGroupClient.list(anyObject(ListSecurityGroupsOptions.class))).andReturn(response2).once(); + expect(securityGroupApi.list(anyObject(ListSecurityGroupsOptions.class))).andReturn(response1).once(); + expect(securityGroupApi.list(anyObject(ListSecurityGroupsOptions.class))).andReturn(response2).once(); - EasyMock.replay(securityGroupClient); + EasyMock.replay(securityGroupApi); - Assert.assertEquals(2, Iterables.size(RDS.listSecurityGroups(securityGroupClient, options))); + Assert.assertEquals(2, Iterables.size(RDS.listSecurityGroups(securityGroupApi, options))); } } diff --git a/labs/rds/src/test/java/org/jclouds/rds/features/InstanceClientExpectTest.java b/labs/rds/src/test/java/org/jclouds/rds/features/InstanceApiExpectTest.java similarity index 85% rename from labs/rds/src/test/java/org/jclouds/rds/features/InstanceClientExpectTest.java rename to labs/rds/src/test/java/org/jclouds/rds/features/InstanceApiExpectTest.java index ba3922ba5b..3dd44e3c9f 100644 --- a/labs/rds/src/test/java/org/jclouds/rds/features/InstanceClientExpectTest.java +++ b/labs/rds/src/test/java/org/jclouds/rds/features/InstanceApiExpectTest.java @@ -27,8 +27,8 @@ import java.util.TimeZone; import org.jclouds.http.HttpRequest; import org.jclouds.http.HttpResponse; -import org.jclouds.rds.RDSClient; -import org.jclouds.rds.internal.BaseRDSClientExpectTest; +import org.jclouds.rds.RDSApi; +import org.jclouds.rds.internal.BaseRDSApiExpectTest; import org.jclouds.rds.parse.DescribeDBInstancesResponseTest; import org.jclouds.rds.parse.GetInstanceResponseTest; import org.jclouds.rest.ResourceNotFoundException; @@ -39,10 +39,10 @@ import com.google.common.collect.ImmutableMultimap; /** * @author Adrian Cole */ -@Test(groups = "unit", testName = "InstanceClientExpectTest") -public class InstanceClientExpectTest extends BaseRDSClientExpectTest { +@Test(groups = "unit", testName = "InstanceApiExpectTest") +public class InstanceApiExpectTest extends BaseRDSApiExpectTest { - public InstanceClientExpectTest() { + public InstanceApiExpectTest() { TimeZone.setDefault(TimeZone.getTimeZone("America/Los_Angeles")); } @@ -71,20 +71,20 @@ public class InstanceClientExpectTest extends BaseRDSClientExpectTest { HttpResponse getResponse = HttpResponse.builder().statusCode(200) .payload(payloadFromResourceWithContentType("/get_instance.xml", "text/xml")).build(); - RDSClient clientWhenExist = requestSendsResponse( + RDSApi apiWhenExist = requestSendsResponse( get, getResponse); - assertEquals(clientWhenExist.getInstanceClient().get("id").toString(), new GetInstanceResponseTest().expected().toString()); + assertEquals(apiWhenExist.getInstanceApi().get("id").toString(), new GetInstanceResponseTest().expected().toString()); } public void testGetWhenResponseIs404() throws Exception { HttpResponse getResponse = HttpResponse.builder().statusCode(404).build(); - RDSClient clientWhenDontExist = requestSendsResponse( + RDSApi apiWhenDontExist = requestSendsResponse( get, getResponse); - assertNull(clientWhenDontExist.getInstanceClient().get("id")); + assertNull(apiWhenDontExist.getInstanceApi().get("id")); } HttpRequest list = HttpRequest.builder() @@ -110,10 +110,10 @@ public class InstanceClientExpectTest extends BaseRDSClientExpectTest { HttpResponse listResponse = HttpResponse.builder().statusCode(200) .payload(payloadFromResourceWithContentType("/describe_instances.xml", "text/xml")).build(); - RDSClient clientWhenExist = requestSendsResponse( + RDSApi apiWhenExist = requestSendsResponse( list, listResponse); - assertEquals(clientWhenExist.getInstanceClient().list().toString(), new DescribeDBInstancesResponseTest().expected().toString()); + assertEquals(apiWhenExist.getInstanceApi().list().toString(), new DescribeDBInstancesResponseTest().expected().toString()); } // TODO: this should really be an empty set @@ -122,10 +122,10 @@ public class InstanceClientExpectTest extends BaseRDSClientExpectTest { HttpResponse listResponse = HttpResponse.builder().statusCode(404).build(); - RDSClient clientWhenDontExist = requestSendsResponse( + RDSApi apiWhenDontExist = requestSendsResponse( list, listResponse); - clientWhenDontExist.getInstanceClient().list(); + apiWhenDontExist.getInstanceApi().list(); } public void testListWithOptionsWhenResponseIs2xx() throws Exception { @@ -151,10 +151,10 @@ public class InstanceClientExpectTest extends BaseRDSClientExpectTest { HttpResponse listWithOptionsResponse = HttpResponse.builder().statusCode(200) .payload(payloadFromResourceWithContentType("/describe_instances.xml", "text/xml")).build(); - RDSClient clientWhenWithOptionsExist = requestSendsResponse(listWithOptions, + RDSApi apiWhenWithOptionsExist = requestSendsResponse(listWithOptions, listWithOptionsResponse); - assertEquals(clientWhenWithOptionsExist.getInstanceClient().list(afterMarker("MARKER")).toString(), + assertEquals(apiWhenWithOptionsExist.getInstanceApi().list(afterMarker("MARKER")).toString(), new DescribeDBInstancesResponseTest().expected().toString()); } @@ -181,17 +181,17 @@ public class InstanceClientExpectTest extends BaseRDSClientExpectTest { HttpResponse deleteResponse = HttpResponse.builder().statusCode(200).build(); - RDSClient clientWhenExist = requestSendsResponse(delete, deleteResponse); + RDSApi apiWhenExist = requestSendsResponse(delete, deleteResponse); - clientWhenExist.getInstanceClient().delete("id"); + apiWhenExist.getInstanceApi().delete("id"); } public void testDeleteWhenResponseIs404() throws Exception { HttpResponse deleteResponse = HttpResponse.builder().statusCode(404).build(); - RDSClient clientWhenDontExist = requestSendsResponse(delete, deleteResponse); + RDSApi apiWhenDontExist = requestSendsResponse(delete, deleteResponse); - clientWhenDontExist.getInstanceClient().delete("id"); + apiWhenDontExist.getInstanceApi().delete("id"); } } diff --git a/labs/rds/src/test/java/org/jclouds/rds/features/InstanceClientLiveTest.java b/labs/rds/src/test/java/org/jclouds/rds/features/InstanceApiLiveTest.java similarity index 78% rename from labs/rds/src/test/java/org/jclouds/rds/features/InstanceClientLiveTest.java rename to labs/rds/src/test/java/org/jclouds/rds/features/InstanceApiLiveTest.java index eaa7ac0746..9264a79c7a 100644 --- a/labs/rds/src/test/java/org/jclouds/rds/features/InstanceClientLiveTest.java +++ b/labs/rds/src/test/java/org/jclouds/rds/features/InstanceApiLiveTest.java @@ -22,7 +22,7 @@ import static com.google.common.base.Preconditions.checkNotNull; import org.jclouds.collect.PaginatedIterable; import org.jclouds.rds.domain.Instance; -import org.jclouds.rds.internal.BaseRDSClientLiveTest; +import org.jclouds.rds.internal.BaseRDSApiLiveTest; import org.jclouds.rds.options.ListInstancesOptions; import org.testng.Assert; import org.testng.annotations.Test; @@ -32,8 +32,8 @@ import com.google.common.collect.Iterables; /** * @author Adrian Cole */ -@Test(groups = "live", testName = "InstanceClientLiveTest") -public class InstanceClientLiveTest extends BaseRDSClientLiveTest { +@Test(groups = "live", testName = "InstanceApiLiveTest") +public class InstanceApiLiveTest extends BaseRDSApiLiveTest { private void checkInstance(Instance instance) { checkNotNull(instance.getId(), "Id cannot be null for a Instance: %s", instance); @@ -44,12 +44,12 @@ public class InstanceClientLiveTest extends BaseRDSClientLiveTest { "While SubnetGroup can be null for a Instance, its Optional wrapper cannot: %s", instance); // TODO: other checks if (instance.getSubnetGroup().isPresent()) - SubnetGroupClientLiveTest.checkSubnetGroup(instance.getSubnetGroup().get()); + SubnetGroupApiLiveTest.checkSubnetGroup(instance.getSubnetGroup().get()); } @Test protected void testDescribeInstances() { - PaginatedIterable response = client().list(); + PaginatedIterable response = api().list(); for (Instance instance : response) { checkInstance(instance); @@ -57,17 +57,17 @@ public class InstanceClientLiveTest extends BaseRDSClientLiveTest { if (Iterables.size(response) > 0) { Instance instance = response.iterator().next(); - Assert.assertEquals(client().get(instance.getId()), instance); + Assert.assertEquals(api().get(instance.getId()), instance); } // Test with a Marker, even if it's null - response = client().list(ListInstancesOptions.Builder.afterMarker(response.getNextMarker())); + response = api().list(ListInstancesOptions.Builder.afterMarker(response.getNextMarker())); for (Instance instance : response) { checkInstance(instance); } } - protected InstanceClient client() { - return context.getApi().getInstanceClient(); + protected InstanceApi api() { + return context.getApi().getInstanceApi(); } } diff --git a/labs/rds/src/test/java/org/jclouds/rds/features/SecurityGroupClientExpectTest.java b/labs/rds/src/test/java/org/jclouds/rds/features/SecurityGroupApiExpectTest.java similarity index 85% rename from labs/rds/src/test/java/org/jclouds/rds/features/SecurityGroupClientExpectTest.java rename to labs/rds/src/test/java/org/jclouds/rds/features/SecurityGroupApiExpectTest.java index 3773a0e016..671d49cde6 100644 --- a/labs/rds/src/test/java/org/jclouds/rds/features/SecurityGroupClientExpectTest.java +++ b/labs/rds/src/test/java/org/jclouds/rds/features/SecurityGroupApiExpectTest.java @@ -27,8 +27,8 @@ import java.util.TimeZone; import org.jclouds.http.HttpRequest; import org.jclouds.http.HttpResponse; -import org.jclouds.rds.RDSClient; -import org.jclouds.rds.internal.BaseRDSClientExpectTest; +import org.jclouds.rds.RDSApi; +import org.jclouds.rds.internal.BaseRDSApiExpectTest; import org.jclouds.rds.parse.DescribeDBSecurityGroupsResponseTest; import org.jclouds.rds.parse.GetSecurityGroupResponseTest; import org.jclouds.rest.ResourceNotFoundException; @@ -39,10 +39,10 @@ import com.google.common.collect.ImmutableMultimap; /** * @author Adrian Cole */ -@Test(groups = "unit", testName = "SecurityGroupClientExpectTest") -public class SecurityGroupClientExpectTest extends BaseRDSClientExpectTest { +@Test(groups = "unit", testName = "SecurityGroupApiExpectTest") +public class SecurityGroupApiExpectTest extends BaseRDSApiExpectTest { - public SecurityGroupClientExpectTest() { + public SecurityGroupApiExpectTest() { TimeZone.setDefault(TimeZone.getTimeZone("America/Los_Angeles")); } @@ -71,20 +71,20 @@ public class SecurityGroupClientExpectTest extends BaseRDSClientExpectTest { HttpResponse getResponse = HttpResponse.builder().statusCode(200) .payload(payloadFromResourceWithContentType("/get_securitygroup.xml", "text/xml")).build(); - RDSClient clientWhenExist = requestSendsResponse( + RDSApi apiWhenExist = requestSendsResponse( get, getResponse); - assertEquals(clientWhenExist.getSecurityGroupClient().get("name").toString(), new GetSecurityGroupResponseTest().expected().toString()); + assertEquals(apiWhenExist.getSecurityGroupApi().get("name").toString(), new GetSecurityGroupResponseTest().expected().toString()); } public void testGetWhenResponseIs404() throws Exception { HttpResponse getResponse = HttpResponse.builder().statusCode(404).build(); - RDSClient clientWhenDontExist = requestSendsResponse( + RDSApi apiWhenDontExist = requestSendsResponse( get, getResponse); - assertNull(clientWhenDontExist.getSecurityGroupClient().get("name")); + assertNull(apiWhenDontExist.getSecurityGroupApi().get("name")); } HttpRequest list = HttpRequest.builder() @@ -110,10 +110,10 @@ public class SecurityGroupClientExpectTest extends BaseRDSClientExpectTest { HttpResponse listResponse = HttpResponse.builder().statusCode(200) .payload(payloadFromResourceWithContentType("/describe_securitygroups.xml", "text/xml")).build(); - RDSClient clientWhenExist = requestSendsResponse( + RDSApi apiWhenExist = requestSendsResponse( list, listResponse); - assertEquals(clientWhenExist.getSecurityGroupClient().list().toString(), new DescribeDBSecurityGroupsResponseTest().expected().toString()); + assertEquals(apiWhenExist.getSecurityGroupApi().list().toString(), new DescribeDBSecurityGroupsResponseTest().expected().toString()); } // TODO: this should really be an empty set @@ -122,10 +122,10 @@ public class SecurityGroupClientExpectTest extends BaseRDSClientExpectTest { HttpResponse listResponse = HttpResponse.builder().statusCode(404).build(); - RDSClient clientWhenDontExist = requestSendsResponse( + RDSApi apiWhenDontExist = requestSendsResponse( list, listResponse); - clientWhenDontExist.getSecurityGroupClient().list(); + apiWhenDontExist.getSecurityGroupApi().list(); } public void testListWithOptionsWhenResponseIs2xx() throws Exception { @@ -151,10 +151,10 @@ public class SecurityGroupClientExpectTest extends BaseRDSClientExpectTest { HttpResponse listWithOptionsResponse = HttpResponse.builder().statusCode(200) .payload(payloadFromResourceWithContentType("/describe_securitygroups.xml", "text/xml")).build(); - RDSClient clientWhenWithOptionsExist = requestSendsResponse(listWithOptions, + RDSApi apiWhenWithOptionsExist = requestSendsResponse(listWithOptions, listWithOptionsResponse); - assertEquals(clientWhenWithOptionsExist.getSecurityGroupClient().list(afterMarker("MARKER")).toString(), + assertEquals(apiWhenWithOptionsExist.getSecurityGroupApi().list(afterMarker("MARKER")).toString(), new DescribeDBSecurityGroupsResponseTest().expected().toString()); } @@ -181,17 +181,17 @@ public class SecurityGroupClientExpectTest extends BaseRDSClientExpectTest { HttpResponse deleteResponse = HttpResponse.builder().statusCode(200).build(); - RDSClient clientWhenExist = requestSendsResponse(delete, deleteResponse); + RDSApi apiWhenExist = requestSendsResponse(delete, deleteResponse); - clientWhenExist.getSecurityGroupClient().delete("name"); + apiWhenExist.getSecurityGroupApi().delete("name"); } public void testDeleteWhenResponseIs404() throws Exception { HttpResponse deleteResponse = HttpResponse.builder().statusCode(404).build(); - RDSClient clientWhenDontExist = requestSendsResponse(delete, deleteResponse); + RDSApi apiWhenDontExist = requestSendsResponse(delete, deleteResponse); - clientWhenDontExist.getSecurityGroupClient().delete("name"); + apiWhenDontExist.getSecurityGroupApi().delete("name"); } } diff --git a/labs/rds/src/test/java/org/jclouds/rds/features/SecurityGroupClientLiveTest.java b/labs/rds/src/test/java/org/jclouds/rds/features/SecurityGroupApiLiveTest.java similarity index 83% rename from labs/rds/src/test/java/org/jclouds/rds/features/SecurityGroupClientLiveTest.java rename to labs/rds/src/test/java/org/jclouds/rds/features/SecurityGroupApiLiveTest.java index 3a4c3c5ea5..4a2a240d79 100644 --- a/labs/rds/src/test/java/org/jclouds/rds/features/SecurityGroupClientLiveTest.java +++ b/labs/rds/src/test/java/org/jclouds/rds/features/SecurityGroupApiLiveTest.java @@ -23,7 +23,7 @@ import static com.google.common.base.Preconditions.checkNotNull; import org.jclouds.collect.PaginatedIterable; import org.jclouds.rds.domain.EC2SecurityGroup; import org.jclouds.rds.domain.SecurityGroup; -import org.jclouds.rds.internal.BaseRDSClientLiveTest; +import org.jclouds.rds.internal.BaseRDSApiLiveTest; import org.jclouds.rds.options.ListSecurityGroupsOptions; import org.testng.Assert; import org.testng.annotations.Test; @@ -33,8 +33,8 @@ import com.google.common.collect.Iterables; /** * @author Adrian Cole */ -@Test(groups = "live", testName = "SecurityGroupClientLiveTest") -public class SecurityGroupClientLiveTest extends BaseRDSClientLiveTest { +@Test(groups = "live", testName = "SecurityGroupApiLiveTest") +public class SecurityGroupApiLiveTest extends BaseRDSApiLiveTest { static void checkSecurityGroup(SecurityGroup securityGroup) { checkNotNull(securityGroup.getName(), "Name cannot be null for a SecurityGroup: %s", securityGroup); @@ -55,7 +55,7 @@ public class SecurityGroupClientLiveTest extends BaseRDSClientLiveTest { @Test protected void testDescribeSecurityGroups() { - PaginatedIterable response = client().list(); + PaginatedIterable response = api().list(); for (SecurityGroup securityGroup : response) { checkSecurityGroup(securityGroup); @@ -63,17 +63,17 @@ public class SecurityGroupClientLiveTest extends BaseRDSClientLiveTest { if (Iterables.size(response) > 0) { SecurityGroup securityGroup = response.iterator().next(); - Assert.assertEquals(client().get(securityGroup.getName()), securityGroup); + Assert.assertEquals(api().get(securityGroup.getName()), securityGroup); } // Test with a Marker, even if it's null - response = client().list(ListSecurityGroupsOptions.Builder.afterMarker(response.getNextMarker())); + response = api().list(ListSecurityGroupsOptions.Builder.afterMarker(response.getNextMarker())); for (SecurityGroup securityGroup : response) { checkSecurityGroup(securityGroup); } } - protected SecurityGroupClient client() { - return context.getApi().getSecurityGroupClient(); + protected SecurityGroupApi api() { + return context.getApi().getSecurityGroupApi(); } } diff --git a/labs/rds/src/test/java/org/jclouds/rds/features/SubnetGroupClientExpectTest.java b/labs/rds/src/test/java/org/jclouds/rds/features/SubnetGroupApiExpectTest.java similarity index 85% rename from labs/rds/src/test/java/org/jclouds/rds/features/SubnetGroupClientExpectTest.java rename to labs/rds/src/test/java/org/jclouds/rds/features/SubnetGroupApiExpectTest.java index adc59cd137..ff648599c3 100644 --- a/labs/rds/src/test/java/org/jclouds/rds/features/SubnetGroupClientExpectTest.java +++ b/labs/rds/src/test/java/org/jclouds/rds/features/SubnetGroupApiExpectTest.java @@ -27,8 +27,8 @@ import java.util.TimeZone; import org.jclouds.http.HttpRequest; import org.jclouds.http.HttpResponse; -import org.jclouds.rds.RDSClient; -import org.jclouds.rds.internal.BaseRDSClientExpectTest; +import org.jclouds.rds.RDSApi; +import org.jclouds.rds.internal.BaseRDSApiExpectTest; import org.jclouds.rds.parse.DescribeDBSubnetGroupsResponseTest; import org.jclouds.rds.parse.GetSubnetGroupResponseTest; import org.jclouds.rest.ResourceNotFoundException; @@ -39,10 +39,10 @@ import com.google.common.collect.ImmutableMultimap; /** * @author Adrian Cole */ -@Test(groups = "unit", testName = "SubnetGroupClientExpectTest") -public class SubnetGroupClientExpectTest extends BaseRDSClientExpectTest { +@Test(groups = "unit", testName = "SubnetGroupApiExpectTest") +public class SubnetGroupApiExpectTest extends BaseRDSApiExpectTest { - public SubnetGroupClientExpectTest() { + public SubnetGroupApiExpectTest() { TimeZone.setDefault(TimeZone.getTimeZone("America/Los_Angeles")); } @@ -71,20 +71,20 @@ public class SubnetGroupClientExpectTest extends BaseRDSClientExpectTest { HttpResponse getResponse = HttpResponse.builder().statusCode(200) .payload(payloadFromResourceWithContentType("/get_subnetgroup.xml", "text/xml")).build(); - RDSClient clientWhenExist = requestSendsResponse( + RDSApi apiWhenExist = requestSendsResponse( get, getResponse); - assertEquals(clientWhenExist.getSubnetGroupClient().get("name").toString(), new GetSubnetGroupResponseTest().expected().toString()); + assertEquals(apiWhenExist.getSubnetGroupApi().get("name").toString(), new GetSubnetGroupResponseTest().expected().toString()); } public void testGetWhenResponseIs404() throws Exception { HttpResponse getResponse = HttpResponse.builder().statusCode(404).build(); - RDSClient clientWhenDontExist = requestSendsResponse( + RDSApi apiWhenDontExist = requestSendsResponse( get, getResponse); - assertNull(clientWhenDontExist.getSubnetGroupClient().get("name")); + assertNull(apiWhenDontExist.getSubnetGroupApi().get("name")); } HttpRequest list = HttpRequest.builder() @@ -110,10 +110,10 @@ public class SubnetGroupClientExpectTest extends BaseRDSClientExpectTest { HttpResponse listResponse = HttpResponse.builder().statusCode(200) .payload(payloadFromResourceWithContentType("/describe_subnetgroups.xml", "text/xml")).build(); - RDSClient clientWhenExist = requestSendsResponse( + RDSApi apiWhenExist = requestSendsResponse( list, listResponse); - assertEquals(clientWhenExist.getSubnetGroupClient().list().toString(), new DescribeDBSubnetGroupsResponseTest().expected().toString()); + assertEquals(apiWhenExist.getSubnetGroupApi().list().toString(), new DescribeDBSubnetGroupsResponseTest().expected().toString()); } // TODO: this should really be an empty set @@ -122,10 +122,10 @@ public class SubnetGroupClientExpectTest extends BaseRDSClientExpectTest { HttpResponse listResponse = HttpResponse.builder().statusCode(404).build(); - RDSClient clientWhenDontExist = requestSendsResponse( + RDSApi apiWhenDontExist = requestSendsResponse( list, listResponse); - clientWhenDontExist.getSubnetGroupClient().list(); + apiWhenDontExist.getSubnetGroupApi().list(); } public void testListWithOptionsWhenResponseIs2xx() throws Exception { @@ -151,10 +151,10 @@ public class SubnetGroupClientExpectTest extends BaseRDSClientExpectTest { HttpResponse listWithOptionsResponse = HttpResponse.builder().statusCode(200) .payload(payloadFromResourceWithContentType("/describe_subnetgroups.xml", "text/xml")).build(); - RDSClient clientWhenWithOptionsExist = requestSendsResponse(listWithOptions, + RDSApi apiWhenWithOptionsExist = requestSendsResponse(listWithOptions, listWithOptionsResponse); - assertEquals(clientWhenWithOptionsExist.getSubnetGroupClient().list(afterMarker("MARKER")).toString(), + assertEquals(apiWhenWithOptionsExist.getSubnetGroupApi().list(afterMarker("MARKER")).toString(), new DescribeDBSubnetGroupsResponseTest().expected().toString()); } @@ -181,17 +181,17 @@ public class SubnetGroupClientExpectTest extends BaseRDSClientExpectTest { HttpResponse deleteResponse = HttpResponse.builder().statusCode(200).build(); - RDSClient clientWhenExist = requestSendsResponse(delete, deleteResponse); + RDSApi apiWhenExist = requestSendsResponse(delete, deleteResponse); - clientWhenExist.getSubnetGroupClient().delete("name"); + apiWhenExist.getSubnetGroupApi().delete("name"); } public void testDeleteWhenResponseIs404() throws Exception { HttpResponse deleteResponse = HttpResponse.builder().statusCode(404).build(); - RDSClient clientWhenDontExist = requestSendsResponse(delete, deleteResponse); + RDSApi apiWhenDontExist = requestSendsResponse(delete, deleteResponse); - clientWhenDontExist.getSubnetGroupClient().delete("name"); + apiWhenDontExist.getSubnetGroupApi().delete("name"); } } diff --git a/labs/rds/src/test/java/org/jclouds/rds/features/SubnetGroupClientLiveTest.java b/labs/rds/src/test/java/org/jclouds/rds/features/SubnetGroupApiLiveTest.java similarity index 83% rename from labs/rds/src/test/java/org/jclouds/rds/features/SubnetGroupClientLiveTest.java rename to labs/rds/src/test/java/org/jclouds/rds/features/SubnetGroupApiLiveTest.java index ef7bc993e9..5fcb2651ae 100644 --- a/labs/rds/src/test/java/org/jclouds/rds/features/SubnetGroupClientLiveTest.java +++ b/labs/rds/src/test/java/org/jclouds/rds/features/SubnetGroupApiLiveTest.java @@ -24,7 +24,7 @@ import static com.google.common.base.Preconditions.checkState; import org.jclouds.collect.PaginatedIterable; import org.jclouds.rds.domain.Subnet; import org.jclouds.rds.domain.SubnetGroup; -import org.jclouds.rds.internal.BaseRDSClientLiveTest; +import org.jclouds.rds.internal.BaseRDSApiLiveTest; import org.jclouds.rds.options.ListSubnetGroupsOptions; import org.testng.Assert; import org.testng.annotations.Test; @@ -34,8 +34,8 @@ import com.google.common.collect.Iterables; /** * @author Adrian Cole */ -@Test(groups = "live", testName = "SubnetGroupClientLiveTest") -public class SubnetGroupClientLiveTest extends BaseRDSClientLiveTest { +@Test(groups = "live", testName = "SubnetGroupApiLiveTest") +public class SubnetGroupApiLiveTest extends BaseRDSApiLiveTest { static void checkSubnetGroup(SubnetGroup subnetGroup) { checkNotNull(subnetGroup.getName(), "Name cannot be null for a SubnetGroup: %s", subnetGroup); @@ -55,7 +55,7 @@ public class SubnetGroupClientLiveTest extends BaseRDSClientLiveTest { @Test protected void testDescribeSubnetGroups() { - PaginatedIterable response = client().list(); + PaginatedIterable response = api().list(); for (SubnetGroup subnetGroup : response) { checkSubnetGroup(subnetGroup); @@ -63,17 +63,17 @@ public class SubnetGroupClientLiveTest extends BaseRDSClientLiveTest { if (Iterables.size(response) > 0) { SubnetGroup subnetGroup = response.iterator().next(); - Assert.assertEquals(client().get(subnetGroup.getName()), subnetGroup); + Assert.assertEquals(api().get(subnetGroup.getName()), subnetGroup); } // Test with a Marker, even if it's null - response = client().list(ListSubnetGroupsOptions.Builder.afterMarker(response.getNextMarker())); + response = api().list(ListSubnetGroupsOptions.Builder.afterMarker(response.getNextMarker())); for (SubnetGroup subnetGroup : response) { checkSubnetGroup(subnetGroup); } } - protected SubnetGroupClient client() { - return context.getApi().getSubnetGroupClient(); + protected SubnetGroupApi api() { + return context.getApi().getSubnetGroupApi(); } } diff --git a/labs/rds/src/test/java/org/jclouds/rds/internal/BaseRDSClientExpectTest.java b/labs/rds/src/test/java/org/jclouds/rds/internal/BaseRDSApiExpectTest.java similarity index 88% rename from labs/rds/src/test/java/org/jclouds/rds/internal/BaseRDSClientExpectTest.java rename to labs/rds/src/test/java/org/jclouds/rds/internal/BaseRDSApiExpectTest.java index ef6484d48e..0da60434a3 100644 --- a/labs/rds/src/test/java/org/jclouds/rds/internal/BaseRDSClientExpectTest.java +++ b/labs/rds/src/test/java/org/jclouds/rds/internal/BaseRDSApiExpectTest.java @@ -18,13 +18,13 @@ */ package org.jclouds.rds.internal; -import org.jclouds.rds.RDSClient; +import org.jclouds.rds.RDSApi; /** * * @author Adrian Cole */ -public class BaseRDSClientExpectTest extends BaseRDSExpectTest { +public class BaseRDSApiExpectTest extends BaseRDSExpectTest { } diff --git a/labs/rds/src/test/java/org/jclouds/rds/internal/BaseRDSClientLiveTest.java b/labs/rds/src/test/java/org/jclouds/rds/internal/BaseRDSApiLiveTest.java similarity index 80% rename from labs/rds/src/test/java/org/jclouds/rds/internal/BaseRDSClientLiveTest.java rename to labs/rds/src/test/java/org/jclouds/rds/internal/BaseRDSApiLiveTest.java index 2cfc057a7d..56e3e049ee 100644 --- a/labs/rds/src/test/java/org/jclouds/rds/internal/BaseRDSClientLiveTest.java +++ b/labs/rds/src/test/java/org/jclouds/rds/internal/BaseRDSApiLiveTest.java @@ -20,8 +20,8 @@ package org.jclouds.rds.internal; import org.jclouds.apis.BaseContextLiveTest; import org.jclouds.rds.RDSApiMetadata; -import org.jclouds.rds.RDSAsyncClient; -import org.jclouds.rds.RDSClient; +import org.jclouds.rds.RDSAsyncApi; +import org.jclouds.rds.RDSApi; import org.jclouds.rest.RestContext; import org.testng.annotations.Test; @@ -32,14 +32,14 @@ import com.google.common.reflect.TypeToken; * @author Adrian Cole */ @Test(groups = "live") -public class BaseRDSClientLiveTest extends BaseContextLiveTest> { +public class BaseRDSApiLiveTest extends BaseContextLiveTest> { - public BaseRDSClientLiveTest() { + public BaseRDSApiLiveTest() { provider = "rds"; } @Override - protected TypeToken> contextType() { + protected TypeToken> contextType() { return RDSApiMetadata.CONTEXT_TOKEN; } diff --git a/labs/rds/src/test/java/org/jclouds/rds/internal/BaseRDSAsyncClientExpectTest.java b/labs/rds/src/test/java/org/jclouds/rds/internal/BaseRDSAsyncApiExpectTest.java similarity index 81% rename from labs/rds/src/test/java/org/jclouds/rds/internal/BaseRDSAsyncClientExpectTest.java rename to labs/rds/src/test/java/org/jclouds/rds/internal/BaseRDSAsyncApiExpectTest.java index b9b5725bc5..8a0f07e2f2 100644 --- a/labs/rds/src/test/java/org/jclouds/rds/internal/BaseRDSAsyncClientExpectTest.java +++ b/labs/rds/src/test/java/org/jclouds/rds/internal/BaseRDSAsyncApiExpectTest.java @@ -20,7 +20,7 @@ package org.jclouds.rds.internal; import java.util.Properties; -import org.jclouds.rds.RDSAsyncClient; +import org.jclouds.rds.RDSAsyncApi; import org.jclouds.http.HttpRequest; import org.jclouds.http.HttpResponse; @@ -31,8 +31,8 @@ import com.google.inject.Module; * * @author Adrian Cole */ -public class BaseRDSAsyncClientExpectTest extends BaseRDSExpectTest { - public RDSAsyncClient createClient(Function fn, Module module, Properties props) { - return createInjector(fn, module, props).getInstance(RDSAsyncClient.class); +public class BaseRDSAsyncApiExpectTest extends BaseRDSExpectTest { + public RDSAsyncApi createApi(Function fn, Module module, Properties props) { + return createInjector(fn, module, props).getInstance(RDSAsyncApi.class); } } diff --git a/labs/rds/src/test/java/org/jclouds/rds/internal/BaseRDSExpectTest.java b/labs/rds/src/test/java/org/jclouds/rds/internal/BaseRDSExpectTest.java index 3222cb1b75..043dac3e2f 100644 --- a/labs/rds/src/test/java/org/jclouds/rds/internal/BaseRDSExpectTest.java +++ b/labs/rds/src/test/java/org/jclouds/rds/internal/BaseRDSExpectTest.java @@ -29,7 +29,7 @@ import org.jclouds.rds.config.RDSRestClientModule; import org.jclouds.location.config.LocationModule; import org.jclouds.location.suppliers.RegionIdToURISupplier; import org.jclouds.rest.ConfiguresRestClient; -import org.jclouds.rest.internal.BaseRestClientExpectTest; +import org.jclouds.rest.internal.BaseRestApiExpectTest; import org.jclouds.util.Suppliers2; import com.google.common.base.Supplier; @@ -40,7 +40,7 @@ import com.google.inject.Module; * * @author Adrian Cole */ -public class BaseRDSExpectTest extends BaseRestClientExpectTest { +public class BaseRDSExpectTest extends BaseRestApiExpectTest { public BaseRDSExpectTest() { provider = "rds";