usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject usergrid git commit: Fix ManagementResource to use existing string constant, and adding logging of Cassandra props to ToolBase
Date Thu, 05 May 2016 15:55:02 GMT
Repository: usergrid
Updated Branches:
  refs/heads/release-2.1.1 55251a06a -> 37bee320a


Fix ManagementResource to use existing string constant, and adding logging of Cassandra props
to ToolBase


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

Branch: refs/heads/release-2.1.1
Commit: 37bee320afcd93b597692eecbc08e8df4656ae4e
Parents: 55251a0
Author: Dave Johnson <snoopdave@apache.org>
Authored: Tue May 3 12:16:06 2016 -0400
Committer: Dave Johnson <snoopdave@apache.org>
Committed: Tue May 3 12:16:06 2016 -0400

----------------------------------------------------------------------
 .../rest/management/ManagementResource.java     |  2 +-
 .../org/apache/usergrid/tools/ToolBase.java     | 52 ++++++++++++--------
 2 files changed, 33 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/37bee320/stack/rest/src/main/java/org/apache/usergrid/rest/management/ManagementResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/management/ManagementResource.java
b/stack/rest/src/main/java/org/apache/usergrid/rest/management/ManagementResource.java
index f6aa001..1aa75ee 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/management/ManagementResource.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/management/ManagementResource.java
@@ -53,6 +53,7 @@ import java.util.Map;
 import static javax.servlet.http.HttpServletResponse.*;
 import static javax.ws.rs.core.MediaType.*;
 import static org.apache.commons.lang.StringUtils.isNotBlank;
+import static org.apache.usergrid.security.tokens.cassandra.TokenServiceImpl.USERGRID_CENTRAL_URL;
 import static org.apache.usergrid.utils.JsonUtils.mapToJsonString;
 import static org.apache.usergrid.utils.StringUtils.stringOrSubstringAfterFirst;
 import static org.apache.usergrid.utils.StringUtils.stringOrSubstringBeforeFirst;
@@ -88,7 +89,6 @@ public class ManagementResource extends AbstractContextResource {
 
     // usergrid configuration property names needed
     public static final String USERGRID_SYSADMIN_LOGIN_NAME = "usergrid.sysadmin.login.name";
-    public static final String USERGRID_CENTRAL_URL =         "usergrid.central.url";
 
     MetricsFactory metricsFactory = null;
 

http://git-wip-us.apache.org/repos/asf/usergrid/blob/37bee320/stack/tools/src/main/java/org/apache/usergrid/tools/ToolBase.java
----------------------------------------------------------------------
diff --git a/stack/tools/src/main/java/org/apache/usergrid/tools/ToolBase.java b/stack/tools/src/main/java/org/apache/usergrid/tools/ToolBase.java
index 521e229..bd8686e 100644
--- a/stack/tools/src/main/java/org/apache/usergrid/tools/ToolBase.java
+++ b/stack/tools/src/main/java/org/apache/usergrid/tools/ToolBase.java
@@ -17,36 +17,27 @@
 package org.apache.usergrid.tools;
 
 
-import java.util.Properties;
-
+import me.prettyprint.hector.testutils.EmbeddedServerHelper;
+import org.apache.commons.cli.*;
+import org.apache.commons.lang.ClassUtils;
 import org.apache.usergrid.corepersistence.CpEntityManagerFactory;
+import org.apache.usergrid.management.ManagementService;
+import org.apache.usergrid.persistence.EntityManagerFactory;
+import org.apache.usergrid.persistence.cassandra.CassandraService;
+import org.apache.usergrid.persistence.cassandra.Setup;
+import org.apache.usergrid.services.ServiceManagerFactory;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.config.AutowireCapableBeanFactory;
 import org.springframework.context.ApplicationContext;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
-import org.apache.usergrid.management.ManagementService;
-import org.apache.usergrid.persistence.EntityManagerFactory;
-import org.apache.usergrid.persistence.cassandra.CassandraService;
-import org.apache.usergrid.persistence.cassandra.Setup;
-import org.apache.usergrid.services.ServiceManagerFactory;
-
-import org.apache.commons.cli.CommandLine;
-import org.apache.commons.cli.CommandLineParser;
-import org.apache.commons.cli.GnuParser;
-import org.apache.commons.cli.HelpFormatter;
-import org.apache.commons.cli.Option;
-import org.apache.commons.cli.OptionBuilder;
-import org.apache.commons.cli.Options;
-import org.apache.commons.cli.ParseException;
-import org.apache.commons.lang.ClassUtils;
 
-import me.prettyprint.hector.testutils.EmbeddedServerHelper;
+import java.util.Properties;
 
+import static org.apache.usergrid.utils.JsonUtils.mapToFormattedJsonString;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
-import static org.apache.usergrid.utils.JsonUtils.mapToFormattedJsonString;
 
 
 /**
@@ -253,8 +244,29 @@ public abstract class ToolBase {
 
 
     @Autowired
-    public void setProperties( Properties properties ) {
+    public void setProperties(Properties properties) {
         this.properties = properties;
+
+        logger.info( "Properties set: \n" +
+            "   cassandra.url: {}\n" +
+            "   cassandra.datacenter.local: {}\n" +
+            "   cassandra.username: {}\n" +
+            "   cassandra.password: {}\n" +
+            "   cassandra.keyspace.strategy: {}\n" +
+            "   cassandra.keyspace.application: {}\n" +
+            "   cassandra.lock.keyspace: {}\n" +
+            "   cassandra.keyspace.replication: {}\n" +
+            "   cassandra.connections: {}\n",
+            properties.get("cassandra.url"),
+            properties.get("cassandra.datacenter.local"),
+            properties.get("cassandra.username"),
+            properties.get("cassandra.password"),
+            properties.get("cassandra.keyspace.strategy"),
+            properties.get("cassandra.keyspace.application"),
+            properties.get("cassandra.lock.keyspace"),
+            properties.get("cassandra.keyspace.replication"),
+            properties.get("cassandra.connections")
+        );
     }
 
 


Mime
View raw message