summaryrefslogtreecommitdiffstats
path: root/aai-traversal/src/main/java
diff options
context:
space:
mode:
authorVenkata Harish K Kajur <vk250x@att.com>2017-06-16 17:04:44 -0400
committerVenkata Harish K Kajur <vk250x@att.com>2017-06-16 17:19:03 -0400
commitc87550c395bcb26bc9e6b4716cd2a25ae97694eb (patch)
treee2ae64762dc4973a860aab9d8257f5f8ef2753b4 /aai-traversal/src/main/java
parent4d0bc004f38567750fb31f407fc495c0dee28b29 (diff)
[AAI-ONAP] Add missing named queries fix model del
Add the missing thunderbolt named queries Fix model-based delete functionality Change-Id: Ib49f7a50cefff3a402eed1bfbfc716052ba91538 Signed-off-by: Venkata Harish K Kajur <vk250x@att.com>
Diffstat (limited to 'aai-traversal/src/main/java')
-rw-r--r--aai-traversal/src/main/java/org/openecomp/aai/dbgraphgen/ModelBasedProcessing.java6
-rw-r--r--aai-traversal/src/main/java/org/openecomp/aai/dbgraphmap/SearchGraph.java34
2 files changed, 19 insertions, 21 deletions
diff --git a/aai-traversal/src/main/java/org/openecomp/aai/dbgraphgen/ModelBasedProcessing.java b/aai-traversal/src/main/java/org/openecomp/aai/dbgraphgen/ModelBasedProcessing.java
index da1fc1e..d3b44a3 100644
--- a/aai-traversal/src/main/java/org/openecomp/aai/dbgraphgen/ModelBasedProcessing.java
+++ b/aai-traversal/src/main/java/org/openecomp/aai/dbgraphgen/ModelBasedProcessing.java
@@ -2593,10 +2593,10 @@ public class ModelBasedProcessing{
String emsg = " Unrecognized nodeType bb [" + nodeTypeB + "]\n";
throw new AAIException("AAI_6115", emsg);
}
- } else {
- String msg = " No Edge Rule found for this pair of nodeTypes (order does not matter) ["
+
+ String msg = " No Edge Rule found for this pair of nodeTypes (order does not matter) ["
+ nodeTypeA + "], [" + nodeTypeB + "].";
- throw new AAIException("AAI_6120", msg);
+ throw new AAIException("AAI_6120", msg);
}
diff --git a/aai-traversal/src/main/java/org/openecomp/aai/dbgraphmap/SearchGraph.java b/aai-traversal/src/main/java/org/openecomp/aai/dbgraphmap/SearchGraph.java
index d9e40c4..8821f07 100644
--- a/aai-traversal/src/main/java/org/openecomp/aai/dbgraphmap/SearchGraph.java
+++ b/aai-traversal/src/main/java/org/openecomp/aai/dbgraphmap/SearchGraph.java
@@ -453,7 +453,7 @@ public class SearchGraph {
boolean isParallel = stream.isParallel();
stream.forEach(v -> {
String nodeType = v.<String>property(AAIProperties.NODE_TYPE).orElse(null);
-
+
String thisNodeURL;
try {
thisNodeURL = urlBuilder.pathed(v);
@@ -471,7 +471,7 @@ public class SearchGraph {
} catch (AAIException | AAIFormatVertexException e) {
throw new RuntimeException(e);
}
-
+
});
return searchResults;
}
@@ -667,7 +667,7 @@ public class SearchGraph {
}
DynamicEntity modelAndNamedQuerySearch = (DynamicEntity)loader.unmarshal("ModelAndNamedQuerySearch", queryParameters, mediaType).getUnderlyingObject();
- if (modelAndNamedQuerySearch == null) {
+ if (modelAndNamedQuerySearch == null) {
throw new AAIException("AAI_5105");
}
if (modelAndNamedQuerySearch == null) {
@@ -758,6 +758,13 @@ public class SearchGraph {
ResultSet rs = resultSet.get(0);
TitanVertex firstVert = rs.getVert();
+ String restURI = serializer.getURIForVertex(firstVert).toString();
+ String notificationVersion = AAIProperties.LATEST.toString();
+ if (restURI.startsWith("/")) {
+ restURI = "/aai/" + notificationVersion + restURI;
+ } else {
+ restURI = "/aai/" + notificationVersion + "/" + restURI;
+ }
Map<String,String> delResult = processor.runDeleteByModel( transId, fromAppId,
modelVersionId, topNodeType, startNodeFilterHash.get(0), aaiExtMap.getApiVersion(), resourceVersion );
@@ -768,25 +775,16 @@ public class SearchGraph {
}
resultStr.trim();
- DynamicEntity inventoryItems = jaxbContext.newDynamicEntity("inventory.aai.openecomp.org." + aaiExtMap.getApiVersion() + ".InventoryResponseItems");
+ DynamicEntity inventoryItems = jaxbContext.newDynamicEntity("inventory.aai.att.com." + aaiExtMap.getApiVersion() + ".InventoryResponseItems");
DynamicEntity topInvItem = remapInventoryItems((DynamicEntity)invItemList.get(0), jaxbContext, delResult, objectToVertMap, aaiExtMap);
-
List<DynamicEntity> newInvItemList = new ArrayList<DynamicEntity>();
+
newInvItemList.add(topInvItem);
inventoryItems.set("inventoryResponseItem", newInvItemList);
- String notificationVersion = AAIProperties.LATEST.toString();
-
- String restURI = serializer.getURIForVertex(firstVert).toString();
- if (restURI.startsWith("/")) {
- restURI = "/aai/" + notificationVersion + restURI;
- } else {
- restURI = "/aai/" + notificationVersion + "/" + restURI;
- }
DynamicEntity notificationHeader = (DynamicEntity) loader.introspectorFromName("notification-event-header").getUnderlyingObject();
notificationHeader.set("entityLink", restURI);
- notificationHeader.set("action", "DELETE");
-
+ notificationHeader.set("action", "DELETE");
notificationHeader.set("entityType", "inventory-response-items");
notificationHeader.set("topEntityType", "inventory-response-items");
notificationHeader.set("sourceName", aaiExtMap.getFromAppId());
@@ -945,7 +943,7 @@ public class SearchGraph {
Map<String,String> includeTheseVertices, Map<Object,String> objectToVertMap, AAIExtensionMap aaiExtMap) {
- DynamicEntity inventoryItem = jaxbContext.newDynamicEntity("inventory.aai.openecomp.org." + aaiExtMap.getApiVersion() + ".InventoryResponseItem");
+ DynamicEntity inventoryItem = jaxbContext.newDynamicEntity("inventory.aai.att.com." + aaiExtMap.getApiVersion() + ".InventoryResponseItem");
Object item = invResultItem.get("item");
inventoryItem.set("modelName", invResultItem.get("modelName"));
inventoryItem.set("item", item);
@@ -960,7 +958,7 @@ public class SearchGraph {
if (includeTheseVertices.containsKey(vertexId)) {
if (invResultItem.isSet("inventoryResponseItems")) {
List<DynamicEntity> invItemList = new ArrayList<DynamicEntity>();
- DynamicEntity inventoryItems = jaxbContext.newDynamicEntity("inventory.aai.openecomp.org." + aaiExtMap.getApiVersion() + ".InventoryResponseItems");
+ DynamicEntity inventoryItems = jaxbContext.newDynamicEntity("inventory.aai.att.com." + aaiExtMap.getApiVersion() + ".InventoryResponseItems");
DynamicEntity subInventoryResponseItems = invResultItem.get("inventoryResponseItems");
List<DynamicEntity> subInventoryResponseItemList = subInventoryResponseItems.get("inventoryResponseItem");
for (DynamicEntity ent : subInventoryResponseItemList) {
@@ -1016,7 +1014,7 @@ public class SearchGraph {
String aaiNodeType = vert.<String>property("aai-node-type").orElse(null);
-
+
if (aaiNodeType != null) {
Introspector thisObj = loader.introspectorFromName(aaiNodeType);