summaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib
diff options
context:
space:
mode:
authorMichael Lando <ml636r@att.com>2017-07-12 00:54:52 +0300
committerMichael Lando <ml636r@att.com>2017-07-12 01:55:12 +0300
commitdd60339b06d252fcb1382aa97ab3d65b37dad021 (patch)
treec1551ce67cd77ca810ad5f579eb3617af86be85f /openecomp-be/lib/openecomp-sdc-vendor-software-product-lib
parentab146a193c43e9be0e9efeac7bab2690a7ba2d33 (diff)
[sdc] rebase update
Change-Id: I8f1fc7150975122dd9f3f4e653b9983064b399a6 Signed-off-by: Michael Lando <ml636r@att.com>
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-vendor-software-product-lib')
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/CompositionEntityId.java7
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/factory/impl/CompositionEntityDataManagerFactoryImpl.java1
-rw-r--r--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.java12
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/filedatastructuremodule/CandidateServiceImpl.java4
4 files changed, 22 insertions, 2 deletions
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/CompositionEntityId.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/CompositionEntityId.java
index 71c8e4609a..7f5f69de3b 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/CompositionEntityId.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/CompositionEntityId.java
@@ -61,4 +61,11 @@ public class CompositionEntityId {
return parentId != null ? parentId.equals(that.parentId) : that.parentId == null;
}
+
+ @Override
+ public String toString() {
+ return parentId == null
+ ? id
+ : parentId.toString() + "/" + id;
+ }
}
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/factory/impl/CompositionEntityDataManagerFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/factory/impl/CompositionEntityDataManagerFactoryImpl.java
index 54d67e60fe..9383e41a40 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/factory/impl/CompositionEntityDataManagerFactoryImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/factory/impl/CompositionEntityDataManagerFactoryImpl.java
@@ -32,6 +32,7 @@ public class CompositionEntityDataManagerFactoryImpl extends CompositionEntityDa
@Override
public CompositionEntityDataManager createInterface() {
+ // this class is stateful! it must be recreated from scratch on every use!!!
return new CompositionEntityDataManagerImpl(
VendorSoftwareProductInfoDaoFactory.getInstance().createInterface(),
ComponentDaoFactory.getInstance().createInterface(),
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 81cacf75ac..c33b2dd3b4 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
@@ -27,6 +27,8 @@ import org.openecomp.core.utilities.json.JsonUtil;
import org.openecomp.sdc.common.errors.CoreException;
import org.openecomp.sdc.common.errors.ErrorCategory;
import org.openecomp.sdc.common.errors.ErrorCode;
+import org.openecomp.sdc.logging.api.Logger;
+import org.openecomp.sdc.logging.api.LoggerFactory;
import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage;
import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDao;
import org.openecomp.sdc.vendorsoftwareproduct.dao.NetworkDao;
@@ -68,6 +70,8 @@ public class CompositionEntityDataManagerImpl implements CompositionEntityDataMa
private static final String COMPOSITION_ENTITY_DATA_MANAGER_ERR_MSG =
"Invalid input: %s may not be null";
+ private static final Logger logger =
+ LoggerFactory.getLogger(CompositionEntityDataManagerImpl.class);
private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage();
private Map<CompositionEntityId, CompositionEntityData> entities = new HashMap<>();
@@ -460,7 +464,7 @@ public class CompositionEntityDataManagerImpl implements CompositionEntityDataMa
VspQuestionnaireEntity vspQuestionnaireEntity = (VspQuestionnaireEntity) vspEntity.entity;
VspDetails vspDetails =
vspInfoDao.get(new VspDetails(vspQuestionnaireEntity.getId(),
- vspQuestionnaireEntity.getVersion()));
+ vspQuestionnaireEntity.getVersion()));
return vspDetails.getName();
}
@@ -545,6 +549,12 @@ public class CompositionEntityDataManagerImpl implements CompositionEntityDataMa
}
private Collection<String> validateQuestionnaire(CompositionEntityData compositionEntityData) {
+ logger.debug(String.format("validateQuestionnaire start: " +
+ "[entity.type]=%s, [entity.id]=%s, [entity.questionnaireString]=%s",
+ compositionEntityData.entity.getType().name(),
+ compositionEntityData.entity.getCompositionEntityId().toString(),
+ compositionEntityData.entity.getQuestionnaireData()));
+
return JsonUtil.validate(
compositionEntityData.entity.getQuestionnaireData() == null
? JsonUtil.object2Json(new Object())
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/filedatastructuremodule/CandidateServiceImpl.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/filedatastructuremodule/CandidateServiceImpl.java
index 2822d958d0..e05c848452 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/filedatastructuremodule/CandidateServiceImpl.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/filedatastructuremodule/CandidateServiceImpl.java
@@ -138,7 +138,9 @@ public class CandidateServiceImpl implements CandidateService {
FilesDataStructure fileDataStructureFromManifest =
createFileDataStructureFromManifest(zipContentMap.getFileContent
(SdcCommon.MANIFEST_NAME));
- structure.getArtifacts().addAll(fileDataStructureFromManifest.getArtifacts());
+ List<String> structureArtifacts = structure.getArtifacts();
+ structureArtifacts.addAll(fileDataStructureFromManifest.getArtifacts().stream().filter
+ (artifact -> !structureArtifacts.contains(artifact)).collect((Collectors.toList())));
handleArtifactsFromTree(tree, structure);
return JsonUtil.object2Json(structure);