From cd6f933375c412c2f79a12e909821322d58a8499 Mon Sep 17 00:00:00 2001 From: "andre.schmid" Date: Wed, 29 Jan 2020 17:25:21 +0000 Subject: 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 --- .../org/openecomp/sdc/asdctool/impl/ArtifactUuidFix.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'asdctool/src/main/java/org/openecomp') 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 vfModules = null; if(isCheckVFModules){ Optional 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 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()); -- cgit 1.2.3-korg