You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jclouds.apache.org by Bhathiya <no...@github.com> on 2014/05/16 17:00:59 UTC
[jclouds-labs-google] Created the sketch of GCS Api (#25)
1 Sketch of GCS Api
2 OAuth authorization
You can merge this Pull Request by running:
git pull https://github.com/hsbhathiya/jclouds-labs-google upstream
Or you can view, comment on it, or merge it online at:
https://github.com/jclouds/jclouds-labs-google/pull/25
-- Commit Summary --
* Created the sketch of GCS Api
-- File Changes --
A google-cloud-storage/pom.xml (148)
A google-cloud-storage/src/main/java/org/jclouds/googlecloudstorage/GoogleCloudStorageApiMetadata.java (125)
A google-cloud-storage/src/main/java/org/jclouds/googlecloudstorage/GoogleCloudStorageAsyncClient.java (67)
A google-cloud-storage/src/main/java/org/jclouds/googlecloudstorage/GoogleCloudStorageClient.java (26)
A google-cloud-storage/src/main/java/org/jclouds/googlecloudstorage/blobstore/GoogleCloudStorageAsyncBlobStore.java (130)
A google-cloud-storage/src/main/java/org/jclouds/googlecloudstorage/blobstore/GoogleCloudStorageBlobRequestSigner.java (70)
A google-cloud-storage/src/main/java/org/jclouds/googlecloudstorage/blobstore/GoogleCloudStorageBlobStore.java (125)
A google-cloud-storage/src/main/java/org/jclouds/googlecloudstorage/blobstore/GoogleCloudStorageBlobStoreContext.java (33)
A google-cloud-storage/src/main/java/org/jclouds/googlecloudstorage/blobstore/config/GoogleCloudStorageBlobStoreContextModule.java (35)
A google-cloud-storage/src/main/java/org/jclouds/googlecloudstorage/blobstore/internal/GoogleCloudStorageBlobStoreContextImpl.java (56)
A google-cloud-storage/src/main/java/org/jclouds/googlecloudstorage/config/GoogleCloudStorageParserModule.java (36)
A google-cloud-storage/src/main/java/org/jclouds/googlecloudstorage/config/GoogleCloudStorageRestClientModule.java (97)
A google-cloud-storage/src/main/java/org/jclouds/googlecloudstorage/config/OAuthModuleWithoutTypeAdapters.java (53)
A google-cloud-storage/src/main/java/org/jclouds/googlecloudstorage/config/package-info.java (23)
A google-cloud-storage/src/main/java/org/jclouds/googlecloudstorage/filters/RequestAuthorizeSignature.java (51)
A google-cloud-storage/src/main/java/org/jclouds/googlecloudstorage/filters/package-info.java (24)
A google-cloud-storage/src/main/java/org/jclouds/googlecloudstorage/package-info.java (25)
A google-cloud-storage/src/main/java/org/jclouds/googlecloudstorage/reference/GoogleCloudStorageConstants.java (54)
A google-cloud-storage/src/main/java/org/jclouds/googlecloudstorage/reference/GoogleCloudStorageHeaders.java (27)
A google-cloud-storage/src/main/java/org/jclouds/googlecloudstorage/reference/package-info.java (23)
A google-cloud-storage/src/main/resources/META-INF/services/org.jclouds.apis.ApiMetadata (1)
A google-cloud-storage/src/test/java/org/jclouds/googlecloudstorage/GCSClientMockTest.java (74)
A google-cloud-storage/src/test/java/org/jclouds/googlecloudstorage/GoogleCloudStorageApiMetadataTest.java (42)
A google-cloud-storage/src/test/java/org/jclouds/googlecloudstorage/GoogleCloudStorageAuthenticatedRestContextLiveTest.java (40)
M pom.xml (1)
-- Patch Links --
https://github.com/jclouds/jclouds-labs-google/pull/25.patch
https://github.com/jclouds/jclouds-labs-google/pull/25.diff
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/25
Re: [jclouds-labs-google] Created the sketch of GCS Api (#25)
Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-labs-google-pull-requests #59](https://jclouds.ci.cloudbees.com/job/jclouds-labs-google-pull-requests/59/) SUCCESS
This pull request looks good
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/25#issuecomment-43356055
Re: [jclouds-labs-google] Created the sketch of GCS Api (#25)
Posted by Andrew Phillips <no...@github.com>.
> +import org.jclouds.googlecloudstorage.GoogleCloudStorageApiMetadata;
> +import org.jclouds.googlecloudstorage.config.GoogleCloudStorageParserModule;
> +import org.jclouds.googlecloudstorage.config.OAuthModuleWithoutTypeAdapters;
> +import org.jclouds.oauth.v2.config.OAuthAuthenticationModule;
> +
> +import org.jclouds.rest.internal.BaseHttpApiMetadata;
> +import org.jclouds.rest.internal.BaseRestApiMetadata;
> +
> +import com.google.common.collect.ImmutableSet;
> +import com.google.common.reflect.TypeToken;
> +import com.google.inject.Module;
> +
> +/**
> + * Implementation of {@link ApiMetadata} for api.
> + */
> +
[minor] Remove blank line?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/25/files#r13062080
Re: [jclouds-labs-google] Created the sketch of GCS Api (#25)
Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-labs-google-pull-requests #58](https://jclouds.ci.cloudbees.com/job/jclouds-labs-google-pull-requests/58/) SUCCESS
This pull request looks good
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/25#issuecomment-43342257
Re: [jclouds-labs-google] Created the sketch of GCS Api (#25)
Posted by Andrew Phillips <no...@github.com>.
> +
> +import java.io.IOException;
> +import java.net.URL;
> +import java.util.Properties;
> +import java.util.Set;
> +
> +import org.jclouds.ContextBuilder;
> +import org.jclouds.concurrent.config.ExecutorServiceModule;
> +
> +import com.google.common.collect.ImmutableSet;
> +import com.google.inject.Module;
> +import com.google.mockwebserver.MockResponse;
> +import com.google.mockwebserver.MockWebServer;
> +import com.google.mockwebserver.RecordedRequest;
> +
> +public class GCSClientMockTest {
Please name the test class `<classUnderTest>MockTest`, i.e. `GoogleCloudStorageClientMockTest`
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/25/files#r13062182
Re: [jclouds-labs-google] Created the sketch of GCS Api (#25)
Posted by Andrew Phillips <no...@github.com>.
> +
> +import org.jclouds.View;
> +import org.jclouds.apis.internal.BaseApiMetadataTest;
> +import org.jclouds.googlecloudstorage.GoogleCloudStorageApiMetadata;
> +import org.testng.annotations.Test;
> +
> +import com.google.common.collect.ImmutableSet;
> +import com.google.common.reflect.TypeToken;
> +
> +/**
> + *
> + * <p/>
> + *
> + * <pre>
> + * META - INF / services / org.jclouds.apis.ApiMetadata
> + * </pre>
Remove or complete comment?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/25/files#r13062199
Re: [jclouds-labs-google] Created the sketch of GCS Api (#25)
Posted by Andrew Gaul <no...@github.com>.
@hsbhathiya try to keep commits small but complete, well-scoped, and include tests. The first few of any new provider will be tough since you need need to lay the groundwork but you will get past this in a few review cycles. I look forward to future commits!
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/25#issuecomment-44360076
Re: [jclouds-labs-google] Created the sketch of GCS Api (#25)
Posted by Andrew Phillips <no...@github.com>.
> + </dependency>
> + <dependency>
> + <groupId>org.apache.jclouds.driver</groupId>
> + <artifactId>jclouds-sshj</artifactId>
> + <version>${jclouds.version}</version>
> + <scope>test</scope>
> + </dependency>
> + <dependency>
> + <groupId>ch.qos.logback</groupId>
> + <artifactId>logback-classic</artifactId>
> + <scope>test</scope>
> + </dependency>
> + <dependency>
> + <groupId>com.google.mockwebserver</groupId>
> + <artifactId>mockwebserver</artifactId>
> + <scope>test</scope>
Indents
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/25/files#r13062065
Re: [jclouds-labs-google] Created the sketch of GCS Api (#25)
Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-labs-google-pull-requests #60](https://jclouds.ci.cloudbees.com/job/jclouds-labs-google-pull-requests/60/) SUCCESS
This pull request looks good
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/25#issuecomment-43361660
Re: [jclouds-labs-google] Created the sketch of GCS Api (#25)
Posted by Andrew Phillips <no...@github.com>.
> + *
> + * 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.googlecloudstorage;
> +
> +import java.io.Closeable;
> +
> +public interface GoogleCloudStorageClient extends Closeable {
> +
> + boolean BucketInsert(String bucketName, String ProjectID);
See above
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/25/files#r13062131
Re: [jclouds-labs-google] Created the sketch of GCS Api (#25)
Posted by Andrew Phillips <no...@github.com>.
> + <groupId>org.apache.jclouds.labs</groupId>
> + <artifactId>jclouds-labs-google</artifactId>
> + <version>1.8.0-SNAPSHOT</version>
> + </parent>
> +
> + <!-- TODO: when out of labs, switch to org.jclouds.provider -->
> + <groupId>org.apache.jclouds.labs</groupId>
> + <artifactId>google-cloud-storage</artifactId>
> + <name>jclouds Google Cloud Storage provider</name>
> + <description>jclouds components to access Google Cloud Storage</description>
> +
> + <properties>
> + <test.google-cloud-storage.identity>Client ID associated with with applcation
> + </test.google-cloud-storage.identity>
> + <test.google-cloud-storage.credential>Client Sevret of the application
> + </test.google-cloud-storage.credential>
Please make all these one line
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/25/files#r13062075
Re: [jclouds-labs-google] Created the sketch of GCS Api (#25)
Posted by Andrew Phillips <no...@github.com>.
> +import javax.ws.rs.core.MediaType;
> +
> +import org.jclouds.blobstore.attr.BlobScope;
> +import org.jclouds.oauth.v2.config.OAuthScopes;
> +import org.jclouds.oauth.v2.filters.OAuthAuthenticator;
> +import org.jclouds.rest.annotations.MapBinder;
> +import org.jclouds.rest.annotations.PayloadParam;
> +import org.jclouds.rest.annotations.RequestFilters;
> +import org.jclouds.rest.binders.BindToJsonPayload;
> +
> +import com.google.common.util.concurrent.ListenableFuture;
> +import com.google.inject.name.Named;
> +
> +/**
> + * Provides asynchronous access to GCS via their REST API.
> + * <p/> *
[minor] Remove the `*`?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/25/files#r13062113
Re: [jclouds-labs-google] Created the sketch of GCS Api (#25)
Posted by Andrew Phillips <no...@github.com>.
> +/**
> + * @author Bhathiya Supun
> + *
> + */
> +@Singleton
> +public class RequestAuthorizeSignature implements HttpRequestFilter, RequestSigner {
> +
> + @Override
> + public HttpRequest filter(HttpRequest request) throws HttpException {
> + return request;
> + }
> +
> + @Override
> + public String createStringToSign(HttpRequest input) {
> + // TODO Auto-generated method stub
> + return null;
I assume this still needs to be implemented..?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/25/files#r13062162
Re: [jclouds-labs-google] Created the sketch of GCS Api (#25)
Posted by Andrew Gaul <no...@github.com>.
> +import org.jclouds.oauth.v2.config.OAuthAuthenticationModule;
> +
> +import org.jclouds.rest.internal.BaseHttpApiMetadata;
> +import org.jclouds.rest.internal.BaseRestApiMetadata;
> +
> +import com.google.common.collect.ImmutableSet;
> +import com.google.common.reflect.TypeToken;
> +import com.google.inject.Module;
> +
> +/**
> + * Implementation of {@link ApiMetadata} for api.
> + */
> +
> +public class GoogleCloudStorageApiMetadata extends BaseRestApiMetadata {
> +
> + /**
jclouds prefers 3-space indents, not tab indents.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/25/files#r12746220
Re: [jclouds-labs-google] Created the sketch of GCS Api (#25)
Posted by Andrew Phillips <no...@github.com>.
> + <parent>
> + <groupId>org.apache.jclouds.labs</groupId>
> + <artifactId>jclouds-labs-google</artifactId>
> + <version>1.8.0-SNAPSHOT</version>
> + </parent>
> +
> + <!-- TODO: when out of labs, switch to org.jclouds.provider -->
> + <groupId>org.apache.jclouds.labs</groupId>
> + <artifactId>google-cloud-storage</artifactId>
> + <name>jclouds Google Cloud Storage provider</name>
> + <description>jclouds components to access Google Cloud Storage</description>
> +
> + <properties>
> + <test.google-cloud-storage.identity>Client ID associated with with applcation
> + </test.google-cloud-storage.identity>
> + <test.google-cloud-storage.credential>Client Sevret of the application
"Sevret"?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/25/files#r13062050
Re: [jclouds-labs-google] Created the sketch of GCS Api (#25)
Posted by Andrew Phillips <no...@github.com>.
> Just get the feeling that this PR is not upto the standard and also with small scope I had covered it
> is also diffcult to test the authorization.
Most of the "upto standard" stuff is formatting and other housekeeping things, so please don't be discouraged by that. Added functionality that can be tested is a much more important thing, obviously.
Maybe I missed something, but does this PR already contain working code? If so, could we work on adding tests to document what we expect the code to do? If you have any questions about that, please ask!
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/25#issuecomment-44331632
Re: [jclouds-labs-google] Created the sketch of GCS Api (#25)
Posted by Andrew Phillips <no...@github.com>.
> + return properties;
> + }
> +
> + public abstract static class Builder<T extends Builder<T>> extends BaseRestApiMetadata.Builder<T> {
> +
> + @SuppressWarnings("deprecation")
> + protected Builder() {
> + this(GoogleCloudStorageClient.class, GoogleCloudStorageAsyncClient.class);
> + }
> +
> + protected Builder(Class<?> syncClient, Class<?> asyncClient) {
> + super(syncClient, asyncClient);
> + id(GCS_PROVIDER_NAME)
> + .name("Google Cloud Storage Api ")
> + .identityName("Email associated with the Google API client_id")
> + .credentialName("Private key literal associated with the Google API client_id")
What is a "Private key literal"? Is that a term a GCS user will know?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/25/files#r13062107
Re: [jclouds-labs-google] Created the sketch of GCS Api (#25)
Posted by Andrew Phillips <no...@github.com>.
> @@ -0,0 +1,23 @@
> +/*
Why is this class needed?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/25/files#r13062157
Re: [jclouds-labs-google] Created the sketch of GCS Api (#25)
Posted by Andrew Phillips <no...@github.com>.
> +public class GoogleCloudStorageRestClientModule<S extends GoogleCloudStorageClient, A extends GoogleCloudStorageAsyncClient>
> + extends RestClientModule<S, A> {
> +
> + @SuppressWarnings("unchecked")
> + public GoogleCloudStorageRestClientModule() {
> + this(TypeToken.class.cast(typeToken(GoogleCloudStorageClient.class)), TypeToken.class
> + .cast(typeToken(GoogleCloudStorageAsyncClient.class)));
> + }
> +
> + protected GoogleCloudStorageRestClientModule(TypeToken<S> syncClientType, TypeToken<A> asyncClientType) {
> + super(syncClientType, asyncClientType);
> + }
> +
> + @Override
> + protected void configure() {
> + // TODO Auto-generated method stub
Remove
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/25/files#r13062138
Re: [jclouds-labs-google] Created the sketch of GCS Api (#25)
Posted by Andrew Phillips <no...@github.com>.
Hi @hsbhathiya! Thanks for the start! Some general comments:
* please have a look at the indenting. jclouds uses 3-space indents for Java code, and 2-space indents for XML files. No tabs, please!
* jclouds interface and parameter names are camelCase (except in a very few exceptions), starting with a lowercase letter.
* please have a look at [Checkstyle violations](https://jclouds.ci.cloudbees.com/job/jclouds-labs-google-pull-requests/58/violations/) (which you can see via the cloudbees-pull-request-builder comments and address those.
* I'm assuming the functionality is not meant to be complete at this point. What were your thoughts around next steps?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/25#issuecomment-44236019
Re: [jclouds-labs-google] Created the sketch of GCS Api (#25)
Posted by Bhathiya <no...@github.com>.
@andrewgaul @demobox
This PR contains lot of errors and needed lot of changes in structure when I moved to next step(Bucket Access Controls).So I thought of making a new PR that would not depend on this
Next commit is almost finish (https://github.com/hsbhathiya/jclouds-labs-google/commit/a9ee252a5e8d4451e2e02cbcd9912e94e419d808) and I will make a PR as soon as I correct some checkstyle violations
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/25#issuecomment-44959056
Re: [jclouds-labs-google] Created the sketch of GCS Api (#25)
Posted by BuildHive <no...@github.com>.
[jclouds » jclouds-labs-google #894](https://buildhive.cloudbees.com/job/jclouds/job/jclouds-labs-google/894/) SUCCESS
This pull request looks good
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/25#issuecomment-43356174
Re: [jclouds-labs-google] Created the sketch of GCS Api (#25)
Posted by Andrew Phillips <no...@github.com>.
> + <test.google-cloud-storage.api-version>v1</test.google-cloud-storage.api-version>
> + <test.google-cloud-storage.build-version/>
> + <test.google-cloud-storage.template>imageId=debian-7-wheezy-v20131120,locationId=us-central1-a,minRam=2048</test.google-cloud-storage.template>
> + </properties>
> +
> + <dependencies>
> + <dependency>
> + <groupId>org.apache.jclouds</groupId>
> + <artifactId>jclouds-core</artifactId>
> + <version>${jclouds.version}</version>
> + </dependency>
> + <dependency>
> + <groupId>org.apache.jclouds.labs</groupId>
> + <artifactId>oauth</artifactId>
> + <version>${project.version}</version>
> + <type>jar</type>
No need for `<type>jar</type>`?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/25/files#r13062058
Re: [jclouds-labs-google] Created the sketch of GCS Api (#25)
Posted by Andrew Phillips <no...@github.com>.
> + <systemPropertyVariables>
> + <jclouds.blobstore.httpstream.url>${jclouds.blobstore.httpstream.url}</jclouds.blobstore.httpstream.url>
> + <jclouds.blobstore.httpstream.md5>${jclouds.blobstore.httpstream.md5}</jclouds.blobstore.httpstream.md5>
> + <test.gcs.endpoint>${test.gcs.endpoint}</test.gcs.endpoint>
> + <test.gcs.api-version>${test.gcs.api-version}</test.gcs.api-version>
> + <test.google-cloud-storage.identity>${test.google-cloud-storage.identity}
> + </test.google-cloud-storage.identity>
> + <test.google-cloud-storage.credential>
> + ${test.google-cloud-storage.credential}
> + </test.google-cloud-storage.credential>
> + <test.google-cloud-storage.api-version>
> + ${test.google-cloud-storage.api-version}
> + </test.google-cloud-storage.api-version>
> + <test.google-cloud-storage.build-version>
> + ${test.google-cloud-storage.build-version}
> + </test.google-cloud-storage.build-version>
Indents. And please make all these one line?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/25/files#r13062071
Re: [jclouds-labs-google] Created the sketch of GCS Api (#25)
Posted by BuildHive <no...@github.com>.
[jclouds » jclouds-labs-google #896](https://buildhive.cloudbees.com/job/jclouds/job/jclouds-labs-google/896/) SUCCESS
This pull request looks good
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/25#issuecomment-43361409
Re: [jclouds-labs-google] Created the sketch of GCS Api (#25)
Posted by Andrew Phillips <no...@github.com>.
> + properties.put(OPERATION_COMPLETE_INTERVAL, 500);
> + properties.put(OPERATION_COMPLETE_TIMEOUT, 600000);
> + return properties;
> + }
> +
> + public abstract static class Builder<T extends Builder<T>> extends BaseRestApiMetadata.Builder<T> {
> +
> + @SuppressWarnings("deprecation")
> + protected Builder() {
> + this(GoogleCloudStorageClient.class, GoogleCloudStorageAsyncClient.class);
> + }
> +
> + protected Builder(Class<?> syncClient, Class<?> asyncClient) {
> + super(syncClient, asyncClient);
> + id(GCS_PROVIDER_NAME)
> + .name("Google Cloud Storage Api ")
[minor] Remove space after "Api"
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/25/files#r13062102
Re: [jclouds-labs-google] Created the sketch of GCS Api (#25)
Posted by Andrew Gaul <no...@github.com>.
> + * 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.
> + */
> +
> +/**
> + * This package contains modules who manage the dependencies of the S3Context, S3Client, and S3 Map views.
> + * @author Adrian Cole
Many incorrect comments of this form.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/25/files#r12746388
Re: [jclouds-labs-google] Created the sketch of GCS Api (#25)
Posted by Andrew Gaul <no...@github.com>.
> +import org.jclouds.blobstore.options.CreateContainerOptions;
> +import org.jclouds.blobstore.options.ListContainerOptions;
> +import org.jclouds.blobstore.options.PutOptions;
> +
> +import org.jclouds.blobstore.util.BlobUtils;
> +
> +import org.jclouds.domain.Location;
> +
> +import com.google.common.base.Supplier;
> +
> +/**
> + *
> + * @author Bhathiya Supun
> + */
> +@Singleton
> +public class GoogleCloudStorageBlobStore extends BaseBlobStore {
Please remove the portable abstraction and implement the provider-specific calls first. Subsequent commits can include the portable abstraction.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/25/files#r12746337
Re: [jclouds-labs-google] Created the sketch of GCS Api (#25)
Posted by Bhathiya <no...@github.com>.
Closed #25.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/25#event-127446068
Re: [jclouds-labs-google] Created the sketch of GCS Api (#25)
Posted by Andrew Gaul <no...@github.com>.
> + * (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.googlecloudstorage;
> +
> +import java.io.Closeable;
> +
> +//*********************Form S3Cient**********************************//
Stale comment?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/25/files#r12746239
Re: [jclouds-labs-google] Created the sketch of GCS Api (#25)
Posted by Andrew Phillips <no...@github.com>.
> @@ -0,0 +1,24 @@
> +/*
Why is this class needed?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/25/files#r13062163
Re: [jclouds-labs-google] Created the sketch of GCS Api (#25)
Posted by Andrew Phillips <no...@github.com>.
> +import org.jclouds.oauth.v2.domain.Token;
> +import org.jclouds.oauth.v2.domain.TokenRequest;
> +import org.jclouds.oauth.v2.functions.BuildTokenRequest;
> +import org.jclouds.oauth.v2.functions.FetchToken;
> +import org.jclouds.oauth.v2.functions.OAuthCredentialsSupplier;
> +import org.jclouds.oauth.v2.functions.SignOrProduceMacForToken;
> +import org.jclouds.rest.internal.GeneratedHttpRequest;
> +
> +import com.google.common.base.Function;
> +import com.google.common.base.Supplier;
> +import com.google.inject.TypeLiteral;
> +
> +/**
> + * Overrides OAuthModule leaving TypeAdapters bindings out.
> + * <p/>
> + * TODO overcome this by using multibindings on GSonModule?
Is this a valid TODO?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/25/files#r13062146
Re: [jclouds-labs-google] Created the sketch of GCS Api (#25)
Posted by Andrew Gaul <no...@github.com>.
> + * 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.googlecloudstorage.reference;
> +
> +import com.google.common.annotations.Beta;
> +
> +/**
> + * @author Bhathiya Supun
> + */
> +public interface GoogleCloudStorageConstants {
Can you make this a final class with a private constructor instead of an interface? This technique is more appropriate for constants.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/25/files#r12746541
Re: [jclouds-labs-google] Created the sketch of GCS Api (#25)
Posted by Bhathiya <no...@github.com>.
@demobox & @andrewgaul Thanks for reviewing the PR. Just get the feeling that this PR is not upto the standard and also with small scope I had covered it is also diffcult to test the authorization.I moved to BucketAccessControl (https://developers.google.com/storage/docs/json_api/v1/bucketAccessControls) implementation
Current work can be found in https://github.com/hsbhathiya/jclouds-labs-google/tree/upstream2
I would test both authorization and Bucket Access Control operation and make a new PR
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/25#issuecomment-44274590
Re: [jclouds-labs-google] Created the sketch of GCS Api (#25)
Posted by Andrew Phillips <no...@github.com>.
> +import org.jclouds.oauth.v2.functions.BuildTokenRequest;
> +import org.jclouds.oauth.v2.functions.FetchToken;
> +import org.jclouds.oauth.v2.functions.OAuthCredentialsSupplier;
> +import org.jclouds.oauth.v2.functions.SignOrProduceMacForToken;
> +import org.jclouds.rest.internal.GeneratedHttpRequest;
> +
> +import com.google.common.base.Function;
> +import com.google.common.base.Supplier;
> +import com.google.inject.TypeLiteral;
> +
> +/**
> + * Overrides OAuthModule leaving TypeAdapters bindings out.
> + * <p/>
> + * TODO overcome this by using multibindings on GSonModule?
> + *
> + * @author David Alves
Is this the correct author?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/25/files#r13062148
Re: [jclouds-labs-google] Created the sketch of GCS Api (#25)
Posted by BuildHive <no...@github.com>.
[jclouds » jclouds-labs-google #892](https://buildhive.cloudbees.com/job/jclouds/job/jclouds-labs-google/892/) SUCCESS
This pull request looks good
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/25#issuecomment-43342083
Re: [jclouds-labs-google] Created the sketch of GCS Api (#25)
Posted by Andrew Phillips <no...@github.com>.
> + <version>${jclouds.version}</version>
> + </dependency>
> + <dependency>
> + <groupId>org.apache.jclouds.labs</groupId>
> + <artifactId>oauth</artifactId>
> + <version>${project.version}</version>
> + <type>jar</type>
> + </dependency>
> + <dependency>
> + <groupId>org.apache.jclouds.labs</groupId>
> + <artifactId>oauth</artifactId>
> + <version>${project.version}</version>
> + <type>test-jar</type>
> + <scope>test</scope>
> + </dependency>
> + <dependency>
Move this one above the test deps?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/25/files#r13062062
Re: [jclouds-labs-google] Created the sketch of GCS Api (#25)
Posted by Andrew Phillips <no...@github.com>.
> +
> +import com.google.common.collect.ImmutableSet;
> +import com.google.inject.Module;
> +import com.google.mockwebserver.MockResponse;
> +import com.google.mockwebserver.MockWebServer;
> +import com.google.mockwebserver.RecordedRequest;
> +
> +public class GCSClientMockTest {
> +
> + private static final String BUCKET_NAME = "myBucketName" + (int) 100 * Math.random();
> + private static final String PROJECT_ID = "1082289308625";
> +
> + private static final Set<Module> modules = ImmutableSet.<Module> of(new ExecutorServiceModule(sameThreadExecutor(),
> + sameThreadExecutor()));
> +
> + static GoogleCloudStorageClient getGCSClient(URL server) {
`protected`, so it can be overridden by child classes?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/25/files#r13062188
Re: [jclouds-labs-google] Created the sketch of GCS Api (#25)
Posted by Andrew Phillips <no...@github.com>.
> +@Deprecated
> +@RequestFilters(OAuthAuthenticator.class)
> +@BlobScope(CONTAINER)
> +public interface GoogleCloudStorageAsyncClient extends Closeable {
> +
> + /**
> + * https://developers.google.com/storage/docs/json_api/v1/buckets/insert
> + */
> + @Named("BucketInsert")
> + @POST
> + @Consumes(MediaType.APPLICATION_JSON)
> + @Produces(MediaType.APPLICATION_JSON)
> + @Path("/")
> + @OAuthScopes(STORAGE_FULLCONTROL_SCOPE)
> + @MapBinder(BindToJsonPayload.class)
> + ListenableFuture<Boolean> BucketInsert(@PayloadParam("name") String BucketName,
`insertBucket`? jclouds follows Java convention with camelCase names for methods.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/25/files#r13062121