You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by sn...@apache.org on 2014/09/14 14:38:09 UTC

[1/3] git commit: Finally. The correct usage of PathQuery.

Repository: incubator-usergrid
Updated Branches:
  refs/heads/two-dot-o 99b808354 -> 47cda09de


Finally. The correct usage of PathQuery.


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

Branch: refs/heads/two-dot-o
Commit: 16302ecf30c6e1f31b70ee34260222be35c33ef2
Parents: e9ddd37
Author: Dave Johnson <dm...@apigee.com>
Authored: Thu Sep 11 17:00:54 2014 -0400
Committer: Dave Johnson <dm...@apigee.com>
Committed: Thu Sep 11 17:00:54 2014 -0400

----------------------------------------------------------------------
 .../usergrid/corepersistence/CpRelationManager.java       |  5 +++++
 .../notifications/gcm/NotificationsServiceIT.java         | 10 +++++-----
 2 files changed, 10 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/16302ecf/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpRelationManager.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpRelationManager.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpRelationManager.java
index c5fd7ca..0aa8f47 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpRelationManager.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpRelationManager.java
@@ -940,6 +940,11 @@ public class CpRelationManager implements RelationManager {
         CollectionInfo collection = 
             getDefaultSchema().getCollection( headEntity.getType(), collName );
 
+        if ( collection == null ) {
+            throw new RuntimeException("Cannot find collection-info for '"+collName
+                +"' of "+ headEntity.getType() +":"+headEntity.getUuid() );
+        }
+
         IndexScope indexScope = new IndexScopeImpl(
             applicationScope.getApplication(), 
             cpHeadEntity.getId(), 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/16302ecf/stack/services/src/test/java/org/apache/usergrid/services/notifications/gcm/NotificationsServiceIT.java
----------------------------------------------------------------------
diff --git a/stack/services/src/test/java/org/apache/usergrid/services/notifications/gcm/NotificationsServiceIT.java b/stack/services/src/test/java/org/apache/usergrid/services/notifications/gcm/NotificationsServiceIT.java
index 9a12538..d4db67e 100644
--- a/stack/services/src/test/java/org/apache/usergrid/services/notifications/gcm/NotificationsServiceIT.java
+++ b/stack/services/src/test/java/org/apache/usergrid/services/notifications/gcm/NotificationsServiceIT.java
@@ -196,25 +196,25 @@ public class NotificationsServiceIT extends AbstractServiceNotificationIT {
         // create path query to search in user's device collection for device by UUID
         Query pQuery = new Query();
         pQuery.setLimit(100);
-        pQuery.setCollection("users");
+        pQuery.setCollection("devices");
         pQuery.setResultsLevel(Query.Level.ALL_PROPERTIES);
         pQuery.addIdentifier(new ServiceParameter.NameParameter(
             device.getUuid().toString()).getIdentifier()); 
         ns.TEST_PATH_QUERY =  new PathQuery( user, pQuery );
 
-        // create a push notification 
+        // create and post notification 
         String payload = "Hello, World!";
         Map<String, String> payloads = new HashMap<String, String>(1);
         payloads.put(notifier.getUuid().toString(), payload);
         app.put("payloads", payloads);
         app.put("queued", System.currentTimeMillis());
-
-        // post that notification 
         Entity e = app.testRequest(ServiceAction.POST, 1, "notifications").getEntity();
         app.testRequest(ServiceAction.GET, 1, "notifications", e.getUuid());
-        Notification notification = app.getEm().get(e.getUuid(), Notification.class);
+
+        app.getEm().refreshIndex();
 
         // perform push //
+        Notification notification = app.getEm().get(e.getUuid(), Notification.class);
         notification = scheduleNotificationAndWait(notification);
 
         app.getEm().refreshIndex();


[2/3] git commit: Merge branch 'two-dot-o' of https://git-wip-us.apache.org/repos/asf/incubator-usergrid into two-dot-o

Posted by sn...@apache.org.
Merge branch 'two-dot-o' of https://git-wip-us.apache.org/repos/asf/incubator-usergrid into two-dot-o


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

Branch: refs/heads/two-dot-o
Commit: 927fcde097c593b44394b76439bbcf63c683d99d
Parents: 16302ec 99b8083
Author: Dave Johnson <dm...@apigee.com>
Authored: Sun Sep 14 08:18:40 2014 -0400
Committer: Dave Johnson <dm...@apigee.com>
Committed: Sun Sep 14 08:18:40 2014 -0400

----------------------------------------------------------------------
 .../notifications/ApplicationQueueManager.java  | 62 +++++++-------------
 .../notifications/apns/APNsAdapter.java         | 48 +++++++--------
 2 files changed, 42 insertions(+), 68 deletions(-)
----------------------------------------------------------------------



[3/3] git commit: Remove unserializable interface EntityRef from PathQuery.

Posted by sn...@apache.org.
Remove unserializable interface EntityRef from PathQuery.


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

Branch: refs/heads/two-dot-o
Commit: 47cda09de5716a015b40c47ede0b04093fead6ea
Parents: 927fcde
Author: Dave Johnson <dm...@apigee.com>
Authored: Sun Sep 14 08:37:55 2014 -0400
Committer: Dave Johnson <dm...@apigee.com>
Committed: Sun Sep 14 08:37:55 2014 -0400

----------------------------------------------------------------------
 .../main/java/org/apache/usergrid/persistence/PathQuery.java | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/47cda09d/stack/core/src/main/java/org/apache/usergrid/persistence/PathQuery.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/persistence/PathQuery.java b/stack/core/src/main/java/org/apache/usergrid/persistence/PathQuery.java
index 6a49f39..6d252fd 100644
--- a/stack/core/src/main/java/org/apache/usergrid/persistence/PathQuery.java
+++ b/stack/core/src/main/java/org/apache/usergrid/persistence/PathQuery.java
@@ -17,7 +17,6 @@
 package org.apache.usergrid.persistence;
 
 
-import com.fasterxml.jackson.annotation.JsonIgnore;
 import org.apache.usergrid.persistence.index.query.Query;
 import java.util.Iterator;
 import java.util.UUID;
@@ -27,7 +26,6 @@ import org.apache.usergrid.persistence.index.query.Query.Level;
 
 public class PathQuery<E> {
 
-    private  EntityRef head;
     private PathQuery source;
     private Query query;
     private UUID uuid;
@@ -46,7 +44,6 @@ public class PathQuery<E> {
     public PathQuery( EntityRef head ) {
         this.uuid = head.getUuid();
         this.type = head.getType();
-        this.head = head;
         this.query = null;
     }
 
@@ -63,7 +60,6 @@ public class PathQuery<E> {
         }
         this.uuid = head.getUuid();
         this.type = head.getType();
-        this.head = head;
         this.query = query;
     }
 
@@ -104,7 +100,7 @@ public class PathQuery<E> {
 
 
     protected Results getHeadResults( EntityManager em ) throws Exception {
-        EntityRef ref = head != null ? head : new SimpleEntityRef(type,uuid);
+        EntityRef ref = new SimpleEntityRef(type,uuid);
         return ( query.getCollection() != null ) ? 
                em.searchCollection( ref, query.getCollection(), query ) :
                em.searchConnectedEntities( ref, query );
@@ -131,8 +127,6 @@ public class PathQuery<E> {
     }
 
 
-
-
     public String getType(){return type;}
 
     public UUID getUuid(){return uuid;}