aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorajay_dp001 <ajay.deep.singh@est.tech>2021-01-23 14:50:45 +0530
committerajay_dp001 <ajay.deep.singh@est.tech>2021-02-09 18:00:23 +0530
commit1a88d861bffa7ea1da254f43948111b6c7c821ac (patch)
treeb89ce69ca15b7a47ecf7ab0be20cee03b1fc9b53
parentd55cc18eb1b47c397157102d3395d4e1ce8f74a1 (diff)
[DMaap-dbcapi] Updated Outdated Packages
- Log4j Version 1.2.17 to 2.13.3 - commons-codec version 1.11 to 1.15 - postgresql version 42.2.5 to 42.2.14 - jetty-servlets version 9.4.24.v20191120 to 9.4.36.v20210114 Issue-ID: DMAAP-1515 Signed-off-by: ajay_dp001 <ajay.deep.singh@est.tech> Change-Id: I1716c8c78d4c3ca4f75159b3de98d9c799bae929
-rw-r--r--pom.xml884
-rw-r--r--src/main/resources/log4j2.properties (renamed from src/main/resources/log4j.properties)36
-rw-r--r--src/main/webapp/WEB-INF/log4j.xml45
-rw-r--r--src/main/webapp/WEB-INF/log4j2.xml50
-rw-r--r--src/test/java/org/onap/dmaap/dbcapi/database/DBFieldHandlerTest.java6
-rw-r--r--src/test/java/org/onap/dmaap/dbcapi/model/JUnitTestSuite.java26
-rw-r--r--src/test/java/org/onap/dmaap/dbcapi/model/TestRunner.java31
7 files changed, 566 insertions, 512 deletions
diff --git a/pom.xml b/pom.xml
index 2eb84f5..c39134a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -19,442 +19,474 @@
============LICENSE_END============================================
ECOMP is a trademark and service mark of AT&T Intellectual Property.
-->
-<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/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.onap.dmaap.dbcapi</groupId>
- <artifactId>dbcapi</artifactId>
- <version>${artifact.version}</version>
- <name>dmaap-dbcapi</name>
- <parent>
- <groupId>org.onap.oparent</groupId>
- <artifactId>oparent</artifactId>
- <version>2.1.0</version>
- <relativePath/>
- </parent>
- <build>
- <finalName>dbcapi</finalName>
- <resources>
- <resource>
- <directory>src/main/java/org/onap/dmaap/dbcapi/logging</directory>
- </resource>
- <resource>
- <directory>src/main/resources</directory>
- </resource>
- </resources>
- <plugins>
- <!-- reference: https://tech.homeaway.com/development/2016/06/02/generating-swagger-spec.html -->
- <plugin>
- <groupId>com.github.kongchen</groupId>
- <artifactId>swagger-maven-plugin</artifactId>
- <version>3.1.5</version>
- <configuration>
- <apiSources>
- <apiSource>
- <springmvc>false</springmvc>
- <locations>
- <location>org.onap.dmaap.dbcapi.resources</location>
- </locations>
- <schemes>
- <scheme>http</scheme>
- <scheme>https</scheme>
- </schemes>
- <host>www.[host]:[port]</host>
- <basePath>/webapi</basePath>
- <info>
- <title>DMaaP Bus Controller REST API</title>
- <version>1.1.0</version>
- <description>
- provides an API for OpenDCAE components which need to provision
- underlying DMaaP technologies (Data Router and Message Router).
- Primary clients for this API are anticipated to be the OpenDCAE
- Controller, OpenDCAE Orchestrator, OpenDCAE Inventory and the
- ECOMP Portal.
+<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/maven-v4_0_0.xsd">
- Objects managed by DMaaP are deployed in a dcaeLocation which is a
- unique identifier for an OpenStack tenant for a dcaeLayer,
- opendcae-central (aka ecomp) or opendcae-local-ntc (aka edge).
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.onap.dmaap.dbcapi</groupId>
+ <artifactId>dbcapi</artifactId>
+ <version>${artifact.version}</version>
+ <name>dmaap-dbcapi</name>
- A dcaeEnvironment (e.g. FTL or prod) has a single DMaaP. A
- DMaaP is managed by a one or more stateless DMaaP Bus
- Controller(s), though Bus Controller relies on PGaaS for
- persistence. Each DMaaP has a single instance of Data Router,
- which has 1 or more DR_Nodes deployed at each dcaeLocation. DR
- Clients of type DR_Pub generally publish to a DR_Node that is
- local to its dcaeLocation. Routing for a Feed is determined by
- the dcaelocation of its DR_Sub clients.
+ <parent>
+ <groupId>org.onap.oparent</groupId>
+ <artifactId>oparent</artifactId>
+ <version>3.2.0</version>
+ <relativePath/>
+ </parent>
- A DMaaP may have many Message Router instances. Each instance is
- deployed as an MR_Cluster. One MR_Cluster is deployed at each
- dcaeLocation. MR_Clients generally communicate to the
- MR_Cluster at the same dcaeLocation. Replication of messages
- between MR_Clusters is accomplished by MR Bridge, which is
- provioned by DMaaP Bus Controller based on Topic attributes.
+ <description>Data Movement as a Platform (DMaaP) Bus Controller provides a REST API for other
+ DCAE infrastructure components to provision DMaaP resources. A DMaaP resource is a Data
+ Router Feed or a Message Router Topic, and their associated publishers and subscribers.
+ </description>
- Therefore, the role of DMaaP Bus Controller is to support other
- DCAE infrastructure components to dynamically provision DMaaP
- services on behalf of DMaaP clients, and to assist in any
- management or discovery activity of its clients.
+ <properties>
+ <swagger.version>1.5.19</swagger.version>
+ <log4j.version>2.13.3</log4j.version>
+ <jackson.version>2.9.5</jackson.version>
+ <jersey.version>2.29</jersey.version>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <jettyVersion>9.4.36.v20210114</jettyVersion>
+ <eelf.version>1.0.0</eelf.version>
+ <artifact.version>2.0.3-SNAPSHOT</artifact.version>
+ <junit.version>4.12</junit.version>
+ <!-- SONAR -->
+ <sonar.language>java</sonar.language>
+ <sonar.skip>false</sonar.skip>
+ <sonar.surefire.reportsPath>${project.build.directory}/surefire-reports
+ </sonar.surefire.reportsPath>
+ <sonar.coverage.jacoco.xmlReportPaths>
+ ${project.reporting.outputDirectory}/jacoco-ut/jacoco.xml
+ </sonar.coverage.jacoco.xmlReportPaths>
+ <sonar.projectVersion>${project.version}</sonar.projectVersion>
+ <sonar.exclusions>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**
+ </sonar.exclusions>
- A convention of this API is to return JSON responses per
- OpenStack style.
- </description>
- <termsOfService>
- http://www.apache.org/licenses/LICENSE-2.0
- </termsOfService>
- <contact>
- <url>http://www.onap.org</url>
- </contact>
- <license>
- <url>http://www.apache.org/licenses/LICENSE-2.0</url>
- <name>Licensed under the Apache License, Version 2.0</name>
- </license>
- </info>
- <swaggerDirectory>target/generated-sources/</swaggerDirectory>
- </apiSource>
- </apiSources>
- </configuration>
- <executions>
- <execution>
- <phase>compile</phase>
- <goals>
- <goal>generate</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
+ <!-- for Distribution Management -->
+ <sitePath>/content/sites/site/org/onap/dmaap/dbcapi/${artifact.version}/${project.version}
+ </sitePath>
+ <nexusproxy>https://nexus.onap.org</nexusproxy>
+ </properties>
- <!-- for Staging -->
+ <distributionManagement>
+ <site>
+ <id>ecomp-site</id>
+ <url>dav:${nexusproxy}${sitePath}</url>
+ </site>
+ </distributionManagement>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>3.8.0</version>
- <configuration>
- <release>11</release>
- </configuration>
- </plugin>
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.glassfish.jersey</groupId>
+ <artifactId>jersey-bom</artifactId>
+ <version>${jersey.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
- <!-- for Distribution Managment -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-site-plugin</artifactId>
- <version>3.6</version>
- <dependencies>
- <dependency>
- <groupId>org.apache.maven.wagon</groupId>
- <artifactId>wagon-webdav-jackrabbit</artifactId>
- <version>2.10</version>
- </dependency>
- </dependencies>
- </plugin>
-
- <!-- prevent SNAPSHOT dependencies -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-enforcer-plugin</artifactId>
- <executions>
- <execution>
- <id>enforce-no-snapshots</id>
- <goals>
- <goal>enforce</goal>
- </goals>
- <configuration>
- <rules>
- <requireReleaseDeps>
- <message>No Snapshots Allowed!</message>
- <excludes>
- <exclude>org.onap.aaf.authz:aaf-cadi-client</exclude>
- <exclude>org.onap.aaf.authz:aaf-misc-env</exclude>
- <exclude>org.onap.aaf.authz:aaf-cadi-aaf</exclude>
- <exclude>org.onap.aaf.authz:aaf-auth-client</exclude>
- <exclude>org.onap.aaf.authz:aaf-cadi-core</exclude>
- <exclude>org.onap.aaf.authz:aaf-misc-rosetta</exclude>
- </excludes>
- </requireReleaseDeps>
- </rules>
- <fail>true</fail>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.jacoco</groupId>
- <artifactId>jacoco-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>prepare-agent</id>
- <goals>
- <goal>prepare-agent</goal>
- </goals>
- </execution>
- <execution>
- <id>report</id>
- <goals>
- <goal>report</goal>
- </goals>
- <configuration>
- <dataFile>${project.build.directory}/code-coverage/jacoco.exec</dataFile>
- <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.12.4</version>
- <configuration>
- <excludes>
- <!-- exclude until junits updated <exclude>**/DME2*.java</exclude> -->
- </excludes>
- <!-- <skipTests>true</skipTests> -->
- </configuration>
- </plugin>
-
- </plugins>
- <pluginManagement>
- <plugins>
- <!--This plugin's configuration is used to store Eclipse m2e settings
- only. It has no influence on the Maven build itself. -->
- <plugin>
- <groupId>org.eclipse.m2e</groupId>
- <artifactId>lifecycle-mapping</artifactId>
- <version>1.0.0</version>
- <configuration>
- <lifecycleMappingMetadata>
- <pluginExecutions>
- <pluginExecution>
- <pluginExecutionFilter>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <versionRange>[2.10,)</versionRange>
- <goals>
- <goal>copy-dependencies</goal>
- </goals>
- </pluginExecutionFilter>
- <action>
- <ignore/>
- </action>
- </pluginExecution>
- </pluginExecutions>
- </lifecycleMappingMetadata>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
- </build>
- <dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>org.glassfish.jersey</groupId>
- <artifactId>jersey-bom</artifactId>
- <version>${jersey.version}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
- </dependencies>
- </dependencyManagement>
- <dependencies>
+ <dependencies>
<dependency>
- <groupId>org.onap.aaf.authz</groupId>
- <artifactId>aaf-cadi-aaf</artifactId>
- <version>2.1.7</version>
+ <groupId>org.onap.aaf.authz</groupId>
+ <artifactId>aaf-cadi-aaf</artifactId>
+ <version>2.1.7</version>
<classifier>full</classifier>
</dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-annotations</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>ch.qos.logback</groupId>
- <artifactId>logback-core</artifactId>
- <version>1.2.3</version>
- </dependency>
- <dependency>
- <groupId>ch.qos.logback</groupId>
- <artifactId>logback-classic</artifactId>
- <version>1.2.3</version>
- </dependency>
-<!-- DMAAP-656:
- - override this dependency because it utilized a third party
- - lib called com.google.guava:20.0 which had severe security threat identified.
- -->
- <dependency>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- <version>24.1.1-jre</version>
- </dependency>
- <dependency>
- <groupId>io.swagger</groupId>
- <artifactId>swagger-core</artifactId>
- <version>${swagger.version}</version>
- </dependency>
- <dependency>
- <groupId>io.swagger</groupId>
- <artifactId>swagger-jersey2-jaxrs</artifactId>
- <version>${swagger.version}</version>
- </dependency>
- <dependency>
- <groupId>io.swagger</groupId>
- <artifactId>swagger-annotations</artifactId>
- <version>${swagger.version}</version>
- </dependency>
- <dependency>
- <groupId>org.glassfish.jersey.containers</groupId>
- <artifactId>jersey-container-servlet-core</artifactId>
- <!-- use the following artifactId if you don't need servlet 2.x compatibility -->
- <!-- artifactId>jersey-container-servlet</artifactId -->
- </dependency>
- <dependency>
- <groupId>org.glassfish.jersey.media</groupId>
- <artifactId>jersey-media-moxy</artifactId>
- </dependency>
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>1.2.17</version>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-server</artifactId>
- <version>${jettyVersion}</version>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-servlet</artifactId>
- <version>${jettyVersion}</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-servlets</artifactId>
- <version>${jettyVersion}</version>
- <scope>compile</scope>
- </dependency>
- <!-- https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple -->
- <dependency>
- <groupId>com.googlecode.json-simple</groupId>
- <artifactId>json-simple</artifactId>
- <version>1.1.1</version>
- </dependency>
- <dependency>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- <version>1.11</version>
- </dependency>
- <!-- https://mvnrepository.com/artifact/org.postgresql/postgresql -->
- <dependency>
- <groupId>org.postgresql</groupId>
- <artifactId>postgresql</artifactId>
- <version>42.2.5</version>
- </dependency>
- <dependency>
- <groupId>com.att.eelf</groupId>
- <artifactId>eelf-core</artifactId>
- <version>${eelf.version}</version>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <version>1.7.22</version>
- </dependency>
- <dependency>
- <groupId>org.glassfish.jersey.test-framework.providers</groupId>
- <!-- use this if compatibility issues with jetty artifactId:
- <artifactId>jersey-test-framework-provider-jetty</artifactId>
- <version>${jersey.version}</version>
- -->
- <artifactId>jersey-test-framework-provider-jdk-http</artifactId>
- <version>2.29.1</version>
- </dependency>
- <dependency>
- <groupId>org.glassfish.jersey.inject</groupId>
- <artifactId>jersey-hk2</artifactId>
- <version>2.29.1</version>
- </dependency>
- <dependency>
- <!-- use 2.3.1 to avoid this issue: https://github.com/eclipse-ee4j/jaxb-ri/issues/1222 -->
- <groupId>javax.xml.bind</groupId>
- <artifactId>jaxb-api</artifactId>
- <version>2.3.1</version>
- </dependency>
- <dependency>
- <groupId>javax.activation</groupId>
- <artifactId>javax.activation-api</artifactId>
- <version>1.2.0</version>
- </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-annotations</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>ch.qos.logback</groupId>
+ <artifactId>logback-core</artifactId>
+ <version>1.2.3</version>
+ </dependency>
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ <version>1.2.3</version>
+ </dependency>
+ <!-- DMAAP-656:
+ - override this dependency because it utilized a third party
+ - lib called com.google.guava:20.0 which had severe security threat identified.
+ -->
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ <version>24.1.1-jre</version>
+ </dependency>
+ <dependency>
+ <groupId>io.swagger</groupId>
+ <artifactId>swagger-core</artifactId>
+ <version>${swagger.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>io.swagger</groupId>
+ <artifactId>swagger-jersey2-jaxrs</artifactId>
+ <version>${swagger.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>io.swagger</groupId>
+ <artifactId>swagger-annotations</artifactId>
+ <version>${swagger.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.containers</groupId>
+ <artifactId>jersey-container-servlet-core</artifactId>
+ <!-- use the following artifactId if you don't need servlet 2.x compatibility -->
+ <!-- artifactId>jersey-container-servlet</artifactId -->
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.media</groupId>
+ <artifactId>jersey-media-moxy</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-api</artifactId>
+ <version>${log4j.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-core</artifactId>
+ <version>${log4j.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-server</artifactId>
+ <version>${jettyVersion}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-servlet</artifactId>
+ <version>${jettyVersion}</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-servlets</artifactId>
+ <version>${jettyVersion}</version>
+ <scope>compile</scope>
+ </dependency>
+ <!-- https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple -->
+ <dependency>
+ <groupId>com.googlecode.json-simple</groupId>
+ <artifactId>json-simple</artifactId>
+ <version>1.1.1</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-codec</groupId>
+ <artifactId>commons-codec</artifactId>
+ <version>1.15</version>
+ </dependency>
+ <!-- https://mvnrepository.com/artifact/org.postgresql/postgresql -->
+ <dependency>
+ <groupId>org.postgresql</groupId>
+ <artifactId>postgresql</artifactId>
+ <version>42.2.14</version>
+ </dependency>
+ <dependency>
+ <groupId>com.att.eelf</groupId>
+ <artifactId>eelf-core</artifactId>
+ <version>${eelf.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.7.22</version>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.test-framework.providers</groupId>
+ <!-- use this if compatibility issues with jetty artifactId:
+ <artifactId>jersey-test-framework-provider-jetty</artifactId>
+ <version>${jersey.version}</version>
+ -->
+ <artifactId>jersey-test-framework-provider-jdk-http</artifactId>
+ <version>2.29.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.inject</groupId>
+ <artifactId>jersey-hk2</artifactId>
+ <version>2.29.1</version>
+ </dependency>
+ <dependency>
+ <!-- use 2.3.1 to avoid this issue: https://github.com/eclipse-ee4j/jaxb-ri/issues/1222 -->
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ <version>2.3.1</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.activation</groupId>
+ <artifactId>javax.activation-api</artifactId>
+ <version>1.2.0</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>${junit.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>pl.pragmatists</groupId>
+ <artifactId>JUnitParams</artifactId>
+ <version>1.1.0</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <version>3.0.0-M3</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>dbcapi</finalName>
+ <resources>
+ <resource>
+ <directory>src/main/java/org/onap/dmaap/dbcapi/logging</directory>
+ </resource>
+ <resource>
+ <directory>src/main/resources</directory>
+ </resource>
+ </resources>
+ <plugins>
+ <!-- reference: https://tech.homeaway.com/development/2016/06/02/generating-swagger-spec.html -->
+ <plugin>
+ <groupId>com.github.kongchen</groupId>
+ <artifactId>swagger-maven-plugin</artifactId>
+ <version>3.1.5</version>
+ <configuration>
+ <apiSources>
+ <apiSource>
+ <springmvc>false</springmvc>
+ <locations>
+ <location>org.onap.dmaap.dbcapi.resources</location>
+ </locations>
+ <schemes>
+ <scheme>http</scheme>
+ <scheme>https</scheme>
+ </schemes>
+ <host>www.[host]:[port]</host>
+ <basePath>/webapi</basePath>
+ <info>
+ <title>DMaaP Bus Controller REST API</title>
+ <version>1.1.0</version>
+ <description>
+ provides an API for OpenDCAE components which need to provision
+ underlying DMaaP technologies (Data Router and Message Router).
+ Primary clients for this API are anticipated to be the OpenDCAE
+ Controller, OpenDCAE Orchestrator, OpenDCAE Inventory and the
+ ECOMP Portal.
+
+ Objects managed by DMaaP are deployed in a dcaeLocation which is
+ a unique identifier for an OpenStack tenant for a dcaeLayer,
+ opendcae-central (aka ecomp) or opendcae-local-ntc (aka edge).
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>${junit.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>pl.pragmatists</groupId>
- <artifactId>JUnitParams</artifactId>
- <version>1.1.0</version>
- <scope>test</scope>
- </dependency>
-<dependency>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-enforcer-plugin</artifactId>
- <version>3.0.0-M3</version>
-</dependency>
- </dependencies>
- <reporting>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <version>2.10.4</version>
- <configuration>
- <failOnError>false</failOnError>
- <doclet>org.umlgraph.doclet.UmlGraphDoc</doclet>
- <docletArtifact>
- <groupId>org.umlgraph</groupId>
- <artifactId>umlgraph</artifactId>
- <version>5.6</version>
- </docletArtifact>
- <additionalparam>-views</additionalparam>
- <useStandardDocletOptions>true</useStandardDocletOptions>
- </configuration>
- </plugin>
- </plugins>
- </reporting>
- <distributionManagement>
- <site>
- <id>ecomp-site</id>
- <url>dav:${nexusproxy}${sitePath}</url>
- </site>
- </distributionManagement>
- <properties>
- <swagger.version>1.5.19</swagger.version>
- <jackson.version>2.9.5</jackson.version>
- <jersey.version>2.29</jersey.version>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <jettyVersion>9.4.24.v20191120</jettyVersion>
- <eelf.version>1.0.0</eelf.version>
- <artifact.version>2.0.3-SNAPSHOT</artifact.version>
- <junit.version>4.12</junit.version>
- <!-- SONAR -->
- <sonar.language>java</sonar.language>
- <sonar.skip>false</sonar.skip>
- <sonar.surefire.reportsPath>${project.build.directory}/surefire-reports</sonar.surefire.reportsPath>
- <sonar.coverage.jacoco.xmlReportPaths>${project.reporting.outputDirectory}/jacoco-ut/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
- <sonar.projectVersion>${project.version}</sonar.projectVersion>
- <sonar.exclusions>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</sonar.exclusions>
+ A dcaeEnvironment (e.g. FTL or prod) has a single DMaaP. A
+ DMaaP is managed by a one or more stateless DMaaP Bus
+ Controller(s), though Bus Controller relies on PGaaS for
+ persistence. Each DMaaP has a single instance of Data Router,
+ which has 1 or more DR_Nodes deployed at each dcaeLocation. DR
+ Clients of type DR_Pub generally publish to a DR_Node that is
+ local to its dcaeLocation. Routing for a Feed is determined by
+ the dcaelocation of its DR_Sub clients.
+
+ A DMaaP may have many Message Router instances. Each instance is
+ deployed as an MR_Cluster. One MR_Cluster is deployed at each
+ dcaeLocation. MR_Clients generally communicate to the
+ MR_Cluster at the same dcaeLocation. Replication of messages
+ between MR_Clusters is accomplished by MR Bridge, which is
+ provioned by DMaaP Bus Controller based on Topic attributes.
+
+ Therefore, the role of DMaaP Bus Controller is to support other
+ DCAE infrastructure components to dynamically provision DMaaP
+ services on behalf of DMaaP clients, and to assist in any
+ management or discovery activity of its clients.
+
+ A convention of this API is to return JSON responses per
+ OpenStack style.
+ </description>
+ <termsOfService>
+ http://www.apache.org/licenses/LICENSE-2.0
+ </termsOfService>
+ <contact>
+ <url>http://www.onap.org</url>
+ </contact>
+ <license>
+ <url>http://www.apache.org/licenses/LICENSE-2.0</url>
+ <name>Licensed under the Apache License, Version 2.0</name>
+ </license>
+ </info>
+ <swaggerDirectory>target/generated-sources/</swaggerDirectory>
+ </apiSource>
+ </apiSources>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>compile</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <!-- for Staging -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.8.0</version>
+ <configuration>
+ <release>11</release>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>onap-java-style</id>
+ <configuration>
+ <consoleOutput>false</consoleOutput>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <!-- for Distribution Managment -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-site-plugin</artifactId>
+ <version>3.6</version>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.wagon</groupId>
+ <artifactId>wagon-webdav-jackrabbit</artifactId>
+ <version>2.10</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ <!-- prevent SNAPSHOT dependencies -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>enforce-no-snapshots</id>
+ <goals>
+ <goal>enforce</goal>
+ </goals>
+ <configuration>
+ <rules>
+ <requireReleaseDeps>
+ <message>No Snapshots Allowed!</message>
+ <excludes>
+ <exclude>org.onap.aaf.authz:aaf-cadi-client</exclude>
+ <exclude>org.onap.aaf.authz:aaf-misc-env</exclude>
+ <exclude>org.onap.aaf.authz:aaf-cadi-aaf</exclude>
+ <exclude>org.onap.aaf.authz:aaf-auth-client</exclude>
+ <exclude>org.onap.aaf.authz:aaf-cadi-core</exclude>
+ <exclude>org.onap.aaf.authz:aaf-misc-rosetta</exclude>
+ </excludes>
+ </requireReleaseDeps>
+ </rules>
+ <fail>true</fail>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.jacoco</groupId>
+ <artifactId>jacoco-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>prepare-agent</id>
+ <goals>
+ <goal>prepare-agent</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>report</id>
+ <goals>
+ <goal>report</goal>
+ </goals>
+ <configuration>
+ <dataFile>${project.build.directory}/code-coverage/jacoco.exec
+ </dataFile>
+ <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut
+ </outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.12.4</version>
+ <configuration>
+ <excludes>
+ <!-- exclude until junits updated <exclude>**/DME2*.java</exclude> -->
+ </excludes>
+ <!-- <skipTests>true</skipTests> -->
+ </configuration>
+ </plugin>
+ </plugins>
+ <pluginManagement>
+ <plugins>
+ <!--This plugin's configuration is used to store Eclipse m2e settings
+ only. It has no influence on the Maven build itself. -->
+ <plugin>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>lifecycle-mapping</artifactId>
+ <version>1.0.0</version>
+ <configuration>
+ <lifecycleMappingMetadata>
+ <pluginExecutions>
+ <pluginExecution>
+ <pluginExecutionFilter>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <versionRange>[2.10,)</versionRange>
+ <goals>
+ <goal>copy-dependencies</goal>
+ </goals>
+ </pluginExecutionFilter>
+ <action>
+ <ignore/>
+ </action>
+ </pluginExecution>
+ </pluginExecutions>
+ </lifecycleMappingMetadata>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
- <!-- for Distribution Management -->
- <sitePath>/content/sites/site/org/onap/dmaap/dbcapi/${artifact.version}/${project.version}</sitePath>
- <nexusproxy>https://nexus.onap.org</nexusproxy>
- </properties>
- <description>Data Movement as a Platform (DMaaP) Bus Controller provides a REST API for other DCAE infrastructure components to provision DMaaP resources. A DMaaP resource is a Data Router Feed or a Message Router Topic, and their associated publishers and subscribers.</description>
-</project>
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>2.10.4</version>
+ <configuration>
+ <failOnError>false</failOnError>
+ <doclet>org.umlgraph.doclet.UmlGraphDoc</doclet>
+ <docletArtifact>
+ <groupId>org.umlgraph</groupId>
+ <artifactId>umlgraph</artifactId>
+ <version>5.6</version>
+ </docletArtifact>
+ <additionalparam>-views</additionalparam>
+ <useStandardDocletOptions>true</useStandardDocletOptions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </reporting>
+</project> \ No newline at end of file
diff --git a/src/main/resources/log4j.properties b/src/main/resources/log4j2.properties
index bfaeaf2..23ac122 100644
--- a/src/main/resources/log4j.properties
+++ b/src/main/resources/log4j2.properties
@@ -1,29 +1,39 @@
###
# ============LICENSE_START=======================================================
-# OpenECOMP - org.openecomp.dmaapbc
-# ================================================================================
-# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+# Copyright (C) 2021 Nordix Foundation.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
-#
+#
# http://www.apache.org/licenses/LICENSE-2.0
-#
+#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
+#
+# SPDX-License-Identifier: Apache-2.0
# ============LICENSE_END=========================================================
###
-log4j.debug=FALSE
-log4j.rootLogger=INFO,Root
+# Log4j2 PropertiesConfig
+status=info
+name=PropertiesConfig
+
+# Rolling Appender
+appender.rolling.type=RollingFile
+appender.rolling.name=rollingFile
+appender.rolling.fileName=logs/dmaapBC-api.log
+appender.rolling.filePattern=/tmp/$${date:yyyy-MM-dd}/dmaapBC-api-%d{yyyy-MM-dd}-%i.log
+appender.rolling.layout.type=PatternLayout
+appender.rolling.layout.pattern=%d %p %F %L %t %m%n
+appender.rolling.policies.type=Policies
+appender.rolling.policies.time.type=TimeBasedTriggeringPolicy
+appender.rolling.policies.time.interval=1
+appender.rolling.policies.time.modulate=true
-log4j.appender.Root=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.Root.file=logs/dmaapBC-api.log
-log4j.appender.Root.datePattern='.'yyyyMMdd
-log4j.appender.Root.append=true
-log4j.appender.Root.layout=org.apache.log4j.PatternLayout
-log4j.appender.Root.layout.ConversionPattern=%d %p %F %L %t %m%n
+# Root Logger
+rootLogger.level=info
+rootLogger.appenderRef.rolling.ref=rollingFile \ No newline at end of file
diff --git a/src/main/webapp/WEB-INF/log4j.xml b/src/main/webapp/WEB-INF/log4j.xml
deleted file mode 100644
index 4e4d5e9..0000000
--- a/src/main/webapp/WEB-INF/log4j.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ============LICENSE_START=======================================================
- OpenECOMP - org.openecomp.dmaapbc
- ================================================================================
- Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- ================================================================================
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- ============LICENSE_END=========================================================
- -->
-
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd" >
-<log4j:configuration>
- <appender name="dmaapBC" class="org.apache.log4j.RollingFileAppender">
- <param name="File" value="dmaapBC.log"/>
- <param name="MaxFileSize" value="1000KB"/>
- <param name="MaxBackupIndex" value="3"/>
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="[%d{HH:mm:ss:SSS}] - %-6p - %c.%M() - %m%n"/>
- </layout>
- </appender>
- <appender name="media" class="org.apache.log4j.ConsoleAppender">
- <param name="Threshold" value="FATAL"/>
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%d %-5r %-5p [%c] (%t:%x) %m%n"/>
- </layout>
- </appender>
- <category name="org.openecomp.dcae.dmaapBC">
- <appender-ref ref="dmaapBC"/>
- </category>
- <root>
- <priority value="all"/>
- <appender-ref ref="media"/>
- </root>
-</log4j:configuration>
diff --git a/src/main/webapp/WEB-INF/log4j2.xml b/src/main/webapp/WEB-INF/log4j2.xml
new file mode 100644
index 0000000..bd7e9c5
--- /dev/null
+++ b/src/main/webapp/WEB-INF/log4j2.xml
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ============LICENSE_START=======================================================
+ Copyright (C) 2021 Nordix Foundation.
+ ================================================================================
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ SPDX-License-Identifier: Apache-2.0
+ ============LICENSE_END=========================================================
+ -->
+
+<Configuration status="WARN">
+ <Appenders>
+ <!-- Console Appender -->
+ <Console name="STDOUT" target="SYSTEM_OUT">
+ <PatternLayout pattern="%d %-5r %-5p [%c] (%t:%x) %m%n"/>
+ </Console>
+
+ <!-- Rolling File Appender -->
+ <RollingFile name="rollingFile">
+ <FileName>dmaapBC.log</FileName>
+ <FilePattern>${date:yyyy-MM}/dmaapBC-%d{yyyy-MM-dd}-%i.log.gz</FilePattern>
+ <PatternLayout>
+ <Pattern>[%d{HH:mm:ss:SSS}] - %-6p - %c.%M() - %m%n</Pattern>
+ </PatternLayout>
+ <Policies>
+ <SizeBasedTriggeringPolicy size="1000 KB"/>
+ </Policies>
+ <DefaultRolloverStrategy max="3"/>
+ </RollingFile>
+ </Appenders>
+ <Loggers>
+ <Logger name="org.openecomp.dcae.dmaapBC" level="debug" additivity="false">
+ <AppenderRef ref="rollingFile"/>
+ </Logger>
+ <Root level="ALL">
+ <AppenderRef ref="STDOUT"/>
+ </Root>
+ </Loggers>
+</Configuration> \ No newline at end of file
diff --git a/src/test/java/org/onap/dmaap/dbcapi/database/DBFieldHandlerTest.java b/src/test/java/org/onap/dmaap/dbcapi/database/DBFieldHandlerTest.java
index 5171aaa..23745ac 100644
--- a/src/test/java/org/onap/dmaap/dbcapi/database/DBFieldHandlerTest.java
+++ b/src/test/java/org/onap/dmaap/dbcapi/database/DBFieldHandlerTest.java
@@ -27,8 +27,8 @@ import static org.junit.Assert.assertNull;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
-
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.junit.Test;
import org.onap.dmaap.dbcapi.authentication.AafLurAndFish;
import org.onap.dmaap.dbcapi.model.ReplicationType;
@@ -36,7 +36,7 @@ import org.onap.dmaap.dbcapi.testframework.ReflectionHarness;
public class DBFieldHandlerTest {
- private static final Logger logger = Logger.getLogger(AafLurAndFish.class);
+ private static final Logger logger = LogManager.getLogger(AafLurAndFish.class);
private static final String fmt = "%24s: %s%n";
diff --git a/src/test/java/org/onap/dmaap/dbcapi/model/JUnitTestSuite.java b/src/test/java/org/onap/dmaap/dbcapi/model/JUnitTestSuite.java
index 1c8edc0..a55e420 100644
--- a/src/test/java/org/onap/dmaap/dbcapi/model/JUnitTestSuite.java
+++ b/src/test/java/org/onap/dmaap/dbcapi/model/JUnitTestSuite.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -21,20 +21,22 @@
package org.onap.dmaap.dbcapi.model;
import junit.framework.TestSuite;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;
-import org.apache.log4j.Logger;
@RunWith(Suite.class)
-@SuiteClasses({ DmaapTest.class
- })
+@SuiteClasses({DmaapTest.class})
public class JUnitTestSuite {
- private static final Logger LOGGER = Logger.getLogger(JUnitTestSuite.class);
- public static void main(String[] args) {
- LOGGER.info("Running the test suite");
-
- TestSuite tstSuite = new TestSuite();
- LOGGER.info("Total Test Counts " + tstSuite.countTestCases());
- }
+
+ private static final Logger logger = LogManager.getLogger(JUnitTestSuite.class);
+
+ public static void main(String[] args) {
+ logger.info("Running the test suite");
+
+ TestSuite tstSuite = new TestSuite();
+ logger.info("Total Test Counts " + tstSuite.countTestCases());
+ }
}
diff --git a/src/test/java/org/onap/dmaap/dbcapi/model/TestRunner.java b/src/test/java/org/onap/dmaap/dbcapi/model/TestRunner.java
index fcab3e1..66cec35 100644
--- a/src/test/java/org/onap/dmaap/dbcapi/model/TestRunner.java
+++ b/src/test/java/org/onap/dmaap/dbcapi/model/TestRunner.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -18,19 +18,24 @@
* ============LICENSE_END=========================================================
*/
package org.onap.dmaap.dbcapi.model;
+
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.junit.runner.JUnitCore;
import org.junit.runner.Result;
import org.junit.runner.notification.Failure;
-import org.apache.log4j.Logger;
+
public class TestRunner {
- private static final Logger LOGGER = Logger.getLogger(TestRunner.class);
- public static void main(String[] args) {
-
- Result result = JUnitCore.runClasses(JUnitTestSuite.class);
- for (Failure failure : result.getFailures()) {
- LOGGER.info(failure.toString());
-
- }
- LOGGER.info(result.wasSuccessful());
- }
+
+ private static final Logger logger = LogManager.getLogger(TestRunner.class);
+
+ public static void main(String[] args) {
+
+ Result result = JUnitCore.runClasses(JUnitTestSuite.class);
+ for (Failure failure : result.getFailures()) {
+ logger.info(failure.toString());
+
+ }
+ logger.info(result.wasSuccessful());
+ }
}