+ private static boolean doesTypeNeedConvertingToBoolean(String propertyType) {
+ return ToscaType.BOOLEAN.getType().equals(propertyType);
+ }
+
+ private Map<String, String[]> buildSubstitutionMappingPropertyMapping(final Component component) {
+ if (component == null || CollectionUtils.isEmpty(component.getInputs())) {
+ return Collections.emptyMap();
+ }
+ Map<String, String[]> propertyMapping = new HashMap<>();
+ List<InputDefinition> propertyMappedInputList = component.getInputs().stream().filter(InputDefinition::isMappedToComponentProperty).collect(
+ Collectors.toList());
+
+ if (CollectionUtils.isNotEmpty(propertyMappedInputList)) {
+ propertyMappedInputList.forEach(inputDefinition -> {
+ if (StringUtils.isNotEmpty(inputDefinition.getPropertyId())) {
+ Optional<PropertyDefinition> property = component.getProperties().stream()
+ .filter(propertyDefinition -> propertyDefinition.getUniqueId().equals(inputDefinition.getPropertyId())).findFirst();
+ if (property.isPresent()) {
+ propertyMapping.put(property.get().getName(), new String[]{inputDefinition.getName()});
+ }
+ } else {
+ propertyMapping.put(inputDefinition.getName(), new String[]{inputDefinition.getName()});
+ }
+ });
+ }
+ return propertyMapping;
+ }
+
+ private Map<String, String[]> buildSubstitutionMappingAttributesMapping(final Component component) {
+ if (component == null || CollectionUtils.isEmpty(component.getOutputs())) {
+ return Collections.emptyMap();
+ }
+ return component.getOutputs().stream().map(AttributeDataDefinition::getName)
+ .collect(Collectors.toMap(outputName -> outputName, outputName -> new String[]{outputName}, (outputName1, outputName2) -> outputName1));
+ }
+
+ private Optional<Map<String, ToscaProperty>> getProxyNodeTypeProperties(Component proxyComponent, Map<String, DataTypeDefinition> dataTypes) {
+ if (Objects.isNull(proxyComponent)) {
+ return Optional.empty();
+ }
+ final var proxyProperties = convertInputsToProperties(dataTypes, proxyComponent.getInputs(), proxyComponent.getUniqueId());
+ if (CollectionUtils.isNotEmpty(proxyComponent.getProperties())) {
+ proxyProperties.putAll(proxyComponent.getProperties().stream()
+ .map(propertyDefinition -> resolvePropertyValueFromInput(propertyDefinition, proxyComponent.getInputs())).collect(Collectors
+ .toMap(PropertyDataDefinition::getName,
+ property -> propertyConvertor.convertProperty(dataTypes, property, PropertyType.PROPERTY))));
+ }
+ return MapUtils.isNotEmpty(proxyProperties) ? Optional.of(proxyProperties) : Optional.empty();
+ }
+
+ private Map<String, ToscaProperty> convertInputsToProperties(Map<String, DataTypeDefinition> dataTypes, List<InputDefinition> componentInputs,
+ String componentUniqueId) {
+ if (CollectionUtils.isEmpty(componentInputs)) {
+ return new HashMap<>();
+ }
+ return componentInputs.stream().filter(input -> componentUniqueId.equals(input.getInstanceUniqueId()))
+ .collect(Collectors.toMap(InputDefinition::getName, i -> propertyConvertor.convertProperty(dataTypes, i, PropertyType.INPUT)));
+ }
+
+ private Optional<Map<String, Object>> getProxyNodeTypeInterfaces(Component proxyComponent, Map<String, DataTypeDefinition> dataTypes) {
+ if (Objects.isNull(proxyComponent) || MapUtils.isEmpty(proxyComponent.getInterfaces())) {
+ return Optional.empty();
+ }
+ Map<String, InterfaceDefinition> proxyComponentInterfaces = proxyComponent.getInterfaces();
+ //Unset artifact path for operation implementation for proxy node types as for operations with artifacts it is
+
+ // always available in the proxy node template
+ removeOperationImplementationForProxyNodeType(proxyComponentInterfaces);
+ return Optional.ofNullable(interfacesOperationsConverter.getInterfacesMap(proxyComponent, null, proxyComponentInterfaces, dataTypes, false));
+ }
+
+ private Configuration getConfiguration() {
+ return ConfigurationManager.getConfigurationManager().getConfiguration();