From acffe37459e83ab3d93b713ec6a56766087ead0d Mon Sep 17 00:00:00 2001 From: Jeremy Whitlock Date: Wed, 1 Jun 2011 23:37:39 -0600 Subject: [PATCH] Issue 550: Added ProviderMetadata for Google Storage. [in providers/googlestorage/src] * main/java/org/jclouds/googlestorage/GoogleStorageProviderMetadata.java, main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata, test/java/org/jclouds/googlestorage/GoogleStorageProviderTest.java: Added. --- .../GoogleStorageProviderMetadata.java | 108 ++++++++++++++++++ .../org.jclouds.providers.ProviderMetadata | 1 + .../GoogleStorageProviderTest.java | 37 ++++++ 3 files changed, 146 insertions(+) create mode 100644 providers/googlestorage/src/main/java/org/jclouds/googlestorage/GoogleStorageProviderMetadata.java create mode 100644 providers/googlestorage/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata create mode 100644 providers/googlestorage/src/test/java/org/jclouds/googlestorage/GoogleStorageProviderTest.java diff --git a/providers/googlestorage/src/main/java/org/jclouds/googlestorage/GoogleStorageProviderMetadata.java b/providers/googlestorage/src/main/java/org/jclouds/googlestorage/GoogleStorageProviderMetadata.java new file mode 100644 index 0000000000..65ab1e30a0 --- /dev/null +++ b/providers/googlestorage/src/main/java/org/jclouds/googlestorage/GoogleStorageProviderMetadata.java @@ -0,0 +1,108 @@ +/** + * + * Copyright (C) 2011 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.googlestorage; + +import com.google.common.collect.ImmutableSet; + +import java.net.URI; +import java.util.Set; + +import org.jclouds.providers.BaseProviderMetadata; + +/** + * Implementation of {@ link org.jclouds.types.ProviderMetadata} for Google's + * Storage provider. + * + * @author Jeremy Whitlock + */ +public class GoogleStorageProviderMetadata extends BaseProviderMetadata { + + /** + * {@inheritDoc} + */ + @Override + public String getId() { + return "googlestorage"; + } + + /** + * {@inheritDoc} + */ + @Override + public String getType() { + return BLOBSTORE_TYPE; + } + + /** + * {@inheritDoc} + */ + @Override + public String getName() { + return "Google Storage"; + } + + /** + * {@inheritDoc} + */ + @Override + public String getIdentityName() { + return "Access Key"; + } + + /** + * {@inheritDoc} + */ + @Override + public String getCredentialName() { + return "Secret Key"; + } + + /** + * {@inheritDoc} + */ + @Override + public URI getHomepage() { + return URI.create("http://code.google.com/apis/storage/"); + } + + /** + * {@inheritDoc} + */ + @Override + public URI getConsole() { + return URI.create("https://code.google.com/apis/console#:storage:access"); + } + + /** + * {@inheritDoc} + */ + @Override + public URI getApiDocumentation() { + return URI.create("http://code.google.com/apis/storage/docs/reference-guide.html"); + } + + /** + * {@inheritDoc} + */ + @Override + public Set getIso3166Codes() { + return ImmutableSet.of("US"); + } + +} diff --git a/providers/googlestorage/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata b/providers/googlestorage/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata new file mode 100644 index 0000000000..01a8afea14 --- /dev/null +++ b/providers/googlestorage/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata @@ -0,0 +1 @@ +org.jclouds.googlestorage.GoogleStorageProviderMetadata diff --git a/providers/googlestorage/src/test/java/org/jclouds/googlestorage/GoogleStorageProviderTest.java b/providers/googlestorage/src/test/java/org/jclouds/googlestorage/GoogleStorageProviderTest.java new file mode 100644 index 0000000000..1ac07495ce --- /dev/null +++ b/providers/googlestorage/src/test/java/org/jclouds/googlestorage/GoogleStorageProviderTest.java @@ -0,0 +1,37 @@ +/** + * + * Copyright (C) 2011 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.googlestorage; + +import org.jclouds.providers.BaseProviderMetadataTest; +import org.jclouds.providers.ProviderMetadata; +import org.testng.annotations.Test; + +/** + * The GoogleStorageProviderTest tests the {@link GoogleStorageProviderMetadata} class. + * + * @author Jeremy Whitlock + */ +@Test(groups = "unit", testName = "GoogleStorageProviderTest") +public class GoogleStorageProviderTest extends BaseProviderMetadataTest { + + public GoogleStorageProviderTest() { + super(new GoogleStorageProviderMetadata(), ProviderMetadata.BLOBSTORE_TYPE); + } + +} \ No newline at end of file