diff options
Diffstat (limited to 'common/onap-sdc-artifact-generator-lib/onap-sdc-artifact-generator-core')
9 files changed, 198 insertions, 269 deletions
diff --git a/common/onap-sdc-artifact-generator-lib/onap-sdc-artifact-generator-core/pom.xml b/common/onap-sdc-artifact-generator-lib/onap-sdc-artifact-generator-core/pom.xml index 8732a25b06..6e8c4d11e3 100644 --- a/common/onap-sdc-artifact-generator-lib/onap-sdc-artifact-generator-core/pom.xml +++ b/common/onap-sdc-artifact-generator-lib/onap-sdc-artifact-generator-core/pom.xml @@ -1,120 +1,121 @@ -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> - <name>onap-sdc-artifact-generator-core</name> - <artifactId>onap-sdc-artifact-generator-core</artifactId> + <name>onap-sdc-artifact-generator-core</name> + <artifactId>onap-sdc-artifact-generator-core</artifactId> - <parent> - <artifactId>onap-common-lib</artifactId> - <groupId>org.onap.sdc.common</groupId> - <version>1.3.0-SNAPSHOT</version> - <relativePath>../../</relativePath> - </parent> + <parent> + <artifactId>onap-common-lib</artifactId> + <groupId>org.onap.sdc.common</groupId> + <version>1.3.0-SNAPSHOT</version> + <relativePath>../../</relativePath> + </parent> - <dependencies> - <dependency> - <groupId>org.aspectj</groupId> - <artifactId>aspectjrt</artifactId> - <version>${aspectj.version}</version> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-api</artifactId> - <version>${slf4j.version}</version> - </dependency> - <dependency> - <groupId>ch.qos.logback</groupId> - <artifactId>logback-classic</artifactId> - <version>${logback.version}</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>ch.qos.logback</groupId> - <artifactId>logback-core</artifactId> - <version>${logback.version}</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>com.fasterxml.jackson.core</groupId> - <artifactId>jackson-databind</artifactId> - <version>${jackson.version}</version> - </dependency> - <dependency> - <groupId>com.fasterxml.jackson.dataformat</groupId> - <artifactId>jackson-dataformat-yaml</artifactId> - <version>${jackson.version}</version> - </dependency> - <dependency> - <groupId>commons-codec</groupId> - <artifactId>commons-codec</artifactId> - <version>${commons.codec.version}</version> - </dependency> - <dependency> - <groupId>org.openecomp.sdc</groupId> - <artifactId>openecomp-sdc-logging-api</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>org.openecomp.sdc</groupId> - <artifactId>openecomp-sdc-logging-core</artifactId> - <version>${project.version}</version> - <scope>runtime</scope> - </dependency> - <dependency> - <groupId>org.onap.sdc.common</groupId> - <artifactId>onap-sdc-artifact-generator-api</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>org.testng</groupId> - <artifactId>testng</artifactId> - <scope>test</scope> - <version>${testng.version}</version> - </dependency> - <dependency> - <groupId>commons-io</groupId> - <artifactId>commons-io</artifactId> - <version>${commons.io.version}</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.reflections</groupId> - <artifactId>reflections</artifactId> - <version>${org.reflections.version}</version> - </dependency> - </dependencies> - <build> - <pluginManagement> - <plugins> + <dependencies> + <dependency> + <groupId>org.aspectj</groupId> + <artifactId>aspectjrt</artifactId> + <version>${aspectj.version}</version> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + <version>${slf4j.version}</version> + </dependency> + <dependency> + <groupId>ch.qos.logback</groupId> + <artifactId>logback-classic</artifactId> + <version>${logback.version}</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>ch.qos.logback</groupId> + <artifactId>logback-core</artifactId> + <version>${logback.version}</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>com.fasterxml.jackson.core</groupId> + <artifactId>jackson-databind</artifactId> + <version>${jackson.version}</version> + </dependency> + <dependency> + <groupId>com.fasterxml.jackson.dataformat</groupId> + <artifactId>jackson-dataformat-yaml</artifactId> + <version>${jackson.version}</version> + </dependency> + <dependency> + <groupId>commons-codec</groupId> + <artifactId>commons-codec</artifactId> + <version>${commons.codec.version}</version> + </dependency> + <dependency> + <groupId>org.openecomp.sdc</groupId> + <artifactId>openecomp-sdc-logging-api</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.openecomp.sdc</groupId> + <artifactId>openecomp-sdc-logging-core</artifactId> + <version>${project.version}</version> + <scope>runtime</scope> + </dependency> + <dependency> + <groupId>org.onap.sdc.common</groupId> + <artifactId>onap-sdc-artifact-generator-api</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.testng</groupId> + <artifactId>testng</artifactId> + <scope>test</scope> + <version>${testng.version}</version> + </dependency> + <dependency> + <groupId>commons-io</groupId> + <artifactId>commons-io</artifactId> + <version>${commons.io.version}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.reflections</groupId> + <artifactId>reflections</artifactId> + <version>${org.reflections.version}</version> + </dependency> + </dependencies> + <build> + <pluginManagement> + <plugins> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>aspectj-maven-plugin</artifactId> - <version>1.8</version> - <!-- new configuration is here --> - <configuration> - <complianceLevel>1.8</complianceLevel> - <source>1.8</source> - <target>1.8</target> - </configuration> - <executions> - <execution> - <goals> - <goal>compile</goal> - </goals> - <phase>test-compile</phase> - </execution> - </executions> - </plugin> - </plugins> - </pluginManagement> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>aspectj-maven-plugin</artifactId> + <version>1.8</version> + <!-- new configuration is here --> + <configuration> + <complianceLevel>1.8</complianceLevel> + <source>1.8</source> + <target>1.8</target> + </configuration> + <executions> + <execution> + <goals> + <goal>compile</goal> + </goals> + <phase>test-compile</phase> + </execution> + </executions> + </plugin> + </plugins> + </pluginManagement> - <plugins> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>aspectj-maven-plugin</artifactId> - </plugin> - </plugins> - </build> + <plugins> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>aspectj-maven-plugin</artifactId> + </plugin> + </plugins> + </build> </project> diff --git a/common/onap-sdc-artifact-generator-lib/onap-sdc-artifact-generator-core/src/main/java/org/onap/sdc/generator/GeneratorManager.java b/common/onap-sdc-artifact-generator-lib/onap-sdc-artifact-generator-core/src/main/java/org/onap/sdc/generator/GeneratorManager.java index e0049bd719..92314418f3 100644 --- a/common/onap-sdc-artifact-generator-lib/onap-sdc-artifact-generator-core/src/main/java/org/onap/sdc/generator/GeneratorManager.java +++ b/common/onap-sdc-artifact-generator-lib/onap-sdc-artifact-generator-core/src/main/java/org/onap/sdc/generator/GeneratorManager.java @@ -20,8 +20,6 @@ package org.onap.sdc.generator; -import static org.onap.sdc.generator.util.ArtifactGeneratorUtil.logError; - import com.fasterxml.jackson.databind.ObjectMapper; import org.onap.sdc.generator.data.ArtifactType; import org.onap.sdc.generator.data.GeneratorConfiguration; @@ -33,6 +31,8 @@ import org.openecomp.sdc.logging.api.Logger; import org.openecomp.sdc.logging.api.LoggerFactory; import org.reflections.Reflections; +import static org.onap.sdc.generator.util.ArtifactGeneratorUtil.logError; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; diff --git a/common/onap-sdc-artifact-generator-lib/onap-sdc-artifact-generator-core/src/main/java/org/onap/sdc/generator/MockArtifactGenerator.java b/common/onap-sdc-artifact-generator-lib/onap-sdc-artifact-generator-core/src/main/java/org/onap/sdc/generator/MockArtifactGenerator.java index 9753c26a03..6babf721dc 100644 --- a/common/onap-sdc-artifact-generator-lib/onap-sdc-artifact-generator-core/src/main/java/org/onap/sdc/generator/MockArtifactGenerator.java +++ b/common/onap-sdc-artifact-generator-lib/onap-sdc-artifact-generator-core/src/main/java/org/onap/sdc/generator/MockArtifactGenerator.java @@ -20,12 +20,8 @@ package org.onap.sdc.generator; -import org.onap.sdc.generator.data.GenerationData; +import org.onap.sdc.generator.data.*; import org.onap.sdc.generator.intf.ArtifactGenerator; -import org.onap.sdc.generator.data.Artifact; -import org.onap.sdc.generator.data.ArtifactType; -import org.onap.sdc.generator.data.GeneratorUtil; -import org.onap.sdc.generator.data.GroupType; import org.onap.sdc.generator.intf.Generator; import java.util.Date; diff --git a/common/onap-sdc-artifact-generator-lib/onap-sdc-artifact-generator-core/src/main/java/org/onap/sdc/generator/aai/AaiArtifactGenerator.java b/common/onap-sdc-artifact-generator-lib/onap-sdc-artifact-generator-core/src/main/java/org/onap/sdc/generator/aai/AaiArtifactGenerator.java index 995d0846be..1f8b537bec 100644 --- a/common/onap-sdc-artifact-generator-lib/onap-sdc-artifact-generator-core/src/main/java/org/onap/sdc/generator/aai/AaiArtifactGenerator.java +++ b/common/onap-sdc-artifact-generator-lib/onap-sdc-artifact-generator-core/src/main/java/org/onap/sdc/generator/aai/AaiArtifactGenerator.java @@ -20,35 +20,18 @@ package org.onap.sdc.generator.aai; -import static org.onap.sdc.generator.util.ArtifactGeneratorUtil.logError; - -import org.onap.sdc.generator.aai.model.AllotedResource; -import org.onap.sdc.generator.aai.model.ProvidingService; -import org.onap.sdc.generator.aai.model.Resource; -import org.onap.sdc.generator.aai.model.Service; -import org.onap.sdc.generator.aai.model.Widget; +import org.onap.sdc.generator.aai.model.*; import org.onap.sdc.generator.aai.tosca.GroupDefinition; +import org.onap.sdc.generator.aai.tosca.NodeTemplate; +import org.onap.sdc.generator.aai.tosca.ToscaTemplate; import org.onap.sdc.generator.aai.types.ModelType; -import org.onap.sdc.generator.data.AdditionalParams; -import org.onap.sdc.generator.data.ArtifactType; -import org.onap.sdc.generator.data.GenerationData; -import org.onap.sdc.generator.data.GeneratorConstants; -import org.onap.sdc.generator.data.GroupType; -import org.onap.sdc.generator.data.WidgetConfigurationUtil; +import org.onap.sdc.generator.data.*; import org.onap.sdc.generator.intf.ArtifactGenerator; import org.onap.sdc.generator.intf.Generator; +import org.onap.sdc.generator.logging.annotations.Audit; import org.onap.sdc.generator.util.ArtifactGeneratorUtil; import org.openecomp.sdc.logging.api.Logger; import org.openecomp.sdc.logging.api.LoggerFactory; -import org.onap.sdc.generator.aai.model.L3NetworkWidget; -import org.onap.sdc.generator.aai.model.Model; -import org.onap.sdc.generator.aai.model.TunnelXconnectWidget; -import org.onap.sdc.generator.aai.model.VfModule; -import org.onap.sdc.generator.aai.tosca.NodeTemplate; -import org.onap.sdc.generator.aai.tosca.ToscaTemplate; -import org.onap.sdc.generator.data.Artifact; -import org.onap.sdc.generator.data.GeneratorUtil; -import org.onap.sdc.generator.logging.annotations.Audit; import org.slf4j.MDC; import java.io.File; @@ -64,6 +47,8 @@ import java.util.Map; import java.util.Properties; import java.util.Set; +import static org.onap.sdc.generator.util.ArtifactGeneratorUtil.logError; + @Generator(artifactType = ArtifactType.AAI) public class AaiArtifactGenerator implements ArtifactGenerator { diff --git a/common/onap-sdc-artifact-generator-lib/onap-sdc-artifact-generator-core/src/main/java/org/onap/sdc/generator/aai/AaiModelGeneratorImpl.java b/common/onap-sdc-artifact-generator-lib/onap-sdc-artifact-generator-core/src/main/java/org/onap/sdc/generator/aai/AaiModelGeneratorImpl.java index 4a4f9f0923..fcb0deb66b 100644 --- a/common/onap-sdc-artifact-generator-lib/onap-sdc-artifact-generator-core/src/main/java/org/onap/sdc/generator/aai/AaiModelGeneratorImpl.java +++ b/common/onap-sdc-artifact-generator-lib/onap-sdc-artifact-generator-core/src/main/java/org/onap/sdc/generator/aai/AaiModelGeneratorImpl.java @@ -20,28 +20,21 @@ package org.onap.sdc.generator.aai; -import org.openecomp.sdc.logging.api.Logger; -import org.openecomp.sdc.logging.api.LoggerFactory; import org.onap.sdc.generator.aai.model.Resource; import org.onap.sdc.generator.aai.model.Service; import org.onap.sdc.generator.aai.model.Widget; -import org.onap.sdc.generator.aai.xml.Model; -import org.onap.sdc.generator.aai.xml.ModelElement; -import org.onap.sdc.generator.aai.xml.ModelElements; -import org.onap.sdc.generator.aai.xml.ModelVer; -import org.onap.sdc.generator.aai.xml.ModelVers; -import org.onap.sdc.generator.aai.xml.Relationship; -import org.onap.sdc.generator.aai.xml.RelationshipData; -import org.onap.sdc.generator.aai.xml.RelationshipList; +import org.onap.sdc.generator.aai.xml.*; import org.onap.sdc.generator.logging.annotations.Metrics; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import org.w3c.dom.DOMException; -import java.io.StringWriter; -import java.util.List; -import java.util.Set; import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; import javax.xml.bind.Marshaller; +import java.io.StringWriter; +import java.util.List; +import java.util.Set; /** * Implementation of the {@link AaiModelGenerator} which generates the XML models from the diff --git a/common/onap-sdc-artifact-generator-lib/onap-sdc-artifact-generator-core/src/main/java/org/onap/sdc/generator/impl/ArtifactGenerationServiceImpl.java b/common/onap-sdc-artifact-generator-lib/onap-sdc-artifact-generator-core/src/main/java/org/onap/sdc/generator/impl/ArtifactGenerationServiceImpl.java index 42975478fe..d6a934d58a 100644 --- a/common/onap-sdc-artifact-generator-lib/onap-sdc-artifact-generator-core/src/main/java/org/onap/sdc/generator/impl/ArtifactGenerationServiceImpl.java +++ b/common/onap-sdc-artifact-generator-lib/onap-sdc-artifact-generator-core/src/main/java/org/onap/sdc/generator/impl/ArtifactGenerationServiceImpl.java @@ -20,23 +20,23 @@ package org.onap.sdc.generator.impl; -import static org.onap.sdc.generator.util.ArtifactGeneratorUtil.logError; - -import org.onap.sdc.generator.data.GeneratorConstants; -import org.onap.sdc.generator.util.ArtifactGeneratorUtil; -import org.openecomp.sdc.logging.api.Logger; -import org.openecomp.sdc.logging.api.LoggerFactory; import org.onap.sdc.generator.GeneratorManager; import org.onap.sdc.generator.GeneratorTask; import org.onap.sdc.generator.data.Artifact; import org.onap.sdc.generator.data.GenerationData; +import org.onap.sdc.generator.data.GeneratorConstants; import org.onap.sdc.generator.intf.ArtifactGenerator; import org.onap.sdc.generator.service.ArtifactGenerationService; +import org.onap.sdc.generator.util.ArtifactGeneratorUtil; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import java.util.List; import java.util.Map; import java.util.concurrent.ForkJoinPool; +import static org.onap.sdc.generator.util.ArtifactGeneratorUtil.logError; + /** * Artifact Generation Service implementation class. */ diff --git a/common/onap-sdc-artifact-generator-lib/onap-sdc-artifact-generator-core/src/main/java/org/onap/sdc/generator/util/ArtifactGeneratorUtil.java b/common/onap-sdc-artifact-generator-lib/onap-sdc-artifact-generator-core/src/main/java/org/onap/sdc/generator/util/ArtifactGeneratorUtil.java index 8e6e2c0829..afb61f873b 100644 --- a/common/onap-sdc-artifact-generator-lib/onap-sdc-artifact-generator-core/src/main/java/org/onap/sdc/generator/util/ArtifactGeneratorUtil.java +++ b/common/onap-sdc-artifact-generator-lib/onap-sdc-artifact-generator-core/src/main/java/org/onap/sdc/generator/util/ArtifactGeneratorUtil.java @@ -20,70 +20,12 @@ package org.onap.sdc.generator.util; -import static org.onap.sdc.generator.data.GeneratorConstants.BEGIN_TIMESTAMP; -import static org.onap.sdc.generator.data.GeneratorConstants.BE_FQDN; -import static org.onap.sdc.generator.data.GeneratorConstants.CATEGORY_LOG_LEVEL; -import static org.onap.sdc.generator.data.GeneratorConstants.CLIENT_IP; -import static org.onap.sdc.generator.data.GeneratorConstants.ELAPSED_TIME; -import static org.onap.sdc.generator.data.GeneratorConstants.END_TIMESTAMP; -import static org.onap.sdc.generator.data.GeneratorConstants.ERROR_CATEGORY; -import static org.onap.sdc.generator.data.GeneratorConstants.ERROR_CODE; -import static org.onap.sdc.generator.data.GeneratorConstants.ERROR_DESCRIPTION; -import static org.onap.sdc.generator.data.GeneratorConstants.GENERATOR_AAI_CONFIGFILE_NOT_FOUND; -import static org.onap.sdc.generator.data.GeneratorConstants.GENERATOR_AAI_CONFIGLOCATION_NOT_FOUND; -import static org.onap.sdc.generator.data.GeneratorConstants.GENERATOR_AAI_CONFIGLPROP_NOT_FOUND; -import static org.onap.sdc.generator.data.GeneratorConstants.GENERATOR_AAI_PROVIDING_SERVICE_METADATA_MISSING; -import static org.onap.sdc.generator.data.GeneratorConstants.GENERATOR_AAI_PROVIDING_SERVICE_MISSING; -import static org.onap.sdc.generator.data.GeneratorConstants.GENERATOR_AAI_ERROR_INVALID_ID; -import static org.onap.sdc.generator.data.GeneratorConstants.GENERATOR_AAI_ERROR_INVALID_RESOURCE_VERSION_IN_SERVICE_TOSCA; -import static org.onap.sdc.generator.data.GeneratorConstants.GENERATOR_AAI_ERROR_INVALID_TOSCA_MSG; -import static org.onap.sdc.generator.data.GeneratorConstants.GENERATOR_AAI_ERROR_MANDATORY_METADATA_DEFINITION_MSG; -import static org.onap.sdc.generator.data.GeneratorConstants.GENERATOR_AAI_ERROR_MISSING_RESOURCE_TOSCA; -import static org.onap.sdc.generator.data.GeneratorConstants.GENERATOR_AAI_ERROR_MISSING_SERVICE_TOSCA_MSG; -import static org.onap.sdc.generator.data.GeneratorConstants.GENERATOR_AAI_ERROR_MISSING_SERVICE_VERSION; -import static org.onap.sdc.generator.data.GeneratorConstants.GENERATOR_AAI_ERROR_NULL_RESOURCE_VERSION_IN_SERVICE_TOSCA; -import static org.onap.sdc.generator.data.GeneratorConstants.GENERATOR_AAI_INVALID_SERVICE_VERSION; -import static org.onap.sdc.generator.data.GeneratorConstants.GENERATOR_ERROR_ARTIFACT_GENERATION_FAILED_MSG; -import static org.onap.sdc.generator.data.GeneratorConstants.GENERATOR_ERROR_INVALID_CLIENT_CONFIGURATION_MSG; -import static org.onap.sdc.generator.data.GeneratorConstants.GENERATOR_PARTNER_NAME; -import static org.onap.sdc.generator.data.GeneratorConstants.INSTANCE_UUID; -import static org.onap.sdc.generator.data.GeneratorConstants.LOCAL_ADDR; -import static org.onap.sdc.generator.data.GeneratorConstants.MDC_SDC_INSTANCE_UUID; -import static org.onap.sdc.generator.data.GeneratorConstants.PARTNER_NAME; -import static org.onap.sdc.generator.data.GeneratorConstants.REMOTE_HOST; -import static org.onap.sdc.generator.data.GeneratorConstants.REQUEST_ID; -import static org.onap.sdc.generator.data.GeneratorConstants.RESPONSE_CODE; -import static org.onap.sdc.generator.data.GeneratorConstants.RESPONSE_DESCRIPTION; -import static org.onap.sdc.generator.data.GeneratorConstants.SERVICE_INSTANCE_ID; -import static org.onap.sdc.generator.data.GeneratorConstants.SERVICE_METRIC_BEGIN_TIMESTAMP; -import static org.onap.sdc.generator.data.GeneratorConstants.SERVICE_NAME; -import static org.onap.sdc.generator.data.GeneratorConstants.STATUS_CODE; -import static org.onap.sdc.generator.data.GeneratorConstants.TARGET_ENTITY; -import static org.onap.sdc.generator.data.GeneratorConstants.TARGET_SERVICE_NAME; -import static org.onap.sdc.generator.logging.ArtifactGeneratorLogResponseCode.INTERNAL_SERVER_ERROR; -import static org.onap.sdc.generator.logging.ArtifactGeneratorLogResponseCode.INVALID_CLIENT_CONFIGURATION; -import static org.onap.sdc.generator.logging.ArtifactGeneratorLogResponseCode.INVALID_ID_VALUE; -import static org.onap.sdc.generator.logging.ArtifactGeneratorLogResponseCode.INVALID_RESOURCE_VERSION; -import static org.onap.sdc.generator.logging.ArtifactGeneratorLogResponseCode.INVALID_SERVICE_VERSION; -import static org.onap.sdc.generator.logging.ArtifactGeneratorLogResponseCode.INVALID_TOSCA_YAML; -import static org.onap.sdc.generator.logging.ArtifactGeneratorLogResponseCode.MANDATORY_ATTRIBUTE_MISSING; -import static org.onap.sdc.generator.logging.ArtifactGeneratorLogResponseCode.MISSING_CONFIG_PROPERTIES_FILE; -import static org.onap.sdc.generator.logging.ArtifactGeneratorLogResponseCode.MISSING_PRO_SERVICE; -import static org.onap.sdc.generator.logging.ArtifactGeneratorLogResponseCode.MISSING_PRO_SERVICE_METADATA; -import static org.onap.sdc.generator.logging.ArtifactGeneratorLogResponseCode.MISSING_RESOURCE_VERSION; -import static org.onap.sdc.generator.logging.ArtifactGeneratorLogResponseCode.MISSING_SERVICE_VERSION; -import static org.onap.sdc.generator.logging.ArtifactGeneratorLogResponseCode.MISSING_SYSTME_PROPERY_CONFIGURATION; -import static org.onap.sdc.generator.logging.ArtifactGeneratorLogResponseCode.MISSING_WIDGET_CONFIGURATION; -import static org.onap.sdc.generator.logging.ArtifactGeneratorLogResponseCode.RESOURCE_TOSCA_MISSING; -import static org.onap.sdc.generator.logging.ArtifactGeneratorLogResponseCode.SERVICE_TOSCA_MISSING; -import static org.onap.sdc.generator.logging.ArtifactGeneratorLogResponseCode.UNABLE_TO_GENERATE_ARTIFACT; - -import org.openecomp.sdc.logging.api.Logger; -import org.openecomp.sdc.logging.api.LoggerFactory; import org.onap.sdc.generator.data.Artifact; import org.onap.sdc.generator.logging.ArtifactGeneratorLogResponseCode; import org.onap.sdc.generator.logging.CategoryLogLevel; import org.onap.sdc.generator.logging.StatusCode; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import org.slf4j.MDC; import java.io.PrintWriter; @@ -95,6 +37,9 @@ import java.text.SimpleDateFormat; import java.util.Date; import java.util.TimeZone; +import static org.onap.sdc.generator.data.GeneratorConstants.*; +import static org.onap.sdc.generator.logging.ArtifactGeneratorLogResponseCode.*; + public class ArtifactGeneratorUtil { diff --git a/common/onap-sdc-artifact-generator-lib/onap-sdc-artifact-generator-core/src/test/java/org/onap/sdc/generator/ArtifactGenerationServiceTest.java b/common/onap-sdc-artifact-generator-lib/onap-sdc-artifact-generator-core/src/test/java/org/onap/sdc/generator/ArtifactGenerationServiceTest.java index e6f1abd796..2599d550ef 100644 --- a/common/onap-sdc-artifact-generator-lib/onap-sdc-artifact-generator-core/src/test/java/org/onap/sdc/generator/ArtifactGenerationServiceTest.java +++ b/common/onap-sdc-artifact-generator-lib/onap-sdc-artifact-generator-core/src/test/java/org/onap/sdc/generator/ArtifactGenerationServiceTest.java @@ -52,6 +52,7 @@ import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; + import java.net.URL; import java.util.*; import javax.xml.bind.JAXBContext; diff --git a/common/onap-sdc-artifact-generator-lib/onap-sdc-artifact-generator-core/src/test/resources/logback.xml b/common/onap-sdc-artifact-generator-lib/onap-sdc-artifact-generator-core/src/test/resources/logback.xml index 68438967b1..dc427cdf3f 100644 --- a/common/onap-sdc-artifact-generator-lib/onap-sdc-artifact-generator-core/src/test/resources/logback.xml +++ b/common/onap-sdc-artifact-generator-lib/onap-sdc-artifact-generator-core/src/test/resources/logback.xml @@ -1,51 +1,59 @@ <configuration scan="true" scanPeriod="3 seconds"> - <property name="logDir" value="logs"/> - <property name="componentName" value="COMMON"/> - <property name="OPENECOMP-subcomponent-name" value="ARTIFACT_GENERATOR"/> - - <property name="defaultPattern" - value="%msg%n"/> - - <!--<property name="MetricsLogPattern" value="%X{BeginTimestamp}|%X{EndTimestamp}|%X{RequestId}|%X{ServiceInstanceId}|%thread|%X{ServerName}|%X{ServiceName}|%X{PartnerName}|%X{TargetEntity}|%X{TargetServiceName}|%X{StatusCode}|%X{ResponseCode}|%X{ResponseDescription}|%X{InstanceUUID}|%X{CategoryLogLevel}|%X{Severity}|%X{ServerIPAddress}|%X{ElapsedTime}|%X{ServerFQDN}|%X{ClientIP}|%logger%n" /> - <property name="AuditLogPattern" value="%X{BeginTimestamp}|%X{EndTimestamp}|%X{RequestId}|%X{ServiceInstanceId}|%thread|%X{ServerName}|%X{ServiceName}|%X{PartnerName}|%X{StatusCode}|%X{ResponseCode}|%X{ResponseDescription}|%X{InstanceUUID}|%X{CategoryLogLevel}|%X{Severity}|%X{ServerIPAddress}|%X{ElapsedTime}|%X{ServerFQDN}|%X{ClientIP}%n" /> - <property name="ErrorLogPattern" value="%d{yyyy-MM-dd'T'HH:mm:ss.SSS, GMT}|%X{RequestId}|%thread|%X{ServiceName}|%X{PartnerName}|%X{TargetEntity}|%X{TargetServiceName}|%X{ErrorCategory}|%X{ErrorCode}|%X{ErrorDescription}|%msg%n"/> - <property name="DebugLogPattern" value="%d{yyyy-MM-dd'T'HH:mm:ss.SSS, GMT}|%X{RequestId}||%logger|%msg%n"/>--> - - <!-- new pattern --> - <property name="default-log-pattern" - value="%d{yyyy-MM-dd'T'HH:mm:ss.SSSXXX}|%X{BeginTimestamp}|%X{EndTimestamp}|%X{uuid}|%X{serviceInstanceID}|%thread|%X{ServerName}|%X{ServiceName}|${OPENECOMP-subcomponent-name}|%X{userId}|%X{TargetEntity}|%X{TargetServiceName}|%X{StatusCode}|%X{ResponseCode}|%X{ResponseDescription}|%X{InstanceUUID}|%X{ErrorCategory}|%X{ErrorCode}|%X{ErrorDescription}|%X{level}|%X{alarmSeverity}|%X{localAddr}|%X{ElapsedTime}|%X{beFqdn}|%X{remoteAddr}|%logger{35}|%X{timer}|ActivityType=<%M>, Desc=<%msg>%n"/> - - <property name="logDirectory" value="${logDir}/${componentName}"/> - - <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> - <encoder> - <pattern>${defaultPattern}</pattern> - </encoder> - </appender> - - <appender name="DISPATCHER" class="ch.qos.logback.classic.sift.SiftingAppender"> - <discriminator class="org.openecomp.core.logging.logback.EventTypeDiscriminator"/> - <sift> - <appender name="${eventType}" class="ch.qos.logback.core.rolling.RollingFileAppender"> - <file>${logDirectory}/${eventType}.log</file> - <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> - <fileNamePattern>${logDirectory}/${eventType}.%i.log.zip</fileNamePattern> - <minIndex>1</minIndex> - <maxIndex>9</maxIndex> - </rollingPolicy> - <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> - <maxFileSize>5MB</maxFileSize> - </triggeringPolicy> - <encoder> - <pattern>${default-log-pattern}</pattern> - </encoder> - </appender> - </sift> - </appender> - - <root level="DEBUG"> - <appender-ref ref="DISPATCHER"/> - </root> + <property name="logDir" value="logs" /> + <property name="componentName" value="COMMON" /> + <property name="OPENECOMP-subcomponent-name" + value="ARTIFACT_GENERATOR" /> + + <property name="defaultPattern" value="%msg%n" /> + + <!--<property name="MetricsLogPattern" value="%X{BeginTimestamp}|%X{EndTimestamp}|%X{RequestId}|%X{ServiceInstanceId}|%thread|%X{ServerName}|%X{ServiceName}|%X{PartnerName}|%X{TargetEntity}|%X{TargetServiceName}|%X{StatusCode}|%X{ResponseCode}|%X{ResponseDescription}|%X{InstanceUUID}|%X{CategoryLogLevel}|%X{Severity}|%X{ServerIPAddress}|%X{ElapsedTime}|%X{ServerFQDN}|%X{ClientIP}|%logger%n" + /> <property name="AuditLogPattern" value="%X{BeginTimestamp}|%X{EndTimestamp}|%X{RequestId}|%X{ServiceInstanceId}|%thread|%X{ServerName}|%X{ServiceName}|%X{PartnerName}|%X{StatusCode}|%X{ResponseCode}|%X{ResponseDescription}|%X{InstanceUUID}|%X{CategoryLogLevel}|%X{Severity}|%X{ServerIPAddress}|%X{ElapsedTime}|%X{ServerFQDN}|%X{ClientIP}%n" + /> <property name="ErrorLogPattern" value="%d{yyyy-MM-dd'T'HH:mm:ss.SSS, + GMT}|%X{RequestId}|%thread|%X{ServiceName}|%X{PartnerName}|%X{TargetEntity}|%X{TargetServiceName}|%X{ErrorCategory}|%X{ErrorCode}|%X{ErrorDescription}|%msg%n"/> + <property name="DebugLogPattern" value="%d{yyyy-MM-dd'T'HH:mm:ss.SSS, GMT}|%X{RequestId}||%logger|%msg%n"/> --> + + <!-- new pattern --> + <property name="default-log-pattern" + value="%d{yyyy-MM-dd'T'HH:mm:ss.SSSXXX}|%X{BeginTimestamp}|%X{EndTimestamp}|%X{uuid}|%X{serviceInstanceID}|%thread|%X{ServerName}|%X{ServiceName}|${OPENECOMP-subcomponent-name}|%X{userId}|%X{TargetEntity}|%X{TargetServiceName}|%X{StatusCode}|%X{ResponseCode}|%X{ResponseDescription}|%X{InstanceUUID}|%X{ErrorCategory}|%X{ErrorCode}|%X{ErrorDescription}|%X{level}|%X{alarmSeverity}|%X{localAddr}|%X{ElapsedTime}|%X{beFqdn}|%X{remoteAddr}|%logger{35}|%X{timer}|ActivityType=<%M>, Desc=<%msg>%n" /> + + <property name="logDirectory" + value="${logDir}/${componentName}" /> + + <appender name="STDOUT" + class="ch.qos.logback.core.ConsoleAppender"> + <encoder> + <pattern>${defaultPattern}</pattern> + </encoder> + </appender> + + <appender name="DISPATCHER" + class="ch.qos.logback.classic.sift.SiftingAppender"> + <discriminator + class="org.openecomp.core.logging.logback.EventTypeDiscriminator" /> + <sift> + <appender name="${eventType}" + class="ch.qos.logback.core.rolling.RollingFileAppender"> + <file>${logDirectory}/${eventType}.log</file> + <rollingPolicy + class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> + <fileNamePattern>${logDirectory}/${eventType}.%i.log.zip</fileNamePattern> + <minIndex>1</minIndex> + <maxIndex>9</maxIndex> + </rollingPolicy> + <triggeringPolicy + class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> + <maxFileSize>5MB</maxFileSize> + </triggeringPolicy> + <encoder> + <pattern>${default-log-pattern}</pattern> + </encoder> + </appender> + </sift> + </appender> + + <root level="DEBUG"> + <appender-ref ref="DISPATCHER" /> + </root> </configuration>
\ No newline at end of file |