usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject [2/8] git commit: More work to ensure tests still pass and things still work with old UG EntityManagerImpl and friends.
Date Wed, 16 Jul 2014 13:54:40 GMT
More work to ensure tests still pass and things still work with old UG EntityManagerImpl and
friends.


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

Branch: refs/heads/two-dot-o
Commit: 12aa3d99afadf662043e51e45aa18407d4ada171
Parents: dbeccea
Author: Dave Johnson <dmjohnson@apigee.com>
Authored: Fri May 30 11:26:47 2014 -0400
Committer: Dave Johnson <dmjohnson@apigee.com>
Committed: Fri May 30 11:26:47 2014 -0400

----------------------------------------------------------------------
 .../apache/usergrid/corepersistence/CpEntityManager.java |  6 +++---
 .../usergrid/corepersistence/CpEntityManagerFactory.java |  3 ++-
 .../persistence/cassandra/EntityManagerImpl.java         | 11 ++++++-----
 .../persistence/cassandra/RelationManagerImpl.java       |  3 ++-
 4 files changed, 13 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/12aa3d99/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
index 6e670e2..76e874a 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
@@ -549,7 +549,7 @@ public class CpEntityManager implements EntityManager {
 
     @Override
     public void updateApplication(Map<String, Object> properties) throws Exception
{
-        this.updateProperties( new SimpleEntityRef( "application", applicationId ), properties
);
+        this.updateProperties( new SimpleEntityRef( Application.ENTITY_TYPE, applicationId
), properties );
         this.application = get( applicationId, Application.class );
     }
 
@@ -584,7 +584,7 @@ public class CpEntityManager implements EntityManager {
     @Override
     public EntityRef getAlias(String aliasType, String alias) throws Exception {
 
-        return getAlias( new SimpleEntityRef("application", applicationId), aliasType, alias
);
+        return getAlias( new SimpleEntityRef(Application.ENTITY_TYPE, applicationId), aliasType,
alias );
     }
 
     @Override
@@ -617,7 +617,7 @@ public class CpEntityManager implements EntityManager {
     public Map<String, EntityRef> getAlias(
             String aliasType, List<String> aliases) throws Exception {
 
-        return getAlias( new SimpleEntityRef("application", applicationId), aliasType, aliases
);
+        return getAlias( new SimpleEntityRef(Application.ENTITY_TYPE, applicationId), aliasType,
aliases );
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/12aa3d99/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
index c2ab923..62964fc 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
@@ -42,6 +42,7 @@ import org.apache.usergrid.persistence.collection.EntityCollectionManagerFactory
 import org.apache.usergrid.persistence.collection.impl.CollectionScopeImpl;
 import org.apache.usergrid.persistence.core.scope.ApplicationScope;
 import org.apache.usergrid.persistence.core.scope.ApplicationScopeImpl;
+import org.apache.usergrid.persistence.entities.Application;
 import org.apache.usergrid.persistence.exceptions.ApplicationAlreadyExistsException;
 import org.apache.usergrid.persistence.graph.GraphManagerFactory;
 import org.apache.usergrid.persistence.index.EntityIndex;
@@ -509,7 +510,7 @@ public class CpEntityManagerFactory implements EntityManagerFactory, Application
 
 
     private Id generateApplicationId(UUID id){
-        return new SimpleId( id, "application" );
+        return new SimpleId( id, Application.ENTITY_TYPE );
     }
     
     /**

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/12aa3d99/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/EntityManagerImpl.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/EntityManagerImpl.java
b/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/EntityManagerImpl.java
index 7e6668d..739c1d5 100644
--- a/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/EntityManagerImpl.java
+++ b/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/EntityManagerImpl.java
@@ -271,7 +271,7 @@ public class EntityManagerImpl implements EntityManager {
 
     @Override
     public void updateApplication( Map<String, Object> properties ) throws Exception
{
-        this.updateProperties( applicationId, "application", properties );
+        this.updateProperties( applicationId, Application.ENTITY_TYPE, properties );
         this.application = get( applicationId, Application.class );
     }
 
@@ -1562,14 +1562,15 @@ public class EntityManagerImpl implements EntityManager {
             query.setLimit( 1 );
             query.setResultsLevel( REFS );
 
-            Results r = getRelationManager( ref( applicationId ) ).searchCollection( "users",
query );
+            Results r = getRelationManager( 
+                ref( Application.ENTITY_TYPE, applicationId ) ).searchCollection( "users",
query );
             if ( r != null && r.getRef() != null ) {
                 return r.getRef();
             }
             else {
                 // look-aside as it might be an email in the name field
                 return this.getAlias( 
-                        new SimpleEntityRef("application", applicationId), 
+                        new SimpleEntityRef(Application.ENTITY_TYPE, applicationId), 
                         "user", identifier.getEmail() );
             }
         }
@@ -1587,7 +1588,7 @@ public class EntityManagerImpl implements EntityManager {
         }
         if ( identifier.isName() ) {
             return this.getAlias( 
-                    new SimpleEntityRef("application", applicationId), 
+                    new SimpleEntityRef(Application.ENTITY_TYPE, applicationId), 
                     "group", identifier.getName() );
         }
         return null;
@@ -1770,7 +1771,7 @@ public class EntityManagerImpl implements EntityManager {
 
     @Override
     public EntityRef getAlias( String aliasType, String alias ) throws Exception {
-        return getAlias( new SimpleEntityRef("application", applicationId), aliasType, alias
);
+        return getAlias( new SimpleEntityRef(Application.ENTITY_TYPE, applicationId), aliasType,
alias );
     }
 
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/12aa3d99/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/RelationManagerImpl.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/RelationManagerImpl.java
b/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/RelationManagerImpl.java
index 5175a85..2150751 100644
--- a/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/RelationManagerImpl.java
+++ b/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/RelationManagerImpl.java
@@ -136,6 +136,7 @@ import static org.apache.usergrid.utils.MapUtils.addMapSet;
 import static org.apache.usergrid.utils.UUIDUtils.getTimestampInMicros;
 import static org.apache.usergrid.utils.UUIDUtils.newTimeUUID;
 import static org.apache.usergrid.persistence.cassandra.Serializers.*;
+import org.apache.usergrid.persistence.entities.Application;
 import org.apache.usergrid.persistence.index.query.Query.Level;
 
 
@@ -2314,7 +2315,7 @@ public class RelationManagerImpl implements RelationManager {
         @Override
         public void visit( NameIdentifierNode nameIdentifierNode ) throws Exception {
             //TODO T.N. USERGRID-1919 actually validate this is connected
-            EntityRef ref = em.getAlias( new SimpleEntityRef("applicaion", applicationId),

+            EntityRef ref = em.getAlias( new SimpleEntityRef(Application.ENTITY_TYPE, applicationId),

                     connection.getConnectedEntityType(), nameIdentifierNode.getName() );
 
             if ( ref == null ) {


Mime
View raw message