summaryrefslogtreecommitdiffstats
path: root/sparkybe-onap-service
diff options
context:
space:
mode:
authorSteven Blimkie <Steven.Blimkie@amdocs.com>2018-04-03 19:03:25 +0000
committerGerrit Code Review <gerrit@onap.org>2018-04-03 19:03:25 +0000
commit49c08bd745ce620bb5d22cf8862b49f12a687b14 (patch)
tree0e52dbaf10590bd056d547f8e3a579820e328c7c /sparkybe-onap-service
parente80b8bb943c0a1b4103839245715c5433facdd60 (diff)
parent2d09189503345bfab12d4b9ea832576347f0340d (diff)
Merge "Fix servlet response flows"
Diffstat (limited to 'sparkybe-onap-service')
-rw-r--r--sparkybe-onap-service/src/main/java/org/onap/aai/sparky/aggregatevnf/search/AggregateSummaryProcessor.java9
-rw-r--r--sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/FilterProcessor.java3
2 files changed, 6 insertions, 6 deletions
diff --git a/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/aggregatevnf/search/AggregateSummaryProcessor.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/aggregatevnf/search/AggregateSummaryProcessor.java
index a2df3b5..949c369 100644
--- a/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/aggregatevnf/search/AggregateSummaryProcessor.java
+++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/aggregatevnf/search/AggregateSummaryProcessor.java
@@ -68,7 +68,6 @@ public class AggregateSummaryProcessor {
HttpServletRequest request = exchange.getIn().getBody(HttpServletRequest.class);
ServletUtils.setUpMdcContext(exchange, request);
-
try {
String payload = exchange.getIn().getBody(String.class);
@@ -91,8 +90,8 @@ public class AggregateSummaryProcessor {
JSONObject zeroResponsePayload = new JSONObject();
zeroResponsePayload.put("count", 0);
- // response.setStatus(Status.SUCCESS_OK);
- // response.setEntity(zeroResponsePayload.toString(), MediaType.APPLICATION_JSON);
+ exchange.getOut().setHeader(Exchange.HTTP_RESPONSE_CODE, 200);
+ exchange.getOut().setHeader(Exchange.CONTENT_TYPE, "application/json");
exchange.getOut().setBody(zeroResponsePayload.toString());
LOG.error(AaiUiMsgs.ERROR_FILTERS_NOT_FOUND);
@@ -121,7 +120,9 @@ public class AggregateSummaryProcessor {
}
} catch (Exception exc) {
LOG.error(AaiUiMsgs.ERROR_GENERIC,
- "FilterProcessor failed to get filter list due to error = " + exc.getMessage());
+ "AggregateSummaryProcessor failed to process request due to error = " + exc.getMessage());
+
+
}
}
diff --git a/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/FilterProcessor.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/FilterProcessor.java
index 62b8239..3cef322 100644
--- a/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/FilterProcessor.java
+++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/search/filters/FilterProcessor.java
@@ -130,9 +130,8 @@ public class FilterProcessor {
// In the case of an error we want to respond with a valid empty response
if(wasErrorDuringFilterDiscovery || wasErrorDuringValueSearch) {
- //response.setStatus(Status.SUCCESS_OK);
- //response.setEntity(UiFiltersEntityConverter.generateEmptyResponse().toString(), MediaType.APPLICATION_JSON);
exchange.getOut().setHeader(Exchange.HTTP_RESPONSE_CODE, 404);
+ exchange.getOut().setHeader(Exchange.CONTENT_TYPE, "application/json");
exchange.getOut().setBody(UiFiltersEntityConverter.generateEmptyResponse().toString());
}
}