You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jclouds.apache.org by Adrian Cole <no...@github.com> on 2013/09/28 18:52:07 UTC
[jclouds-labs-openstack] JCLOUDS-298. Add ObjectApi to
openstack-swift (#27)
Supports basic manipulation of objects and their metadata
You can merge this Pull Request by running:
git pull https://github.com/adriancole/jclouds-labs-openstack openstack-swift-object
Or you can view, comment on it, or merge it online at:
https://github.com/jclouds/jclouds-labs-openstack/pull/27
-- Commit Summary --
* JCLOUDS-298. Add ObjectApi to openstack-swift
-- File Changes --
M openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/SwiftApi.java (7)
M openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/binders/BindMetadataToHeaders.java (12)
A openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/domain/SwiftObject.java (219)
M openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/features/ObjectApi.java (203)
A openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/functions/ETagHeader.java (31)
M openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/functions/ParseAccountFromHeaders.java (4)
M openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/functions/ParseContainerFromHeaders.java (2)
A openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/functions/ParseObjectFromResponse.java (59)
M openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/features/ObjectApiLiveTest.java (140)
A openstack-swift/src/test/java/org/jclouds/openstack/swift/v1/features/ObjectApiMockTest.java (309)
-- Patch Links --
https://github.com/jclouds/jclouds-labs-openstack/pull/27.patch
https://github.com/jclouds/jclouds-labs-openstack/pull/27.diff
Re: [jclouds-labs-openstack] JCLOUDS-298. Add ObjectApi to
openstack-swift (#27)
Posted by Adrian Cole <no...@github.com>.
commit 2150c8b65c15aaf0d2865ad894e9cdf86d0a8cb4
Author: Adrian Cole <ad...@gmail.com>
Date: Sat Sep 28 09:50:40 2013 -0700
JCLOUDS-298. Add ObjectApi to openstack-swift
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/27#issuecomment-25306516
Re: [jclouds-labs-openstack] JCLOUDS-298. Add ObjectApi to
openstack-swift (#27)
Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-labs-openstack-pull-requests #53](https://jclouds.ci.cloudbees.com/job/jclouds-labs-openstack-pull-requests/53/) SUCCESS
This pull request looks good
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/27#issuecomment-25302019
Re: [jclouds-labs-openstack] JCLOUDS-298. Add ObjectApi to
openstack-swift (#27)
Posted by Andrew Phillips <no...@github.com>.
> + protected Payload payload;
> + protected Map<String, String> metadata = ImmutableMap.of();
> +
> + /**
> + * @see SwiftObject#name()
> + */
> + public Builder name(String name) {
> + this.name = checkNotNull(name, "name");
> + return this;
> + }
> +
> + /**
> + * @see SwiftObject#hash()
> + */
> + public Builder hash(String hash) {
> + this.hash = hash;
Does this need a `checkNotNull`?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/27/files#r7235105
Re: [jclouds-labs-openstack] JCLOUDS-298. Add ObjectApi to
openstack-swift (#27)
Posted by Andrew Phillips <no...@github.com>.
Minor comment: add messages to `assertTrue` assertions such as
```
assertTrue(objectApi.deleteMetadata(name, meta));
```
Something like
```
assertTrue(objectApi.deleteMetadata(name, meta), "Expected deleteMetadata to succeed");
```
makes figuring out the test failure much easier from e.g. BuildHive.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/27#issuecomment-27156168
Re: [jclouds-labs-openstack] JCLOUDS-298. Add ObjectApi to
openstack-swift (#27)
Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-labs-openstack-pull-requests #52](https://jclouds.ci.cloudbees.com/job/jclouds-labs-openstack-pull-requests/52/) SUCCESS
This pull request looks good
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/27#issuecomment-25301953
Re: [jclouds-labs-openstack] JCLOUDS-298. Add ObjectApi to
openstack-swift (#27)
Posted by Andrew Phillips <no...@github.com>.
> + return this;
> + }
> +
> + /**
> + * @see SwiftObject#hash()
> + */
> + public Builder hash(String hash) {
> + this.hash = hash;
> + return this;
> + }
> +
> + /**
> + * @see SwiftObject#lastModified()
> + */
> + public Builder lastModified(Date lastModified) {
> + this.lastModified = lastModified;
Same here?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/27/files#r7235107
Re: [jclouds-labs-openstack] JCLOUDS-298. Add ObjectApi to
openstack-swift (#27)
Posted by Adrian Cole <no...@github.com>.
live tests pass on both Rackspace and HPCS
Rackspace
```bash
mvn -Dtest.openstack-swift.endpoint=https://identity.api.rackspacecloud.com/v2.0/ -Dtest.openstack-swift.identity=ferncam1 -Dtest.openstack-swift.credential=REDACTED -Dtest.jclouds.keystone.credential-type=passwordCredentials -Plive clean install
```
HPCS
```bash
mvn -Dtest.openstack-swift.endpoint=https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0/ -Dtest.openstack-swift.identity=adrianc-project1:XMNANKT2USE52E2PZF3R -Dtest.openstack-swift.credential=REDACTED -Dtest.jclouds.keystone.credential-type=apiAccessKeyCredentials -Plive clean install
```
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/27#issuecomment-25301985
Re: [jclouds-labs-openstack] JCLOUDS-298. Add ObjectApi to
openstack-swift (#27)
Posted by Andrew Phillips <no...@github.com>.
> + }
> +
> + public void listAt() throws Exception {
> + String lexicographicallyBeforeName = name.substring(0, name.length() - 1);
> + for (String regionId : api.configuredRegions()) {
> + SwiftObject object = api.objectApiInRegionForContainer(regionId, containerName)
> + .listAt(lexicographicallyBeforeName).get(0);
> + assertEquals(object.name(), name);
> + checkObject(object);
> + }
> + }
> +
> + public void updateMetadata() throws Exception {
> + for (String regionId : api.configuredRegions()) {
> + ObjectApi objectApi = api.objectApiInRegionForContainer(regionId, containerName);
> + ;
[minor] Spurious `;`?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/27/files#r7235109
Re: [jclouds-labs-openstack] JCLOUDS-298. Add ObjectApi to
openstack-swift (#27)
Posted by Andrew Phillips <no...@github.com>.
> + return this;
> + }
> +
> + /**
> + * @see SwiftObject#lastModified()
> + */
> + public Builder lastModified(Date lastModified) {
> + this.lastModified = lastModified;
> + return this;
> + }
> +
> + /**
> + * @see SwiftObject#payload()
> + */
> + public Builder payload(Payload payload) {
> + this.payload = payload;
Same here?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/27/files#r7235108