diff options
author | Pamela Dragosh <pdragosh@research.att.com> | 2017-11-14 00:57:19 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2017-11-14 00:57:19 +0000 |
commit | 135ef6acf3d466b2889b2469da26779ad9251797 (patch) | |
tree | 655b70d96b6196bfab97c84738c12aa3e96f08fd /controlloop/common/actors/actor.so/src/main | |
parent | cf19acab1c51a79f57718eb680e6d38c75be6baf (diff) | |
parent | 13837f694cabe2bd997554e5e1455f3434be9163 (diff) |
Merge "Update SO to use is-base-vf-module=false"v1.1.11.0.0-ONAP1.0.0-Amsterdam
Diffstat (limited to 'controlloop/common/actors/actor.so/src/main')
-rw-r--r-- | controlloop/common/actors/actor.so/src/main/java/org/onap/policy/controlloop/actor/so/SOActorServiceProvider.java | 23 |
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); |