aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/org/onap/music/rest/RestMusicDataAPI.java
diff options
context:
space:
mode:
authorThomas Nelson Jr (arthurdent3) tn1381@att.com <tn1381@att.com>2018-06-05 14:09:02 -0400
committerThomas Nelson Jr (arthurdent3) tn1381@att.com <tn1381@att.com>2018-06-05 14:09:02 -0400
commit03ade18ac83ab02ee1ce0d6d43725b96513b4577 (patch)
tree79ccb24c5599169ba3ac764b1ede71fb42c3069e /src/main/java/org/onap/music/rest/RestMusicDataAPI.java
parent932c9e80911645798712a77e4cee9230a4b59408 (diff)
Update Master to include jar folder.
This will put jar folder form separate branch into this where it belongs and we can build properly for beijing. Cassablanca will have a parent pom approach. Change-Id: Ieae3fce5ab42faddf4964285533fdc59d8b963de Issue-ID: MUSIC-79 Signed-off-by: Thomas Nelson Jr (arthurdent3) tn1381@att.com <tn1381@att.com>
Diffstat (limited to 'src/main/java/org/onap/music/rest/RestMusicDataAPI.java')
-rwxr-xr-xsrc/main/java/org/onap/music/rest/RestMusicDataAPI.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/main/java/org/onap/music/rest/RestMusicDataAPI.java b/src/main/java/org/onap/music/rest/RestMusicDataAPI.java
index 93b8f82a..39d5a890 100755
--- a/src/main/java/org/onap/music/rest/RestMusicDataAPI.java
+++ b/src/main/java/org/onap/music/rest/RestMusicDataAPI.java
@@ -1139,7 +1139,10 @@ public class RestMusicDataAPI {
results = MusicCore.atomicGetWithDeleteLock(keyspace, tablename, rowId.primarKeyValue, queryObject);
}
- return response.status(Status.OK).entity(new JsonResponse(ResultType.SUCCESS).setDataResult(MusicCore.marshallResults(results)).toMap()).build();
+ if(results!=null && results.getAvailableWithoutFetching() >0) {
+ return response.status(Status.OK).entity(new JsonResponse(ResultType.SUCCESS).setDataResult(MusicCore.marshallResults(results)).toMap()).build();
+ }
+ return response.status(Status.OK).entity(new JsonResponse(ResultType.SUCCESS).setError("No data found").setDataResult(MusicCore.marshallResults(results)).toMap()).build();
}
/**
@@ -1200,7 +1203,10 @@ public class RestMusicDataAPI {
try {
ResultSet results = MusicCore.get(queryObject);
- return response.status(Status.OK).entity(new JsonResponse(ResultType.SUCCESS).setDataResult(MusicCore.marshallResults(results)).toMap()).build();
+ if(results!=null && results.getAvailableWithoutFetching() >0) {
+ return response.status(Status.OK).entity(new JsonResponse(ResultType.SUCCESS).setDataResult(MusicCore.marshallResults(results)).toMap()).build();
+ }
+ return response.status(Status.OK).entity(new JsonResponse(ResultType.SUCCESS).setError("No data found").setDataResult(MusicCore.marshallResults(results)).toMap()).build();
} catch (MusicServiceException ex) {
logger.error(EELFLoggerDelegate.errorLogger,"", AppMessages.UNKNOWNERROR ,ErrorSeverity.ERROR, ErrorTypes.MUSICSERVICEERROR);
return response.status(Status.BAD_REQUEST).entity(new JsonResponse(ResultType.FAILURE).setError(ex.getMessage()).toMap()).build();
@@ -1274,6 +1280,7 @@ public class RestMusicDataAPI {
} catch (Exception e) {
logger.error(EELFLoggerDelegate.errorLogger,e.getMessage());
}
+ if(tableInfo.getPrimaryKey().get(0).getName().equals(entry.getKey()))
primaryKey.append(indValue);
rowSpec.append(keyName + "= ?");
queryObject.addValue(formattedValue);