From b6379cce2e96293cdc00fc3633a0295b55d6f40c Mon Sep 17 00:00:00 2001 From: vempo Date: Wed, 7 Nov 2018 18:48:04 +0200 Subject: Removed dead and duplicate code in onboarding Change-Id: I2ca0f1a4b00938838213ba2d615ab72c80d6dda3 Issue-ID: SDC-1903 Signed-off-by: vempo --- .../impl/CompositionEntityDataManagerImpl.java | 63 +++++++--------------- 1 file changed, 19 insertions(+), 44 deletions(-) (limited to 'openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main') diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/CompositionEntityDataManagerImpl.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/CompositionEntityDataManagerImpl.java index 1946db8b5d..e9c75319f5 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/CompositionEntityDataManagerImpl.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/CompositionEntityDataManagerImpl.java @@ -16,6 +16,16 @@ package org.openecomp.sdc.vendorsoftwareproduct.impl; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.EnumMap; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.MapUtils; import org.openecomp.core.utilities.CommonMethods; @@ -34,7 +44,15 @@ import org.openecomp.sdc.vendorsoftwareproduct.dao.ImageDao; import org.openecomp.sdc.vendorsoftwareproduct.dao.NetworkDao; import org.openecomp.sdc.vendorsoftwareproduct.dao.NicDao; import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDao; -import org.openecomp.sdc.vendorsoftwareproduct.dao.type.*; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.CompositionEntity; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComputeEntity; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.DeploymentFlavorEntity; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ImageEntity; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspQuestionnaireEntity; import org.openecomp.sdc.vendorsoftwareproduct.services.schemagenerator.SchemaGenerator; import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Component; import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentData; @@ -52,17 +70,6 @@ import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.SchemaTempl import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.SchemaTemplateInput; import org.openecomp.sdc.versioning.dao.types.Version; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.EnumMap; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - public class CompositionEntityDataManagerImpl implements CompositionEntityDataManager { private static final String COMPOSITION_ENTITY_DATA_MANAGER_ERR = @@ -218,38 +225,6 @@ public class CompositionEntityDataManagerImpl implements CompositionEntityDataMa return new HashSet<>(); } - private boolean isThereErrorsInSubTree(CompositionEntityValidationData entity) { - if (Objects.isNull(entity)) { - return false; - } - - if (CollectionUtils.isNotEmpty(entity.getErrors())) { - return true; - } - - Collection subEntitiesValidationData = - entity.getSubEntitiesValidationData(); - return !CollectionUtils.isEmpty(subEntitiesValidationData) && - checkForErrorsInChildren(subEntitiesValidationData); - - } - - private boolean checkForErrorsInChildren( - Collection subEntitiesValidationData) { - boolean result = false; - for (CompositionEntityValidationData subEntity : subEntitiesValidationData) { - if (CollectionUtils.isNotEmpty(subEntity.getErrors())) { - return true; - } - - result = isThereErrorsInSubTree(subEntity) || result; - if (result) { - return true; - } - } - return false; - } - private void saveComponents(String vspId, Version version, CompositionData compositionData, Map networkIdByName) { if (CollectionUtils.isNotEmpty(compositionData.getComponents())) { -- cgit 1.2.3-korg