From 1a88d861bffa7ea1da254f43948111b6c7c821ac Mon Sep 17 00:00:00 2001 From: ajay_dp001 Date: Sat, 23 Jan 2021 14:50:45 +0530 Subject: [PATCH] [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 Change-Id: I1716c8c78d4c3ca4f75159b3de98d9c799bae929 --- pom.xml | 884 +++++++++++---------- .../{log4j.properties => log4j2.properties} | 36 +- src/main/webapp/WEB-INF/log4j.xml | 45 -- src/main/webapp/WEB-INF/log4j2.xml | 50 ++ .../dmaap/dbcapi/database/DBFieldHandlerTest.java | 6 +- .../onap/dmaap/dbcapi/model/JUnitTestSuite.java | 26 +- .../org/onap/dmaap/dbcapi/model/TestRunner.java | 31 +- 7 files changed, 566 insertions(+), 512 deletions(-) rename src/main/resources/{log4j.properties => log4j2.properties} (52%) delete mode 100644 src/main/webapp/WEB-INF/log4j.xml create mode 100644 src/main/webapp/WEB-INF/log4j2.xml 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. --> - - 4.0.0 - org.onap.dmaap.dbcapi - dbcapi - ${artifact.version} - dmaap-dbcapi - - org.onap.oparent - oparent - 2.1.0 - - - - dbcapi - - - src/main/java/org/onap/dmaap/dbcapi/logging - - - src/main/resources - - - - - - com.github.kongchen - swagger-maven-plugin - 3.1.5 - - - - false - - org.onap.dmaap.dbcapi.resources - - - http - https - - www.[host]:[port] - /webapi - - DMaaP Bus Controller REST API - 1.1.0 - - 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). + 4.0.0 + org.onap.dmaap.dbcapi + dbcapi + ${artifact.version} + dmaap-dbcapi - 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. + + org.onap.oparent + oparent + 3.2.0 + + - 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. + 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. + - 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. + + 1.5.19 + 2.13.3 + 2.9.5 + 2.29 + UTF-8 + 9.4.36.v20210114 + 1.0.0 + 2.0.3-SNAPSHOT + 4.12 + + java + false + ${project.build.directory}/surefire-reports + + + ${project.reporting.outputDirectory}/jacoco-ut/jacoco.xml + + ${project.version} + **/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/** + - A convention of this API is to return JSON responses per - OpenStack style. - - - http://www.apache.org/licenses/LICENSE-2.0 - - - http://www.onap.org - - - http://www.apache.org/licenses/LICENSE-2.0 - Licensed under the Apache License, Version 2.0 - - - target/generated-sources/ - - - - - - compile - - generate - - - - + + /content/sites/site/org/onap/dmaap/dbcapi/${artifact.version}/${project.version} + + https://nexus.onap.org + - + + + ecomp-site + dav:${nexusproxy}${sitePath} + + - - org.apache.maven.plugins - maven-compiler-plugin - 3.8.0 - - 11 - - + + + + org.glassfish.jersey + jersey-bom + ${jersey.version} + pom + import + + + - - - org.apache.maven.plugins - maven-site-plugin - 3.6 - - - org.apache.maven.wagon - wagon-webdav-jackrabbit - 2.10 - - - - - - - org.apache.maven.plugins - maven-enforcer-plugin - - - enforce-no-snapshots - - enforce - - - - - No Snapshots Allowed! - - org.onap.aaf.authz:aaf-cadi-client - org.onap.aaf.authz:aaf-misc-env - org.onap.aaf.authz:aaf-cadi-aaf - org.onap.aaf.authz:aaf-auth-client - org.onap.aaf.authz:aaf-cadi-core - org.onap.aaf.authz:aaf-misc-rosetta - - - - true - - - - - - - org.jacoco - jacoco-maven-plugin - - - prepare-agent - - prepare-agent - - - - report - - report - - - ${project.build.directory}/code-coverage/jacoco.exec - ${project.reporting.outputDirectory}/jacoco-ut - - - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.12.4 - - - - - - - - - - - - - - org.eclipse.m2e - lifecycle-mapping - 1.0.0 - - - - - - org.apache.maven.plugins - maven-dependency-plugin - [2.10,) - - copy-dependencies - - - - - - - - - - - - - - - - - org.glassfish.jersey - jersey-bom - ${jersey.version} - pom - import - - - - + - org.onap.aaf.authz - aaf-cadi-aaf - 2.1.7 + org.onap.aaf.authz + aaf-cadi-aaf + 2.1.7 full - - com.fasterxml.jackson.core - jackson-annotations - ${jackson.version} - - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - ${jackson.version} - - - ch.qos.logback - logback-core - 1.2.3 - - - ch.qos.logback - logback-classic - 1.2.3 - - - - com.google.guava - guava - 24.1.1-jre - - - io.swagger - swagger-core - ${swagger.version} - - - io.swagger - swagger-jersey2-jaxrs - ${swagger.version} - - - io.swagger - swagger-annotations - ${swagger.version} - - - org.glassfish.jersey.containers - jersey-container-servlet-core - - - - - org.glassfish.jersey.media - jersey-media-moxy - - - log4j - log4j - 1.2.17 - - - org.eclipse.jetty - jetty-server - ${jettyVersion} - - - org.eclipse.jetty - jetty-servlet - ${jettyVersion} - compile - - - org.eclipse.jetty - jetty-servlets - ${jettyVersion} - compile - - - - com.googlecode.json-simple - json-simple - 1.1.1 - - - commons-codec - commons-codec - 1.11 - - - - org.postgresql - postgresql - 42.2.5 - - - com.att.eelf - eelf-core - ${eelf.version} - - - org.slf4j - slf4j-api - 1.7.22 - - - org.glassfish.jersey.test-framework.providers - - jersey-test-framework-provider-jdk-http - 2.29.1 - - - org.glassfish.jersey.inject - jersey-hk2 - 2.29.1 - - - - javax.xml.bind - jaxb-api - 2.3.1 - - - javax.activation - javax.activation-api - 1.2.0 - + + com.fasterxml.jackson.core + jackson-annotations + ${jackson.version} + + + com.fasterxml.jackson.dataformat + jackson-dataformat-yaml + ${jackson.version} + + + ch.qos.logback + logback-core + 1.2.3 + + + ch.qos.logback + logback-classic + 1.2.3 + + + + com.google.guava + guava + 24.1.1-jre + + + io.swagger + swagger-core + ${swagger.version} + + + io.swagger + swagger-jersey2-jaxrs + ${swagger.version} + + + io.swagger + swagger-annotations + ${swagger.version} + + + org.glassfish.jersey.containers + jersey-container-servlet-core + + + + + org.glassfish.jersey.media + jersey-media-moxy + + + org.apache.logging.log4j + log4j-api + ${log4j.version} + + + org.apache.logging.log4j + log4j-core + ${log4j.version} + + + org.eclipse.jetty + jetty-server + ${jettyVersion} + + + org.eclipse.jetty + jetty-servlet + ${jettyVersion} + compile + + + org.eclipse.jetty + jetty-servlets + ${jettyVersion} + compile + + + + com.googlecode.json-simple + json-simple + 1.1.1 + + + commons-codec + commons-codec + 1.15 + + + + org.postgresql + postgresql + 42.2.14 + + + com.att.eelf + eelf-core + ${eelf.version} + + + org.slf4j + slf4j-api + 1.7.22 + + + org.glassfish.jersey.test-framework.providers + + jersey-test-framework-provider-jdk-http + 2.29.1 + + + org.glassfish.jersey.inject + jersey-hk2 + 2.29.1 + + + + javax.xml.bind + jaxb-api + 2.3.1 + + + javax.activation + javax.activation-api + 1.2.0 + + + + junit + junit + ${junit.version} + test + + + pl.pragmatists + JUnitParams + 1.1.0 + test + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.0.0-M3 + + + + + dbcapi + + + src/main/java/org/onap/dmaap/dbcapi/logging + + + src/main/resources + + + + + + com.github.kongchen + swagger-maven-plugin + 3.1.5 + + + + false + + org.onap.dmaap.dbcapi.resources + + + http + https + + www.[host]:[port] + /webapi + + DMaaP Bus Controller REST API + 1.1.0 + + 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). - - junit - junit - ${junit.version} - test - - - pl.pragmatists - JUnitParams - 1.1.0 - test - - - org.apache.maven.plugins - maven-enforcer-plugin - 3.0.0-M3 - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.10.4 - - false - org.umlgraph.doclet.UmlGraphDoc - - org.umlgraph - umlgraph - 5.6 - - -views - true - - - - - - - ecomp-site - dav:${nexusproxy}${sitePath} - - - - 1.5.19 - 2.9.5 - 2.29 - UTF-8 - 9.4.24.v20191120 - 1.0.0 - 2.0.3-SNAPSHOT - 4.12 - - java - false - ${project.build.directory}/surefire-reports - ${project.reporting.outputDirectory}/jacoco-ut/jacoco.xml - ${project.version} - **/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/** + 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. + + + http://www.apache.org/licenses/LICENSE-2.0 + + + http://www.onap.org + + + http://www.apache.org/licenses/LICENSE-2.0 + Licensed under the Apache License, Version 2.0 + + + target/generated-sources/ + + + + + + compile + + generate + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + 11 + + + + maven-checkstyle-plugin + + + onap-java-style + + false + + + + + + + org.apache.maven.plugins + maven-site-plugin + 3.6 + + + org.apache.maven.wagon + wagon-webdav-jackrabbit + 2.10 + + + + + + org.apache.maven.plugins + maven-enforcer-plugin + + + enforce-no-snapshots + + enforce + + + + + No Snapshots Allowed! + + org.onap.aaf.authz:aaf-cadi-client + org.onap.aaf.authz:aaf-misc-env + org.onap.aaf.authz:aaf-cadi-aaf + org.onap.aaf.authz:aaf-auth-client + org.onap.aaf.authz:aaf-cadi-core + org.onap.aaf.authz:aaf-misc-rosetta + + + + true + + + + + + org.jacoco + jacoco-maven-plugin + + + prepare-agent + + prepare-agent + + + + report + + report + + + ${project.build.directory}/code-coverage/jacoco.exec + + ${project.reporting.outputDirectory}/jacoco-ut + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12.4 + + + + + + + + + + + + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + + org.apache.maven.plugins + maven-dependency-plugin + [2.10,) + + copy-dependencies + + + + + + + + + + + + + - - /content/sites/site/org/onap/dmaap/dbcapi/${artifact.version}/${project.version} - https://nexus.onap.org - - 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. - + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.10.4 + + false + org.umlgraph.doclet.UmlGraphDoc + + org.umlgraph + umlgraph + 5.6 + + -views + true + + + + + \ No newline at end of file diff --git a/src/main/resources/log4j.properties b/src/main/resources/log4j2.properties similarity index 52% rename from src/main/resources/log4j.properties rename to 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 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 @@ + + + + + + + + + + + + + dmaapBC.log + ${date:yyyy-MM}/dmaapBC-%d{yyyy-MM-dd}-%i.log.gz + + [%d{HH:mm:ss:SSS}] - %-6p - %c.%M() - %m%n + + + + + + + + + + + + + + + + \ 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()); + } } -- 2.16.6