summaryrefslogtreecommitdiffstats
path: root/catalog-be/src/main/java
diff options
context:
space:
mode:
authorfranciscovila <javier.paradela.vila@est.tech>2022-06-23 09:33:08 +0100
committerMichael Morris <michael.morris@est.tech>2022-07-21 14:39:37 +0000
commit6a6795ce77219b28f18a3572ae89c8cb4d4406be (patch)
tree10c5ac75b2dfd8132a6c63986af62d22478f7dae /catalog-be/src/main/java
parent63966da5c7a9bd6ba3fa9e97807447d7759e8ace (diff)
Maintain VFC instance directives and node filters
Maintain VFC directives and node filters on instance version change Issue-ID: SDC-4062 Signed-off-by: franciscovila <javier.paradela.vila@est.tech> Change-Id: I90e8d4e5f8262879fb533389a93e2fdfa052caad
Diffstat (limited to 'catalog-be/src/main/java')
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentInstanceBusinessLogic.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentInstanceBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentInstanceBusinessLogic.java
index dcccfd961d..76db103525 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentInstanceBusinessLogic.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentInstanceBusinessLogic.java
@@ -2990,6 +2990,7 @@ public class ComponentInstanceBusinessLogic extends BaseBusinessLogic {
newComponentInstance.setInstanceCount(resResourceInfo.getInstanceCount());
newComponentInstance.setMaxOccurrences(resResourceInfo.getMaxOccurrences());
newComponentInstance.setMinOccurrences(resResourceInfo.getMinOccurrences());
+ newComponentInstance.setDirectives(resResourceInfo.getDirectives());
checkForExternalReqAndCapabilities(origComponent, resResourceInfo);
ComponentInstance updatedComponentInstance =
@@ -3014,6 +3015,9 @@ public class ComponentInstanceBusinessLogic extends BaseBusinessLogic {
log.debug("Component with id {} was not found", containerComponentId);
throw new ByActionStatusComponentException(actionStatus, Constants.EMPTY_STRING);
}
+
+ maintainNodeFilters(currentResourceInstance, newComponentInstance, containerComponentId);
+
resourceInstanceStatus = getResourceInstanceById(updatedComponentRes.left().value(),
updatedComponentInstance.getUniqueId());
if (resourceInstanceStatus.isRight()) {
@@ -3030,6 +3034,19 @@ public class ComponentInstanceBusinessLogic extends BaseBusinessLogic {
}
}
+ private void maintainNodeFilters(
+ ComponentInstance currentResourceInstance,
+ ComponentInstance newComponentInstance,
+ String containerComponentId) {
+ CINodeFilterDataDefinition filterToMaintain = currentResourceInstance.getNodeFilter();
+ if (null != filterToMaintain) {
+ nodeFilterOperation.addNodeFilterData(
+ containerComponentId.toLowerCase(),
+ newComponentInstance.getUniqueId(),
+ filterToMaintain);
+ }
+ }
+
private void checkForExternalReqAndCapabilities(Component component, ComponentInstance resResourceInfo) {
Map<String, List<RequirementDefinition>> requirementsMap = resResourceInfo.getRequirements();
Map<String, List<RequirementDefinition>> externalRequirementsMap = new HashMap<>();