added aws-sqs provider

This commit is contained in:
Adrian Cole 2012-09-14 17:59:53 -07:00
parent bc9cffad40
commit fec732f33b
8 changed files with 364 additions and 0 deletions

114
labs/aws-sqs/pom.xml Normal file
View File

@ -0,0 +1,114 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to jclouds, Inc. (jclouds) under one or more
contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. jclouds licenses this file
to you 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-queue" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.jclouds</groupId>
<artifactId>jclouds-project</artifactId>
<version>1.5.0-SNAPSHOT</version>
<relativePath>../../project/pom.xml</relativePath>
</parent>
<groupId>org.jclouds.labs</groupId>
<artifactId>aws-sqs</artifactId>
<name>jclouds Amazon Simple Queue Service provider</name>
<description>Simple Queue Service implementation targeted to Amazon Web Services</description>
<packaging>bundle</packaging>
<properties>
<test.aws-sqs.endpoint>https://sqs.us-east-1.amazonaws.com</test.aws-sqs.endpoint>
<test.aws-sqs.api-version>2011-10-01</test.aws-sqs.api-version>
<test.aws-sqs.build-version></test.aws-sqs.build-version>
<test.aws-sqs.identity>${test.aws.identity}</test.aws-sqs.identity>
<test.aws-sqs.credential>${test.aws.credential}</test.aws-sqs.credential>
<jclouds.osgi.export>org.jclouds.aws.sqs*;version="${project.version}"</jclouds.osgi.export>
<jclouds.osgi.import>org.jclouds*;version="${project.version}",*</jclouds.osgi.import>
</properties>
<dependencies>
<dependency>
<groupId>org.jclouds.labs</groupId>
<artifactId>sqs</artifactId>
<version>${project.version}</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.jclouds.labs</groupId>
<artifactId>sqs</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jclouds</groupId>
<artifactId>jclouds-core</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jclouds.driver</groupId>
<artifactId>jclouds-slf4j</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.0.0</version>
<scope>test</scope>
</dependency>
</dependencies>
<profiles>
<profile>
<id>live</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<executions>
<execution>
<id>integration</id>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<systemPropertyVariables>
<test.aws-sqs.endpoint>${test.aws-sqs.endpoint}</test.aws-sqs.endpoint>
<test.aws-sqs.api-version>${test.aws-sqs.api-version}</test.aws-sqs.api-version>
<test.aws-sqs.build-version>${test.aws-sqs.build-version}</test.aws-sqs.build-version>
<test.aws-sqs.identity>${test.aws-sqs.identity}</test.aws-sqs.identity>
<test.aws-sqs.credential>${test.aws-sqs.credential}</test.aws-sqs.credential>
</systemPropertyVariables>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

View File

@ -0,0 +1,107 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you 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.aws.sqs;
import static org.jclouds.aws.domain.Region.AP_NORTHEAST_1;
import static org.jclouds.aws.domain.Region.AP_SOUTHEAST_1;
import static org.jclouds.aws.domain.Region.EU_WEST_1;
import static org.jclouds.aws.domain.Region.SA_EAST_1;
import static org.jclouds.aws.domain.Region.US_EAST_1;
import static org.jclouds.aws.domain.Region.US_WEST_1;
import static org.jclouds.aws.domain.Region.US_WEST_2;
import static org.jclouds.location.reference.LocationConstants.PROPERTY_REGION;
import java.net.URI;
import java.util.Properties;
import org.jclouds.aws.domain.Region;
import org.jclouds.sqs.SQSApiMetadata;
import org.jclouds.providers.ProviderMetadata;
import org.jclouds.providers.internal.BaseProviderMetadata;
/**
* Implementation of @ link org.jclouds.types.ProviderMetadata} for Amazon's Simple Queue Service
* provider.
*
* @author Adrian Cole
*/
public class AWSSQSProviderMetadata extends BaseProviderMetadata {
/** The serialVersionUID */
private static final long serialVersionUID = 7750012233546655021L;
public static Builder builder() {
return new Builder();
}
@Override
public Builder toBuilder() {
return Builder.class.cast(builder().fromProviderMetadata(this));
}
public AWSSQSProviderMetadata() {
super(builder());
}
public AWSSQSProviderMetadata(Builder builder) {
super(builder);
}
public static Properties defaultProperties() {
Properties properties = new Properties();
properties.putAll(Region.regionProperties());
properties.setProperty(PROPERTY_REGION + "." + US_EAST_1 + ".endpoint",
"https://sqs.us-east-1.amazonaws.com");
properties.setProperty(PROPERTY_REGION + "." + US_WEST_1 + ".endpoint",
"https://sqs.us-west-1.amazonaws.com");
properties.setProperty(PROPERTY_REGION + "." + US_WEST_2 + ".endpoint",
"https://sqs.us-west-2.amazonaws.com");
properties.setProperty(PROPERTY_REGION + "." + SA_EAST_1 + ".endpoint",
"https://sqs.sa-east-1.amazonaws.com");
properties.setProperty(PROPERTY_REGION + "." + EU_WEST_1 + ".endpoint",
"https://sqs.eu-west-1.amazonaws.com");
properties.setProperty(PROPERTY_REGION + "." + AP_SOUTHEAST_1 + ".endpoint",
"https://sqs.ap-southeast-1.amazonaws.com");
properties.setProperty(PROPERTY_REGION + "." + AP_NORTHEAST_1 + ".endpoint",
"https://sqs.ap-northeast-1.amazonaws.com");
return properties;
}
public static class Builder extends BaseProviderMetadata.Builder {
protected Builder(){
id("aws-sqs")
.name("Amazon Simple Queue Service")
.endpoint("https://sqs.us-east-1.amazonaws.com")
.homepage(URI.create("http://aws.amazon.com/sqs"))
.console(URI.create("https://console.aws.amazon.com/ec2/home"))
.linkedServices("aws-ec2", "aws-rds", "aws-sqs", "aws-elb", "aws-iam","aws-cloudwatch", "aws-s3", "aws-simpledb")
.iso3166Codes("US-VA", "US-CA", "BR-SP", "US-OR", "IE", "SG", "JP-13")
.apiMetadata(new SQSApiMetadata())
.defaultProperties(AWSSQSProviderMetadata.defaultProperties());
}
@Override
public Builder fromProviderMetadata(
ProviderMetadata in) {
super.fromProviderMetadata(in);
return this;
}
}
}

View File

@ -0,0 +1 @@
org.jclouds.aws.sqs.AWSSQSProviderMetadata

View File

@ -0,0 +1,36 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you 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.aws.sqs;
import org.jclouds.sqs.SQSApiMetadata;
import org.jclouds.providers.internal.BaseProviderMetadataTest;
import org.testng.annotations.Test;
/**
* The AWSSQSProviderTest tests the org.jclouds.providers.AWSSQSProvider class.
*
* @author Adrian Cole
*/
@Test(groups = "unit", testName = "AWSSQSProviderTest")
public class AWSSQSProviderTest extends BaseProviderMetadataTest {
public AWSSQSProviderTest() {
super(new AWSSQSProviderMetadata(), new SQSApiMetadata());
}
}

View File

@ -0,0 +1,35 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you 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.aws.sqs.features;
import org.jclouds.sqs.features.MessageApiLiveTest;
import org.testng.annotations.Test;
/**
*
* @author Adrian Cole
*/
@Test(groups = "live", testName = "AWSMessageApiLiveTest")
public class AWSMessageApiLiveTest extends MessageApiLiveTest {
public AWSMessageApiLiveTest() {
provider = "aws-sqs";
}
}

View File

@ -0,0 +1,35 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you 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.aws.sqs.features;
import org.jclouds.sqs.features.PermissionApiLiveTest;
import org.testng.annotations.Test;
/**
*
* @author Adrian Cole
*/
@Test(groups = "live", testName = "AWSPermissionApiLiveTest")
public class AWSPermissionApiLiveTest extends PermissionApiLiveTest {
public AWSPermissionApiLiveTest() {
provider = "aws-sqs";
}
}

View File

@ -0,0 +1,35 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you 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.aws.sqs.features;
import org.jclouds.sqs.features.QueueApiLiveTest;
import org.testng.annotations.Test;
/**
*
* @author Adrian Cole
*/
@Test(groups = "live", testName = "AWSQueueApiLiveTest")
public class AWSQueueApiLiveTest extends QueueApiLiveTest {
public AWSQueueApiLiveTest() {
provider = "aws-sqs";
}
}

View File

@ -62,5 +62,6 @@
<module>fgcp-au</module> <module>fgcp-au</module>
<module>fgcp-de</module> <module>fgcp-de</module>
<module>sqs</module> <module>sqs</module>
<module>aws-sqs</module>
</modules> </modules>
</project> </project>