X-Git-Url: https://gerrit.onap.org/r/gitweb?p=aai%2Fbabel.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fonap%2Faai%2Fbabel%2Fxml%2Fgenerator%2Fdata%2FWidgetConfigurationUtil.java;h=8f774c98f902b1b7db74b66e19fa67566461c3b4;hp=620f792ddc38aec99d9eb2f9d853613b543a3ebe;hb=bfde3ef00beb3c6f31cebfd12e90b9b9cdcc492e;hpb=8a7d9a0d7782b9339810b02208620bdd2f0a12b2 diff --git a/src/main/java/org/onap/aai/babel/xml/generator/data/WidgetConfigurationUtil.java b/src/main/java/org/onap/aai/babel/xml/generator/data/WidgetConfigurationUtil.java index 620f792..8f774c9 100644 --- a/src/main/java/org/onap/aai/babel/xml/generator/data/WidgetConfigurationUtil.java +++ b/src/main/java/org/onap/aai/babel/xml/generator/data/WidgetConfigurationUtil.java @@ -28,7 +28,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Optional; -import java.util.Properties; import org.onap.aai.babel.xml.generator.XmlArtifactGenerationException; import org.onap.aai.babel.xml.generator.model.Resource; import org.onap.aai.babel.xml.generator.model.Widget; @@ -40,7 +39,6 @@ public class WidgetConfigurationUtil { public static final String GENERATOR_AAI_CONFIGLPROP_NOT_FOUND = "Cannot generate artifacts. Widget configuration not found for %s"; - private static Properties config; private static List instanceGroups = Collections.emptyList(); private static Map typeToResource = new HashMap<>(); private static Map typeToWidget = new HashMap<>(); @@ -52,10 +50,6 @@ public class WidgetConfigurationUtil { throw new UnsupportedOperationException("This static class should not be instantiated!"); } - public static void setConfig(Properties config) { - WidgetConfigurationUtil.config = config; - } - public static void setSupportedInstanceGroups(List supportedInstanceGroups) { instanceGroups = supportedInstanceGroups; } @@ -94,15 +88,10 @@ public class WidgetConfigurationUtil { public static void setWidgetTypes(List types) { WidgetType.clearElements(); for (WidgetTypeConfig type : types) { - if (type.type == null || type.name == null) { + if (type.type == null || type.name == null || type.modelInvariantId == null + || type.modelVersionId == null) { throw new IllegalArgumentException("Incomplete widget type specified: " + type); } - if (type.modelInvariantId == null) { - type.modelInvariantId = WidgetConfigurationUtil.getModelInvariantId(type.name); - } - if (type.modelVersionId == null) { - type.modelVersionId = WidgetConfigurationUtil.getModelVersionId(type.name); - } Widget widget = new Widget(new WidgetType(type.type), type.name, type.deleteFlag, // type.modelInvariantId, type.modelVersionId); typeToWidget.put(type.type, widget); @@ -123,21 +112,4 @@ public class WidgetConfigurationUtil { } } - public static String getModelInvariantId(String name) { - String id = config.getProperty(ArtifactType.AAI.name() + ".model-invariant-id." + name); - if (id == null) { - throw new IllegalArgumentException(String.format(GENERATOR_AAI_CONFIGLPROP_NOT_FOUND, - ArtifactType.AAI.name() + ".model-invariant-id." + name)); - } - return id; - } - - public static String getModelVersionId(String name) { - String id = config.getProperty(ArtifactType.AAI.name() + ".model-version-id." + name); - if (id == null) { - throw new IllegalArgumentException(String.format(GENERATOR_AAI_CONFIGLPROP_NOT_FOUND, - ArtifactType.AAI.name() + ".model-version-id." + name)); - } - return id; - } }