aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-model/src
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-model/src')
-rw-r--r--catalog-model/src/main/java/org/openecomp/sdc/be/model/ComponentParametersView.java3
-rw-r--r--catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/NodeTemplateOperation.java18
2 files changed, 14 insertions, 7 deletions
diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/ComponentParametersView.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/ComponentParametersView.java
index 505b8e6c7c..6488d41f25 100644
--- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/ComponentParametersView.java
+++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/ComponentParametersView.java
@@ -98,6 +98,8 @@ public class ComponentParametersView {
this.setIgnoreNodeFilter(false);
this.setIgnoreSubstitutionFilter(false);
this.setIgnoreCapabiltyProperties(false);
+ this.setIgnoreInterfaces(false);
+ this.setIgnoreComponentInstancesInterfaces(false);
break;
case COMPONENT_INSTANCES_PROPERTIES:
this.setIgnoreComponentInstances(false); //we need this in order to get the calculate capabilities requirements
@@ -160,6 +162,7 @@ public class ComponentParametersView {
break;
case COMPONENT_INSTANCES_INTERFACES:
this.setIgnoreComponentInstances(false);
+ this.setIgnoreInterfaces(false);
this.setIgnoreComponentInstancesInterfaces(false);
break;
case DATA_TYPES:
diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/NodeTemplateOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/NodeTemplateOperation.java
index facbcbe2a4..3f3e54146d 100644
--- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/NodeTemplateOperation.java
+++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/NodeTemplateOperation.java
@@ -169,8 +169,9 @@ public class NodeTemplateOperation extends BaseOperation {
}
result = Either.right(status);
}
- if (componentInstance.getOriginType() == OriginTypeEnum.ServiceProxy || componentInstance.getOriginType() == OriginTypeEnum.ServiceSubstitution) {
- TopologyTemplate updatedContainer = addComponentInstanceRes.left().value();
+ final TopologyTemplate updatedContainer = addComponentInstanceRes.left().value();
+ if (componentInstance.getOriginType() == OriginTypeEnum.ServiceProxy
+ || componentInstance.getOriginType() == OriginTypeEnum.ServiceSubstitution) {
result = addCapAndReqToProxyServiceInstance(updatedContainer, componentInstance, componentInstanceData);
if(result.isRight()) {
return result;
@@ -185,12 +186,15 @@ public class NodeTemplateOperation extends BaseOperation {
if(result.isRight()) {
return result;
}
-
- result = addServiceInstanceInterfacesToProxyServiceInstance(updatedContainer, componentInstance);
+ }
+ if (componentInstance.getOriginType() == OriginTypeEnum.ServiceProxy
+ || componentInstance.getOriginType() == OriginTypeEnum.ServiceSubstitution
+ || componentInstance.getOriginType() == OriginTypeEnum.VF
+ || componentInstance.getOriginType() == OriginTypeEnum.VFC) {
+ result = addComponentInstanceInterfacesToTopologyTemplate(updatedContainer, componentInstance);
if(result.isRight()) {
return result;
}
-
}
}
if (result == null) {
@@ -362,11 +366,11 @@ public class NodeTemplateOperation extends BaseOperation {
return Either.left(new ImmutablePair<>(updatedContainer, componentInstance.getUniqueId()));
}
- private Either<ImmutablePair<TopologyTemplate, String>, StorageOperationStatus> addServiceInstanceInterfacesToProxyServiceInstance(TopologyTemplate updatedContainer, ComponentInstance componentInstance) {
+ private Either<ImmutablePair<TopologyTemplate, String>, StorageOperationStatus> addComponentInstanceInterfacesToTopologyTemplate(TopologyTemplate updatedContainer, ComponentInstance componentInstance) {
Map<String, Object> interfaces = componentInstance.getInterfaces();
if(MapUtils.isNotEmpty(interfaces)){
- Map<String, InterfaceDataDefinition> interfacesMap = interfaces.entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, e -> (InterfaceDataDefinition) e.getValue()));
+ Map<String, InterfaceDataDefinition> interfacesMap = interfaces.entrySet().stream().collect(Collectors.toMap(e -> ((InterfaceDataDefinition) e.getValue()).getUniqueId(), e -> (InterfaceDataDefinition) e.getValue()));
MapInterfaceDataDefinition instInterfaces = new MapInterfaceDataDefinition(interfacesMap);
Map<String, MapInterfaceDataDefinition> instInterfacesMap = new HashMap<>();