summaryrefslogtreecommitdiffstats
path: root/controlloop/common/actors
diff options
context:
space:
mode:
authorHockla, Ali (ah999m) <ah999m@att.com>2017-11-13 17:12:28 -0600
committerAli Hockla <ah999m@att.com>2017-11-13 23:18:52 +0000
commit13837f694cabe2bd997554e5e1455f3434be9163 (patch)
treed9543aaa52cb49fe7d7877d72c8ede24c868b62b /controlloop/common/actors
parent2c5a8e0ea008834b2f06549c17504f90ffa6eec8 (diff)
Update SO to use is-base-vf-module=false
Issue-ID: POLICY-447 Change-Id: I63cd5d20670f224aa4b9220b99ee40aad4f3e50c Signed-off-by: Hockla, Ali (ah999m) <ah999m@att.com>
Diffstat (limited to 'controlloop/common/actors')
-rw-r--r--controlloop/common/actors/actor.so/src/main/java/org/onap/policy/controlloop/actor/so/SOActorServiceProvider.java23
1 files changed, 14 insertions, 9 deletions
diff --git a/controlloop/common/actors/actor.so/src/main/java/org/onap/policy/controlloop/actor/so/SOActorServiceProvider.java b/controlloop/common/actors/actor.so/src/main/java/org/onap/policy/controlloop/actor/so/SOActorServiceProvider.java
index 8f52608e2..72119f639 100644
--- a/controlloop/common/actors/actor.so/src/main/java/org/onap/policy/controlloop/actor/so/SOActorServiceProvider.java
+++ b/controlloop/common/actors/actor.so/src/main/java/org/onap/policy/controlloop/actor/so/SOActorServiceProvider.java
@@ -239,19 +239,24 @@ public class SOActorServiceProvider implements Actor {
// Find the index for base vf module and non-base vf module
int baseIndex = -1;
+ int nonBaseIndex = -1;
List<AAINQInventoryResponseItem> inventoryItems = namedQueryResponseWrapper.aainqresponse.inventoryResponseItems.get(0).items.inventoryResponseItems.get(0).items.inventoryResponseItems;
for (AAINQInventoryResponseItem m : inventoryItems) {
- if (m.vfModule != null && m.vfModule.isBaseVfModule) {
- baseIndex = inventoryItems.indexOf(m);
- }
+ if (m.vfModule != null) {
+ if (m.vfModule.isBaseVfModule) {
+ baseIndex = inventoryItems.indexOf(m);
+ } else if (m.vfModule.isBaseVfModule == false) {
+ nonBaseIndex = inventoryItems.indexOf(m);
+ }
+ }
//
- if (baseIndex != -1) {
+ if (baseIndex != -1 && nonBaseIndex != -1) {
break;
}
}
// Report the error if either base vf module or non-base vf module is not found
- if (baseIndex == -1) {
+ if (baseIndex == -1 || nonBaseIndex == -1) {
logger.error("Either base or non-base vf module is not found from AAI response.");
return;
}
@@ -261,10 +266,10 @@ public class SOActorServiceProvider implements Actor {
setVfModuleItemVfModuleName(vfModuleItemVfModuleName.replace("Vfmodule", "vDNS"));
// vfModuleItem - NOT the base module
- setVfModuleItemModelInvariantId(namedQueryResponseWrapper.aainqresponse.inventoryResponseItems.get(0).items.inventoryResponseItems.get(0).items.inventoryResponseItems.get(baseIndex).vfModule.modelInvariantId);
- setVfModuleItemModelNameVersionId(namedQueryResponseWrapper.aainqresponse.inventoryResponseItems.get(0).items.inventoryResponseItems.get(0).items.inventoryResponseItems.get(baseIndex).vfModule.modelVersionId);
- setVfModuleItemModelName(namedQueryResponseWrapper.aainqresponse.inventoryResponseItems.get(0).items.inventoryResponseItems.get(0).items.inventoryResponseItems.get(baseIndex).extraProperties.extraProperty.get(1).propertyValue);
- setVfModuleItemModelVersionId(namedQueryResponseWrapper.aainqresponse.inventoryResponseItems.get(0).items.inventoryResponseItems.get(0).items.inventoryResponseItems.get(baseIndex).extraProperties.extraProperty.get(4).propertyValue);
+ setVfModuleItemModelInvariantId(namedQueryResponseWrapper.aainqresponse.inventoryResponseItems.get(0).items.inventoryResponseItems.get(0).items.inventoryResponseItems.get(nonBaseIndex).vfModule.modelInvariantId);
+ setVfModuleItemModelNameVersionId(namedQueryResponseWrapper.aainqresponse.inventoryResponseItems.get(0).items.inventoryResponseItems.get(0).items.inventoryResponseItems.get(nonBaseIndex).vfModule.modelVersionId);
+ setVfModuleItemModelName(namedQueryResponseWrapper.aainqresponse.inventoryResponseItems.get(0).items.inventoryResponseItems.get(0).items.inventoryResponseItems.get(nonBaseIndex).extraProperties.extraProperty.get(1).propertyValue);
+ setVfModuleItemModelVersionId(namedQueryResponseWrapper.aainqresponse.inventoryResponseItems.get(0).items.inventoryResponseItems.get(0).items.inventoryResponseItems.get(nonBaseIndex).extraProperties.extraProperty.get(4).propertyValue);
// tenantItem
setTenantItemTenantId(namedQueryResponseWrapper.aainqresponse.inventoryResponseItems.get(0).items.inventoryResponseItems.get(1).tenant.tenantId);