From a61abdd7a41ba5f4da8fa5ff8588fd009fc10dbe Mon Sep 17 00:00:00 2001 From: vasraz Date: Tue, 6 Aug 2019 09:44:08 +0000 Subject: Handle 'get_input' syntax for layer_protocols in PnfExtCp type Change-Id: I52f91e47dbda20c8c0701ee25f2eec5a83815112 Issue-ID: SDC-2427 Signed-off-by: vasraz --- .../sdc/be/components/impl/BaseBusinessLogic.java | 15 ++++++++------- .../sdc/be/components/impl/ResourceBusinessLogic.java | 6 +++--- 2 files changed, 11 insertions(+), 10 deletions(-) (limited to 'catalog-be/src') diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/BaseBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/BaseBusinessLogic.java index a764c89db2..b1356fc11b 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/BaseBusinessLogic.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/BaseBusinessLogic.java @@ -429,7 +429,7 @@ public abstract class BaseBusinessLogic { String type; String innerType = null; if (!propertyOperation.isPropertyTypeValid(property)) { - log.info("Invalid type for property {} type {}", property.getName(), property.getType()); + log.info("Invalid type for property '{}' type '{}'", property.getName(), property.getType()); ResponseFormat responseFormat = componentsUtils.getResponseFormat(ActionStatus.INVALID_PROPERTY_TYPE, property.getType(), property.getName()); return Either.right(responseFormat); } @@ -438,13 +438,13 @@ public abstract class BaseBusinessLogic { ImmutablePair propertyInnerTypeValid = propertyOperation.isPropertyInnerTypeValid(property, dataTypes); innerType = propertyInnerTypeValid.getLeft(); if (!propertyInnerTypeValid.getRight()) { - log.info("Invalid inner type for property {} type {}, dataTypeCount {}", property.getName(), property.getType(), dataTypes.size()); + log.info("Invalid inner type for property '{}' type '{}', dataTypeCount '{}'", property.getName(), property.getType(), dataTypes.size()); ResponseFormat responseFormat = componentsUtils.getResponseFormat(ActionStatus.INVALID_PROPERTY_INNER_TYPE, innerType, property.getName()); return Either.right(responseFormat); } } if (!propertyOperation.isPropertyDefaultValueValid(property, dataTypes)) { - log.info("Invalid default value for property {} type {}", property.getName(), property.getType()); + log.info("Invalid default value for property '{}' type '{}'", property.getName(), property.getType()); ResponseFormat responseFormat; if (type.equals(ToscaPropertyType.LIST.getType()) || type.equals(ToscaPropertyType.MAP.getType())) { responseFormat = componentsUtils.getResponseFormat(ActionStatus.INVALID_COMPLEX_DEFAULT_VALUE, property.getName(), type, innerType, @@ -556,9 +556,10 @@ public abstract class BaseBusinessLogic { return Arrays.asList(enumValues).contains(enumFound); } - String validatePropValueBeforeCreate(IPropertyInputCommon property, String value, boolean isValidate, String innerType, Map allDataTypes) { + String validatePropValueBeforeCreate(IPropertyInputCommon property, String value, boolean isValidate, + Map allDataTypes) { String propertyType = property.getType(); - String updatedInnerType = updateInnerType(property, innerType); + String updatedInnerType = updateInnerType(property); Either isValid = validateAndUpdatePropertyValue(propertyType, value, isValidate, updatedInnerType, allDataTypes); String newValue = value; if (isValid.isRight()) { @@ -583,7 +584,7 @@ public abstract class BaseBusinessLogic { return newValue; } - private String updateInnerType(IPropertyInputCommon property, String innerType) { + private String updateInnerType(IPropertyInputCommon property) { ToscaPropertyType type = ToscaPropertyType.isValidType(property.getType()); if (type == ToscaPropertyType.LIST || type == ToscaPropertyType.MAP) { SchemaDefinition def = property.getSchema(); @@ -598,7 +599,7 @@ public abstract class BaseBusinessLogic { } return propDef.getType(); } - return innerType; + return null; } private void failOnIllegalArgument() { diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogic.java index 5355ad95df..c40c845718 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogic.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogic.java @@ -2481,7 +2481,7 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { } } property.setValue(value); - return validatePropValueBeforeCreate(property, value, isValidate, null, allDataTypes); + return validatePropValueBeforeCreate(property, value, isValidate, allDataTypes); } private Either updateCalculatedCapReqWithSubstitutionMappings(Resource resource, @@ -2736,7 +2736,7 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { String innerType = null; property = new ComponentInstanceInput(curPropertyDef, value, null); - String validPropertyVAlue = validatePropValueBeforeCreate(property, value, isValidate, innerType, allDataTypes); + String validPropertyVAlue = validatePropValueBeforeCreate(property, value, isValidate, allDataTypes); property.setValue(validPropertyVAlue); @@ -2846,7 +2846,7 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { String innerType = null; property = new ComponentInstanceProperty(curPropertyDef, value, null); - String validatePropValue = validatePropValueBeforeCreate(property, value, isValidate, innerType, allDataTypes); + String validatePropValue = validatePropValueBeforeCreate(property, value, isValidate, allDataTypes); property.setValue(validatePropValue); if (getInputs != null && !getInputs.isEmpty()) { -- cgit 1.2.3-korg