Remove straggling zookeper references
[music.git] / src / main / java / org / onap / music / main / MusicUtil.java
index dd08968..b737377 100755 (executable)
@@ -48,7 +48,6 @@ import java.util.concurrent.ConcurrentMap;
 
 import javax.ws.rs.core.Response;
 import javax.ws.rs.core.Response.ResponseBuilder;
-
 import org.onap.music.datastore.MusicDataStoreHandle;
 import org.onap.music.datastore.PreparedQueryObject;
 import org.onap.music.eelf.logging.EELFLoggerDelegate;
@@ -59,7 +58,6 @@ import org.onap.music.exceptions.MusicQueryException;
 import org.onap.music.exceptions.MusicServiceException;
 import org.onap.music.service.MusicCoreService;
 import org.onap.music.service.impl.MusicCassaCore;
-import org.onap.music.service.impl.MusicZKCore;
 
 import com.datastax.driver.core.ConsistencyLevel;
 import com.datastax.driver.core.DataType;
@@ -95,7 +93,6 @@ public class MusicUtil {
     public static final String USERID = "userId";
     public static final String PASSWORD = "password";
     public static final String CASSANDRA = "cassandra";
-    public static final String ZOOKEEPER = "zookeeper";
 
     public static final String AUTHORIZATION = "Authorization";
 
@@ -121,7 +118,7 @@ public class MusicUtil {
     private static String musicRestIp = LOCALHOST;
     private static String musicPropertiesFilePath = PROPERTIES_FILE;
     private static long defaultLockLeasePeriod = 6000;
-    private static final String[] propKeys = new String[] { "zookeeper.host", "cassandra.host", "music.ip", "debug",
+    private static final String[] propKeys = new String[] { "cassandra.host", "music.ip", "debug",
             "version", "music.rest.ip", "music.properties", "lock.lease.period", "id", "all.ids", "public.ip",
             "all.pubic.ips", "cassandra.user", "cassandra.password", "aaf.endpoint.url","admin.username","admin.password","aaf.admin.url",
             "music.namespace","admin.aaf.role","cassandra.port","lock.using"};
@@ -430,25 +427,6 @@ public class MusicUtil {
         return version;
     }
 
-    /**
-     * Get MyZkHost - Zookeeper Hostname - Default = localhost property file
-     * value - zookeeper.host
-     *
-     * @return
-     */
-    public static String getMyZkHost() {
-        return myZkHost;
-    }
-
-    /**
-     * Set MyZkHost - Zookeeper Hostname
-     *
-     * @param myZkHost
-     */
-    public static void setMyZkHost(String myZkHost) {
-        MusicUtil.myZkHost = myZkHost;
-    }
-
     /**
      * Get MyCassHost - Cassandra Hostname - Default = localhost property file
      * value - cassandra.host
@@ -737,8 +715,6 @@ public class MusicUtil {
         }
         // get the property value and return it
         MusicUtil.setMyCassaHost(prop.getProperty("cassandra.host"));
-        String zkHosts = prop.getProperty("zookeeper.host");
-        MusicUtil.setMyZkHost(zkHosts);
         MusicUtil.setCassName(prop.getProperty("cassandra.user"));
         MusicUtil.setCassPwd(prop.getProperty("cassandra.password"));
         MusicUtil.setCassandraPort(Integer.parseInt(prop.getProperty("cassandra.port")));
@@ -789,8 +765,6 @@ public class MusicUtil {
     public static MusicCoreService  getMusicCoreService() {
         if(getLockUsing().equals(MusicUtil.CASSANDRA))
             return MusicCassaCore.getInstance();
-        else if (getLockUsing().equals(MusicUtil.ZOOKEEPER))
-            return MusicZKCore.getInstance();
         else
             return MusicCassaCore.getInstance();
     }
@@ -815,7 +789,6 @@ public class MusicUtil {
 
 
     public static void setIsCadi(boolean isCadi) {
-        // TODO Auto-generated method stub
         MusicUtil.isCadi = isCadi;
     }
 
@@ -859,5 +832,15 @@ public class MusicUtil {
         return MusicUtil.isCadi;
     }
 
+
+    /**
+     * @return a random uuid
+     */
+    public static String generateUUID() {
+        String uuid = UUID.randomUUID().toString();
+        logger.info(EELFLoggerDelegate.applicationLogger,"New AID generated: "+uuid);
+        return uuid;
+    }
+
 }