summaryrefslogtreecommitdiffstats
path: root/catalog-be/src/main/java/org/openecomp/sdc/be/components/utils/InterfaceOperationUtils.java
diff options
context:
space:
mode:
authorMojahidul Islam <mojahidul.islam@amdocs.com>2019-05-14 12:49:31 +0530
committerMojahidul Islam <mojahidul.islam@amdocs.com>2019-05-14 12:50:27 +0530
commit82e531a1ee8ffa30e80b27d9097a2272ae18cdee (patch)
tree900964c5f61e15437e0568f3a5bec3c7083ca5a2 /catalog-be/src/main/java/org/openecomp/sdc/be/components/utils/InterfaceOperationUtils.java
parent3d5b80b9035b9832f86326858b4c6c2cecd952a3 (diff)
Support Capability Properties
This change includes following changes 1. Get capability properties from global types- BE 2. Show capability properties in cap/req screen 3. Support Capability Properties in assingment, operation and consumption screens Change-Id: Ieb4fa5705007c8bed3d82eb4fe4604572aa202d7 Issue-ID: SDC-2294 Signed-off-by: Mojahidul Islam <mojahidul.islam@amdocs.com>
Diffstat (limited to 'catalog-be/src/main/java/org/openecomp/sdc/be/components/utils/InterfaceOperationUtils.java')
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/components/utils/InterfaceOperationUtils.java28
1 files changed, 23 insertions, 5 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/utils/InterfaceOperationUtils.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/utils/InterfaceOperationUtils.java
index 0ee6264f4d..38cdeb8d40 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/utils/InterfaceOperationUtils.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/utils/InterfaceOperationUtils.java
@@ -87,14 +87,18 @@ public class InterfaceOperationUtils {
}
public static boolean isOperationInputMappedToComponentInput(OperationInputDefinition input,
- List<InputDefinition> inputs) {
+ List<InputDefinition> inputs) {
if (CollectionUtils.isEmpty(inputs)) {
return false;
}
- return inputs.stream().anyMatch(inp -> inp.getUniqueId().equals(input.getInputId()))
- || (input.getInputId().contains(".")
- && inputs.stream().anyMatch(inp -> inp.getUniqueId().equals(
- input.getInputId().substring(0, input.getInputId().lastIndexOf('.'))))) ;
+
+ boolean matchedInput = inputs.stream().anyMatch(inp -> inp.getUniqueId().equals(input.getInputId()));
+ if (!matchedInput && input.getInputId().contains(".")) {
+ return inputs.stream()
+ .anyMatch(inp -> inp.getUniqueId()
+ .equals(input.getInputId().substring(0, input.getInputId().lastIndexOf('.'))));
+ }
+ return matchedInput;
}
public static boolean isOperationInputMappedToOtherOperationOutput(String outputName,
@@ -119,6 +123,20 @@ public class InterfaceOperationUtils {
return getPropertyMap;
}
+ public static Map<String, List<String>> createMappedCapabilityPropertyDefaultValue(String capabilityName,
+ String propertyName) {
+ Map<String, List<String>> getPropertyMap = new HashMap<>();
+ List<String> values = new ArrayList<>();
+ values.add(InterfacesOperationsToscaUtil.SELF);
+ values.add(capabilityName);
+
+ if (Objects.nonNull(propertyName) && !propertyName.isEmpty()) {
+ values.addAll(Arrays.asList(propertyName.split("\\.")));
+ }
+ getPropertyMap.put(ToscaFunctions.GET_PROPERTY.getFunctionName(), values);
+ return getPropertyMap;
+ }
+
/**
* Get the list of outputs of other operations of all the interfaces in the component.
* @param currentOperationIdentifier Fully qualified operation name e.g. org.test.interfaces.node.lifecycle.Abc.stop