Skip to content
Permalink
Browse files
Initial implementation of OpenStack Marconi and Rackspace Cloud Queues.
  • Loading branch information
Everett Toews committed Oct 17, 2013
1 parent 41e2583 commit 2e92538b188aca55d8678dd390b5bdcf56eaa726
Showing 20 changed files with 1,057 additions and 0 deletions.
@@ -10,13 +10,15 @@ Although this is a "labs" repository, some of the providers and APIs here are pr
| Name | Type | Production Ready |
|------|------|------------------|
| openstack-glance | API | No |
| openstack-marconi | API | No |
| openstack-neutron | API | Yes |
| openstack-swift | API | No |
| openstack-trove | API | Yes |
| rackspace-autoscale | API | No |
| rackspace-autoscale-us | Provider | No |
| rackspace-clouddatabases-uk | Provider | Yes |
| rackspace-clouddatabases-us | Provider | Yes |
| rackspace-cloudqueues-us | Provider | No |

License
-------
@@ -0,0 +1,7 @@
OpenStack Marconi
=================

Marconi is a robust, web-scale message queuing service to support the distributed nature of large web applications.

Production ready?
No
@@ -0,0 +1,135 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF 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-instance" 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.apache.jclouds</groupId>
<artifactId>jclouds-project</artifactId>
<version>1.7.0-SNAPSHOT</version>
</parent>

<!-- TODO: when out of labs, switch to org.jclouds.api -->
<groupId>org.apache.jclouds.labs</groupId>
<artifactId>openstack-marconi</artifactId>
<version>1.7.0-SNAPSHOT</version>
<name>jclouds openstack-marconi api</name>
<description>jclouds components to access an implementation of OpenStack Marconi</description>
<packaging>bundle</packaging>

<properties>
<!-- keystone endpoint -->
<test.openstack-marconi.endpoint>http://localhost:5000/v2.0/</test.openstack-marconi.endpoint>
<test.openstack-marconi.api-version>1</test.openstack-marconi.api-version>
<test.openstack-marconi.build-version />
<test.openstack-marconi.identity>FIXME_IDENTITY</test.openstack-marconi.identity>
<test.openstack-marconi.credential>FIXME_CREDENTIALS</test.openstack-marconi.credential>
<test.jclouds.keystone.credential-type>passwordCredentials</test.jclouds.keystone.credential-type>
<jclouds.osgi.export>org.jclouds.openstack.marconi.v1*;version="${project.version}"</jclouds.osgi.export>
<jclouds.osgi.import>org.jclouds*;version="${project.version}",*</jclouds.osgi.import>
</properties>

<repositories>
<repository>
<id>apache-snapshots</id>
<url>https://repository.apache.org/content/repositories/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>org.apache.jclouds.api</groupId>
<artifactId>openstack-keystone</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>org.apache.jclouds</groupId>
<artifactId>jclouds-core</artifactId>
<version>${project.parent.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.jclouds.api</groupId>
<artifactId>openstack-keystone</artifactId>
<version>${project.parent.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.jclouds.driver</groupId>
<artifactId>jclouds-slf4j</artifactId>
<version>${project.parent.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.squareup.okhttp</groupId>
<artifactId>mockwebserver</artifactId>
<version>1.2.1</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.openstack-marconi.endpoint>${test.openstack-marconi.endpoint}</test.openstack-marconi.endpoint>
<test.openstack-marconi.api-version>${test.openstack-marconi.api-version}</test.openstack-marconi.api-version>
<test.openstack-marconi.build-version>${test.openstack-marconi.build-version}</test.openstack-marconi.build-version>
<test.openstack-marconi.identity>${test.openstack-marconi.identity}</test.openstack-marconi.identity>
<test.openstack-marconi.credential>${test.openstack-marconi.credential}</test.openstack-marconi.credential>
<test.jclouds.keystone.credential-type>${test.jclouds.keystone.credential-type}</test.jclouds.keystone.credential-type>
<jclouds.blobstore.httpstream.url>${jclouds.blobstore.httpstream.url}</jclouds.blobstore.httpstream.url>
<jclouds.blobstore.httpstream.md5>${jclouds.blobstore.httpstream.md5}</jclouds.blobstore.httpstream.md5>
</systemPropertyVariables>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>
@@ -0,0 +1,50 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF 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.openstack.marconi.v1;

import com.google.inject.Provides;
import org.jclouds.javax.annotation.Nullable;
import org.jclouds.location.Region;
import org.jclouds.location.Zone;
import org.jclouds.location.functions.ZoneToEndpoint;
import org.jclouds.openstack.marconi.v1.features.QueueApi;
import org.jclouds.rest.annotations.Delegate;
import org.jclouds.rest.annotations.EndpointParam;

import java.io.Closeable;
import java.util.Set;

/**
* Marconi is a robust, web-scale message queuing service to support the distributed nature of large web applications.
*
* @author Everett Toews
*/
public interface MarconiApi extends Closeable {
/**
* @return The Zone codes configured
*/
@Provides
@Zone
Set<String> getConfiguredZones();

/**
* Provides access to Queue features.
*/
@Delegate
QueueApi getQueueApiForZone(
@EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
}
@@ -0,0 +1,93 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF 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.openstack.marconi.v1;

import com.google.common.collect.ImmutableSet;
import com.google.inject.Module;
import org.jclouds.openstack.keystone.v2_0.config.AuthenticationApiModule;
import org.jclouds.openstack.keystone.v2_0.config.CredentialTypes;
import org.jclouds.openstack.keystone.v2_0.config.KeystoneAuthenticationModule;
import org.jclouds.openstack.keystone.v2_0.config.KeystoneAuthenticationModule.ZoneModule;
import org.jclouds.openstack.marconi.v1.config.MarconiHttpApiModule;
import org.jclouds.openstack.marconi.v1.config.MarconiTypeAdapters;
import org.jclouds.openstack.v2_0.ServiceType;
import org.jclouds.rest.internal.BaseHttpApiMetadata;

import java.net.URI;
import java.util.Properties;

import static org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties.CREDENTIAL_TYPE;
import static org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties.SERVICE_TYPE;

/**
* Implementation of {@link org.jclouds.apis.ApiMetadata} for Marconi 1.0 API
*
* @author Everett Toews
*/
public class MarconiApiMetadata extends BaseHttpApiMetadata<MarconiApi> {

@Override
public Builder toBuilder() {
return new Builder().fromApiMetadata(this);
}

public MarconiApiMetadata() {
this(new Builder());
}

protected MarconiApiMetadata(Builder builder) {
super(builder);
}

public static Properties defaultProperties() {
Properties properties = BaseHttpApiMetadata.defaultProperties();
properties.setProperty(SERVICE_TYPE, ServiceType.QUEUES);
properties.setProperty(CREDENTIAL_TYPE, CredentialTypes.PASSWORD_CREDENTIALS);
return properties;
}

public static class Builder extends BaseHttpApiMetadata.Builder<MarconiApi, Builder> {

protected Builder() {
id("openstack-marconi")
.name("OpenStack Marconi Havana API")
.identityName("${tenantName}:${userName} or ${userName}, if your keystone supports a default tenant")
.credentialName("${password}")
.documentation(URI.create("https://wiki.openstack.org/wiki/Marconi"))
.version("1.0")
.endpointName("Keystone base url ending in /v2.0/")
.defaultEndpoint("http://localhost:5000/v2.0/")
.defaultProperties(MarconiApiMetadata.defaultProperties())
.defaultModules(ImmutableSet.<Class<? extends Module>>builder()
.add(AuthenticationApiModule.class)
.add(KeystoneAuthenticationModule.class)
.add(ZoneModule.class)
.add(MarconiTypeAdapters.class)
.add(MarconiHttpApiModule.class).build());
}

@Override
public MarconiApiMetadata build() {
return new MarconiApiMetadata(this);
}

@Override
protected Builder self() {
return this;
}
}
}
@@ -0,0 +1,40 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF 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.openstack.marconi.v1.config;

import org.jclouds.http.HttpErrorHandler;
import org.jclouds.http.annotation.ClientError;
import org.jclouds.http.annotation.Redirection;
import org.jclouds.http.annotation.ServerError;
import org.jclouds.openstack.marconi.v1.MarconiApi;
import org.jclouds.openstack.marconi.v1.handlers.MarconiErrorHandler;
import org.jclouds.rest.ConfiguresHttpApi;
import org.jclouds.rest.config.HttpApiModule;

@ConfiguresHttpApi
public class MarconiHttpApiModule extends HttpApiModule<MarconiApi> {

public MarconiHttpApiModule() {
}

@Override
protected void bindErrorHandlers() {
bind(HttpErrorHandler.class).annotatedWith(Redirection.class).to(MarconiErrorHandler.class);
bind(HttpErrorHandler.class).annotatedWith(ClientError.class).to(MarconiErrorHandler.class);
bind(HttpErrorHandler.class).annotatedWith(ServerError.class).to(MarconiErrorHandler.class);
}
}
@@ -0,0 +1,29 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF 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.openstack.marconi.v1.config;

import com.google.inject.AbstractModule;
import org.jclouds.json.config.GsonModule.DateAdapter;
import org.jclouds.json.config.GsonModule.Iso8601DateAdapter;

public class MarconiTypeAdapters extends AbstractModule {

@Override
protected void configure() {
bind(DateAdapter.class).to(Iso8601DateAdapter.class);
}
}

0 comments on commit 2e92538

Please sign in to comment.