diff options
author | vempo <vitaliy.emporopulo@amdocs.com> | 2018-01-30 21:35:14 +0200 |
---|---|---|
committer | Avi Gaffa <avi.gaffa@amdocs.com> | 2018-02-01 11:13:57 +0000 |
commit | ca297aeb432b3d718bf09f0bac7b9f051c26e66d (patch) | |
tree | 1cf23878b79423e1446d2b68ccdd923d3c07f876 /openecomp-be/lib/openecomp-sdc-tosca-generator-lib | |
parent | ab88e0fdb4250730588bea07f357c4fd721f1425 (diff) |
Removed log constants
Removed constants associated with audit/metrics logging.
Deleted unused code. Some other safe cleanup and refactoring.
Change-Id: Idfda72e1fb27ca695a74f2a09cb46381c9caed1a
Issue-ID: SDC-772
Signed-off-by: vempo <vitaliy.emporopulo@amdocs.com>
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-tosca-generator-lib')
-rw-r--r-- | openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-core/src/main/java/org/openecomp/sdc/generator/core/utils/GeneratorUtils.java | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-core/src/main/java/org/openecomp/sdc/generator/core/utils/GeneratorUtils.java b/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-core/src/main/java/org/openecomp/sdc/generator/core/utils/GeneratorUtils.java index 1bd5e0bb0f..168cc1ff30 100644 --- a/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-core/src/main/java/org/openecomp/sdc/generator/core/utils/GeneratorUtils.java +++ b/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-core/src/main/java/org/openecomp/sdc/generator/core/utils/GeneratorUtils.java @@ -1,9 +1,5 @@ package org.openecomp.sdc.generator.core.utils; -import org.openecomp.sdc.datatypes.error.ErrorLevel; -import org.openecomp.sdc.logging.types.LoggerConstants; -import org.openecomp.sdc.logging.types.LoggerErrorCode; -import org.openecomp.sdc.logging.types.LoggerTragetServiceName; import org.openecomp.sdc.tosca.datatypes.ToscaElementTypes; import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel; import org.openecomp.sdc.tosca.datatypes.model.CapabilityDefinition; @@ -20,6 +16,7 @@ import org.openecomp.sdc.tosca.services.impl.ToscaAnalyzerServiceImpl; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collections; import java.util.HashMap; import java.util.Iterator; import java.util.List; @@ -32,14 +29,13 @@ import static org.openecomp.sdc.tosca.services.DataModelUtil.addSubstitutionNode */ public class GeneratorUtils { - private static List<String> supportedCapabilities = new ArrayList<>(); - private static List<String> supportedRequirements = new ArrayList<>(); - static { - //TODO : Read from configuration - supportedCapabilities.addAll(Arrays.asList("host", "os", "endpoint", "scalable")); - supportedRequirements.addAll(Arrays.asList("link")); + private GeneratorUtils() { + // prevent instantiation } + //TODO : Read from configuration + private static final List<String> SUPPORTED_CAPABILITIES = Arrays.asList("host", "os", "endpoint", "scalable"); + private static final List<String> SUPPORTED_REQUIREMENTS = Collections.singletonList("link"); /** * Add service template to tosca service model. @@ -123,7 +119,7 @@ public class GeneratorUtils { for (Map.Entry<String, RequirementDefinition> requirementDefinitionEntry : requirementDefinitionMap.entrySet()) { String requirementKey = requirementDefinitionEntry.getKey(); - if (!supportedRequirements.contains(requirementKey)) { + if (!SUPPORTED_REQUIREMENTS.contains(requirementKey)) { iterator.remove(); } } @@ -147,7 +143,7 @@ public class GeneratorUtils { Map.Entry<String, CapabilityDefinition> capabilityDefinitionEntry = iterator.next(); //Expected Capability is of the format <capabilityId>_<componentName> String capabilityKey = capabilityDefinitionEntry.getKey().split("_")[0]; - if (!supportedCapabilities.contains(capabilityKey)) { + if (!SUPPORTED_CAPABILITIES.contains(capabilityKey)) { iterator.remove(); } } |