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;
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;
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";
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"};
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
}
// 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")));
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();
}
public static void setIsCadi(boolean isCadi) {
- // TODO Auto-generated method stub
MusicUtil.isCadi = isCadi;
}
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;
+ }
+
}