diff options
author | talig <talig@amdocs.com> | 2017-09-13 18:16:36 +0300 |
---|---|---|
committer | talig <talig@amdocs.com> | 2017-09-13 18:25:16 +0300 |
commit | 3e805e4880fb799a7e1eac6ac3ee14162fa1e9e6 (patch) | |
tree | 4cf2cbaacb96c96be742804ed002cec21785c096 /openecomp-be/lib/openecomp-sdc-vendor-software-product-lib | |
parent | 45e38d57442499a535f2915aab95a057e106d79f (diff) |
Change healing manager logic
Execute all healers even if one/more have failed.
Turn off vsp old version indication and log healers errors.
This is a temporary solution that would fix non-heat issues only.
Change-Id: I1fbcd3cc33a0520034b3dd373e2cfbe7339c06bd
Issue-ID: SDC-332
Signed-off-by: talig <talig@amdocs.com>
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-vendor-software-product-lib')
1 files changed, 10 insertions, 11 deletions
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/composition/CompositionEntityDataManagerImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/composition/CompositionEntityDataManagerImpl.java index c76b15d221..fffcc47932 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/composition/CompositionEntityDataManagerImpl.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/composition/CompositionEntityDataManagerImpl.java @@ -51,14 +51,12 @@ import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspQuestionnaireEntity; import org.openecomp.sdc.vendorsoftwareproduct.services.composition.CompositionEntityDataManager; import org.openecomp.sdc.vendorsoftwareproduct.services.schemagenerator.SchemaGenerator; import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Component; -import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentComputeAssociation; import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentData; import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionData; import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityId; import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityType; import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityValidationData; import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComputeData; -import org.openecomp.sdc.vendorsoftwareproduct.types.composition.DeploymentFlavor; import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Image; import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Network; import org.openecomp.sdc.vendorsoftwareproduct.types.composition.NetworkType; @@ -69,6 +67,7 @@ import org.openecomp.sdc.versioning.dao.types.Version; import java.util.ArrayList; import java.util.Collection; +import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -82,6 +81,8 @@ public class CompositionEntityDataManagerImpl implements CompositionEntityDataMa "COMPOSITION_ENTITY_DATA_MANAGER_ERR"; private static final String COMPOSITION_ENTITY_DATA_MANAGER_ERR_MSG = "Invalid input: %s may not be null"; + private static final String MISSING_OR_INVALID_QUESTIONNAIRE_MSG = + "Data is missing/invalid for this %s. Please refill and resubmit."; private static final Logger logger = LoggerFactory.getLogger(CompositionEntityDataManagerImpl.class); @@ -105,7 +106,7 @@ public class CompositionEntityDataManagerImpl implements CompositionEntityDataMa NicDao nicDao, NetworkDao networkDao, ImageDao imageDao, ComputeDao computeDao, DeploymentFlavorDao deploymentFlavorDao, - VendorSoftwareProductDao vendorSoftwareProductDao ) { + VendorSoftwareProductDao vendorSoftwareProductDao) { this.vspInfoDao = vspInfoDao; this.componentDao = componentDao; this.nicDao = nicDao; @@ -588,12 +589,10 @@ public class CompositionEntityDataManagerImpl implements CompositionEntityDataMa compositionEntityData.entity.getCompositionEntityId().toString(), compositionEntityData.entity.getQuestionnaireData())); - if(Objects.isNull(compositionEntityData.entity.getQuestionnaireData()) || !JsonUtil.isValidJson - (compositionEntityData.entity.getQuestionnaireData())){ - List<String> errors = new ArrayList<>(); - errors.add("Data is missing for the above " + compositionEntityData.entity.getType() + - ". Complete the mandatory fields and resubmit."); - return errors; + if (Objects.isNull(compositionEntityData.entity.getQuestionnaireData()) || + !JsonUtil.isValidJson(compositionEntityData.entity.getQuestionnaireData())) { + return Collections.singletonList(String + .format(MISSING_OR_INVALID_QUESTIONNAIRE_MSG, compositionEntityData.entity.getType())); } return JsonUtil.validate( @@ -677,8 +676,8 @@ public class CompositionEntityDataManagerImpl implements CompositionEntityDataMa return compute; } - public void saveComputesFlavorByComponent(String vspId, Version version, Component component, String - componentId) { + public void saveComputesFlavorByComponent(String vspId, Version version, Component component, + String componentId) { if (CollectionUtils.isNotEmpty(component.getCompute())) { for (ComputeData flavor : component.getCompute()) { ComputeEntity computeEntity = new ComputeEntity(vspId, version, componentId, null); |