Implement public private locator
[aaf/authz.git] / auth / auth-cass / src / main / java / org / onap / aaf / auth / dao / CassAccess.java
index b8062fc..cde2611 100644 (file)
@@ -102,9 +102,9 @@ public class CassAccess {
             }
     
             str = env.getProperty(Config.CADI_LATITUDE);
-            Double lat = str!=null?Double.parseDouble(str):null;
+            Double lat = str!=null && !str.isEmpty()?Double.parseDouble(str):null;
             str = env.getProperty(Config.CADI_LONGITUDE);
-            Double lon = str!=null?Double.parseDouble(str):null;
+            Double lon = str!=null && !str.isEmpty()?Double.parseDouble(str):null;
             if (lat == null || lon == null) {
                 throw new APIException(Config.CADI_LATITUDE + " and/or " + Config.CADI_LONGITUDE + " are not set");
             }
@@ -112,7 +112,7 @@ public class CassAccess {
             env.init().printf("Service Latitude,Longitude = %f,%f",lat,lon);
             
             str = env.getProperty(pre+CASSANDRA_CLUSTERS,env.getProperty(CASSANDRA_CLUSTERS,"localhost"));
-            env.init().log("Cass Clusters = ",str );
+            env.init().printf("Cass Clusters = '%s'\n",str );
             String[] machs = Split.split(',', str);
             String[] cpoints = new String[machs.length];
             String bestDC = null;
@@ -215,9 +215,9 @@ public class CassAccess {
         }
         for (Resettable re : resetExceptions) {
             if (re.matches(e)) {
-                return true;
+                return false;
             }
         }
-        return false;
+        return true;
     }
 }