summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Nelson Jr (arthurdent3) tn1381@att.com <tn1381@att.com>2018-09-17 22:35:25 -0400
committerThomas Nelson Jr (arthurdent3) tn1381@att.com <tn1381@att.com>2018-09-17 22:35:25 -0400
commita9efc16e26cd57d69bb2dc691cec01ec842930cc (patch)
tree8ed97ecbfdb7c3e94d5e3aad5dff8d812dbefbc7
parentbdeb60322c8a4477f19c616f5f1a6a1058c72204 (diff)
Update distribution files to support helm charts
Helm Charts require new Docker images. Refined Cassandra and Cassandra cql loader. Change-Id: Ie7726025afd63e256a43aef9f39d53c32c90c77b Issue-ID: MUSIC-99 Signed-off-by: Thomas Nelson Jr (arthurdent3) tn1381@att.com <tn1381@att.com>
-rw-r--r--distribution/cassandra/Dockerfile7
-rw-r--r--distribution/cassandra/cassandra.yaml5
-rw-r--r--distribution/cassandra_job/Dockerfile9
-rw-r--r--distribution/cassandra_job/admin.cql17
-rw-r--r--distribution/cassandra_job/admin_pw.cql2
-rw-r--r--distribution/cassandra_job/runcql.sh31
-rw-r--r--distribution/cassandra_job/test.cql2
-rwxr-xr-xpom.xml33
-rw-r--r--src/main/java/org/onap/music/conductor/conditionals/MusicConditional.java2
-rw-r--r--src/main/java/org/onap/music/datastore/MusicDataStore.java2
-rw-r--r--src/main/java/org/onap/music/exceptions/MusicServiceException.java38
-rwxr-xr-xsrc/main/java/org/onap/music/main/CachingUtil.java9
-rwxr-xr-xsrc/main/java/org/onap/music/rest/RestMusicAdminAPI.java154
-rwxr-xr-xsrc/main/java/org/onap/music/rest/RestMusicDataAPI.java20
-rwxr-xr-xversion.properties2
15 files changed, 204 insertions, 129 deletions
diff --git a/distribution/cassandra/Dockerfile b/distribution/cassandra/Dockerfile
index 9405fcb3..fe13322c 100644
--- a/distribution/cassandra/Dockerfile
+++ b/distribution/cassandra/Dockerfile
@@ -1,9 +1,4 @@
#registry.hub.docker.com/
-FROM library/cassandra:3.0
-RUN mkdir -p /docker-entrypoint-initdb.d && mkdir -p /home/cassandra/.cassandra && chown -R cassandra /home/cassandra
+FROM library/cassandra:3.11
COPY cassandra.yaml /etc/cassandra/
-COPY music_single.cql /docker-entrypoint-initdb.d/
-COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
-RUN chmod 755 /usr/local/bin/docker-entrypoint.sh && chown -R cassandra /docker-entrypoint-initdb.d
-
ENTRYPOINT ["docker-entrypoint.sh"]
diff --git a/distribution/cassandra/cassandra.yaml b/distribution/cassandra/cassandra.yaml
index d4af64af..fa7c74a6 100644
--- a/distribution/cassandra/cassandra.yaml
+++ b/distribution/cassandra/cassandra.yaml
@@ -530,7 +530,8 @@ native_transport_port: 9042
# native_transport_max_concurrent_connections_per_ip: -1
# Whether to start the thrift rpc server.
-start_rpc: false
+#start_rpc: false
+start_rpc: true
# The address or interface to bind the Thrift RPC service and native transport
# server to.
@@ -720,7 +721,7 @@ sstable_preemptive_open_interval_in_mb: 50
# How long the coordinator should wait for read operations to complete
read_request_timeout_in_ms: 5000
# How long the coordinator should wait for seq or index scans to complete
-range_request_timeout_in_ms: 10000
+range_request_timeout_in_ms: 15000
# How long the coordinator should wait for writes to complete
write_request_timeout_in_ms: 2000
# How long the coordinator should wait for counter writes to complete
diff --git a/distribution/cassandra_job/Dockerfile b/distribution/cassandra_job/Dockerfile
new file mode 100644
index 00000000..528c3bf4
--- /dev/null
+++ b/distribution/cassandra_job/Dockerfile
@@ -0,0 +1,9 @@
+#registry.hub.docker.com/
+FROM library/cassandra:3.11
+ENV DEF_USER=cassandra
+ENV DEF_PASS=cassandra
+COPY runcql.sh /
+RUN mkdir -p cql/extra && \
+ chmod 755 runcql.sh && \
+ chown cassandra runcql.sh
+CMD ["/runcql.sh"]
diff --git a/distribution/cassandra_job/admin.cql b/distribution/cassandra_job/admin.cql
new file mode 100644
index 00000000..904a2bab
--- /dev/null
+++ b/distribution/cassandra_job/admin.cql
@@ -0,0 +1,17 @@
+CREATE KEYSPACE IF NOT EXISTS admin
+ WITH REPLICATION = {
+ 'class' : 'SimpleStrategy',
+ 'replication_factor': 1
+ }
+ AND DURABLE_WRITES = true;
+
+CREATE TABLE IF NOT EXISTS admin.keyspace_master (
+ uuid uuid,
+ keyspace_name text,
+ application_name text,
+ is_api boolean,
+ password text,
+ username text,
+ is_aaf boolean,
+ PRIMARY KEY (uuid)
+);
diff --git a/distribution/cassandra_job/admin_pw.cql b/distribution/cassandra_job/admin_pw.cql
new file mode 100644
index 00000000..bbad8d1d
--- /dev/null
+++ b/distribution/cassandra_job/admin_pw.cql
@@ -0,0 +1,2 @@
+CREATE ROLE IF NOT EXISTS <CASSUSER> WITH PASSWORD = '<CASSPASS>' AND SUPERUSER = True AND LOGIN = True;
+ALTER ROLE cassandra WITH PASSWORD = 'SomeLongRandomStringNoonewillthinkof';
diff --git a/distribution/cassandra_job/runcql.sh b/distribution/cassandra_job/runcql.sh
new file mode 100644
index 00000000..e1fb31fc
--- /dev/null
+++ b/distribution/cassandra_job/runcql.sh
@@ -0,0 +1,31 @@
+#! /bin/bash
+if [ $CASS_HOSTNAME ]; then
+ echo "#############################################"
+ echo "############## Let run cql's ################"
+ echo "#############################################"
+ echo "admin.cql file:"
+ cat /cql/admin.cql
+ echo "Running cqlsh -u $DEF_USER -p $DEF_PASS -f /cql/admin.cql ${CASS_HOSTNAME} ${PORT}"
+ sleep 1;
+ if cqlsh -u $DEF_USER -p $DEF_PASS -f /cql/admin.cql ${CASS_HOSTNAME} ${PORT}; then echo "success"; else echo "failure" && exit 1;fi
+ echo "admin_pw.cql file:"
+ cat /cql/admin_pw.cql
+ echo "Running cqlsh -u $DEF_USER -p $DEF_PASS -f /cql/admin_pw.cql ${CASS_HOSTNAME} ${PORT}"
+ sleep 1;
+ if cqlsh -u $DEF_USER -p $DEF_PASS -f /cql/admin_pw.cql ${CASS_HOSTNAME} ${PORT}; then echo "success"; else echo "failure" && exit 1;fi
+
+ for f in /cql/extra/*; do
+ case "$f" in
+ *.cql)
+ echo "$0: running $f" && cqlsh -u ${USERNAME} -p ${PASSWORD} -f "$f" ${CASS_HOSTNAME} ${PORT};
+ ;;
+ *)
+ echo "$0: ignoring $f"
+ ;;
+ esac
+ done
+else
+ echo "Missing CASS_HOSTNAME";
+ exit 1;
+fi
+
diff --git a/distribution/cassandra_job/test.cql b/distribution/cassandra_job/test.cql
new file mode 100644
index 00000000..196fea22
--- /dev/null
+++ b/distribution/cassandra_job/test.cql
@@ -0,0 +1,2 @@
+DESCRIBE keyspaces;
+
diff --git a/pom.xml b/pom.xml
index 5f686d21..d370856d 100755
--- a/pom.xml
+++ b/pom.xml
@@ -16,7 +16,7 @@
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-
+
============LICENSE_END=============================================
====================================================================
-->
@@ -25,12 +25,12 @@
<groupId>org.onap.music</groupId>
<artifactId>MUSIC</artifactId>
<packaging>war</packaging>
- <version>3.0.15-SNAPSHOT</version>
+ <version>3.0.19-SNAPSHOT</version>
<description>
This is the MUSIC REST interface, packaged as a war file.
</description>
- <parent>
+ <parent>
<groupId>org.onap.oparent</groupId>
<artifactId>oparent</artifactId>
<version>1.2.0</version>
@@ -42,7 +42,7 @@
<jersey1.version>1.19</jersey1.version>
<jersey2.version>2.25.1</jersey2.version>
<jaxrs.version>2.0.1</jaxrs.version>
- <cassandra.version>3.4.0</cassandra.version>
+ <cassandra.version>3.6.0</cassandra.version>
<zookeeper.version>3.4.11</zookeeper.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -219,7 +219,6 @@
<version>1.0.1-oss</version>
</dependency>
<!-- End Logging -->
-
<!-- Cassandra -->
<dependency>
<groupId>com.datastax.cassandra</groupId>
@@ -227,7 +226,6 @@
<version>${cassandra.version}</version>
</dependency>
<!-- /Cassandra -->
-
<!-- Zookeeper -->
<dependency>
<groupId>org.apache.zookeeper</groupId>
@@ -241,7 +239,6 @@
</exclusions>
</dependency>
<!-- /Zookeeper -->
-
<!-- Jersey -->
<dependency>
<groupId>com.sun.jersey</groupId>
@@ -335,7 +332,6 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
-
</dependency>
<dependency>
<groupId>org.mindrot</groupId>
@@ -402,17 +398,30 @@
</image>
<!-- Cassandra -->
<image>
- <name>onap/music/cassandra_music</name>
- <alias>docker_cassandra</alias>
+ <name>onap/music/cassandra_3_11</name>
+ <alias>docker_cassandra_sec</alias>
<build>
<cleanup>true</cleanup>
<tags>
- <tag>3.0-${timestamp}</tag>
- <tag>3.0-latest</tag>
+ <tag>${docker.tag}</tag>
+ <tag>${docker.latest.tag}</tag>
</tags>
<dockerFileDir>${project.basedir}/distribution/cassandra</dockerFileDir>
</build>
</image>
+ <!-- Cassandra Job -->
+ <image>
+ <name>onap/music/cassandra_job</name>
+ <alias>docker_cassandra_job</alias>
+ <build>
+ <cleanup>true</cleanup>
+ <tags>
+ <tag>${docker.tag}</tag>
+ <tag>${docker.latest.tag}</tag>
+ </tags>
+ <dockerFileDir>${project.basedir}/distribution/cassandra_job</dockerFileDir>
+ </build>
+ </image>
<!-- Zookeeper -->
<!-- <image> <name>onap/music/zookeeper_music</name>
<alias>docker_zookeeper</alias> <build> <cleanup>true</cleanup> <tags> <tag>3.4-${timestamp}</tag>
diff --git a/src/main/java/org/onap/music/conductor/conditionals/MusicConditional.java b/src/main/java/org/onap/music/conductor/conditionals/MusicConditional.java
index 0e8cc14a..d5e9e4d5 100644
--- a/src/main/java/org/onap/music/conductor/conditionals/MusicConditional.java
+++ b/src/main/java/org/onap/music/conductor/conditionals/MusicConditional.java
@@ -355,4 +355,4 @@ public class MusicConditional {
}
-} \ No newline at end of file
+}
diff --git a/src/main/java/org/onap/music/datastore/MusicDataStore.java b/src/main/java/org/onap/music/datastore/MusicDataStore.java
index 38f5fe9f..21b0053f 100644
--- a/src/main/java/org/onap/music/datastore/MusicDataStore.java
+++ b/src/main/java/org/onap/music/datastore/MusicDataStore.java
@@ -335,7 +335,7 @@ public class MusicDataStore {
ColumnDefinitions colInfo = row.getColumnDefinitions();
HashMap<String, Object> resultOutput = new HashMap<String, Object>();
for (Definition definition : colInfo) {
- if (!"vector_ts".equals(definition.getName())) {
+ if (!definition.getName().equals("vector_ts")) {
if(definition.getType().toString().toLowerCase().contains("blob")) {
resultOutput.put(definition.getName(),
getBlobValue(row, definition.getName(), definition.getType()));
diff --git a/src/main/java/org/onap/music/exceptions/MusicServiceException.java b/src/main/java/org/onap/music/exceptions/MusicServiceException.java
index 35ce5c8c..a3b1fc56 100644
--- a/src/main/java/org/onap/music/exceptions/MusicServiceException.java
+++ b/src/main/java/org/onap/music/exceptions/MusicServiceException.java
@@ -32,6 +32,25 @@ public class MusicServiceException extends Exception {
private int errorCode;
private String errorMessage;
+ public int getErrorCode() {
+ return errorCode;
+ }
+
+
+ public void setErrorCode(int errorCode) {
+ this.errorCode = errorCode;
+ }
+
+
+ public String getErrorMessage() {
+ return errorMessage;
+ }
+
+
+ public void setErrorMessage(String errorMessage) {
+ this.errorMessage = errorMessage;
+ }
+
public MusicServiceException() {
super();
@@ -62,23 +81,4 @@ public class MusicServiceException extends Exception {
}
- public int getErrorCode() {
- return errorCode;
- }
-
-
- public void setErrorCode(int errorCode) {
- this.errorCode = errorCode;
- }
-
-
- public String getErrorMessage() {
- return errorMessage;
- }
-
-
- public void setErrorMessage(String errorMessage) {
- this.errorMessage = errorMessage;
- }
-
}
diff --git a/src/main/java/org/onap/music/main/CachingUtil.java b/src/main/java/org/onap/music/main/CachingUtil.java
index 34bc52d3..a81887a0 100755
--- a/src/main/java/org/onap/music/main/CachingUtil.java
+++ b/src/main/java/org/onap/music/main/CachingUtil.java
@@ -147,7 +147,7 @@ public class CachingUtil implements Runnable {
public static boolean authenticateAAFUser(String nameSpace, String userId, String password,
String keySpace) throws Exception {
- if (aafCache.get(nameSpace) != null) {
+ if (aafCache.get(nameSpace) != null && musicCache.get(keySpace)!=null) {
if (keySpace != null && !musicCache.get(keySpace).equals(nameSpace)) {
logger.info(EELFLoggerDelegate.applicationLogger,"Create new application for the same namespace.");
} else if (aafCache.get(nameSpace).get(userId).equals(password)) {
@@ -181,9 +181,10 @@ public class CachingUtil implements Runnable {
boolean responseObj = triggerAAF(nameSpace, userId, password);
if (responseObj) {
//if (responseObj.getNs().get(0).getAdmin().contains(userId)) {
- //Map<String, String> map = new HashMap<>();
- //map.put(userId, password);
- //aafCache.put(nameSpace, map);
+ Map<String, String> map = new HashMap<>();
+ map.put(userId, password);
+ aafCache.put(nameSpace, map);
+ CachingUtil.updateMusicCache(keySpace, nameSpace);
return true;
//}
}
diff --git a/src/main/java/org/onap/music/rest/RestMusicAdminAPI.java b/src/main/java/org/onap/music/rest/RestMusicAdminAPI.java
index f28f236f..0e365650 100755
--- a/src/main/java/org/onap/music/rest/RestMusicAdminAPI.java
+++ b/src/main/java/org/onap/music/rest/RestMusicAdminAPI.java
@@ -481,6 +481,32 @@ public class RestMusicAdminAPI {
break;
}
}
+ if(baseRequestObj == null || field_value == null) {
+ for(String element: inputUpdateList) {
+ String[] elementArr = element.split(":");
+ String newElement = null;
+ if(elementArr.length >= 2) {
+ newElement = elementArr[0]+":"+elementArr[1];
+ }
+ baseRequestObj = CachingUtil.getCallBackCache(newElement);
+ if(baseRequestObj != null) {
+ logger.info("Found the element that was changed... "+newElement);
+ break;
+ }
+ }
+ for(String element : updateList) {
+ String[] elementArr = element.split(":");
+ String newElement = null;
+ if(elementArr.length >= 2) {
+ newElement = elementArr[0]+":"+elementArr[1];
+ }
+ if(notifiyList.contains(newElement)) {
+ logger.info("Found the notifyOn property: "+newElement);
+ field_value = newElement;
+ break;
+ }
+ }
+ }
} else {
field_value = jsonResponse.getFull_table();
baseRequestObj = CachingUtil.getCallBackCache(field_value);
@@ -609,80 +635,62 @@ public class RestMusicAdminAPI {
String primaryId = tableInfo.getPrimaryKey().get(0).getName();
Map<String, String> responseBodyMap = baseRequestObj.getResponseBody();
- for (Entry<String, String> entry : new HashSet<>(responseBodyMap.entrySet())) {
- String trimmed = entry.getKey().trim();
- if (!trimmed.equals(entry.getKey())) {
- responseBodyMap.remove(entry.getKey());
- responseBodyMap.put(trimmed, entry.getValue());
- }
+ Map<String, String> newMap = new HashMap<>();
+ if(responseBodyMap.size() == 1 && responseBodyMap.containsKey("")) {
+ jsonNotification.setResponse_body(newMap);
+ } else {
+ for (Entry<String, String> entry : new HashSet<>(responseBodyMap.entrySet())) {
+ String trimmed = entry.getKey().trim();
+ if (!trimmed.equals(entry.getKey())) {
+ responseBodyMap.remove(entry.getKey());
+ responseBodyMap.put(trimmed, entry.getValue());
+ }
+ }
+
+ Set<String> keySet = responseBodyMap.keySet();
+ String cql = "select *";
+ /*for(String keys: keySet) {
+ cql = cql + keys + ",";
+ }*/
+ //cql = cql.substring(0, cql.length()-1);
+ cql = cql + " FROM "+fullNotifyArr[0]+" WHERE "+primaryId+" = ?";
+ logger.info("CQL in constructJsonNotification: "+cql);
+ PreparedQueryObject pQuery = new PreparedQueryObject();
+ pQuery.appendQueryString(cql);
+ pQuery.addValue(MusicUtil.convertToActualDataType(primaryIdType, pkValue));
+ Row row = MusicCore.get(pQuery).one();
+ if(row != null) {
+ ColumnDefinitions colInfo = row.getColumnDefinitions();
+ for (Definition definition : colInfo) {
+ String colName = definition.getName();
+ if(keySet.contains(colName)) {
+ DataType colType = definition.getType();
+ Object valueObj = MusicCore.getDSHandle().getColValue(row, colName, colType);
+ Object valueString = MusicUtil.convertToActualDataType(colType, valueObj);
+ logger.info(colName+" : "+valueString);
+ newMap.put(colName, valueString.toString());
+ keySet.remove(colName);
+ }
+ }
+ }
+ if(! keySet.isEmpty()) {
+ Iterator<String> iterator = keySet.iterator();
+ while (iterator.hasNext()) {
+ String element = iterator.next();
+ if(element != null && element.length() > 0)
+ newMap.put(element,"COLUMN_NOT_FOUND");
+ }
+ }
+
+ if("delete".equals(jsonResponse.getOperation()) || newMap.isEmpty()) {
+ newMap.put(primaryId, pkValue);
+ }
+ jsonNotification.setResponse_body(newMap);
}
-
- Set<String> keySet = responseBodyMap.keySet();
- String cql = "select *";
- /*for(String keys: keySet) {
- cql = cql + keys + ",";
- }*/
- //cql = cql.substring(0, cql.length()-1);
- cql = cql + " FROM "+fullNotifyArr[0]+" WHERE "+primaryId+" = ?";
- logger.info("CQL in constructJsonNotification: "+cql);
- PreparedQueryObject pQuery = new PreparedQueryObject();
- pQuery.appendQueryString(cql);
- pQuery.addValue(MusicUtil.convertToActualDataType(primaryIdType, pkValue));
- Row row = MusicCore.get(pQuery).one();
- Map<String, String> newMap = new HashMap<>();
- if(row != null) {
- ColumnDefinitions colInfo = row.getColumnDefinitions();
- for (Definition definition : colInfo) {
- String colName = definition.getName();
- if(keySet.contains(colName)) {
- DataType colType = definition.getType();
- Object valueObj = MusicCore.getDSHandle().getColValue(row, colName, colType);
- Object valueString = MusicUtil.convertToActualDataType(colType, valueObj);
- logger.info(colName+" : "+valueString);
- newMap.put(colName, valueString.toString());
- keySet.remove(colName);
- }
- }
- }
- if(! keySet.isEmpty()) {
- Iterator<String> iterator = keySet.iterator();
- while (iterator.hasNext()) {
- String element = iterator.next();
- newMap.put(element,"COLUMN_NOT_FOUND");
- }
- }
-
- /*if(row != null) {
- for(String keys: keySet1) {
- String value = null;
- try {
- logger.info(">>>>>>>> converting <<<<<<<<<<<< "+keys + " : "+responseBodyMap.get(keys));
- if(responseBodyMap.get(keys).equals("uuid"))
- value = row.getUUID(keys.trim()).toString();
- else if (responseBodyMap.get(keys).equals("text"))
- value = row.getString(keys.trim());
- else if (responseBodyMap.get(keys).equals("int"))
- value = String.valueOf(row.getInt(keys.trim()));
- else if (responseBodyMap.get(keys).equals("bigint"))
- value = String.valueOf(row.getLong(keys.trim()));
- } catch (Exception e) {
- newMap.put(primaryId, pkValue);
- logger.info("Error in constructJsonNotification: Invalid column..");
- }
- else if (responseBodyMap.get(keys).contains("int"))
- value = row.getLong(keys).toString();
- newMap.put(keys.trim(), value);
- }
- }*/
-
- if("delete".equals(jsonResponse.getOperation()) || newMap.isEmpty()) {
- newMap.put(primaryId, pkValue);
- }
- jsonNotification.setResponse_body(newMap);
- } catch(Exception e) {
- e.printStackTrace();
- }
- return jsonNotification;
+ } catch(Exception e) {
+ e.printStackTrace();
+ }
+ return jsonNotification;
}
private void constructJsonCallbackFromCache() throws Exception{
diff --git a/src/main/java/org/onap/music/rest/RestMusicDataAPI.java b/src/main/java/org/onap/music/rest/RestMusicDataAPI.java
index f0c1663c..2d1a8836 100755
--- a/src/main/java/org/onap/music/rest/RestMusicDataAPI.java
+++ b/src/main/java/org/onap/music/rest/RestMusicDataAPI.java
@@ -159,7 +159,7 @@ public class RestMusicDataAPI {
if (!authMap.isEmpty()) {
logger.error(EELFLoggerDelegate.errorLogger,"", AppMessages.MISSINGDATA ,ErrorSeverity.CRITICAL, ErrorTypes.AUTHENTICATIONERROR);
response.status(Status.UNAUTHORIZED);
- return response.entity(new JsonResponse(ResultType.FAILURE).setError(String.valueOf(authMap.get("Exception"))).toMap()).build();
+ return response.entity(new JsonResponse(ResultType.FAILURE).setError(String.valueOf(authMap.get("Error"))).toMap()).build();
}
if(kspObject == null || kspObject.getReplicationInfo() == null) {
authMap.put(ResultType.EXCEPTION.getResult(), ResultType.BODYMISSING.getResult());
@@ -183,7 +183,7 @@ public class RestMusicDataAPI {
} else {
logger.error(EELFLoggerDelegate.errorLogger,"", AppMessages.MISSINGDATA ,ErrorSeverity.CRITICAL, ErrorTypes.AUTHENTICATIONERROR);
response.status(Status.UNAUTHORIZED);
- return response.entity(new JsonResponse(ResultType.FAILURE).setError(String.valueOf(authMap.get("Exception"))).toMap()).build();
+ return response.entity(new JsonResponse(ResultType.FAILURE).setError(String.valueOf(authMap.get("Error"))).toMap()).build();
}
}
@@ -368,7 +368,7 @@ public class RestMusicDataAPI {
authMap.remove("aid");
if (!authMap.isEmpty()) {
logger.error(EELFLoggerDelegate.errorLogger,"", AppMessages.MISSINGINFO ,ErrorSeverity.CRITICAL, ErrorTypes.AUTHENTICATIONERROR);
- return response.status(Status.UNAUTHORIZED).entity(new JsonResponse(ResultType.FAILURE).setError(String.valueOf(authMap.get("Exception"))).toMap()).build();
+ return response.status(Status.UNAUTHORIZED).entity(new JsonResponse(ResultType.FAILURE).setError(String.valueOf(authMap.get("Error"))).toMap()).build();
}
String consistency = MusicUtil.EVENTUAL;
// for now this needs only eventual consistency
@@ -594,7 +594,7 @@ public class RestMusicDataAPI {
if (!authMap.isEmpty()) {
logger.error(EELFLoggerDelegate.errorLogger,"", AppMessages.MISSINGINFO ,ErrorSeverity.CRITICAL, ErrorTypes.AUTHENTICATIONERROR);
response.status(Status.UNAUTHORIZED);
- return response.entity(new JsonResponse(ResultType.FAILURE).setError(String.valueOf(authMap.get("Exception"))).toMap()).build();
+ return response.entity(new JsonResponse(ResultType.FAILURE).setError(String.valueOf(authMap.get("Error"))).toMap()).build();
}
MultivaluedMap<String, String> rowParams = info.getQueryParameters();
String indexName = "";
@@ -662,7 +662,7 @@ public class RestMusicDataAPI {
authMap.remove("aid");
if (!authMap.isEmpty()) {
logger.error(EELFLoggerDelegate.errorLogger,"", AppMessages.MISSINGINFO ,ErrorSeverity.CRITICAL, ErrorTypes.AUTHENTICATIONERROR);
- return response.status(Status.UNAUTHORIZED).entity(new JsonResponse(ResultType.FAILURE).setError(String.valueOf(authMap.get("Exception"))).toMap()).build();
+ return response.status(Status.UNAUTHORIZED).entity(new JsonResponse(ResultType.FAILURE).setError(String.valueOf(authMap.get("Error"))).toMap()).build();
}
Map<String, Object> valuesMap = insObj.getValues();
@@ -872,7 +872,7 @@ public class RestMusicDataAPI {
authMap.remove("aid");
if (!authMap.isEmpty()) {
logger.error(EELFLoggerDelegate.errorLogger,"", AppMessages.MISSINGINFO ,ErrorSeverity.WARN, ErrorTypes.AUTHENTICATIONERROR);
- return response.status(Status.UNAUTHORIZED).entity(new JsonResponse(ResultType.FAILURE).setError(String.valueOf(authMap.get("Exception"))).toMap()).build();
+ return response.status(Status.UNAUTHORIZED).entity(new JsonResponse(ResultType.FAILURE).setError(String.valueOf(authMap.get("Error"))).toMap()).build();
}
long startTime = System.currentTimeMillis();
String operationId = UUID.randomUUID().toString();// just for infoging
@@ -1085,7 +1085,7 @@ public class RestMusicDataAPI {
authMap.remove("aid");
if (!authMap.isEmpty()) {
logger.error(EELFLoggerDelegate.errorLogger,"", AppMessages.MISSINGINFO ,ErrorSeverity.WARN, ErrorTypes.AUTHENTICATIONERROR);
- return response.status(Status.UNAUTHORIZED).entity(new JsonResponse(ResultType.FAILURE).setError(String.valueOf(authMap.get("Exception"))).toMap()).build();
+ return response.status(Status.UNAUTHORIZED).entity(new JsonResponse(ResultType.FAILURE).setError(String.valueOf(authMap.get("Error"))).toMap()).build();
}
if(delObj == null) {
logger.error(EELFLoggerDelegate.errorLogger,"", AppMessages.MISSINGDATA ,ErrorSeverity.WARN, ErrorTypes.DATAERROR);
@@ -1220,7 +1220,7 @@ public class RestMusicDataAPI {
authMap.remove("aid");
if (!authMap.isEmpty()) {
logger.error(EELFLoggerDelegate.errorLogger,"", AppMessages.MISSINGINFO ,ErrorSeverity.WARN, ErrorTypes.AUTHENTICATIONERROR);
- return response.status(Status.UNAUTHORIZED).entity(new JsonResponse(ResultType.FAILURE).setError(String.valueOf(authMap.get("Exception"))).toMap()).build();
+ return response.status(Status.UNAUTHORIZED).entity(new JsonResponse(ResultType.FAILURE).setError(String.valueOf(authMap.get("Error"))).toMap()).build();
}
String consistency = "eventual";// for now this needs only eventual
// consistency
@@ -1275,7 +1275,7 @@ public class RestMusicDataAPI {
authMap.remove("aid");
if (!authMap.isEmpty()) {
logger.error(EELFLoggerDelegate.errorLogger,"Error while authentication... ", AppMessages.MISSINGINFO ,ErrorSeverity.WARN, ErrorTypes.AUTHENTICATIONERROR);
- return response.status(Status.UNAUTHORIZED).entity(new JsonResponse(ResultType.FAILURE).setError(String.valueOf(authMap.get("Exception"))).toMap()).build();
+ return response.status(Status.UNAUTHORIZED).entity(new JsonResponse(ResultType.FAILURE).setError(String.valueOf(authMap.get("Error"))).toMap()).build();
}
String lockId = selObj.getConsistencyInfo().get("lockId");
@@ -1358,7 +1358,7 @@ public class RestMusicDataAPI {
authMap.remove("aid");
if (!authMap.isEmpty()) {
logger.error(EELFLoggerDelegate.errorLogger,"", AppMessages.AUTHENTICATIONERROR ,ErrorSeverity.WARN, ErrorTypes.AUTHENTICATIONERROR);
- return response.status(Status.UNAUTHORIZED).entity(new JsonResponse(ResultType.FAILURE).setError(String.valueOf(authMap.get("Exception"))).toMap()).build();
+ return response.status(Status.UNAUTHORIZED).entity(new JsonResponse(ResultType.FAILURE).setError(String.valueOf(authMap.get("Error"))).toMap()).build();
}
PreparedQueryObject queryObject = new PreparedQueryObject();
diff --git a/version.properties b/version.properties
index bcb19409..0b918c88 100755
--- a/version.properties
+++ b/version.properties
@@ -4,7 +4,7 @@
major=3
minor=0
-patch=15
+patch=19
base_version=${major}.${minor}.${patch}