summaryrefslogtreecommitdiffstats
path: root/sparkybe-onap-service/src
diff options
context:
space:
mode:
authorrv871f <richard.vondadelszen@amdocs.com>2018-04-03 13:33:46 -0400
committerrv871f <richard.vondadelszen@amdocs.com>2018-04-03 13:34:23 -0400
commit2d09189503345bfab12d4b9ea832576347f0340d (patch)
treecc3ef6edcb97d5f61c28580d6a77cb4fd621f8ba /sparkybe-onap-service/src
parenta4fdf1d339c89403ad747698f1d314600bdc13b9 (diff)
Fix servlet response flows
Issue-ID: AAI-991 Change-Id: I1526ff2ebd5611576aa89a74fb0ee224066f9cd2 Signed-off-by: rv871f <richard.vondadelszen@amdocs.com>
Diffstat (limited to 'sparkybe-onap-service/src')
-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());
}
}