summaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/openecomp/sparky/synchronizer/AggregationSynchronizer.java1
-rw-r--r--src/main/java/org/openecomp/sparky/synchronizer/CrossEntityReferenceSynchronizer.java7
-rw-r--r--src/main/java/org/openecomp/sparky/synchronizer/ElasticSearchIndexCleaner.java13
-rw-r--r--src/main/java/org/openecomp/sparky/synchronizer/GeoSynchronizer.java1
-rw-r--r--src/main/java/org/openecomp/sparky/viewandinspect/entity/ActiveInventoryNode.java2
-rw-r--r--src/main/java/org/openecomp/sparky/viewandinspect/services/VisualizationService.java5
6 files changed, 18 insertions, 11 deletions
diff --git a/src/main/java/org/openecomp/sparky/synchronizer/AggregationSynchronizer.java b/src/main/java/org/openecomp/sparky/synchronizer/AggregationSynchronizer.java
index 2d7429c..2fd67c3 100644
--- a/src/main/java/org/openecomp/sparky/synchronizer/AggregationSynchronizer.java
+++ b/src/main/java/org/openecomp/sparky/synchronizer/AggregationSynchronizer.java
@@ -632,6 +632,7 @@ public class AggregationSynchronizer extends AbstractEntitySynchronizer
"Could not deserialize JSON (representing operation result) as node tree. " +
"Operation result = " + jsonResult + ". " + exc.getLocalizedMessage();
LOG.error(AaiUiMsgs.JSON_PROCESSING_ERROR, message);
+ return;
}
JsonNode resultData = rootNode.get("result-data");
diff --git a/src/main/java/org/openecomp/sparky/synchronizer/CrossEntityReferenceSynchronizer.java b/src/main/java/org/openecomp/sparky/synchronizer/CrossEntityReferenceSynchronizer.java
index c825040..1e3e85c 100644
--- a/src/main/java/org/openecomp/sparky/synchronizer/CrossEntityReferenceSynchronizer.java
+++ b/src/main/java/org/openecomp/sparky/synchronizer/CrossEntityReferenceSynchronizer.java
@@ -338,7 +338,10 @@ public class CrossEntityReferenceSynchronizer extends AbstractEntitySynchronizer
try {
rootNode = mapper.readTree(jsonResult);
} catch (IOException exc) {
- // TODO // TODO -> LOG, waht should be logged here?
+ String message = "Could not deserialize JSON (representing operation result) as node tree. "
+ + "Operation result = " + jsonResult + ". " + exc.getLocalizedMessage();
+ LOG.error(AaiUiMsgs.JSON_PROCESSING_ERROR, message);
+ return;
}
JsonNode resultData = rootNode.get("result-data");
@@ -576,7 +579,7 @@ public class CrossEntityReferenceSynchronizer extends AbstractEntitySynchronizer
}
} else {
- String message = "Entity sync failed because AAI query failed with error " + aaiQueryResult.getResult();
+ String message = "Entity sync failed because AAI query failed with error ";
LOG.error(AaiUiMsgs.ENTITY_SYNC_FAILED_QUERY_ERROR, message);
}
diff --git a/src/main/java/org/openecomp/sparky/synchronizer/ElasticSearchIndexCleaner.java b/src/main/java/org/openecomp/sparky/synchronizer/ElasticSearchIndexCleaner.java
index b23764c..9ef4fe6 100644
--- a/src/main/java/org/openecomp/sparky/synchronizer/ElasticSearchIndexCleaner.java
+++ b/src/main/java/org/openecomp/sparky/synchronizer/ElasticSearchIndexCleaner.java
@@ -521,11 +521,6 @@ public class ElasticSearchIndexCleaner implements IndexCleaner {
}
JsonNode rootNode = parseElasticSearchResult(opResult.getResult());
- boolean timedOut = Boolean.parseBoolean(getFieldValue(rootNode, "timed_out"));
- final String tookStr = getFieldValue(rootNode, "took");
- int tookInMs = (tookStr == null) ? 0 : Integer.parseInt(tookStr);
-
- JsonNode hitsNode = rootNode.get("hits");
/*
* Check the result for success / failure, and enumerate all the index ids that resulted in
@@ -533,6 +528,11 @@ public class ElasticSearchIndexCleaner implements IndexCleaner {
*/
if (rootNode != null) {
+ boolean timedOut = Boolean.parseBoolean(getFieldValue(rootNode, "timed_out"));
+ final String tookStr = getFieldValue(rootNode, "took");
+ int tookInMs = (tookStr == null) ? 0 : Integer.parseInt(tookStr);
+
+ JsonNode hitsNode = rootNode.get("hits");
if (timedOut) {
LOG.info(AaiUiMsgs.COLLECT_TIME_WITH_ERROR, "Scroll Context", String.valueOf(tookInMs));
@@ -576,6 +576,9 @@ public class ElasticSearchIndexCleaner implements IndexCleaner {
}
}
+ } else {
+ // scroll context get failed, nothing else to do
+ LOG.error(AaiUiMsgs.ERROR_GENERIC, opResult.toString());
}
return OperationState.OK;
diff --git a/src/main/java/org/openecomp/sparky/synchronizer/GeoSynchronizer.java b/src/main/java/org/openecomp/sparky/synchronizer/GeoSynchronizer.java
index c8d3b95..493f3c9 100644
--- a/src/main/java/org/openecomp/sparky/synchronizer/GeoSynchronizer.java
+++ b/src/main/java/org/openecomp/sparky/synchronizer/GeoSynchronizer.java
@@ -250,6 +250,7 @@ public class GeoSynchronizer extends AbstractEntitySynchronizer implements Index
rootNode = mapper.readTree(jsonResult);
} catch (IOException exc) {
LOG.error(AaiUiMsgs.ERROR_GENERIC, exc);
+ return;
}
JsonNode resultData = rootNode.get("result-data");
diff --git a/src/main/java/org/openecomp/sparky/viewandinspect/entity/ActiveInventoryNode.java b/src/main/java/org/openecomp/sparky/viewandinspect/entity/ActiveInventoryNode.java
index aef710d..fc0f074 100644
--- a/src/main/java/org/openecomp/sparky/viewandinspect/entity/ActiveInventoryNode.java
+++ b/src/main/java/org/openecomp/sparky/viewandinspect/entity/ActiveInventoryNode.java
@@ -166,7 +166,7 @@ public class ActiveInventoryNode {
public void addQueryParams(Collection<String> params) {
- if (params != null & params.size() > 0) {
+ if (params != null && !params.isEmpty()) {
for (String param : params) {
addQueryParam(param);
diff --git a/src/main/java/org/openecomp/sparky/viewandinspect/services/VisualizationService.java b/src/main/java/org/openecomp/sparky/viewandinspect/services/VisualizationService.java
index 63d4e59..e3f57aa 100644
--- a/src/main/java/org/openecomp/sparky/viewandinspect/services/VisualizationService.java
+++ b/src/main/java/org/openecomp/sparky/viewandinspect/services/VisualizationService.java
@@ -347,10 +347,9 @@ public class VisualizationService {
try {
output = transformer
.generateVisualizationOutput((System.currentTimeMillis() - opStartTimeInMs), graphMeta);
- } catch (JsonProcessingException exc) {
- throw new ServletException("Caught an exception while generation visualization output", exc);
- } catch (IOException exc) {
+ } catch (Exception exc) {
LOG.error(AaiUiMsgs.FAILURE_TO_PROCESS_REQUEST, exc.getLocalizedMessage());
+ throw new ServletException("Caught an exception while generation visualization output", exc);
}
output.setInlineMessage(visContext.getInlineMessage());