summaryrefslogtreecommitdiffstats
path: root/asdctool/src/main/java
diff options
context:
space:
mode:
authorandre.schmid <andre.schmid@est.tech>2020-01-29 17:25:21 +0000
committerOfir Sonsino <ofir.sonsino@intl.att.com>2020-04-19 16:35:32 +0000
commitcd6f933375c412c2f79a12e909821322d58a8499 (patch)
tree758ff2e742b514169bbc84a8433d68fe221ef5c9 /asdctool/src/main/java
parentdc56692a4a307f378c827f017d2efbf754c223e0 (diff)
Configure a new Artifact Type
Centralizes artifact configuration in one yaml entry. Allow the configuration of a new artifact type without the need of code changes. The configuration file now is used as a source of artifacts types instead the artifact type enum. The enum will be used as a source of base artifact types and also in hard coded business rules. Change-Id: Id0383d9fca9bce0519a4d52a4ecb3a68c8713f0f Issue-ID: SDC-2754 Signed-off-by: andre.schmid <andre.schmid@est.tech>
Diffstat (limited to 'asdctool/src/main/java')
-rw-r--r--asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/ArtifactUuidFix.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/ArtifactUuidFix.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/ArtifactUuidFix.java
index 4ad90b884c..e21594db46 100644
--- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/ArtifactUuidFix.java
+++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/ArtifactUuidFix.java
@@ -358,7 +358,7 @@ public class ArtifactUuidFix {
List<VfModuleArtifactPayloadEx> vfModules = null;
if(isCheckVFModules){
Optional<ArtifactDefinition> optionalVfModuleArtifact = deploymentArtifacts.values().stream()
- .filter(p -> p.getArtifactType().equals(ArtifactTypeEnum.VF_MODULES_METADATA.name())).findAny();
+ .filter(p -> p.getArtifactType().equals(ArtifactTypeEnum.VF_MODULES_METADATA.getType())).findAny();
if(!optionalVfModuleArtifact.isPresent())
return true;
@@ -436,7 +436,7 @@ public class ArtifactUuidFix {
resourceName);
return true;
}
- ArtifactTypeEnum artifactType = ArtifactTypeEnum.findType(artifactDefinition.getArtifactType());
+ ArtifactTypeEnum artifactType = ArtifactTypeEnum.parse(artifactDefinition.getArtifactType());
if (artifactType != ArtifactTypeEnum.HEAT_ENV) {
if (!artifactId.equals(artifactDefinition.getUniqueId())) {
log.info(
@@ -520,7 +520,7 @@ public class ArtifactUuidFix {
servicename);
return true;
}
- ArtifactTypeEnum artifactType = ArtifactTypeEnum.findType(artifactDefinition.getArtifactType());
+ ArtifactTypeEnum artifactType = ArtifactTypeEnum.parse(artifactDefinition.getArtifactType());
if (artifactType != ArtifactTypeEnum.HEAT_ENV) {
if (!artifactId.equals(artifactDefinition.getUniqueId())) {
log.info(
@@ -856,7 +856,7 @@ public class ArtifactUuidFix {
}
Optional<ArtifactDefinition> optionalVfModuleArtifact = artifactsMap.values().stream()
- .filter(p -> p.getArtifactType().equals(ArtifactTypeEnum.VF_MODULES_METADATA.name())).findAny();
+ .filter(p -> p.getArtifactType().equals(ArtifactTypeEnum.VF_MODULES_METADATA.getType())).findAny();
ArtifactDefinition vfModuleArtifact;
if(!optionalVfModuleArtifact.isPresent()){
vfModuleArtifact = createVfModuleArtifact(instance, service);
@@ -925,7 +925,7 @@ public class ArtifactUuidFix {
group.getName(), artifactId, artifactlabel);
if (!artifactlabel.isEmpty() && artifactsMap.containsKey(artifactlabel)) {
ArtifactDefinition artifact = artifactsMap.get(artifactlabel);
- ArtifactTypeEnum artifactType = ArtifactTypeEnum.findType(artifact.getArtifactType());
+ ArtifactTypeEnum artifactType = ArtifactTypeEnum.parse(artifact.getArtifactType());
String correctArtifactId = artifact.getUniqueId();
String correctArtifactUUID = artifact.getArtifactUUID();
if (artifactType != ArtifactTypeEnum.HEAT_ENV) {
@@ -1018,7 +1018,7 @@ public class ArtifactUuidFix {
String correctArtifactUUID = artifact.getArtifactUUID();
boolean isAddToGroup = true;
if (groupArtifacts.size() == 1) {
- ArtifactTypeEnum artifactType = ArtifactTypeEnum.findType(artifact.getArtifactType());
+ ArtifactTypeEnum artifactType = ArtifactTypeEnum.parse(artifact.getArtifactType());
if (artifactType == ArtifactTypeEnum.HEAT_ARTIFACT) {
isAddToGroup = false;
artifact.setArtifactType(ArtifactTypeEnum.OTHER.getType());