You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by ro...@apache.org on 2014/12/22 17:54:55 UTC
[49/50] incubator-usergrid git commit: fixed put method,
moved connection to entity
fixed put method, moved connection to entity
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/615ac49b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/615ac49b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/615ac49b
Branch: refs/heads/two-dot-o
Commit: 615ac49bc38bc239c7a2b643a734bfdcaecbb9d4
Parents: a8a4865
Author: Rod Simpson <ro...@apigee.com>
Authored: Fri Dec 19 19:59:41 2014 -0700
Committer: Rod Simpson <ro...@apigee.com>
Committed: Fri Dec 19 19:59:41 2014 -0700
----------------------------------------------------------------------
.../endpoints/CollectionEndpoint.java | 13 +-----------
.../endpoints/EntityEndpoint.java | 21 ++++++++++++++++++--
2 files changed, 20 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/615ac49b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/CollectionEndpoint.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/CollectionEndpoint.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/CollectionEndpoint.java
index 2bd6fcf..9b9f40c 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/CollectionEndpoint.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/CollectionEndpoint.java
@@ -44,18 +44,7 @@ public class CollectionEndpoint extends NamedResource {
return new EntityEndpoint(identifier, context, this);
}
- /**
- *
- * app.collection("users").uniqueID("fred").connection("following).get();
- * GET /users/fred/following
- *
- */
- public CollectionEndpoint connection(final String identifier) {
- return new CollectionEndpoint(identifier, context, this);
- }
- public CollectionEndpoint connection(){
- return this;
- }
+
/**
*
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/615ac49b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/EntityEndpoint.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/EntityEndpoint.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/EntityEndpoint.java
index 0e5e171..4ed8fa2 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/EntityEndpoint.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/EntityEndpoint.java
@@ -97,7 +97,7 @@ public class EntityEndpoint extends NamedResource {
*/
public Entity put(Entity entity){
ApiResponse response = getResource(true).type( MediaType.APPLICATION_JSON_TYPE ).accept(MediaType.APPLICATION_JSON)
- .post(ApiResponse.class, entity);
+ .put(ApiResponse.class, entity);
return new Entity(response);
}
@@ -125,7 +125,24 @@ public class EntityEndpoint extends NamedResource {
}
-
+ /**
+ *
+ * app.collection("users").uniqueID("fred").connection("following).get();
+ * GET /users/fred/following
+ *
+ * app.collection("users").uniqueID("fred").connection("following").collection("users").uniqueID("barney").post();
+ * POST /users/fred/following/users/barney?token=<token>
+ *
+ * app.collection("users").uniqueID("fred").connection().collection("users").uniqueID("barney").post();
+ * POST /users/fred/following/users/barney?token=<token>
+ *
+ */
+ public CollectionEndpoint connection(final String identifier) {
+ return new CollectionEndpoint(identifier, context, this);
+ }
+ public CollectionEndpoint connection(){
+ return new CollectionEndpoint("", context, this);
+ }