You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by sf...@apache.org on 2015/06/10 17:08:07 UTC

incubator-usergrid git commit: move app id construction

Repository: incubator-usergrid
Updated Branches:
  refs/heads/USERGRID-652 dd729cbb1 -> 15641d137


move app id construction


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

Branch: refs/heads/USERGRID-652
Commit: 15641d1375996af3a53faeff3bfe7067ae441371
Parents: dd729cb
Author: Shawn Feldman <sf...@apache.org>
Authored: Wed Jun 10 09:08:06 2015 -0600
Committer: Shawn Feldman <sf...@apache.org>
Committed: Wed Jun 10 09:08:06 2015 -0600

----------------------------------------------------------------------
 .../index/ManagementIndexLocationStrategy.java            | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/15641d13/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/ManagementIndexLocationStrategy.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/ManagementIndexLocationStrategy.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/ManagementIndexLocationStrategy.java
index 59f1025..0bf674a 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/ManagementIndexLocationStrategy.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/ManagementIndexLocationStrategy.java
@@ -32,16 +32,16 @@ import org.apache.usergrid.utils.StringUtils;
  * Strategy for getting the management index name
  */
 class ManagementIndexLocationStrategy implements IndexLocationStrategy {
-    private final Id managementAppId;
     private final String prefix;
     private final IndexFig indexFig;
     private final CoreIndexFig coreIndexFig;
     private final IndexAlias alias;
+    private final ApplicationScope applicationScope;
 
     public ManagementIndexLocationStrategy(final IndexFig indexFig, final CoreIndexFig coreIndexFig){
         this.indexFig = indexFig;
         this.coreIndexFig = coreIndexFig;
-        this.managementAppId = CpNamingUtils.getManagementApplicationId();
+        this.applicationScope = CpNamingUtils.getApplicationScope( CpNamingUtils.getManagementApplicationId().getUuid());
         //remove usergrid
         this.prefix = coreIndexFig.getManagementAppIndexName().toLowerCase();  ////use lowercase value
         this.alias = new ManagementIndexAlias(indexFig,prefix);
@@ -62,7 +62,7 @@ class ManagementIndexLocationStrategy implements IndexLocationStrategy {
 
     @Override
     public ApplicationScope getApplicationScope() {
-        return new ApplicationScopeImpl(managementAppId);
+        return applicationScope;
     }
 
     @Override
@@ -82,14 +82,14 @@ class ManagementIndexLocationStrategy implements IndexLocationStrategy {
 
         ManagementIndexLocationStrategy that = (ManagementIndexLocationStrategy) o;
 
-        if (!managementAppId.equals(that.managementAppId)) return false;
+        if (!applicationScope.equals(that.applicationScope)) return false;
         return prefix.equals(that.prefix);
 
     }
 
     @Override
     public int hashCode() {
-        int result = managementAppId.hashCode();
+        int result = applicationScope.hashCode();
         result = 31 * result + prefix.hashCode();
         return result;
     }