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:24 UTC

[18/50] incubator-usergrid git commit: change method name to subresource

change method name to subresource


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/2267511f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/2267511f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/2267511f

Branch: refs/heads/two-dot-o
Commit: 2267511ffc2418eb032ced20b295202b25788d4c
Parents: 9ef6ec8
Author: Shawn Feldman <sf...@apache.org>
Authored: Tue Dec 16 13:59:52 2014 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Tue Dec 16 13:59:52 2014 -0700

----------------------------------------------------------------------
 .../endpoints/AbstractCollectionResource.java   |  2 +-
 .../endpoints/ApplicationResource.java          | 40 --------------------
 .../endpoints/ApplicationsResource.java         |  7 ++--
 .../rest/test/resource2point0/model/Entity.java |  2 +-
 4 files changed, 5 insertions(+), 46 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2267511f/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/AbstractCollectionResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/AbstractCollectionResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/AbstractCollectionResource.java
index 7e5afa3..1a02115 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/AbstractCollectionResource.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/AbstractCollectionResource.java
@@ -36,7 +36,7 @@ public abstract class AbstractCollectionResource<T,K> extends NamedResource {
         super(name, context, parent);
     }
 
-    public K entity(final String identifier){
+    public K getSubResource(final String identifier){
         return instantiateK(identifier, context, this);
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2267511f/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/ApplicationResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/ApplicationResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/ApplicationResource.java
deleted file mode 100644
index e8754ac..0000000
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/ApplicationResource.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- *
- *  * Licensed to the Apache Software Foundation (ASF) under one or more
- *  *  contributor license agreements.  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.  For additional information regarding
- *  * copyright in this work, please see the NOTICE file in the top level
- *  * directory of this distribution.
- *
- */
-
-package org.apache.usergrid.rest.test.resource2point0.endpoints;
-
-import org.apache.usergrid.rest.test.resource2point0.model.ApiResponse;
-import org.apache.usergrid.rest.test.resource2point0.model.Application;
-import org.apache.usergrid.rest.test.resource2point0.state.ClientContext;
-
-/**
- * Classy class class.
- */
-public class ApplicationResource extends AbstractEntityResource<Application> {
-
-    public ApplicationResource(String identifier, ClientContext context, UrlResource parent) {
-        super(identifier, context, parent);
-    }
-
-    @Override
-    protected Application instantiateT(ApiResponse response) {
-        return new Application(response);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2267511f/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/ApplicationsResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/ApplicationsResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/ApplicationsResource.java
index 5aad2fb..6fa722e 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/ApplicationsResource.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/ApplicationsResource.java
@@ -30,7 +30,7 @@ import javax.ws.rs.core.MediaType;
  * Should also contain the GET,PUT,POST,DELETE methods of functioning in here.
  * This class also holds how we're currently interaction with collections.
  */
-public class ApplicationsResource extends AbstractCollectionResource<Application,ApplicationResource> {
+public class ApplicationsResource extends AbstractCollectionResource<Application,CollectionResource> {
 
 
     public ApplicationsResource(final String name, final ClientContext context, final UrlResource parent) {
@@ -43,11 +43,10 @@ public class ApplicationsResource extends AbstractCollectionResource<Application
     }
 
     @Override
-    protected ApplicationResource instantiateK(String identifier, ClientContext context, UrlResource parent) {
-        return new ApplicationResource(identifier,context,parent);
+    protected CollectionResource instantiateK(String identifier, ClientContext context, UrlResource parent) {
+        return new CollectionResource(identifier,context,parent);
     }
 
-    public CollectionResource collection(final String name){ return new CollectionResource(name,context,this);}
 
     /**
      * Currently hardcoded to users, this is because we expect to create and chain different cases of collections.

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2267511f/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/model/Entity.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/model/Entity.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/model/Entity.java
index 9ccdb8f..42b3437 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/model/Entity.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/model/Entity.java
@@ -66,7 +66,7 @@ public class Entity implements Serializable, Map<String,Object> {
      */
     public void save(){
         targetResource.put(this);
-        Entity entity = targetResource.entity(this.getName()).get();
+        Entity entity = targetResource.getSubResource(this.getName()).get();
         this.dynamic_properties.putAll(entity.getDynamicProperties());
     }