diff --git a/README.txt b/README.txt
index 6ef98d2ad9..b460e36ce6 100644
--- a/README.txt
+++ b/README.txt
@@ -29,7 +29,7 @@ data.
our current version is 1.0-beta-8
our dev version is 1.0-SNAPSHOT
-our compute api supports: ec2, gogrid, cloudservers (rackspace), rimuhosting, vcloud,
+our compute api supports: ec2, gogrid, cloudservers (rackspace), vcloud,
trmk-ecloud, trmk-vcloudexpress, eucalyptus, cloudsigma,
elasticstack, bluelock-vclouddirector, slicehost,
elastichosts-lon-p (Peer 1), elastichosts-sat-p (Peer 1),
@@ -45,8 +45,8 @@ our blobstore api supports: s3, cloudfiles (rackspace), azurestorage, atmosonlin
* note * the pom dependency org.jclouds/jclouds-allblobstore gives you access to
to all of these providers
-we also have support for: ibmdev, mezeo, nirvanix, boxdotnet, as well a number of features
- the sandbox
+we also have support for: ibmdev, mezeo, nirvanix, boxdotnet, rimuhosting, as well
+ a number of features the sandbox
If you want access to all jclouds components, include the maven dependency org.jclouds/jclouds-all
@@ -105,7 +105,7 @@ Compute Example (Clojure):
Downloads:
* distribution zip: http://jclouds.googlecode.com/files/jclouds-1.0-beta-8.zip
- * maven repo: https://oss.sonatype.org/content/repositories/releases
+ * maven repo: http://repo2.maven.org/maven2 (maven central - the default repository)
* snapshot repo: https://oss.sonatype.org/content/repositories/snapshots
Links:
diff --git a/all/pom.xml b/all/pom.xml
index 51f0aab3ea..d95e9bb766 100644
--- a/all/pom.xml
+++ b/all/pom.xml
@@ -39,5 +39,10 @@
jclouds-allblobstore
${project.version}
+
+ org.jclouds.provider
+ aws-simpledb
+ ${project.version}
+
diff --git a/allblobstore/pom.xml b/allblobstore/pom.xml
index f2c691d3bf..4b8c604873 100644
--- a/allblobstore/pom.xml
+++ b/allblobstore/pom.xml
@@ -50,8 +50,8 @@
${project.version}
- ${project.groupId}
- jclouds-filesystem
+ org.jclouds.api
+ filesystem
${project.version}
diff --git a/allcompute/pom.xml b/allcompute/pom.xml
index 3d4e4dfb54..14b531754e 100644
--- a/allcompute/pom.xml
+++ b/allcompute/pom.xml
@@ -39,11 +39,6 @@
jclouds-rackspace
${project.version}
-
- ${project.groupId}
- jclouds-rimuhosting
- ${project.version}
-
${project.groupId}
jclouds-vcloud
@@ -60,13 +55,13 @@
${project.version}
- ${project.groupId}
- jclouds-gogrid
+ org.jclouds.provider
+ gogrid
${project.version}
- ${project.groupId}
- jclouds-slicehost
+ org.jclouds.provider
+ slicehost
${project.version}
@@ -75,8 +70,8 @@
${project.version}
- ${project.groupId}
- jclouds-cloudsigma
+ org.jclouds.provider
+ cloudsigma
${project.version}
diff --git a/apis/cloudwatch/pom.xml b/apis/cloudwatch/pom.xml
new file mode 100644
index 0000000000..a4c2f717fc
--- /dev/null
+++ b/apis/cloudwatch/pom.xml
@@ -0,0 +1,110 @@
+
+
+
+
+ 4.0.0
+
+ org.jclouds.api
+ jclouds-apis-project
+ 1.0-SNAPSHOT
+ ../pom.xml
+
+ cloudwatch
+ jcloud cloudwatch api
+ jclouds components to access an implementation of CloudWatch
+
+
+ https://monitoring.us-east-1.amazonaws.com
+ 2009-05-15
+ ${test.aws.identity}
+ ${test.aws.credential}
+
+
+
+
+ org.jclouds
+ jclouds-aws
+ ${project.version}
+ jar
+
+
+ org.jclouds
+ jclouds-core
+ ${project.version}
+ test-jar
+ test
+
+
+ org.jclouds
+ jclouds-log4j
+ ${project.version}
+ test
+
+
+
+
+
+ live
+
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+
+
+ integration
+ integration-test
+
+ test
+
+
+
+
+ test.cloudwatch.endpoint
+ ${test.cloudwatch.endpoint}
+
+
+ test.cloudwatch.apiversion
+ ${test.cloudwatch.apiversion}
+
+
+ test.cloudwatch.identity
+ ${test.cloudwatch.identity}
+
+
+ test.cloudwatch.credential
+ ${test.cloudwatch.credential}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/apis/ec2/pom.xml b/apis/ec2/pom.xml
new file mode 100644
index 0000000000..ac9ed1536b
--- /dev/null
+++ b/apis/ec2/pom.xml
@@ -0,0 +1,129 @@
+
+
+
+
+ 4.0.0
+
+ org.jclouds.api
+ jclouds-apis-project
+ 1.0-SNAPSHOT
+ ../pom.xml
+
+ ec2
+ jcloud ec2 api
+ jclouds components to access an implementation of EC2
+
+
+
+ trmkrun-ccc,test.trmk-924
+ https://ec2.us-east-1.amazonaws.com
+ 2010-06-15
+ ${test.aws.identity}
+ ${test.aws.credential}
+
+
+
+
+ org.jclouds
+ jclouds-aws
+ ${project.version}
+ jar
+
+
+ org.jclouds
+ jclouds-compute
+ ${project.version}
+ jar
+
+
+ org.jclouds
+ jclouds-core
+ ${project.version}
+ test-jar
+ test
+
+
+ org.jclouds
+ jclouds-compute
+ ${project.version}
+ test-jar
+ test
+
+
+ org.jclouds
+ jclouds-log4j
+ ${project.version}
+ test
+
+
+
+
+
+ live
+
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+
+
+ integration
+ integration-test
+
+ test
+
+
+
+
+ test.ec2.endpoint
+ ${test.ec2.endpoint}
+
+
+ test.ec2.apiversion
+ ${test.ec2.apiversion}
+
+
+ test.ec2.identity
+ ${test.ec2.identity}
+
+
+ test.ec2.credential
+ ${test.ec2.credential}
+
+
+ jclouds.compute.blacklist-nodes
+ ${jclouds.compute.blacklist-nodes}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/apis/elb/pom.xml b/apis/elb/pom.xml
new file mode 100644
index 0000000000..7adb982f66
--- /dev/null
+++ b/apis/elb/pom.xml
@@ -0,0 +1,129 @@
+
+
+
+
+ 4.0.0
+
+ org.jclouds.api
+ jclouds-apis-project
+ 1.0-SNAPSHOT
+ ../pom.xml
+
+ elb
+ jcloud elb api
+ jclouds components to access an implementation of Elastic Load Balancer
+
+
+ https://elasticloadbalancing.us-east-1.amazonaws.com
+ 2010-07-01
+ ${test.aws.identity}
+ ${test.aws.credential}
+
+
+
+
+ org.jclouds
+ jclouds-aws
+ ${project.version}
+ jar
+
+
+ org.jclouds
+ jclouds-loadbalancer
+ ${project.version}
+ jar
+
+
+ org.jclouds
+ jclouds-core
+ ${project.version}
+ test-jar
+ test
+
+
+ org.jclouds
+ jclouds-jsch
+ ${project.version}
+ test
+
+
+ org.jclouds
+ jclouds-loadbalancer
+ ${project.version}
+ test-jar
+ test
+
+
+ org.jclouds
+ jclouds-log4j
+ ${project.version}
+ test
+
+
+
+
+
+ live
+
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+
+
+ integration
+ integration-test
+
+ test
+
+
+
+
+ test.elb.endpoint
+ ${test.elb.endpoint}
+
+
+ test.elb.apiversion
+ ${test.elb.apiversion}
+
+
+ test.elb.identity
+ ${test.elb.identity}
+
+
+ test.elb.credential
+ ${test.elb.credential}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/aws/core/src/main/java/org/jclouds/aws/elb/ELBAsyncClient.java b/apis/elb/src/main/java/org/jclouds/elb/ELBAsyncClient.java
similarity index 56%
rename from aws/core/src/main/java/org/jclouds/aws/elb/ELBAsyncClient.java
rename to apis/elb/src/main/java/org/jclouds/elb/ELBAsyncClient.java
index f0e1c47f49..6bb3b8db16 100644
--- a/aws/core/src/main/java/org/jclouds/aws/elb/ELBAsyncClient.java
+++ b/apis/elb/src/main/java/org/jclouds/elb/ELBAsyncClient.java
@@ -17,7 +17,7 @@
* ====================================================================
*/
-package org.jclouds.aws.elb;
+package org.jclouds.elb;
import static org.jclouds.aws.ec2.reference.EC2Parameters.ACTION;
import static org.jclouds.aws.ec2.reference.EC2Parameters.VERSION;
@@ -29,20 +29,23 @@ import javax.ws.rs.FormParam;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
-import org.jclouds.aws.elb.binders.BindAvailabilityZonesToIndexedFormParams;
-import org.jclouds.aws.elb.binders.BindELBInstanceIdsToIndexedFormParams;
-import org.jclouds.aws.elb.domain.LoadBalancer;
-import org.jclouds.aws.elb.xml.CreateLoadBalancerResponseHandler;
-import org.jclouds.aws.elb.xml.DescribeLoadBalancersResponseHandler;
-import org.jclouds.aws.elb.xml.RegisterInstancesWithLoadBalancerResponseHandler;
import org.jclouds.aws.filters.FormSigner;
-import org.jclouds.aws.functions.RegionToEndpoint;
+import org.jclouds.elb.binders.BindAvailabilityZonesToIndexedFormParams;
+import org.jclouds.elb.binders.BindInstanceIdsToIndexedFormParams;
+import org.jclouds.elb.binders.BindLoadBalancerNamesToIndexedFormParams;
+import org.jclouds.elb.domain.LoadBalancer;
+import org.jclouds.elb.xml.CreateLoadBalancerResponseHandler;
+import org.jclouds.elb.xml.DescribeLoadBalancersResponseHandler;
+import org.jclouds.elb.xml.RegisterInstancesWithLoadBalancerResponseHandler;
+import org.jclouds.location.functions.RegionToEndpointOrProviderIfNull;
import org.jclouds.rest.annotations.BinderParam;
import org.jclouds.rest.annotations.EndpointParam;
+import org.jclouds.rest.annotations.ExceptionParser;
import org.jclouds.rest.annotations.FormParams;
import org.jclouds.rest.annotations.RequestFilters;
import org.jclouds.rest.annotations.VirtualHost;
import org.jclouds.rest.annotations.XMLResponseParser;
+import org.jclouds.rest.functions.ReturnEmptySetOnNotFoundOr404;
import com.google.common.util.concurrent.ListenableFuture;
@@ -56,7 +59,7 @@ import com.google.common.util.concurrent.ListenableFuture;
@FormParams(keys = VERSION, values = ELBAsyncClient.VERSION)
@VirtualHost
public interface ELBAsyncClient {
- public static final String VERSION = "2009-11-25";
+ public static final String VERSION = "2010-07-01";
/**
* @see ELBClient#createLoadBalancerInRegion
@@ -66,12 +69,11 @@ public interface ELBAsyncClient {
@XMLResponseParser(CreateLoadBalancerResponseHandler.class)
@FormParams(keys = ACTION, values = "CreateLoadBalancer")
ListenableFuture createLoadBalancerInRegion(
- @EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
- @FormParam("LoadBalancerName") String name,
- @FormParam("Listeners.member.1.Protocol") String protocol,
- @FormParam("Listeners.member.1.LoadBalancerPort") int loadBalancerPort,
- @FormParam("Listeners.member.1.InstancePort") int instancePort,
- @BinderParam(BindAvailabilityZonesToIndexedFormParams.class) String... availabilityZones);
+ @EndpointParam(parser = RegionToEndpointOrProviderIfNull.class) @Nullable String region,
+ @FormParam("LoadBalancerName") String name, @FormParam("Listeners.member.1.Protocol") String protocol,
+ @FormParam("Listeners.member.1.LoadBalancerPort") int loadBalancerPort,
+ @FormParam("Listeners.member.1.InstancePort") int instancePort,
+ @BinderParam(BindAvailabilityZonesToIndexedFormParams.class) String... availabilityZones);
/**
* @see ELBClient#deleteLoadBalancerInRegion
@@ -80,8 +82,8 @@ public interface ELBAsyncClient {
@Path("/")
@FormParams(keys = ACTION, values = "DeleteLoadBalancer")
ListenableFuture deleteLoadBalancerInRegion(
- @EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
- @FormParam("LoadBalancerName") String name);
+ @EndpointParam(parser = RegionToEndpointOrProviderIfNull.class) @Nullable String region,
+ @FormParam("LoadBalancerName") String name);
/**
* @see ELBClient#registerInstancesWithLoadBalancerInRegion
@@ -90,10 +92,10 @@ public interface ELBAsyncClient {
@Path("/")
@XMLResponseParser(RegisterInstancesWithLoadBalancerResponseHandler.class)
@FormParams(keys = ACTION, values = "RegisterInstancesWithLoadBalancer")
- ListenableFuture extends Set> registerInstancesWithLoadBalancerInRegion(
- @EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
- @FormParam("LoadBalancerName") String name,
- @BinderParam(BindELBInstanceIdsToIndexedFormParams.class) String... instanceIds);
+ ListenableFuture> registerInstancesWithLoadBalancerInRegion(
+ @EndpointParam(parser = RegionToEndpointOrProviderIfNull.class) @Nullable String region,
+ @FormParam("LoadBalancerName") String name,
+ @BinderParam(BindInstanceIdsToIndexedFormParams.class) String... instanceIds);
/**
* @see ELBClient#deregisterInstancesWithLoadBalancerInRegion
@@ -102,9 +104,9 @@ public interface ELBAsyncClient {
@Path("/")
@FormParams(keys = ACTION, values = "DeregisterInstancesFromLoadBalancer")
ListenableFuture deregisterInstancesWithLoadBalancerInRegion(
- @EndpointParam(parser = RegionToEndpoint.class) @Nullable String region,
- @FormParam("LoadBalancerName") String name,
- @BinderParam(BindELBInstanceIdsToIndexedFormParams.class) String... instanceIds);
+ @EndpointParam(parser = RegionToEndpointOrProviderIfNull.class) @Nullable String region,
+ @FormParam("LoadBalancerName") String name,
+ @BinderParam(BindInstanceIdsToIndexedFormParams.class) String... instanceIds);
/**
* @see ELBClient#describeLoadBalancersInRegion
@@ -113,7 +115,9 @@ public interface ELBAsyncClient {
@Path("/")
@XMLResponseParser(DescribeLoadBalancersResponseHandler.class)
@FormParams(keys = ACTION, values = "DescribeLoadBalancers")
- ListenableFuture extends Set> describeLoadBalancersInRegion(
- @EndpointParam(parser = RegionToEndpoint.class) @Nullable String region);
+ @ExceptionParser(ReturnEmptySetOnNotFoundOr404.class)
+ ListenableFuture> describeLoadBalancersInRegion(
+ @EndpointParam(parser = RegionToEndpointOrProviderIfNull.class) @Nullable String region,
+ @BinderParam(BindLoadBalancerNamesToIndexedFormParams.class) String... loadbalancerNames);
}
diff --git a/aws/core/src/main/java/org/jclouds/aws/elb/ELBClient.java b/apis/elb/src/main/java/org/jclouds/elb/ELBClient.java
similarity index 92%
rename from aws/core/src/main/java/org/jclouds/aws/elb/ELBClient.java
rename to apis/elb/src/main/java/org/jclouds/elb/ELBClient.java
index 2013fe03a0..2bad8f3fc4 100644
--- a/aws/core/src/main/java/org/jclouds/aws/elb/ELBClient.java
+++ b/apis/elb/src/main/java/org/jclouds/elb/ELBClient.java
@@ -17,15 +17,15 @@
* ====================================================================
*/
-package org.jclouds.aws.elb;
+package org.jclouds.elb;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import javax.annotation.Nullable;
-import org.jclouds.aws.elb.domain.LoadBalancer;
import org.jclouds.concurrent.Timeout;
+import org.jclouds.elb.domain.LoadBalancer;
/**
* Provides access to EC2 Elastic Load Balancer via their REST API.
@@ -97,8 +97,9 @@ public interface ELBClient {
/**
* Returns a set of elastic load balancers
* @param region
+ * @param loadbalancerNames names associated with the LoadBalancers at creation time.
* @return
*/
- Set describeLoadBalancersInRegion(@Nullable String region);
+ Set extends LoadBalancer> describeLoadBalancersInRegion(@Nullable String region, String... loadbalancerNames);
-}
\ No newline at end of file
+}
diff --git a/aws/core/src/main/java/org/jclouds/aws/elb/ELBContextBuilder.java b/apis/elb/src/main/java/org/jclouds/elb/ELBContextBuilder.java
similarity index 79%
rename from aws/core/src/main/java/org/jclouds/aws/elb/ELBContextBuilder.java
rename to apis/elb/src/main/java/org/jclouds/elb/ELBContextBuilder.java
index 2b6bcb6360..024976e443 100644
--- a/aws/core/src/main/java/org/jclouds/aws/elb/ELBContextBuilder.java
+++ b/apis/elb/src/main/java/org/jclouds/elb/ELBContextBuilder.java
@@ -17,15 +17,16 @@
* ====================================================================
*/
-package org.jclouds.aws.elb;
+package org.jclouds.elb;
import java.util.List;
import java.util.Properties;
-import org.jclouds.aws.elb.config.ELBRestClientModule;
+import org.jclouds.elb.config.ELBRestClientModule;
+import org.jclouds.elb.loadbalancer.config.ELBLoadBalancerContextModule;
import org.jclouds.http.config.JavaUrlHttpCommandExecutorServiceModule;
+import org.jclouds.loadbalancer.LoadBalancerServiceContextBuilder;
import org.jclouds.logging.jdk.config.JDKLoggingModule;
-import org.jclouds.rest.RestContextBuilder;
import com.google.inject.Injector;
import com.google.inject.Module;
@@ -43,7 +44,12 @@ import com.google.inject.Module;
* @author Adrian Cole
* @see ELBContext
*/
-public class ELBContextBuilder extends RestContextBuilder {
+public class ELBContextBuilder extends LoadBalancerServiceContextBuilder {
+
+ @Override
+ protected void addContextModule(List modules) {
+ modules.add(new ELBLoadBalancerContextModule());
+ }
public ELBContextBuilder(Properties props) {
super(ELBClient.class, ELBAsyncClient.class, props);
diff --git a/aws/core/src/main/java/org/jclouds/aws/elb/ELBPropertiesBuilder.java b/apis/elb/src/main/java/org/jclouds/elb/ELBPropertiesBuilder.java
similarity index 71%
rename from aws/core/src/main/java/org/jclouds/aws/elb/ELBPropertiesBuilder.java
rename to apis/elb/src/main/java/org/jclouds/elb/ELBPropertiesBuilder.java
index eb9bfee832..6f4803ee7e 100644
--- a/aws/core/src/main/java/org/jclouds/aws/elb/ELBPropertiesBuilder.java
+++ b/apis/elb/src/main/java/org/jclouds/elb/ELBPropertiesBuilder.java
@@ -17,13 +17,14 @@
* ====================================================================
*/
-package org.jclouds.aws.elb;
+package org.jclouds.elb;
import static org.jclouds.Constants.PROPERTY_API_VERSION;
import static org.jclouds.Constants.PROPERTY_ENDPOINT;
import static org.jclouds.aws.reference.AWSConstants.PROPERTY_AUTH_TAG;
import static org.jclouds.aws.reference.AWSConstants.PROPERTY_HEADER_TAG;
-import static org.jclouds.aws.reference.AWSConstants.PROPERTY_REGIONS;
+import static org.jclouds.aws.reference.AWSConstants.PROPERTY_ZONECLIENT_ENDPOINT;
+import static org.jclouds.location.reference.LocationConstants.PROPERTY_REGIONS;
import java.util.Properties;
@@ -44,18 +45,18 @@ public class ELBPropertiesBuilder extends PropertiesBuilder {
properties.setProperty(PROPERTY_AUTH_TAG, "AWS");
properties.setProperty(PROPERTY_HEADER_TAG, "amz");
properties.setProperty(PROPERTY_API_VERSION, ELBAsyncClient.VERSION);
- properties.setProperty(PROPERTY_REGIONS, Joiner.on(',').join(Region.US_EAST_1,
- Region.US_WEST_1, Region.EU_WEST_1, Region.AP_SOUTHEAST_1));
- properties.setProperty(PROPERTY_ENDPOINT,
- "https://elasticloadbalancing.us-east-1.amazonaws.com");
+ properties.setProperty(PROPERTY_REGIONS,
+ Joiner.on(',').join(Region.US_EAST_1, Region.US_WEST_1, Region.EU_WEST_1, Region.AP_SOUTHEAST_1));
+ properties.setProperty(PROPERTY_ENDPOINT, "https://elasticloadbalancing.us-east-1.amazonaws.com");
properties.setProperty(PROPERTY_ENDPOINT + "." + Region.US_EAST_1,
- "https://elasticloadbalancing.us-east-1.amazonaws.com");
+ "https://elasticloadbalancing.us-east-1.amazonaws.com");
properties.setProperty(PROPERTY_ENDPOINT + "." + Region.US_WEST_1,
- "https://elasticloadbalancing.us-west-1.amazonaws.com");
+ "https://elasticloadbalancing.us-west-1.amazonaws.com");
properties.setProperty(PROPERTY_ENDPOINT + "." + Region.EU_WEST_1,
- "https://elasticloadbalancing.eu-west-1.amazonaws.com");
+ "https://elasticloadbalancing.eu-west-1.amazonaws.com");
properties.setProperty(PROPERTY_ENDPOINT + "." + Region.AP_SOUTHEAST_1,
- "https://elasticloadbalancing.ap-southeast-1.amazonaws.com");
+ "https://elasticloadbalancing.ap-southeast-1.amazonaws.com");
+ properties.setProperty(PROPERTY_ZONECLIENT_ENDPOINT, "https://ec2.us-east-1.amazonaws.com");
return properties;
}
diff --git a/aws/core/src/main/java/org/jclouds/aws/elb/binders/BindAvailabilityZonesToIndexedFormParams.java b/apis/elb/src/main/java/org/jclouds/elb/binders/BindAvailabilityZonesToIndexedFormParams.java
similarity index 83%
rename from aws/core/src/main/java/org/jclouds/aws/elb/binders/BindAvailabilityZonesToIndexedFormParams.java
rename to apis/elb/src/main/java/org/jclouds/elb/binders/BindAvailabilityZonesToIndexedFormParams.java
index 2ee7410a34..10c59069e5 100644
--- a/aws/core/src/main/java/org/jclouds/aws/elb/binders/BindAvailabilityZonesToIndexedFormParams.java
+++ b/apis/elb/src/main/java/org/jclouds/elb/binders/BindAvailabilityZonesToIndexedFormParams.java
@@ -17,7 +17,7 @@
* ====================================================================
*/
-package org.jclouds.aws.elb.binders;
+package org.jclouds.elb.binders;
import static org.jclouds.aws.ec2.util.EC2Utils.indexStringArrayToFormValuesWithStringFormat;
@@ -33,9 +33,9 @@ import org.jclouds.rest.Binder;
*/
@Singleton
public class BindAvailabilityZonesToIndexedFormParams implements Binder {
-
- public void bindToRequest(HttpRequest request, Object input) {
- indexStringArrayToFormValuesWithStringFormat(request, "AvailabilityZones.member.%s", input);
+ @Override
+ public R bindToRequest(R request, Object input) {
+ return indexStringArrayToFormValuesWithStringFormat(request, "AvailabilityZones.member.%s", input);
}
-}
\ No newline at end of file
+}
diff --git a/aws/core/src/main/java/org/jclouds/aws/elb/binders/BindELBInstanceIdsToIndexedFormParams.java b/apis/elb/src/main/java/org/jclouds/elb/binders/BindInstanceIdsToIndexedFormParams.java
similarity index 78%
rename from aws/core/src/main/java/org/jclouds/aws/elb/binders/BindELBInstanceIdsToIndexedFormParams.java
rename to apis/elb/src/main/java/org/jclouds/elb/binders/BindInstanceIdsToIndexedFormParams.java
index e31b21930d..c6a873ac42 100644
--- a/aws/core/src/main/java/org/jclouds/aws/elb/binders/BindELBInstanceIdsToIndexedFormParams.java
+++ b/apis/elb/src/main/java/org/jclouds/elb/binders/BindInstanceIdsToIndexedFormParams.java
@@ -17,7 +17,7 @@
* ====================================================================
*/
-package org.jclouds.aws.elb.binders;
+package org.jclouds.elb.binders;
import static org.jclouds.aws.ec2.util.EC2Utils.indexStringArrayToFormValuesWithStringFormat;
@@ -32,10 +32,10 @@ import org.jclouds.rest.Binder;
* @author Adrian Cole
*/
@Singleton
-public class BindELBInstanceIdsToIndexedFormParams implements Binder {
-
- public void bindToRequest(HttpRequest request, Object input) {
- indexStringArrayToFormValuesWithStringFormat(request, "Instances.member.%s.InstanceId", input);
+public class BindInstanceIdsToIndexedFormParams implements Binder {
+ @Override
+ public R bindToRequest(R request, Object input) {
+ return indexStringArrayToFormValuesWithStringFormat(request, "Instances.member.%s.InstanceId", input);
}
-}
\ No newline at end of file
+}
diff --git a/apis/elb/src/main/java/org/jclouds/elb/binders/BindLoadBalancerNamesToIndexedFormParams.java b/apis/elb/src/main/java/org/jclouds/elb/binders/BindLoadBalancerNamesToIndexedFormParams.java
new file mode 100644
index 0000000000..f9f4ce10ed
--- /dev/null
+++ b/apis/elb/src/main/java/org/jclouds/elb/binders/BindLoadBalancerNamesToIndexedFormParams.java
@@ -0,0 +1,22 @@
+package org.jclouds.elb.binders;
+
+import static org.jclouds.aws.ec2.util.EC2Utils.indexStringArrayToFormValuesWithStringFormat;
+
+import javax.inject.Singleton;
+
+import org.jclouds.http.HttpRequest;
+import org.jclouds.rest.Binder;
+
+/**
+ * Binds the String [] to form parameters named with LoadBalancerNames.member.index
+ *
+ * @author Adrian Cole
+ */
+@Singleton
+public class BindLoadBalancerNamesToIndexedFormParams implements Binder {
+ @Override
+ public R bindToRequest(R request, Object input) {
+ return indexStringArrayToFormValuesWithStringFormat(request, "LoadBalancerNames.member.%s", input);
+ }
+
+}
diff --git a/aws/core/src/main/java/org/jclouds/aws/elb/config/ELBRestClientModule.java b/apis/elb/src/main/java/org/jclouds/elb/config/ELBRestClientModule.java
old mode 100755
new mode 100644
similarity index 79%
rename from aws/core/src/main/java/org/jclouds/aws/elb/config/ELBRestClientModule.java
rename to apis/elb/src/main/java/org/jclouds/elb/config/ELBRestClientModule.java
index 6cb675a8f1..466910dceb
--- a/aws/core/src/main/java/org/jclouds/aws/elb/config/ELBRestClientModule.java
+++ b/apis/elb/src/main/java/org/jclouds/elb/config/ELBRestClientModule.java
@@ -17,11 +17,11 @@
* ====================================================================
*/
-package org.jclouds.aws.elb.config;
+package org.jclouds.elb.config;
-import org.jclouds.aws.config.AWSFormSigningRestClientModule;
-import org.jclouds.aws.elb.ELBAsyncClient;
-import org.jclouds.aws.elb.ELBClient;
+import org.jclouds.aws.config.WithZonesFormSigningRestClientModule;
+import org.jclouds.elb.ELBAsyncClient;
+import org.jclouds.elb.ELBClient;
import org.jclouds.http.RequiresHttp;
import org.jclouds.rest.ConfiguresRestClient;
@@ -32,9 +32,9 @@ import org.jclouds.rest.ConfiguresRestClient;
*/
@RequiresHttp
@ConfiguresRestClient
-public class ELBRestClientModule extends AWSFormSigningRestClientModule {
+public class ELBRestClientModule extends WithZonesFormSigningRestClientModule {
public ELBRestClientModule() {
super(ELBClient.class, ELBAsyncClient.class);
}
-}
\ No newline at end of file
+}
diff --git a/aws/core/src/main/java/org/jclouds/aws/elb/domain/LoadBalancer.java b/apis/elb/src/main/java/org/jclouds/elb/domain/LoadBalancer.java
similarity index 88%
rename from aws/core/src/main/java/org/jclouds/aws/elb/domain/LoadBalancer.java
rename to apis/elb/src/main/java/org/jclouds/elb/domain/LoadBalancer.java
index 6ff63cd212..1cdffca4d5 100644
--- a/aws/core/src/main/java/org/jclouds/aws/elb/domain/LoadBalancer.java
+++ b/apis/elb/src/main/java/org/jclouds/elb/domain/LoadBalancer.java
@@ -17,7 +17,7 @@
* ====================================================================
*/
-package org.jclouds.aws.elb.domain;
+package org.jclouds.elb.domain;
import java.util.HashSet;
import java.util.Set;
@@ -45,9 +45,8 @@ public class LoadBalancer implements Comparable {
this.loadBalancerListeners = new HashSet();
}
- public LoadBalancer(String region, String name, Set instanceIds,
- Set availabilityZones, String dnsName) {
- super();
+ public LoadBalancer(String region, String name, Set instanceIds, Set availabilityZones,
+ String dnsName) {
this.region = region;
this.name = name;
this.instanceIds = instanceIds;
@@ -125,19 +124,24 @@ public class LoadBalancer implements Comparable {
return name.compareTo(that.name);
}
+ @Override
+ public String toString() {
+ return "[region=" + region + ", name=" + name + ", instanceIds=" + instanceIds + ", availabilityZones="
+ + availabilityZones + ", dnsName=" + dnsName + ", appCookieStickinessPolicy=" + appCookieStickinessPolicy
+ + ", lBCookieStickinessPolicy=" + lBCookieStickinessPolicy + ", loadBalancerListeners="
+ + loadBalancerListeners + "]";
+ }
+
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
- result = prime * result
- + ((appCookieStickinessPolicy == null) ? 0 : appCookieStickinessPolicy.hashCode());
+ result = prime * result + ((appCookieStickinessPolicy == null) ? 0 : appCookieStickinessPolicy.hashCode());
result = prime * result + ((availabilityZones == null) ? 0 : availabilityZones.hashCode());
result = prime * result + ((dnsName == null) ? 0 : dnsName.hashCode());
result = prime * result + ((instanceIds == null) ? 0 : instanceIds.hashCode());
- result = prime * result
- + ((lBCookieStickinessPolicy == null) ? 0 : lBCookieStickinessPolicy.hashCode());
- result = prime * result
- + ((loadBalancerListeners == null) ? 0 : loadBalancerListeners.hashCode());
+ result = prime * result + ((lBCookieStickinessPolicy == null) ? 0 : lBCookieStickinessPolicy.hashCode());
+ result = prime * result + ((loadBalancerListeners == null) ? 0 : loadBalancerListeners.hashCode());
result = prime * result + ((name == null) ? 0 : name.hashCode());
result = prime * result + ((region == null) ? 0 : region.hashCode());
return result;
@@ -234,6 +238,11 @@ public class LoadBalancer implements Comparable {
return result;
}
+ @Override
+ public String toString() {
+ return "[policyName=" + policyName + ", cookieName=" + cookieName + "]";
+ }
+
@Override
public boolean equals(Object obj) {
if (this == obj)
@@ -292,8 +301,7 @@ public class LoadBalancer implements Comparable {
public int hashCode() {
final int prime = 31;
int result = 1;
- result = prime * result
- + ((cookieExpirationPeriod == null) ? 0 : cookieExpirationPeriod.hashCode());
+ result = prime * result + ((cookieExpirationPeriod == null) ? 0 : cookieExpirationPeriod.hashCode());
result = prime * result + ((policyName == null) ? 0 : policyName.hashCode());
return result;
}
@@ -320,6 +328,11 @@ public class LoadBalancer implements Comparable {
return true;
}
+ @Override
+ public String toString() {
+ return "[policyName=" + policyName + ", cookieExpirationPeriod=" + cookieExpirationPeriod + "]";
+ }
+
}
public static class LoadBalancerListener {
@@ -328,8 +341,8 @@ public class LoadBalancer implements Comparable {
private Integer loadBalancerPort;
private String protocol;
- public LoadBalancerListener(Set policyNames, Integer instancePort,
- Integer loadBalancerPort, String protocol) {
+ public LoadBalancerListener(Set policyNames, Integer instancePort, Integer loadBalancerPort,
+ String protocol) {
super();
this.policyNames = policyNames;
this.instancePort = instancePort;
@@ -416,5 +429,11 @@ public class LoadBalancer implements Comparable {
return true;
}
+ @Override
+ public String toString() {
+ return "[policyNames=" + policyNames + ", instancePort=" + instancePort + ", loadBalancerPort="
+ + loadBalancerPort + ", protocol=" + protocol + "]";
+ }
+
}
}
diff --git a/apis/elb/src/main/java/org/jclouds/elb/loadbalancer/config/ELBBindLoadBalancerStrategiesByClass.java b/apis/elb/src/main/java/org/jclouds/elb/loadbalancer/config/ELBBindLoadBalancerStrategiesByClass.java
new file mode 100644
index 0000000000..7a735dee7e
--- /dev/null
+++ b/apis/elb/src/main/java/org/jclouds/elb/loadbalancer/config/ELBBindLoadBalancerStrategiesByClass.java
@@ -0,0 +1,56 @@
+/**
+ *
+ * Copyright (C) 2010 Cloud Conscious, LLC.
+ *
+ * ====================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ====================================================================
+ */
+
+package org.jclouds.elb.loadbalancer.config;
+
+import org.jclouds.elb.loadbalancer.strategy.ELBDestroyLoadBalancerStrategy;
+import org.jclouds.elb.loadbalancer.strategy.ELBGetLoadBalancerMetadataStrategy;
+import org.jclouds.elb.loadbalancer.strategy.ELBListLoadBalancersStrategy;
+import org.jclouds.elb.loadbalancer.strategy.ELBLoadBalanceNodesStrategy;
+import org.jclouds.loadbalancer.config.BindLoadBalancerStrategiesByClass;
+import org.jclouds.loadbalancer.strategy.DestroyLoadBalancerStrategy;
+import org.jclouds.loadbalancer.strategy.GetLoadBalancerMetadataStrategy;
+import org.jclouds.loadbalancer.strategy.ListLoadBalancersStrategy;
+import org.jclouds.loadbalancer.strategy.LoadBalanceNodesStrategy;
+
+/**
+ * @author Adrian Cole
+ */
+public class ELBBindLoadBalancerStrategiesByClass extends BindLoadBalancerStrategiesByClass {
+
+ @Override
+ protected Class extends LoadBalanceNodesStrategy> defineLoadBalanceNodesStrategy() {
+ return ELBLoadBalanceNodesStrategy.class;
+ }
+
+ @Override
+ protected Class extends DestroyLoadBalancerStrategy> defineDestroyLoadBalancerStrategy() {
+ return ELBDestroyLoadBalancerStrategy.class;
+ }
+
+ @Override
+ protected Class extends GetLoadBalancerMetadataStrategy> defineGetLoadBalancerMetadataStrategy() {
+ return ELBGetLoadBalancerMetadataStrategy.class;
+ }
+
+ @Override
+ protected Class extends ListLoadBalancersStrategy> defineListLoadBalancersStrategy() {
+ return ELBListLoadBalancersStrategy.class;
+ }
+}
\ No newline at end of file
diff --git a/compute/src/main/java/org/jclouds/compute/suppliers/LocationSupplier.java b/apis/elb/src/main/java/org/jclouds/elb/loadbalancer/config/ELBBindLoadBalancerSuppliersByClass.java
similarity index 59%
rename from compute/src/main/java/org/jclouds/compute/suppliers/LocationSupplier.java
rename to apis/elb/src/main/java/org/jclouds/elb/loadbalancer/config/ELBBindLoadBalancerSuppliersByClass.java
index 8336082741..2266822fce 100644
--- a/compute/src/main/java/org/jclouds/compute/suppliers/LocationSupplier.java
+++ b/apis/elb/src/main/java/org/jclouds/elb/loadbalancer/config/ELBBindLoadBalancerSuppliersByClass.java
@@ -17,35 +17,29 @@
* ====================================================================
*/
-package org.jclouds.compute.suppliers;
+package org.jclouds.elb.loadbalancer.config;
import java.util.Set;
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
import org.jclouds.domain.Location;
+import org.jclouds.loadbalancer.config.BindLoadBalancerSuppliersByClass;
+import org.jclouds.location.suppliers.FirstZoneOrRegionMatchingRegionId;
+import org.jclouds.location.suppliers.ZoneToRegionToProvider;
import com.google.common.base.Supplier;
/**
- *
* @author Adrian Cole
- *
- * By default allows you to use a static set of locations bound to Set extends Location>
*/
-@Singleton
-public class LocationSupplier implements Supplier> {
- private final Set extends Location> locations;
+public class ELBBindLoadBalancerSuppliersByClass extends BindLoadBalancerSuppliersByClass {
- @Inject
- LocationSupplier(Set extends Location> locations) {
- this.locations = locations;
+ @Override
+ protected Class extends Supplier> defineDefaultLocationSupplier() {
+ return FirstZoneOrRegionMatchingRegionId.class;
}
@Override
- public Set extends Location> get() {
- return locations;
+ protected Class extends Supplier>> defineLocationSupplier() {
+ return ZoneToRegionToProvider.class;
}
-
}
\ No newline at end of file
diff --git a/apis/elb/src/main/java/org/jclouds/elb/loadbalancer/config/ELBLoadBalancerContextModule.java b/apis/elb/src/main/java/org/jclouds/elb/loadbalancer/config/ELBLoadBalancerContextModule.java
new file mode 100644
index 0000000000..253f5d4a61
--- /dev/null
+++ b/apis/elb/src/main/java/org/jclouds/elb/loadbalancer/config/ELBLoadBalancerContextModule.java
@@ -0,0 +1,39 @@
+/**
+ *
+ * Copyright (C) 2010 Cloud Conscious, LLC.
+ *
+ * ====================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ====================================================================
+ */
+
+package org.jclouds.elb.loadbalancer.config;
+
+import org.jclouds.loadbalancer.config.BaseLoadBalancerServiceContextModule;
+
+/**
+ * Configures the ELB connection.
+ *
+ * @author Adrian Cole
+ */
+
+public class ELBLoadBalancerContextModule extends BaseLoadBalancerServiceContextModule {
+
+ @Override
+ protected void configure() {
+ install(new ELBBindLoadBalancerSuppliersByClass());
+ install(new ELBBindLoadBalancerStrategiesByClass());
+ install(new ELBLoadBalancerServiceDependenciesModule());
+ super.configure();
+ }
+}
diff --git a/apis/elb/src/main/java/org/jclouds/elb/loadbalancer/config/ELBLoadBalancerServiceDependenciesModule.java b/apis/elb/src/main/java/org/jclouds/elb/loadbalancer/config/ELBLoadBalancerServiceDependenciesModule.java
new file mode 100644
index 0000000000..abb62787cc
--- /dev/null
+++ b/apis/elb/src/main/java/org/jclouds/elb/loadbalancer/config/ELBLoadBalancerServiceDependenciesModule.java
@@ -0,0 +1,23 @@
+package org.jclouds.elb.loadbalancer.config;
+
+import org.jclouds.elb.domain.LoadBalancer;
+import org.jclouds.elb.loadbalancer.functions.LoadBalancerToLoadBalancerMetadata;
+import org.jclouds.loadbalancer.domain.LoadBalancerMetadata;
+
+import com.google.common.base.Function;
+import com.google.inject.AbstractModule;
+import com.google.inject.TypeLiteral;
+
+/**
+ *
+ * @author Adrian Cole
+ */
+public class ELBLoadBalancerServiceDependenciesModule extends AbstractModule {
+
+ @Override
+ protected void configure() {
+ bind(new TypeLiteral>() {
+ }).to(LoadBalancerToLoadBalancerMetadata.class);
+ }
+
+}
diff --git a/apis/elb/src/main/java/org/jclouds/elb/loadbalancer/functions/LoadBalancerToLoadBalancerMetadata.java b/apis/elb/src/main/java/org/jclouds/elb/loadbalancer/functions/LoadBalancerToLoadBalancerMetadata.java
new file mode 100644
index 0000000000..07a6f8fdc5
--- /dev/null
+++ b/apis/elb/src/main/java/org/jclouds/elb/loadbalancer/functions/LoadBalancerToLoadBalancerMetadata.java
@@ -0,0 +1,59 @@
+/**
+ *
+ * Copyright (C) 2010 Cloud Conscious, LLC.
+ *
+ * ====================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ====================================================================
+ */
+
+package org.jclouds.elb.loadbalancer.functions;
+
+import java.util.Map;
+
+import javax.inject.Inject;
+import javax.inject.Singleton;
+
+import org.jclouds.domain.Location;
+import org.jclouds.elb.domain.LoadBalancer;
+import org.jclouds.loadbalancer.domain.LoadBalancerMetadata;
+import org.jclouds.loadbalancer.domain.LoadBalancerType;
+import org.jclouds.loadbalancer.domain.internal.LoadBalancerMetadataImpl;
+
+import com.google.common.base.Function;
+import com.google.common.base.Supplier;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableSet;
+
+/**
+ *
+ * @author Adrian Cole
+ */
+@Singleton
+public class LoadBalancerToLoadBalancerMetadata implements Function {
+ protected final Supplier