Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull updates from master branch #277

Merged
merged 221 commits into from
Oct 22, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
221 commits
Select commit Hold shift + click to select a range
47632ab
Avoid downloading gcd if gcloud is installed and gcd version matches …
mziccard Sep 15, 2015
1c52730
Refactor process invocation for gcd in tests. Restored Windows support.
mziccard Sep 17, 2015
b0a88f5
Add fine-grained logging to LocalGcdHelper
mziccard Sep 17, 2015
e792c2c
Formatted LocalGcdHelper
mziccard Sep 18, 2015
f753b44
Single factory method for CommandWrapper in LocalGcdHelper
mziccard Sep 18, 2015
3a183e4
BucketInfo: add null check for rules in builder. Add test case.
mziccard Sep 18, 2015
71b62e8
Merge pull request #162 from mziccard/use-installed-gcd-for-testing
aozarov Sep 18, 2015
3739a1a
Merge pull request #167 from mziccard/fix-bucketinfo-tobuilder
aozarov Sep 18, 2015
af17114
initial work on functional blob/bucket
aozarov Jul 9, 2015
21fc90c
update copyright
aozarov Jul 9, 2015
d8fa7bb
Split ListResult into interface and implementation. Add BlobListResul…
mziccard Sep 22, 2015
44cefb0
Blob and Bucket extended with more functionalities, added tests
mziccard Sep 22, 2015
c1f018c
Avoid storing Iterable<Blob> in BlobListResult
mziccard Sep 23, 2015
8591284
Remove redundant return from Blob and Bucket javadoc
mziccard Sep 23, 2015
a10b74b
Make Blob.copyTo accept string parameters
mziccard Sep 24, 2015
ccc0230
Minor refactoring to Bucket and BucketTest
mziccard Sep 24, 2015
929030d
Fix if-match error on blob delete
mziccard Sep 24, 2015
3cf6af3
Make Bucket and Blob immutable
mziccard Sep 24, 2015
2e90926
Use transform in BlobListResult
mziccard Sep 24, 2015
cab0ebd
Fix IllegalArgumentException when OPTIONS in cors
mziccard Sep 24, 2015
4a0862d
Merge pull request #178 from mziccard/fix-exception-cors-option
aozarov Sep 24, 2015
1318e33
Merge pull request #176 from mziccard/fix-match-error-blob-delete
aozarov Sep 24, 2015
210355d
Add AuthCredentials.createForJson. More javadoc.
mziccard Sep 25, 2015
d638926
Merge pull request #180 from mziccard/auth-credentials-from-json
aozarov Sep 25, 2015
eb9ea81
Update Blob and Bucket javadoc
mziccard Sep 25, 2015
af6bbef
Add third RetryResult (instead of using null) to denote 'proceed'
Sep 25, 2015
fa7d7fc
Minor updates javadoc Blob, Bucket, ListResult
mziccard Sep 25, 2015
0a71721
Merge pull request #171 from mziccard/functional-blob-bucket
aozarov Sep 25, 2015
800b709
Rename RetryResult enum values, and update datastore and storage inte…
Sep 25, 2015
48458d3
Merge pull request #181 from ajkannan/add-retry-result-value
aozarov Sep 26, 2015
b5b43d9
Fix NPE when listing buckets in empty project and blobs in empty bucket
mziccard Sep 28, 2015
90dd070
Add null checks to fromPb in BucketInfo and BlobInfo, updated tests
mziccard Sep 28, 2015
23ebbec
Merge pull request #183 from mziccard/fix-npe-storage-list
aozarov Sep 28, 2015
abb421e
Merge pull request #185 from mziccard/fix-to-from-pb
aozarov Sep 28, 2015
93b7a0c
createFromStream added to Storage, StorageRpc.create uses InputStream
mziccard Sep 28, 2015
575fa1f
Add test for blob channels, remove duplicated call in BlobWriterChann…
mziccard Sep 29, 2015
82cd3ea
javadoc: recommend Storage.writer for large uploads
mziccard Sep 29, 2015
967c429
Remove redundant read test, add buffered write test, add EasyMock.verify
mziccard Sep 29, 2015
7145030
Renaming BlobWriterChannelImpl to BlobWriteChannelImpl, renaming tests
mziccard Sep 29, 2015
8928c49
Add test for runtime exception
Sep 29, 2015
1f617b7
choose port for LocalGcdHelper dynamically
Sep 30, 2015
e776320
add test for nonretryable DatastoreException
Sep 30, 2015
22a9e99
Allow a default port to be passed in as a parameter, and also fix names
Sep 30, 2015
e13fc60
Merge pull request #189 from ajkannan/datastore-exception-handling
aozarov Sep 30, 2015
86065a7
Rename Storage.createFromStream create, add create for empty content
mziccard Sep 30, 2015
1311e0f
Tabbed view with examples in landing page
mziccard Sep 30, 2015
3123b93
Removed PROJECT_ID from GCE/GAE example
mziccard Sep 30, 2015
5d8d123
Merge pull request #188 from mziccard/test-storage-blob-channels
aozarov Sep 30, 2015
1fa53a8
Merge pull request #186 from mziccard/add-storage-create-from-stream
aozarov Sep 30, 2015
9ea8d66
Add unit test class for StorageImpl
mziccard Sep 30, 2015
00ec956
Allow option to specify port in LocalGcdHelper's main
Sep 30, 2015
a6ccc30
Merge pull request #190 from ajkannan/specify-gcd-port
aozarov Sep 30, 2015
4bca63e
Fix source (meta)generation parameters in StorageImpl.copy
mziccard Oct 1, 2015
0de3141
Merge pull request #196 from mziccard/fix-copy-source-generation
aozarov Oct 1, 2015
eec6c4e
Refactor StorageImplTest add tests for readBytes writer and reader wi…
mziccard Oct 1, 2015
da3c441
Remove unnecessary lines from landing page examples
mziccard Sep 30, 2015
464de20
Merge pull request #192 from mziccard/unit-test-storage-impl
aozarov Oct 1, 2015
a6a2898
Merge pull request #191 from mziccard/tabbed-view-to-site
aozarov Oct 1, 2015
88a1031
fix joda-time version
Oct 1, 2015
f004c1f
Merge pull request #198 from ajkannan/fix-joda-version
aozarov Oct 1, 2015
36f2867
Make StorageImpl and related methods throw StorageException, add tests
mziccard Oct 2, 2015
30b9a54
Fix GENERATION(_NOT)_MATCH values in StorageRpc.Option
mziccard Oct 2, 2015
cfc09e4
Merge pull request #203 from mziccard/fix-storage-rpc-option-value
aozarov Oct 2, 2015
3d3c5ab
Automate push to maven central repository for releases
Oct 2, 2015
e4f7dd8
doc fix
Oct 2, 2015
0ba6652
Make resumable upload request use PUT instead of POST
mziccard Oct 2, 2015
c7bbc65
Merge pull request #206 from mziccard/put-resumable-upload
aozarov Oct 2, 2015
f3a19a6
Merge pull request #205 from ajkannan/automate-maven-push
aozarov Oct 2, 2015
21cde60
fix travis encryption variables for maven deployment
Oct 2, 2015
d82500d
Merge pull request #202 from mziccard/fix-and-test-storage-exceptions
aozarov Oct 2, 2015
e3dba5e
Merge pull request #207 from ajkannan/fix-env-vars
aozarov Oct 2, 2015
6766acb
Move decrypting to after_success.sh (no pull requests)
mziccard Oct 5, 2015
d14c314
Merge pull request #210 from mziccard/fix-travis-pull-request
ajkannan Oct 5, 2015
9f30b61
Update storage examples, add storage section to readme
mziccard Oct 5, 2015
ebfde4b
Make readme anchors consistent
mziccard Oct 5, 2015
2aa9e32
Add integration test config to pom.xml
mziccard Oct 5, 2015
f02bd97
Add storage integration tests
mziccard Oct 5, 2015
abc9a00
Refactor storage readme example to use strings
mziccard Oct 6, 2015
167197f
Update StorageExample actions to use functional Blob and Bucket
mziccard Oct 6, 2015
bfd4fc4
Refactor storage integration tests
mziccard Oct 6, 2015
3751460
Document how to test
Oct 7, 2015
3f9f621
Updated exception handling in ITStorageTest, minor refactoring
mziccard Oct 7, 2015
a1e3cc4
Update travis config to run integration tests
mziccard Oct 7, 2015
429ac30
Merge pull request #211 from mziccard/storage-integration-tests
aozarov Oct 7, 2015
25bde60
Testing doc fixes and adding/updating examples
Oct 7, 2015
c6b7f27
Merge pull request #209 from mziccard/storage-example
aozarov Oct 7, 2015
2e3042c
Move testing helpers to subpackages within their service's src/main/ …
Oct 7, 2015
bfae667
Fix javadoc link
Oct 7, 2015
be1d504
Overload RemoteGcsHelper.create to take projectId and key path
mziccard Oct 8, 2015
385dd4e
Add default RetryParams to storage options built from RemoteGcsHelper
mziccard Oct 8, 2015
c23b9a2
Check storage not null before deleting bucket in ITStorageTest
mziccard Oct 8, 2015
59722fa
Minor wording and link changes to testing readme.
Oct 8, 2015
d8478d7
Update examples in package-info
Oct 8, 2015
26fb875
Fixing merge conflict in README.md
Oct 8, 2015
e1a50bc
Add scheme to user-provided host if necessary
Oct 8, 2015
b8923f4
simplify logic in host normalization
Oct 8, 2015
5b1e341
Merge pull request #224 from ajkannan/handle-scheme
aozarov Oct 8, 2015
396db25
fix typo in README.md
Oct 8, 2015
234f964
Merge pull request #222 from mziccard/overload-create-remotegcshelper
aozarov Oct 8, 2015
2171251
Merge pull request #223 from mziccard/fix-npe-itstoragetest-afterclass
aozarov Oct 8, 2015
c7059ae
fix merge conflict
Oct 8, 2015
b52ded3
make testing directions more standardized between datastore and storage
Oct 8, 2015
476d594
Merge pull request #221 from ajkannan/add-testing-subpackages
aozarov Oct 8, 2015
b455911
Merge pull request #218 from ajkannan/add-testing-docs
aozarov Oct 8, 2015
e3f5275
update version to 0.0.9
Oct 8, 2015
e76c85c
Merge pull request #225 from ajkannan/update-version
aozarov Oct 8, 2015
76bf376
Updating version in README files.
Oct 8, 2015
8cca008
Link to specific package of javadoc from README
Oct 8, 2015
b40bf53
Merge to fix conflict from recent README.md updates
Oct 8, 2015
22f1839
Add javadoc links to maven site
Oct 8, 2015
b60f5bf
Updates to pom.xml by script
Oct 8, 2015
7af8180
skip the rerun of tests during deployment
Oct 8, 2015
a1059d8
Merge pull request #230 from ajkannan/stop-test-reruns
aozarov Oct 8, 2015
30d0036
Increase retry parameters for storage
Oct 8, 2015
ad64788
Merge pull request #231 from ajkannan/increase-storage-retries
aozarov Oct 8, 2015
8310e70
Merge pull request #226 from ajkannan/module-specific-docs-links
aozarov Oct 9, 2015
92b6fce
Merge pull request #227 from ajkannan/update-version-to-snapshot
aozarov Oct 9, 2015
fc3a2d7
Add batch get, update, delete methods to storage
mziccard Oct 9, 2015
b1918ca
Add batch get update and delete to Blob
mziccard Oct 9, 2015
77bfdd7
Add connectTimeout and readTimeout to ServiceOptions
mziccard Oct 9, 2015
93ce84c
Make links to examples more specific
Oct 9, 2015
5253270
fix apidocs/index.html to update version automatically
Oct 9, 2015
ef16c27
add example usage for Storage.signUrl
aozarov Oct 9, 2015
06893c8
Merge pull request #237 from ajkannan/autoupdate-apidocs-version
aozarov Oct 9, 2015
f7d30a6
Merge pull request #235 from ajkannan/specific-example-links
aozarov Oct 9, 2015
0f5829b
Add RELEASING.md
Oct 9, 2015
c8b2823
make javadoc for Java 8 happy
aozarov Oct 9, 2015
b574e90
Add step for tag and github release
Oct 9, 2015
9f95061
Merge pull request #236 from aozarov/master
mziccard Oct 9, 2015
51bfef6
Add javadoc to ServiceOptions.Builder methods
mziccard Oct 9, 2015
6423879
Add timeout getters and javadocs to StorageOptions
mziccard Oct 9, 2015
5515d52
Merge pull request #234 from mziccard/add-timeout-service-options
aozarov Oct 9, 2015
2f0bf9a
Add conventions for releases
Oct 9, 2015
eac140a
Add usage example for gcloud-java-examples
Oct 9, 2015
494cd91
shorten usage example by using gcloud sdk set project
Oct 9, 2015
5923d10
Increase connect and read timeout for storage service
Oct 9, 2015
89dafea
Merge pull request #241 from ajkannan/increase-storage-timeout
aozarov Oct 9, 2015
7680281
Merge pull request #240 from ajkannan/usage-example
aozarov Oct 9, 2015
c1d1fb7
Fix link to PR
ajkannan Oct 9, 2015
46d5efa
add 429 to the retriable error codes
aozarov Oct 9, 2015
8d19606
Merge pull request #239 from ajkannan/releasing-docs
aozarov Oct 9, 2015
2ffd822
Merge pull request #242 from aozarov/master
ajkannan Oct 9, 2015
c552ede
Rename getAll in Bucket to get, return immutable list
mziccard Oct 12, 2015
5bf23b6
Refactor Blob/Storage batch get, update and delete
mziccard Oct 12, 2015
f1c6b04
Add storage.update(blobInfo) and update batch methods params
mziccard Oct 12, 2015
75f1c09
More detailed javadoc for options.retryParams and RetryParams
mziccard Oct 12, 2015
e844c36
Merge pull request #246 from mziccard/better-options-retryparams-doc
aozarov Oct 12, 2015
68408bf
Standardize readme files
Oct 12, 2015
41a2a7a
Standardize gcloud-java/gcloud-java/README
Oct 12, 2015
e868ca3
Update README.md
ajkannan Oct 12, 2015
ea493d5
simplify code snippets
Oct 12, 2015
469be5f
Merge pull request #247 from ajkannan/standardize-readme
aozarov Oct 12, 2015
f2b6adc
Remove case for 1 item array in Blob batch methods, add @throws to docs
mziccard Oct 12, 2015
cedc9a2
Merge pull request #233 from mziccard/simple-storage-batch-requests
aozarov Oct 12, 2015
33ddb90
Split normal and error output streams in ProcessStreamReader to forwa…
Oct 13, 2015
d60d3f4
Make signUrl take long duration and TimeUnit parameter
mziccard Oct 12, 2015
286065d
Update storage example
mziccard Oct 12, 2015
64121d8
Enhance storage/blob signUrl javadoc
mziccard Oct 12, 2015
194d239
Rename TimeSource to Clock and move it to ServiceOptions
mziccard Oct 13, 2015
3e57ae7
Fix javadoc indent in Blob and Storage
mziccard Oct 13, 2015
6bbfb05
Add readResolve to StorageOptions.DefaultClock
mziccard Oct 13, 2015
52e60ee
Merge pull request #243 from mziccard/sign-url-time-unit
aozarov Oct 13, 2015
235da5a
Log gcd.sh errors instead of printing to stderr
Oct 13, 2015
264a8ae
Add BlobId class and update other storage classes accordingly
mziccard Oct 13, 2015
fd333a9
Add storage.delete(blobId) to resolve ambiguities
mziccard Oct 14, 2015
8b89ba3
Use blobId in Blob whenever possible
mziccard Oct 14, 2015
41da3aa
Add copyTo(BlobId) method to Blob
mziccard Oct 14, 2015
5e1d71b
Merge pull request #251 from mziccard/add-blob-id
aozarov Oct 14, 2015
77a9dd1
Add options parameter to Blob.exists
mziccard Oct 14, 2015
7115734
Merge pull request #256 from mziccard/blob-exists-options
aozarov Oct 14, 2015
3011587
Add static load method to Blob and Bucket, add tests, update example
mziccard Oct 14, 2015
13572e7
Fix Blob/Bucket load javadoc, return null if not found
mziccard Oct 14, 2015
39e3d3a
Make two threads to digest gcd.sh output
Oct 15, 2015
6e66dfd
fix merge conflict
Oct 15, 2015
fb25804
Update examples to properly use load and BlobId
mziccard Oct 15, 2015
32e7521
Update Storage example in README.md and package-info
mziccard Oct 15, 2015
029fbe2
Remove Serializable from BlobRead and BlobWriteChannel
mziccard Oct 15, 2015
ac5db6a
clean before deploying
Oct 15, 2015
49f9b3f
clean and test for snapshot builds as well
Oct 15, 2015
87d698b
skip tests for snapshot builds
Oct 15, 2015
fa5933e
update verison to 0.0.10
Oct 15, 2015
1cc1d3a
Merge pull request #263 from ajkannan/clean-before-deploy
aozarov Oct 15, 2015
207ebd2
Merge pull request #264 from ajkannan/update-version-0.0.10
aozarov Oct 15, 2015
03d2f19
Updating version in README files.
Oct 15, 2015
73ccc02
Fix exported variable scope issue
Oct 15, 2015
35e3f81
remove extra exports
Oct 15, 2015
06661a9
Merge pull request #265 from ajkannan/source-it-vars
mziccard Oct 15, 2015
bbec253
update version to 0.0.11-SNAPSHOT
Oct 15, 2015
3310a82
Merge pull request #266 from ajkannan/update-version-0.0.11-SNAPSHOT
mziccard Oct 15, 2015
d51311e
Update StorageExample, readme and package info examples
mziccard Oct 16, 2015
33400da
Move State interface out of channels, move to core module and make it…
mziccard Oct 16, 2015
ab56573
Add channel write and restore integration tests
mziccard Oct 16, 2015
b0c8874
Merge pull request #257 from mziccard/add-blob-bucket-load
aozarov Oct 16, 2015
007a9ab
simplify logging logic
Oct 16, 2015
4e7aa3a
try continue to consuming output in the event of exception
Oct 16, 2015
8e595a7
avoid duplicating last log on terminate
Oct 16, 2015
5029f00
use StringBuilder for accumulating logs
Oct 16, 2015
054ed10
ensure last line of logs is output
Oct 16, 2015
c993853
remove check for duplicate logs
Oct 16, 2015
291486d
style fix
Oct 16, 2015
03dbc8c
Merge pull request #250 from ajkannan/forward-errors
aozarov Oct 16, 2015
dcbe37f
Remove public modifiers from channels StateImpl Builder
mziccard Oct 19, 2015
71604bb
Remove compact param from write channel flush, restore limit from arr…
mziccard Oct 19, 2015
2060526
Fix wrapping, remove limit from write channel StateImpl
mziccard Oct 19, 2015
638bd92
Add test for save/restore closed BlobWriteChannelImpl
mziccard Oct 19, 2015
30992ae
Merge pull request #261 from mziccard/remove-serializable-channels
aozarov Oct 19, 2015
cebb0bb
Add BlobWriteOption to support MD5 and CRC32C checks on create/write
mziccard Oct 19, 2015
3d13b99
Remove md5 and crc32c options from StorageRpc
mziccard Oct 20, 2015
3c71bf2
Add create from stream to RemoteGcsHelper, fix javadoc format
mziccard Oct 20, 2015
f24b2bf
Add RemoteGcsHelper unit tests
mziccard Oct 20, 2015
1c5030a
Fix testForceDeleteTimeout and add test for fatal failure
mziccard Oct 20, 2015
354d047
Remove unnecessary final from create(blobInfo, content, blobWriteOpti…
mziccard Oct 20, 2015
460948e
rename operators in PropertyFilter
Oct 20, 2015
2665ab5
Merge pull request #274 from ajkannan/property-filter-naming
aozarov Oct 20, 2015
5f01eb9
add javadocs for set vs add in structured query builder
Oct 20, 2015
5595770
Merge pull request #271 from mziccard/add-blob-write-options
aozarov Oct 20, 2015
8b129ce
Fix javadoc wording and location
Oct 20, 2015
99a4091
Merge pull request #275 from ajkannan/query-javadoc
aozarov Oct 21, 2015
862ea6a
Removed RemoteGcsHeler.Option
mziccard Oct 21, 2015
0dd3d97
Merge pull request #272 from mziccard/add-remotegcshelper-test
aozarov Oct 21, 2015
bba6925
pull updates from upstream/master into update-datastore branch
Oct 22, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ before_install:
- git clone -b travis `git config --get remote.origin.url` target/travis
- cp target/travis/settings.xml ~/.m2/settings.xml
install: mvn install -DskipTests=true -Dgpg.skip=true
script: mvn verify
script:
- utilities/verify.sh
branches:
only:
- master
Expand All @@ -20,3 +21,5 @@ env:
- secure: "CUM2l73KFm7U4eDsUKkh1WyEUzF3v94Ltvs7MnKU9olE1dNp3YmRBL9Lqhx3hSDqm/xv0ETQsPy29Fs2+VFkhQQxSley6iS/4trr2fioTB680txfXo/zDdmGSP1q1/U40fv1S+jvuBRAhDV5W+8dhWOGtzMH0tJp/TszeDGlmCY="
- secure: "YBbdzseg5yDFpQIiMoc3P2BTmqef4o+KAvrLMEbobXjIkiglUQ7UHCoRWClX74fTKAwuC7JvK7o5xJGLnaY43jJADXrGtE8/d44HNJaieE67mNosDYtOiA0iI2uIRFCAnXJCZ8f/iHx2xVMHMNWlwyoil4IUcjj+D7FRcsT5alE="
- secure: "Od7BwllgFXVfzFe8ooTNm05TR+Xd5QjHW0oqhU8vclaQs2oX4e0eNIsebXQfLi3xDgd1pz5uUQC/Z4S0NqACwyUuUvPdGYYmRPTR7Dh8HgGJ4ojSdN3RwaHsxUqG7Ajts9rIHOtRpY28xOChVRNX0Z7eAPlvxYU4Ed2ZEo356r0="
- secure: "ROxa8HHuba+Dfixljq6poW1+Uwv8EaZUtTTTB7KEtAHJRN8rwoNS4TC0U0PEHcYAL+ivxP3zIfWOCoWreJGoa+V8y9BtLSuamUj/SSsuoHRdJjq5BmcHI/77P11HAzCH6Ul/GxsRB52/IRHwJyfKkh8XUMVSsCl7AG4CKUgt63Y="
- secure: "MKZ3y6IYp3Z67T+BO4Brw+my8sRMSMdWWgvUcyBpwQZ64w7ccHJCce4W8WHCPNko/eczHHCJELPG28VNyPTWIV/Jt2ZJ6L9qLCjsQpDPOdJdDaAKc9Df4sm8fB0FBiPVDwMYPQF1/Sy2gK7FZf0YR3LOeoyzswRgmj5bQMdVEeU="
105 changes: 79 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,11 @@ Java idiomatic client for [Google Cloud Platform][cloud-platform] services.

- [Homepage] (https://googlecloudplatform.github.io/gcloud-java/)
- [API Documentation] (http://googlecloudplatform.github.io/gcloud-java/apidocs)
- [Examples] (http://googlecloudplatform.github.io/gcloud-java/apidocs/index.html?com/google/gcloud/examples/package-summary.html)

This client supports the following Google Cloud Platform services:

- [Google Cloud Datastore] (#google-cloud-datastore)

<!---
- [Google Cloud Storage] (https://cloud.google.com/storage/)
--->
- [Google Cloud Storage] (#google-cloud-storage)

> Note: This client is a work-in-progress, and may occasionally
> make backwards-incompatible changes.
Expand All @@ -29,32 +25,39 @@ Add this to your pom.xml file
<dependency>
<groupId>com.google.gcloud</groupId>
<artifactId>gcloud-java</artifactId>
<version>0.0.7</version>
<version>0.0.10</version>
</dependency>
```

<!---
Example Applications
--------------------

- `java-datastore-sample`_ - A sample using Cloud Datastore
.. _java-datastore-sample: https://github.com/GoogleCloudPlatform/java-datastore-sample
--->
- [`DatastoreExample`](https://github.com/GoogleCloudPlatform/gcloud-java/blob/master/gcloud-java-examples/src/main/java/com/google/gcloud/examples/DatastoreExample.java) - A simple command line interface for the Cloud Datastore
- Read more about using this application on the [`gcloud-java-examples` docs page](http://googlecloudplatform.github.io/gcloud-java/apidocs/?com/google/gcloud/examples/DatastoreExample.html).
- [`StorageExample`](https://github.com/GoogleCloudPlatform/gcloud-java/blob/master/gcloud-java-examples/src/main/java/com/google/gcloud/examples/StorageExample.java) - A simple command line interface providing some of Cloud Storage's functionality
- Read more about using this application on the [`gcloud-java-examples` docs page](http://googlecloudplatform.github.io/gcloud-java/apidocs/?com/google/gcloud/examples/StorageExample.html).

Authentication
--------------

There are multiple ways to authenticate to use Google Cloud services.

1. When using `gcloud-java` libraries from within Compute/App Engine, no additional authentication steps are necessary.
2. When using `gcloud-java` libraries elsewhere, there are two options:
* [Generate a JSON service account key](https://cloud.google.com/storage/docs/authentication?hl=en#service_accounts). Supply a path to the downloaded JSON credentials file when building the options supplied to datastore/storage constructor.
* If running locally for development/testing, you can use use [Google Cloud SDK](https://cloud.google.com/sdk/?hl=en). To use the SDK authentication, [download the SDK](https://cloud.google.com/sdk/?hl=en) if you haven't already. Then login using the SDK (`gcloud auth login` in command line), and set your current project using `gcloud config set project PROJECT_ID`.

Google Cloud Datastore
----------------------

Google [Cloud Datastore][cloud-datastore] is a fully managed, schemaless database for
storing non-relational data. Cloud Datastore automatically scales with
your users and supports ACID transactions, high availability of reads and
writes, strong consistency for reads and ancestor queries, and eventual
consistency for all other queries.
- [API Documentation][datastore-api]
- [Official Documentation][cloud-datastore-docs]

See the [Google Cloud Datastore docs][cloud-datastore-activation] for more details on how to activate
Cloud Datastore for your project.
*Follow the [activation instructions][cloud-datastore-activation] to use the Google Cloud Datastore API with your project.*

See the ``gcloud-java`` API [datastore documentation][datastore-api] to learn how to interact
with the Cloud Datastore using this Client Library.
#### Preview

Here is a code snippet showing a simple usage example from within Compute/App Engine. Note that you must [supply credentials](#authentication) and a project ID if running this snippet elsewhere.

```java
import com.google.gcloud.datastore.Datastore;
Expand All @@ -65,8 +68,7 @@ import com.google.gcloud.datastore.Entity;
import com.google.gcloud.datastore.Key;
import com.google.gcloud.datastore.KeyFactory;

DatastoreOptions options = DatastoreOptions.builder().projectId(PROJECT_ID).build();
Datastore datastore = DatastoreFactory.instance().get(options);
Datastore datastore = DatastoreFactory.instance().get(DatastoreOptions.getDefaultInstance());
KeyFactory keyFactory = datastore.newKeyFactory().kind(KIND);
Key key = keyFactory.newKey(keyName);
Entity entity = datastore.get(key);
Expand All @@ -86,20 +88,59 @@ if (entity == null) {
}
```

Contributing
------------
Google Cloud Storage
----------------------

Contributions to this library are always welcome and highly encouraged.
- [API Documentation][storage-api]
- [Official Documentation][cloud-storage-docs]

See [CONTRIBUTING] for more information on how to get started.
*Follow the [activation instructions][cloud-storage-activation] to use the Google Cloud Storage API with your project.*

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms. See [Code of Conduct][code-of-conduct] for more information.
#### Preview

Here is a code snippet showing a simple usage example from within Compute/App Engine. Note that you must [supply credentials](#authentication) and a project ID if running this snippet elsewhere.

```java
import static java.nio.charset.StandardCharsets.UTF_8;

import com.google.gcloud.storage.Blob;
import com.google.gcloud.storage.BlobId;
import com.google.gcloud.storage.Storage;
import com.google.gcloud.storage.StorageFactory;
import com.google.gcloud.storage.StorageOptions;

import java.nio.ByteBuffer;
import java.nio.channels.WritableByteChannel;

StorageOptions options = StorageOptions.builder().projectId("project").build();
Storage storage = StorageFactory.instance().get(options);
BlobId blobId = BlobId.of("bucket", "blob_name");
Blob blob = Blob.load(storage, blobId);
if (blob == null) {
BlobInfo blobInfo = BlobInfo.builder(blobId).contentType("text/plain").build();
storage.create(blobInfo, "Hello, Cloud Storage!".getBytes(UTF_8));
} else {
System.out.println("Updating content for " + blobId.name());
byte[] prevContent = blob.content();
System.out.println(new String(prevContent, UTF_8));
WritableByteChannel channel = blob.writer();
channel.write(ByteBuffer.wrap("Updated content".getBytes(UTF_8)));
channel.close();
}
```

Java Versions
-------------

Java 7 or above is required for using this client.

Testing
-------

This library provides tools to help write tests for code that uses gcloud-java services.

See [TESTING] to read more about using our testing helpers.

Versioning
----------

Expand All @@ -109,6 +150,15 @@ It is currently in major version zero (``0.y.z``), which means that anything
may change at any time and the public API should not be considered
stable.

Contributing
------------

Contributions to this library are always welcome and highly encouraged.

See [CONTRIBUTING] for more information on how to get started.

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms. See [Code of Conduct][code-of-conduct] for more information.

License
-------

Expand All @@ -118,6 +168,7 @@ Apache 2.0 - See [LICENSE] for more information.
[CONTRIBUTING]:https://github.com/GoogleCloudPlatform/gcloud-java/blob/master/CONTRIBUTING.md
[code-of-conduct]:https://github.com/GoogleCloudPlatform/gcloud-java/blob/master/CODE_OF_CONDUCT.md
[LICENSE]: https://github.com/GoogleCloudPlatform/gcloud-java/blob/master/LICENSE
[TESTING]: https://github.com/GoogleCloudPlatform/gcloud-java/blob/master/TESTING.md
[cloud-platform]: https://cloud.google.com/
[cloud-datastore]: https://cloud.google.com/datastore/docs
[cloud-datastore-docs]: https://cloud.google.com/datastore/docs
Expand All @@ -130,3 +181,5 @@ Apache 2.0 - See [LICENSE] for more information.
[cloud-storage]: https://cloud.google.com/storage/
[cloud-storage-docs]: https://cloud.google.com/storage/docs/overview
[cloud-storage-create-bucket]: https://cloud.google.com/storage/docs/cloud-console#_creatingbuckets
[cloud-storage-activation]: https://cloud.google.com/storage/docs/signup
[storage-api]: http://googlecloudplatform.github.io/gcloud-java/apidocs/index.html?com/google/gcloud/storage/package-summary.html
27 changes: 27 additions & 0 deletions RELEASING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
### Overview

Most of the release process is handled by the `after_success.sh` script, triggered after Travis CI successfully completes a non-PR build. A new artifact will be released to Maven Central Repository via Travis CI when "-SNAPSHOT" is not included in the version (as listed in the base directory's `pom.xml`). The website and README files will also be updated automatically in this case. When "-SNAPSHOT" is included in the version, Travis only updates the artifact in the snapshot repository.

### To push a release version

1. Run `utilities/update_pom_version.sh` from the repository's base directory.
This script takes an optional argument denoting the new version. By default, if the current version is X.Y.Z-SNAPSHOT, the script will update the version in all the pom.xml files to X.Y.Z. If desired, another version can be supplied via command line argument instead.

2. Create a PR to update the pom.xml version.
The PR should look something like [#225](https://github.com/GoogleCloudPlatform/gcloud-java/pull/225). After this PR is merged into GoogleCloudPlatform/gcloud-java, Travis CI will push a new website to GoogleCloudPlatform/gh-pages, push a new artifact to the Maven Central Repository, and update versions in the README files.

3. Create a release on Github manually.
Go to the [releases page](https://github.com/GoogleCloudPlatform/gcloud-java/releases) and click "Draft a new release." Use `vX.Y.Z` as the "Tag Version" and `X.Y.Z` as the "Release Title", where `X.Y.Z` is the release version as listed in the `pom.xml` files.

4. Run `utilities/update_pom_version.sh` again (to include "-SNAPSHOT" in the project version).
As mentioned before, there is an optional version argument. By default, the script will update the version from "X.Y.Z" to "X.Y.Z+1-SNAPSHOT". Suppose a different version is desired, for example X+1.0.0-SNAPSHOT. Then the appropriate command to run would be `utilities/update_pom_version.sh X+1.0.0-SNAPSHOT`.

5. Create and merge in another PR to reflect the updated project version. For an example of what this PR should look like, see [#227](https://github.com/GoogleCloudPlatform/gcloud-java/pull/227).

### To push a snapshot version

Pushing a snapshot is completely automated. If "-SNAPSHOT" is included in the version denoted by the base directory's pom.xml, then an updated artifact will be pushed to the snapshot repository when Travis CI successfully completes a non-PR build.

### Improvements

Automatic tagging is not currently implemented, though it was discussed in [#119](https://github.com/GoogleCloudPlatform/gcloud-java/pull/119). If the version updates continue to be manual, a one-line git tag command can be added to `after_success.sh` to correctly tag releases. However, automatically creating useful annotations for this tag will be difficult. Also, if the release process becomes fully automated, tagging becomes a harder problem, as mentioned in that issue.
69 changes: 69 additions & 0 deletions TESTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
## gcloud-java tools for testing

This library provides tools to help write tests for code that uses gcloud-java services.

### Testing code that uses Datastore

#### On your machine

You can test against a temporary local datastore by following these steps:

1. Start the local datastore emulator using `LocalGcdHelper`. This can be done in two ways:
- Run `LocalGcdHelper.java`'s `main` method with arguments `START` and (optionally) `--port=<port number>`. This will create a temporary folder on your computer and bind `localhost:<port number>` for communication with the local datastore. The port number is an optional argument. If no port number is specified, port 8080 will be used.
- Call `LocalGcdHelper.start(<project ID>, <port number>)` before running your tests. Save the `LocalGcdHelper` object returned so that you can stop the emulator later.

2. In your program, create and use a datastore whose host is set host to `localhost:<port number>`. For example,
```java
DatastoreOptions options = DatastoreOptions.builder()
.projectId(PROJECT_ID)
.host("http://localhost:8080")
.build();
Datastore localDatastore = DatastoreFactory.instance().get(options);
```
3. Run your tests.

4. Stop the local datastore emulator.
- If you ran `LocalGcdHelper.java`'s `main` function to start the emulator, run `LocalGcdHelper.java`'s `main` method with arguments `STOP` and (optionally) `--port=<port number>`. If the port is not supplied, the program will attempt to close the last port started.
- If you ran `LocalGcdHelper.start()` to start the emulator, call the `stop()` method on the `LocalGcdHelper` object returned by `LocalGcdHelper.start()`.

#### On a remote machine

You can test against a remote datastore emulator as well. To do this, set the `DatastoreOptions` project endpoint to the hostname of the remote machine, like the example below.

```java
DatastoreOptions options = DatastoreOptions.builder()
.projectId(PROJECT_ID)
.host("http://<hostname of machine>:<port>")
.build();
Datastore localDatastore = DatastoreFactory.instance().get(options);
```

Note that the remote datastore must be running before your tests are run.

### Testing code that uses Storage

Currently, there isn't an emulator for Google Cloud Storage, so an alternative is to create a test project. `RemoteGcsHelper` contains convenience methods to make setting up and cleaning up the test project easier. To use this class, follow the steps below:

1. Create a test Google Cloud project.

2. Download a JSON service account credentials file from the Google Developer's Console. See more about this on the [Google Cloud Platform Storage Authentication page][cloud-platform-storage-authentication].

3. Create a `RemoteGcsHelper` object using your project ID and JSON key.
Here is an example that uses the `RemoteGcsHelper` to create a bucket.
```java
RemoteGcsHelper gcsHelper = RemoteGcsHelper.create(PROJECT_ID, "/path/to/my/JSON/key.json");
Storage storage = StorageFactory.instance().get(gcsHelper.options());
String bucket = RemoteGcsHelper.generateBucketName();
storage.create(BucketInfo.of(bucket));
```

4. Run your tests.

5. Clean up the test project by using `forceDelete` to clear any buckets used.
Here is an example that clears the bucket created in Step 3 with a timeout of 5 seconds.
```java
RemoteGcsHelper.forceDelete(storage, bucket, 5, TimeUnit.SECONDS);
```


[cloud-platform-storage-authentication]:https://cloud.google.com/storage/docs/authentication?hl=en#service_accounts
24 changes: 11 additions & 13 deletions gcloud-java-core/README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
Google Cloud Java Client
==========================
Google Cloud Java Client -- Core
=========================================

Java idiomatic client for [Google Cloud Platform][cloud-platform] services.
This module provides common functionality required by service-specific modules of this library.

[![Build Status](https://travis-ci.org/GoogleCloudPlatform/gcloud-java.svg?branch=master)](https://travis-ci.org/GoogleCloudPlatform/gcloud-java)
[![Coverage Status](https://coveralls.io/repos/GoogleCloudPlatform/gcloud-java/badge.svg?branch=master)](https://coveralls.io/r/GoogleCloudPlatform/gcloud-java?branch=master)
[![Maven](https://img.shields.io/maven-central/v/com.google.gcloud/gcloud-java-core.svg)](https://img.shields.io/maven-central/v/com.google.gcloud/gcloud-java-core.svg)

- [Homepage] (https://googlecloudplatform.github.io/gcloud-java/)
- [API Documentation] (http://googlecloudplatform.github.io/gcloud-java/apidocs)
- [Examples] (http://googlecloudplatform.github.io/gcloud-java/apidocs/index.html?com/google/gcloud/examples/package-summary.html)

This module provides common functionality and is required by the other service specific modules.
- [API Documentation] (http://googlecloudplatform.github.io/gcloud-java/apidocs/index.html?com/google/gcloud/package-summary.html)

Quickstart
----------
Expand All @@ -19,22 +17,22 @@ Add this to your pom.xml file
<dependency>
<groupId>com.google.gcloud</groupId>
<artifactId>gcloud-java-core</artifactId>
<version>0.0.7</version>
<version>0.0.10</version>
</dependency>
```

Java Versions
-------------

Java 7 or above is required for using this client.

Contributing
------------

Contributions to this library are always welcome and highly encouraged.

See [CONTRIBUTING] for more information on how to get started.

Java Versions
-------------

Java 7 or above is required for using this client.

Versioning
----------

Expand Down
4 changes: 2 additions & 2 deletions gcloud-java-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>com.google.gcloud</groupId>
<artifactId>gcloud-java-pom</artifactId>
<version>0.0.8-SNAPSHOT</version>
<version>0.0.11-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
Expand Down Expand Up @@ -74,7 +74,7 @@
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>RELEASE</version>
<version>2.8.2</version>
<scope>compile</scope>
</dependency>
<dependency>
Expand Down
Loading