Spring-boot 3 upgrade in graphadmin 26/140126/8
authorFiete Ostkamp <Fiete.Ostkamp@telekom.de>
Sun, 2 Feb 2025 18:35:57 +0000 (19:35 +0100)
committerFiete Ostkamp <Fiete.Ostkamp@telekom.de>
Tue, 25 Feb 2025 14:06:52 +0000 (15:06 +0100)
Issue-ID: AAI-4116
Change-Id: I894e0b0482df4078791cb58d0259852be02c2255
Signed-off-by: Fiete Ostkamp <Fiete.Ostkamp@telekom.de>
83 files changed:
pom.xml
src/main/docker/Dockerfile
src/main/docker/docker-entrypoint.sh
src/main/java/org/onap/aai/GraphAdminApp.java
src/main/java/org/onap/aai/audit/AuditGraphson2Sql.java
src/main/java/org/onap/aai/config/SecurityConfig.java
src/main/java/org/onap/aai/dataexport/DataExportTasks.java
src/main/java/org/onap/aai/datagrooming/DataGrooming.java
src/main/java/org/onap/aai/datasnapshot/PrintVertexDetails.java
src/main/java/org/onap/aai/dbgen/DupeTool.java
src/main/java/org/onap/aai/dbgen/DynamicPayloadGenerator.java
src/main/java/org/onap/aai/dbgen/GraphSONPartialReader.java
src/main/java/org/onap/aai/dbgen/UpdatePropertyToolInternal.java
src/main/java/org/onap/aai/interceptors/post/InvalidResponseStatus.java
src/main/java/org/onap/aai/interceptors/post/ResponseHeaderManipulation.java
src/main/java/org/onap/aai/interceptors/post/ResponseTransactionLogging.java
src/main/java/org/onap/aai/interceptors/pre/HeaderValidation.java
src/main/java/org/onap/aai/interceptors/pre/HttpHeaderInterceptor.java
src/main/java/org/onap/aai/interceptors/pre/RequestHeaderManipulation.java
src/main/java/org/onap/aai/interceptors/pre/RequestModification.java
src/main/java/org/onap/aai/interceptors/pre/RequestTransactionLogging.java
src/main/java/org/onap/aai/interceptors/pre/RetiredInterceptor.java
src/main/java/org/onap/aai/interceptors/pre/VersionInterceptor.java
src/main/java/org/onap/aai/interceptors/pre/VersionLatestInterceptor.java
src/main/java/org/onap/aai/migration/MigrationControllerInternal.java
src/main/java/org/onap/aai/migration/Migrator.java
src/main/java/org/onap/aai/migration/NotificationHelper.java
src/main/java/org/onap/aai/migration/ValueMigrator.java
src/main/java/org/onap/aai/migration/v12/ALTSLicenseEntitlementMigration.java
src/main/java/org/onap/aai/migration/v12/ContainmentDeleteOtherVPropertyMigration.java
src/main/java/org/onap/aai/migration/v12/MigrateHUBEvcInventory.java
src/main/java/org/onap/aai/migration/v12/MigrateINVPhysicalInventory.java
src/main/java/org/onap/aai/migration/v12/MigratePATHEvcInventory.java
src/main/java/org/onap/aai/migration/v12/MigrateSAREvcInventory.java
src/main/java/org/onap/aai/migration/v12/UriMigration.java
src/main/java/org/onap/aai/migration/v13/MigrateForwarderEvcCircuitId.java
src/main/java/org/onap/aai/migration/v13/MigrateModelVer.java
src/main/java/org/onap/aai/migration/v14/MigrateSameSourcedRCTROPserverData.java
src/main/java/org/onap/aai/migration/v14/MigrateSdnaIvlanData.java
src/main/java/org/onap/aai/migration/v14/PserverDedupWithDifferentSourcesOfTruth.java
src/main/java/org/onap/aai/migration/v15/MigrateCloudRegionUpgradeCycle.java
src/main/java/org/onap/aai/migration/v15/MigrateRadcomChanges.java
src/main/java/org/onap/aai/rest/AuditSqlDbConsumer.java
src/main/java/org/onap/aai/rest/ExceptionHandler.java
src/main/java/org/onap/aai/rest/QueryConsumer.java
src/main/java/org/onap/aai/rest/SchemaJobStatusController.java
src/main/java/org/onap/aai/rest/client/ApertureService.java
src/main/java/org/onap/aai/rest/client/ApertureServiceNoAuthClient.java
src/main/java/org/onap/aai/rest/client/ApertureServiceOneWayClient.java
src/main/java/org/onap/aai/rest/client/ApertureServiceRestClient.java
src/main/java/org/onap/aai/rest/dsl/DslListener.java
src/main/java/org/onap/aai/rest/dsl/DslQueryProcessor.java
src/main/java/org/onap/aai/rest/search/GenericQueryProcessor.java
src/main/java/org/onap/aai/rest/util/EchoResponse.java
src/main/java/org/onap/aai/schema/GenTester.java
src/main/java/org/onap/aai/service/RetiredService.java
src/main/java/org/onap/aai/util/ExceptionTranslator.java
src/main/java/org/onap/aai/util/SendDeleteMigrationNotifications.java
src/main/java/org/onap/aai/util/SendMigrationNotifications.java
src/main/java/org/onap/aai/web/JerseyConfiguration.java
src/main/java/org/onap/aai/web/LocalHostAccessLog.java [deleted file]
src/main/resources/application.properties
src/main/resources/localhost-access-logback.xml [deleted file]
src/test/java/org/onap/aai/AAIGremlinQueryTest.java
src/test/java/org/onap/aai/AAISetup.java
src/test/java/org/onap/aai/GraphAdminTestConfiguration.java
src/test/java/org/onap/aai/MetricsConfigurationTest.java
src/test/java/org/onap/aai/PayloadUtil.java
src/test/java/org/onap/aai/datasnapshot/DataSnapshot4HistInitTest.java
src/test/java/org/onap/aai/datasnapshot/DataSnapshotTest.java
src/test/java/org/onap/aai/datasnapshot/DataSnapshotTest4HistInit.java
src/test/java/org/onap/aai/migration/VertexMergeTest.java
src/test/java/org/onap/aai/migration/v12/MigrateINVPhysicalInventoryTest.java
src/test/java/org/onap/aai/migration/v13/MigrateModelVerTest.java
src/test/java/org/onap/aai/migration/v14/MigrateNetworkTechToCloudRegionTest.java
src/test/java/org/onap/aai/migration/v14/MigrateSameSourcedRCTROPServerDataTest.java
src/test/java/org/onap/aai/migration/v14/PserverDedupWithDifferentSourcesOfTruthTest.java
src/test/java/org/onap/aai/rest/util/EchoResponseTest.java
src/test/java/org/onap/aai/schema/db/ManageSchemaTest.java
src/test/java/org/onap/aai/util/SendDeleteMigrationNotificationsTest.java
src/test/java/org/onap/aai/util/SendMigrationNotificationsTest.java
src/test/resources/application-test.properties
version.properties

diff --git a/pom.xml b/pom.xml
index 88680cf..91dedea 100755 (executable)
--- a/pom.xml
+++ b/pom.xml
     <parent>
         <groupId>org.onap.aai.aai-common</groupId>
         <artifactId>aai-parent</artifactId>
-        <version>1.15.5</version>
+        <version>1.16.0-SNAPSHOT</version>
     </parent>
     <groupId>org.onap.aai.graphadmin</groupId>
     <artifactId>aai-graphadmin</artifactId>
-    <version>1.15.6-SNAPSHOT</version>
+    <version>1.16.0-SNAPSHOT</version>
 
     <properties>
+        <maven.compiler.release>17</maven.compiler.release>
 
         <!-- Start of Compiler Related Properties -->
-        <java.version>11</java.version>
-        <maven.compiler.source>11</maven.compiler.source>
-        <maven.compiler.target>11</maven.compiler.target>
+        <java.version>17</java.version>
+        <maven.compiler.source>17</maven.compiler.source>
+        <maven.compiler.target>17</maven.compiler.target>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <!-- End of Compiler Related Properties -->
 
@@ -55,7 +56,7 @@
         <docker.push.registry>localhost:5000</docker.push.registry>
         <aai.docker.version>1.0.0</aai.docker.version>
         <aai.schema.service.version>1.12.7</aai.schema.service.version>
-        <aai.common.version>1.15.5</aai.common.version>
+        <aai.common.version>1.16.0-SNAPSHOT</aai.common.version>
         <aai.build.directory>${project.build.directory}/${project.artifactId}-${project.version}-build/
         </aai.build.directory>
         <aai.docker.namespace>onap</aai.docker.namespace>
         <dependency>
             <groupId>org.projectlombok</groupId>
             <artifactId>lombok</artifactId>
-            <version>1.18.30</version>
+            <version>1.18.36</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
             </exclusions>
         </dependency>
         <dependency>
-            <groupId>javax.ws.rs</groupId>
-            <artifactId>javax.ws.rs-api</artifactId>
-            <version>2.1</version>
+            <groupId>jakarta.ws.rs</groupId>
+            <artifactId>jakarta.ws.rs-api</artifactId>
         </dependency>
         <dependency>
-            <groupId>javax.xml.bind</groupId>
-            <artifactId>jaxb-api</artifactId>
+            <groupId>jakarta.xml.bind</groupId>
+            <artifactId>jakarta.xml.bind-api</artifactId>
         </dependency>
 
         <!-- Start of Logback Dependencies -->
         </dependency>
         <!-- End of Tinkerpop Dependencies -->
         <dependency>
-            <groupId>com.fasterxml.jackson.jaxrs</groupId>
-            <artifactId>jackson-jaxrs-json-provider</artifactId>
+            <groupId>com.fasterxml.jackson.jakarta.rs</groupId>
+            <artifactId>jackson-jakarta-rs-json-provider</artifactId>
         </dependency>
         <dependency>
             <groupId>org.json</groupId>
             with jersey 2 which we are using -->
         <!-- Use this to make http requests instead of jersey 1.0 client -->
         <dependency>
-            <groupId>org.apache.httpcomponents</groupId>
-            <artifactId>httpclient</artifactId>
+            <groupId>org.apache.httpcomponents.client5</groupId>
+            <artifactId>httpclient5</artifactId>
         </dependency>
         <!-- Start of Spring Framework Dependencies -->
         <dependency>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-web</artifactId>
-            <exclusions>
-                <exclusion>
-                    <groupId>org.springframework.boot</groupId>
-                    <artifactId>spring-boot-starter-tomcat</artifactId>
-                </exclusion>
-            </exclusions>
-        </dependency>
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-jetty</artifactId>
         </dependency>
         <dependency>
             <groupId>org.springframework.boot</groupId>
index 6fb1cd3..e26fb50 100755 (executable)
@@ -1,4 +1,4 @@
-FROM eclipse-temurin:11-jre-alpine
+FROM eclipse-temurin:17-jre-alpine
 USER root
 ENV SERVER_PORT=8449
 EXPOSE ${SERVER_PORT}
index d80eea5..d5cf77c 100644 (file)
@@ -50,7 +50,7 @@ MAX_METASPACE_SIZE=${MAX_METASPACE_SIZE:-512m};
 JAVA_CMD="exec java";
 
 JVM_OPTS="${JVM_OPTS} -XX:HeapDumpPath=/opt/app/aai-graphadmin/logs/ajsc-jetty/heap-dump";
-JVM_OPTS="${JVM_OPTS} -XX:MaxRAMPercentage=${MAX_RAM_PERCENTAGE:-60}";
+JVM_OPTS="${JVM_OPTS} -XX:MaxRAMPercentage=${MAX_RAM_PERCENTAGE:-70}";
 JVM_OPTS="${JVM_OPTS} -XX:MaxMetaspaceSize=${MAX_METASPACE_SIZE}";
 
 JVM_OPTS="${JVM_OPTS} -server";
@@ -59,9 +59,6 @@ JVM_OPTS="${JVM_OPTS} -XX:MaxNewSize=512m";
 JVM_OPTS="${JVM_OPTS} -XX:SurvivorRatio=8";
 JVM_OPTS="${JVM_OPTS} -XX:+DisableExplicitGC";
 JVM_OPTS="${JVM_OPTS} -XX:+UseG1GC";
-JVM_OPTS="${JVM_OPTS} -XX:+CMSParallelRemarkEnabled";
-JVM_OPTS="${JVM_OPTS} -XX:+CMSClassUnloadingEnabled";
-JVM_OPTS="${JVM_OPTS} -XX:-UseBiasedLocking";
 JVM_OPTS="${JVM_OPTS} -XX:ParallelGCThreads=4";
 JVM_OPTS="${JVM_OPTS} -XX:LargePageSizeInBytes=128m";
 JVM_OPTS="${JVM_OPTS} -Dsun.net.inetaddr.ttl=180";
index 036f216..5d80f2d 100644 (file)
@@ -43,8 +43,8 @@ import org.springframework.core.env.Environment;
 import org.springframework.scheduling.annotation.EnableAsync;
 import org.springframework.scheduling.annotation.EnableScheduling;
 
-import javax.annotation.PostConstruct;
-import javax.annotation.PreDestroy;
+import jakarta.annotation.PostConstruct;
+import jakarta.annotation.PreDestroy;
 
 @SpringBootApplication
 // Scan the specific packages that has the beans/components
@@ -124,7 +124,7 @@ public class GraphAdminApp {
             AAIException aai = ExceptionTranslator.schemaServiceExceptionTranslator(ex);
             ErrorLogHelper.logException(aai);
             ErrorLogHelper.logError(aai.getCode(), ex.getMessage() + ", resolve and restart GraphAdmin");
-            throw aai;
+            throw ex;
         }
         LOGGER.info(
                 "Application '{}' is running on {}!" ,
index 73c07b8..07a25dc 100644 (file)
@@ -30,7 +30,6 @@ import java.io.FileWriter;
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
-import java.nio.file.Paths;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.Collection;
@@ -53,7 +52,6 @@ import org.onap.aai.setup.SchemaVersions;
 import org.onap.aai.util.FormatDate;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 @Component
@@ -70,7 +68,6 @@ public class AuditGraphson2Sql {
     public static final String DEFAULT_OUTPUT_DIR = "logs/data/audit";
 
     //DEBUG -- should be getting default-src-dir, default-output-dir and rdbms-db-name from param file
-       @Autowired
        public AuditGraphson2Sql( EdgeIngestor ei, SchemaVersions schemaVersions, LoaderFactory loaderFactory, ApertureService apertureService) {
                this.schemaVersions = schemaVersions;
                this.loader = loaderFactory.createLoaderForVersion(ModelType.MOXY, schemaVersions.getDefaultVersion());
@@ -411,7 +408,7 @@ public class AuditGraphson2Sql {
                throw new Exception(msg);
         }
         
-        final List<File> graphsons = Files.walk(Paths.get(graphsonDir))
+        final List<File> graphsons = Files.walk(Path.of(graphsonDir))
                 .filter(Files::isRegularFile)
                 .map(Path::toFile)
                 .sorted()
index 98d6bbd..6673f37 100644 (file)
@@ -20,6 +20,8 @@
 
 package org.onap.aai.config;
 
+import static org.springframework.security.web.util.matcher.AntPathRequestMatcher.antMatcher;
+
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
@@ -39,7 +41,7 @@ public class SecurityConfig {
     SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Exception{
         httpSecurity.csrf(csrf -> csrf.disable())
             .authorizeHttpRequests(requests -> requests
-                .antMatchers("/util/echo", "/actuator/**")
+                .requestMatchers(antMatcher("/util/echo"), antMatcher("/actuator/**"))
                 .permitAll()
                 .anyRequest()
                 .authenticated())
index e9fba2f..d638570 100644 (file)
@@ -47,7 +47,6 @@ import org.onap.aai.setup.SchemaVersions;
 import org.onap.aai.util.AAIConfig;
 import org.onap.aai.util.AAIConstants;
 import org.onap.logging.filter.base.ONAPComponents;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.context.annotation.PropertySource;
 import org.springframework.scheduling.annotation.Scheduled;
@@ -83,7 +82,6 @@ public class DataExportTasks {
        private EdgeIngestor edgeIngestor;
        private SchemaVersions schemaVersions;
 
-       @Autowired
        public DataExportTasks(LoaderFactory loaderFactory, EdgeIngestor edgeIngestor, SchemaVersions schemaVersions){
            this.loaderFactory  = loaderFactory;
            this.edgeIngestor   = edgeIngestor;
index 74f4310..c092751 100644 (file)
@@ -1855,8 +1855,8 @@ public class DataGrooming {
                Vertex nullVtx = null;
                Vertex preferredVtx = null;
 
-               Long vidA = new Long(vtxA.id().toString());
-               Long vidB = new Long(vtxB.id().toString());
+               Long vidA = Long.valueOf(vtxA.id().toString());
+               Long vidB = Long.valueOf(vtxB.id().toString());
 
                String vtxANodeType = "";
                String vtxBNodeType = "";
index ff6835b..9fb1654 100644 (file)
@@ -77,7 +77,7 @@ public class PrintVertexDetails implements Runnable{
                                try(FileOutputStream subFileStr = new FileOutputStream(fname)) {
                                        int okCount = 0;
                                        int failCount = 0;
-                                       Long debugDelayMsL = new Long(debugDelayMs);
+                                       Long debugDelayMsL = Long.valueOf(debugDelayMs);
                                        
                                        GraphWriter graphWriter = null;
                                        if ("gryo".equalsIgnoreCase(snapshotType)) {
index db53caf..d07485d 100644 (file)
@@ -795,7 +795,7 @@ public class DupeTool {
                     vtx = ed.outVertex();
                 }
                 if (vtx == null) {
-                    retArr.add(String.format(" >>> COULD NOT FIND VERTEX on the other side of this edge edgeId = %s <<< ", ed.id()));
+                    retArr.add(" >>> COULD NOT FIND VERTEX on the other side of this edge edgeId = %s <<< ".formatted(ed.id()));
                 } else {
                     String nType = vtx.<String>property("aai-node-type").orElse(null);
                     if (displayAllVidsFlag) {
@@ -901,7 +901,7 @@ public class DupeTool {
         }
 
         if (retVertList.size() == 0) {
-            logger.debug(String.format("DEBUG No node found for nodeType = [%s], propsAndVal = %s", nodeType, propsAndValuesForMsg));
+            logger.debug("DEBUG No node found for nodeType = [%s], propsAndVal = %s".formatted(nodeType, propsAndValuesForMsg));
         }
 
         return retVertList;
@@ -988,7 +988,7 @@ public class DupeTool {
         }
 
         if (retVertList.size() == 0) {
-            logger.debug(String.format("DEBUG No node found for: [%s, with aai-created-ts > %d", qStringForMsg, windowStartTime));
+            logger.debug("DEBUG No node found for: [%s, with aai-created-ts > %d".formatted(qStringForMsg, windowStartTime));
         }
 
         return retVertList;
@@ -1104,8 +1104,8 @@ public class DupeTool {
         Vertex nullVtx = null;
         Vertex preferredVtx = null;
 
-        Long vidA = new Long(vtxA.id().toString());
-        Long vidB = new Long(vtxB.id().toString());
+        Long vidA = Long.valueOf(vtxA.id().toString());
+        Long vidB = Long.valueOf(vtxB.id().toString());
 
         String vtxANodeType = "";
         String vtxBNodeType = "";
@@ -1548,7 +1548,7 @@ public class DupeTool {
                        String origVid = origVtx.id().toString();
                        if (ob == null || ob.toString().equals("")) {
                                // It is missing its aai-uri
-                               eLogger.debug(String.format("DEBUG No [aai-uri] property found for vid = [%s] ", origVid));
+                               eLogger.debug("DEBUG No [aai-uri] property found for vid = [%s] ".formatted(origVid));
                                return false;
                        }
                        else {
@@ -1560,16 +1560,16 @@ public class DupeTool {
                                        Vertex foundV = verts.next();
                                        String foundVid = foundV.id().toString();
                                        if( !origVid.equals(foundVid) ){
-                                               eLogger.debug(String.format("DEBUG aai-uri key property [%s] for vid = [%s] brought back different vertex with vid = [%s].", aaiUriStr, origVid, foundVid));
+                                               eLogger.debug("DEBUG aai-uri key property [%s] for vid = [%s] brought back different vertex with vid = [%s].".formatted(aaiUriStr, origVid, foundVid));
                                                return false;
                                        }
                                }
                                if( count == 0 ){
-                                       eLogger.debug(String.format("DEBUG aai-uri key property [%s] for vid = [%s] could not be used to query for that vertex. ", aaiUriStr, origVid));
+                                       eLogger.debug("DEBUG aai-uri key property [%s] for vid = [%s] could not be used to query for that vertex. ".formatted(aaiUriStr, origVid));
                                        return false;
                                }
                                else if( count > 1 ){
-                                       eLogger.debug(String.format("DEBUG aai-uri key property [%s] for vid = [%s] brought back multiple (%d) vertices instead of just one. ", aaiUriStr, origVid, count));
+                                       eLogger.debug("DEBUG aai-uri key property [%s] for vid = [%s] brought back multiple (%d) vertices instead of just one. ".formatted(aaiUriStr, origVid, count));
                                        return false;
                                }
                        }
index 7ee9372..de8a230 100644 (file)
@@ -69,7 +69,6 @@ import java.net.URI;
 import java.nio.file.Files;
 import java.nio.file.InvalidPathException;
 import java.nio.file.Path;
-import java.nio.file.Paths;
 import java.text.DateFormat;
 import java.text.SimpleDateFormat;
 import java.util.*;
@@ -472,7 +471,7 @@ public class DynamicPayloadGenerator {
                // FileLocation
                Path pathDir = null;
                try {
-                       pathDir = Paths.get(dirName);
+                       pathDir = Path.of(dirName);
                } catch (InvalidPathException i) {
                        String emsg = "Directory " + dirName + " could not be found.";
                        LOGGER.error(emsg);
index a170453..80edd7b 100644 (file)
@@ -288,7 +288,7 @@ public final class GraphSONPartialReader implements GraphReader {
         if (unwrapAdjacencyList) {
                final JsonNode root = mapper.readTree(inputStream);
             final JsonNode vertices = root.get(GraphSONTokens.VERTICES);
-            if (!vertices.getNodeType().equals(JsonNodeType.ARRAY)) throw new IOException(String.format("The '%s' key must be an array", GraphSONTokens.VERTICES));
+            if (!vertices.getNodeType().equals(JsonNodeType.ARRAY)) throw new IOException("The '%s' key must be an array".formatted(GraphSONTokens.VERTICES));
             return IteratorUtils.stream(vertices.elements()).map(Object::toString);
         } else {
                final BufferedReader br = new BufferedReader(new InputStreamReader(inputStream));
index 3b7c4b8..d93e923 100644 (file)
@@ -270,7 +270,7 @@ public class UpdatePropertyToolInternal {
                 logAndPrint("All vertex IDs from file " + filePath + ":\n" + allVertexIdsString);
             } catch (IOException ioe) {
                 if(ioe instanceof FileNotFoundException) {
-                    logErrorAndPrint(String.format("File %s not found.", filePath));
+                    logErrorAndPrint("File %s not found.".formatted(filePath));
                 } else {
                     logErrorAndPrint("ERROR reading in text file failed.", ioe);
                 }
index 7fd0b9c..5b414fc 100644 (file)
@@ -23,11 +23,11 @@ import org.onap.aai.exceptions.AAIException;
 import org.onap.aai.interceptors.AAIContainerFilter;
 import org.onap.aai.logging.ErrorLogHelper;
 
-import javax.annotation.Priority;
-import javax.ws.rs.container.ContainerRequestContext;
-import javax.ws.rs.container.ContainerResponseContext;
-import javax.ws.rs.container.ContainerResponseFilter;
-import javax.ws.rs.core.MediaType;
+import jakarta.annotation.Priority;
+import jakarta.ws.rs.container.ContainerRequestContext;
+import jakarta.ws.rs.container.ContainerResponseContext;
+import jakarta.ws.rs.container.ContainerResponseFilter;
+import jakarta.ws.rs.core.MediaType;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
index 9d4efe7..222bccf 100644 (file)
@@ -22,11 +22,11 @@ package org.onap.aai.interceptors.post;
 import org.onap.aai.interceptors.AAIContainerFilter;
 import org.onap.aai.interceptors.AAIHeaderProperties;
 
-import javax.annotation.Priority;
-import javax.ws.rs.container.ContainerRequestContext;
-import javax.ws.rs.container.ContainerResponseContext;
-import javax.ws.rs.container.ContainerResponseFilter;
-import javax.ws.rs.core.MediaType;
+import jakarta.annotation.Priority;
+import jakarta.ws.rs.container.ContainerRequestContext;
+import jakarta.ws.rs.container.ContainerResponseContext;
+import jakarta.ws.rs.container.ContainerResponseFilter;
+import jakarta.ws.rs.core.MediaType;
 import java.io.IOException;
 
 @Priority(AAIResponseFilterPriority.HEADER_MANIPULATION)
index a544a90..31c9669 100644 (file)
@@ -29,11 +29,11 @@ import org.onap.aai.logging.ErrorLogHelper;
 import org.onap.aai.util.AAIConfig;
 import org.springframework.beans.factory.annotation.Autowired;
 
-import javax.annotation.Priority;
-import javax.servlet.http.HttpServletResponse;
-import javax.ws.rs.container.ContainerRequestContext;
-import javax.ws.rs.container.ContainerResponseContext;
-import javax.ws.rs.container.ContainerResponseFilter;
+import jakarta.annotation.Priority;
+import jakarta.servlet.http.HttpServletResponse;
+import jakarta.ws.rs.container.ContainerRequestContext;
+import jakarta.ws.rs.container.ContainerResponseContext;
+import jakarta.ws.rs.container.ContainerResponseFilter;
 import java.io.IOException;
 import java.util.Objects;
 import java.util.Optional;
index 0182f2c..17da7dc 100644 (file)
@@ -26,14 +26,14 @@ import org.onap.aai.logging.ErrorLogHelper;
 import org.onap.logging.filter.base.Constants;
 import org.onap.logging.ref.slf4j.ONAPLogConstants;
 
-import javax.annotation.Priority;
-import javax.ws.rs.container.ContainerRequestContext;
-import javax.ws.rs.container.ContainerRequestFilter;
-import javax.ws.rs.container.PreMatching;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.ext.Provider;
+import jakarta.annotation.Priority;
+import jakarta.ws.rs.container.ContainerRequestContext;
+import jakarta.ws.rs.container.ContainerRequestFilter;
+import jakarta.ws.rs.container.PreMatching;
+import jakarta.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.MultivaluedMap;
+import jakarta.ws.rs.core.Response;
+import jakarta.ws.rs.ext.Provider;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
index 94d8ca1..cb3309e 100644 (file)
@@ -22,13 +22,13 @@ package org.onap.aai.interceptors.pre;
 import org.onap.aai.interceptors.AAIContainerFilter;
 import org.onap.aai.interceptors.AAIHeaderProperties;
 
-import javax.annotation.Priority;
-import javax.ws.rs.HttpMethod;
-import javax.ws.rs.container.ContainerRequestContext;
-import javax.ws.rs.container.ContainerRequestFilter;
-import javax.ws.rs.container.PreMatching;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.ext.Provider;
+import jakarta.annotation.Priority;
+import jakarta.ws.rs.HttpMethod;
+import jakarta.ws.rs.container.ContainerRequestContext;
+import jakarta.ws.rs.container.ContainerRequestFilter;
+import jakarta.ws.rs.container.PreMatching;
+import jakarta.ws.rs.core.MultivaluedMap;
+import jakarta.ws.rs.ext.Provider;
 import java.io.IOException;
 
 /**
index ee4807e..578d449 100644 (file)
@@ -22,12 +22,12 @@ package org.onap.aai.interceptors.pre;
 import org.onap.aai.interceptors.AAIContainerFilter;
 import org.onap.aai.interceptors.AAIHeaderProperties;
 
-import javax.annotation.Priority;
-import javax.ws.rs.container.ContainerRequestContext;
-import javax.ws.rs.container.ContainerRequestFilter;
-import javax.ws.rs.container.PreMatching;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.ext.Provider;
+import jakarta.annotation.Priority;
+import jakarta.ws.rs.container.ContainerRequestContext;
+import jakarta.ws.rs.container.ContainerRequestFilter;
+import jakarta.ws.rs.container.PreMatching;
+import jakarta.ws.rs.core.MultivaluedMap;
+import jakarta.ws.rs.ext.Provider;
 import java.util.Collections;
 import java.util.regex.Matcher;
 
index 9c17ffc..ae66e5e 100644 (file)
@@ -21,13 +21,13 @@ package org.onap.aai.interceptors.pre;
 
 import org.onap.aai.interceptors.AAIContainerFilter;
 
-import javax.annotation.Priority;
-import javax.ws.rs.container.ContainerRequestContext;
-import javax.ws.rs.container.ContainerRequestFilter;
-import javax.ws.rs.container.PreMatching;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.core.UriBuilder;
-import javax.ws.rs.ext.Provider;
+import jakarta.annotation.Priority;
+import jakarta.ws.rs.container.ContainerRequestContext;
+import jakarta.ws.rs.container.ContainerRequestFilter;
+import jakarta.ws.rs.container.PreMatching;
+import jakarta.ws.rs.core.MultivaluedMap;
+import jakarta.ws.rs.core.UriBuilder;
+import jakarta.ws.rs.ext.Provider;
 import java.io.IOException;
 import java.util.Arrays;
 import java.util.List;
index ecaff91..699a612 100644 (file)
@@ -32,15 +32,15 @@ import org.onap.aai.util.AAIConstants;
 import org.onap.aai.util.HbaseSaltPrefixer;
 import org.springframework.beans.factory.annotation.Autowired;
 
-import javax.annotation.Priority;
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.HttpMethod;
-import javax.ws.rs.container.ContainerRequestContext;
-import javax.ws.rs.container.ContainerRequestFilter;
-import javax.ws.rs.container.PreMatching;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.ext.Provider;
+import jakarta.annotation.Priority;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.ws.rs.HttpMethod;
+import jakarta.ws.rs.container.ContainerRequestContext;
+import jakarta.ws.rs.container.ContainerRequestFilter;
+import jakarta.ws.rs.container.PreMatching;
+import jakarta.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.MultivaluedMap;
+import jakarta.ws.rs.ext.Provider;
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
index 9a33b05..9ed73c4 100644 (file)
@@ -24,15 +24,14 @@ import org.onap.aai.interceptors.AAIContainerFilter;
 import org.onap.aai.logging.ErrorLogHelper;
 import org.onap.aai.service.RetiredService;
 import org.onap.aai.util.AAIConfig;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 
-import javax.annotation.Priority;
-import javax.ws.rs.container.ContainerRequestContext;
-import javax.ws.rs.container.ContainerRequestFilter;
-import javax.ws.rs.container.PreMatching;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.ext.Provider;
+import jakarta.annotation.Priority;
+import jakarta.ws.rs.container.ContainerRequestContext;
+import jakarta.ws.rs.container.ContainerRequestFilter;
+import jakarta.ws.rs.container.PreMatching;
+import jakarta.ws.rs.core.Response;
+import jakarta.ws.rs.ext.Provider;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
@@ -53,7 +52,6 @@ public class RetiredInterceptor extends AAIContainerFilter implements ContainerR
 
     private String basePath;
 
-    @Autowired
     public RetiredInterceptor(RetiredService retiredService, @Value("${schema.uri.base.path}") String basePath){
         this.retiredService = retiredService;
         this.basePath = basePath;
index 5d32649..b76190f 100644 (file)
@@ -24,13 +24,12 @@ import org.onap.aai.interceptors.AAIContainerFilter;
 import org.onap.aai.logging.ErrorLogHelper;
 import org.onap.aai.setup.SchemaVersion;
 import org.onap.aai.setup.SchemaVersions;
-import org.springframework.beans.factory.annotation.Autowired;
 
-import javax.annotation.Priority;
-import javax.ws.rs.container.ContainerRequestContext;
-import javax.ws.rs.container.ContainerRequestFilter;
-import javax.ws.rs.container.PreMatching;
-import javax.ws.rs.core.Response;
+import jakarta.annotation.Priority;
+import jakarta.ws.rs.container.ContainerRequestContext;
+import jakarta.ws.rs.container.ContainerRequestFilter;
+import jakarta.ws.rs.container.PreMatching;
+import jakarta.ws.rs.core.Response;
 import java.util.ArrayList;
 import java.util.Set;
 import java.util.regex.Matcher;
@@ -47,7 +46,6 @@ public class VersionInterceptor extends AAIContainerFilter implements ContainerR
 
     private final SchemaVersions schemaVersions;
 
-    @Autowired
     public VersionInterceptor(SchemaVersions schemaVersions){
         this.schemaVersions = schemaVersions;
         allowedVersions  = schemaVersions.getVersions()
index 61008b6..7fc581b 100644 (file)
@@ -21,12 +21,11 @@ package org.onap.aai.interceptors.pre;
 
 import org.onap.aai.interceptors.AAIContainerFilter;
 import org.onap.aai.setup.SchemaVersions;
-import org.springframework.beans.factory.annotation.Autowired;
 
-import javax.annotation.Priority;
-import javax.ws.rs.container.ContainerRequestContext;
-import javax.ws.rs.container.ContainerRequestFilter;
-import javax.ws.rs.container.PreMatching;
+import jakarta.annotation.Priority;
+import jakarta.ws.rs.container.ContainerRequestContext;
+import jakarta.ws.rs.container.ContainerRequestFilter;
+import jakarta.ws.rs.container.PreMatching;
 import java.net.URI;
 
 @PreMatching
@@ -35,7 +34,6 @@ public class VersionLatestInterceptor extends AAIContainerFilter implements Cont
 
     private final SchemaVersions schemaVersions;
 
-    @Autowired
     public VersionLatestInterceptor(SchemaVersions schemaVersions){
         this.schemaVersions = schemaVersions;
     }
index 21879cc..d19a7f6 100644 (file)
@@ -26,7 +26,7 @@ import org.apache.commons.configuration2.ex.ConfigurationException;
 import org.apache.commons.configuration2.PropertiesConfiguration;
 import org.apache.commons.configuration2.builder.FileBasedConfigurationBuilder;
 import org.apache.commons.configuration2.builder.fluent.Parameters;
-import org.apache.commons.lang.exception.ExceptionUtils;
+import org.apache.commons.lang3.exception.ExceptionUtils;
 import org.onap.aai.datasnapshot.DataSnapshot;
 import org.onap.aai.db.props.AAIProperties;
 import org.onap.aai.dbmap.AAIGraph;
@@ -53,7 +53,6 @@ import java.io.IOException;
 import java.lang.reflect.InvocationTargetException;
 import java.nio.file.Files;
 import java.nio.file.Path;
-import java.nio.file.Paths;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
@@ -132,7 +131,7 @@ public class MigrationControllerInternal {
                                        dataSnapshot.executeCommand(dataSnapShotArgs, true, false, null, "MULTITHREAD_RELOAD", snapshotFile);
                                }
                        } catch (ConfigurationException e) {
-                               logAndPrint("ERROR: Could not load janusgraph configuration.\n" + ExceptionUtils.getFullStackTrace(e));
+                               logAndPrint("ERROR: Could not load janusgraph configuration.\n" + ExceptionUtils.getStackTrace(e));
                                return;
                        }
                }
@@ -207,7 +206,7 @@ public class MigrationControllerInternal {
                                                        SchemaVersions.class
                                                ).newInstance(engine, loaderFactory, edgeIngestor, edgeSerializer,schemaVersions);
                                } catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e) {
-                                       logAndPrint("EXCEPTION caught initalizing migration class " + migratorClass.getSimpleName() + ".\n" + ExceptionUtils.getFullStackTrace(e));
+                                       logAndPrint("EXCEPTION caught initalizing migration class " + migratorClass.getSimpleName() + ".\n" + ExceptionUtils.getStackTrace(e));
                                        engine.rollback();
                                        continue;
                                }
@@ -360,7 +359,7 @@ public class MigrationControllerInternal {
                logAndPrint("Saving snapshot of graph " + phase + " migration to " + fileName);
                try {
 
-                       Path pathToFile = Paths.get(fileName);
+                       Path pathToFile = Path.of(fileName);
                        if (!pathToFile.toFile().exists()) {
                                Files.createDirectories(pathToFile.getParent());
                        }
@@ -368,7 +367,7 @@ public class MigrationControllerInternal {
                        DataSnapshot dataSnapshot = new DataSnapshot();
                        dataSnapshot.executeCommand(dataSnapshotArgs, true, false, null, "THREADED_SNAPSHOT", null);
                } catch (IOException e) {
-                       logAndPrint("ERROR: Could not write in memory graph to " + phase + "Migration file. \n" + ExceptionUtils.getFullStackTrace(e));
+                       logAndPrint("ERROR: Could not write in memory graph to " + phase + "Migration file. \n" + ExceptionUtils.getStackTrace(e));
                        engine.rollback();
                }
 
index ca9af63..8ab0553 100644 (file)
@@ -22,7 +22,7 @@ package org.onap.aai.migration;
 import java.io.File;
 import java.io.IOException;
 import java.nio.file.Files;
-import java.nio.file.Paths;
+import java.nio.file.Path;
 import java.nio.file.StandardOpenOption;
 import java.util.Collections;
 import java.util.Iterator;
@@ -143,7 +143,7 @@ public abstract class Migrator implements Runnable {
 
                if (dmaapMsgList.size() > 0) {
                        try {
-                               Files.write(Paths.get(logDirectory+"/"+fileName), (Iterable<String>)dmaapMsgList.stream()::iterator);
+                               Files.write(Path.of(logDirectory+"/"+fileName), (Iterable<String>)dmaapMsgList.stream()::iterator);
                        } catch (IOException e) {
                                System.out.println("Unable to generate file with dmaap msgs for " + getMigrationName() +
                                                " Exception is: " + e.getMessage());
@@ -167,7 +167,7 @@ public abstract class Migrator implements Runnable {
                        f.mkdirs();
 
                        try {
-                               Files.createFile(Paths.get(logDirectory + "/" + fileName));
+                               Files.createFile(Path.of(logDirectory + "/" + fileName));
                        } catch (Exception e) {
                                logger.error("Unable to create file", e);
                        }
@@ -180,7 +180,7 @@ public abstract class Migrator implements Runnable {
                                                try {
                                                        finalStr =
                                                                        svIntr.getName() + "#@#" + svIntr.getURI() + "#@#" + str + "\n";
-                                                       Files.write(Paths.get(logDirectory + "/" + fileName),
+                                                       Files.write(Path.of(logDirectory + "/" + fileName),
                                                                        finalStr.getBytes(), StandardOpenOption.APPEND);
                                                } catch (IOException e) {
                                                        System.out.println("Unable to generate file with dmaap msgs for " +
index de13dbb..33e4a9b 100644 (file)
@@ -24,7 +24,7 @@ import java.net.URI;
 import java.util.HashMap;
 import java.util.List;
 
-import javax.ws.rs.core.Response.Status;
+import jakarta.ws.rs.core.Response.Status;
 
 import org.apache.tinkerpop.gremlin.structure.Vertex;
 import org.onap.aai.exceptions.AAIException;
index 685855c..d4e7179 100644 (file)
@@ -137,15 +137,15 @@ public abstract class ValueMigrator extends Migrator {
             String propertyValue = v.property(property).value().toString();
             if (propertyValue.isEmpty()) {
                 v.property(property, newValue);
-               logAndPrint(logger,String.format("Node Type %s: Property %s is empty, adding value %s",
-                        nodeType, property, newValue.toString()));
+               logAndPrint(logger,"Node Type %s: Property %s is empty, adding value %s".formatted(
+                                               nodeType, property, newValue.toString()));
                 this.touchVertexProperties(v, false);
                 updateDmaapList(v);
                 this.migrationSuccess++;
                 this.subTotal++;
             } else {
-               logAndPrint(logger,String.format("Node Type %s: Property %s value already exists - skipping",
-                        nodeType, property));
+               logAndPrint(logger,"Node Type %s: Property %s value already exists - skipping".formatted(
+                                               nodeType, property));
             }
         } else {
                logAndPrint(logger,String.format("Node Type %s: Property %s does not exist or " +
index 135685c..6e47a09 100644 (file)
@@ -150,7 +150,7 @@ public class ALTSLicenseEntitlementMigration extends Migrator{
         }
         else if (vertices.size() == 1) {
             try {
-                logger.info(String.format("Updating %s with groupUuid %s from generic-vnf with vnfId %s with newResourceUuid %s", nodeType, groupUuid, vnfId, newResourceUuid));
+                logger.info("Updating %s with groupUuid %s from generic-vnf with vnfId %s with newResourceUuid %s".formatted(nodeType, groupUuid, vnfId, newResourceUuid));
                 Vertex v = vertices.get(0);
                 String resourceUuid = v.<String>property("resource-uuid").value();
                 logger.info("\tOriginal resource-uuid: " + resourceUuid);
index 361e8bc..b9084fb 100644 (file)
@@ -21,7 +21,7 @@ package org.onap.aai.migration.v12;
 
 import java.util.Optional;
 
-import org.apache.commons.lang.exception.ExceptionUtils;
+import org.apache.commons.lang3.exception.ExceptionUtils;
 import org.apache.tinkerpop.gremlin.structure.Edge;
 import org.onap.aai.edges.EdgeIngestor;
 import org.onap.aai.edges.enums.EdgeProperty;
@@ -42,22 +42,22 @@ import org.onap.aai.setup.SchemaVersions;
 public class ContainmentDeleteOtherVPropertyMigration extends Migrator {
 
        private boolean success = true;
-       
+
        public ContainmentDeleteOtherVPropertyMigration(TransactionalGraphEngine engine, LoaderFactory loaderFactory, EdgeIngestor edgeIngestor, EdgeSerializer edgeSerializer, SchemaVersions schemaVersions) {
                super(engine, loaderFactory, edgeIngestor, edgeSerializer, schemaVersions);
        }
-       
+
        //just for testing using test edge rule files
        public ContainmentDeleteOtherVPropertyMigration(TransactionalGraphEngine engine, LoaderFactory loaderFactory, EdgeIngestor edgeIngestor, EdgeSerializer edgeSerializer, SchemaVersions schemaVersions, String edgeRulesFile) {
                super(engine, loaderFactory, edgeIngestor, edgeSerializer, schemaVersions);
        }
-       
+
        @Override
        public void run() {
                try {
                        engine.asAdmin().getTraversalSource().E().sideEffect(t -> {
                                Edge e = t.get();
-                               logger.info("out vertex: " + e.outVertex().property("aai-node-type").value() + 
+                               logger.info("out vertex: " + e.outVertex().property("aai-node-type").value() +
                                                                " in vertex: " + e.inVertex().property("aai-node-type").value() +
                                                                " label : " + e.label());
                                if (e.property(EdgeProperty.CONTAINS.toString()).isPresent() &&
@@ -77,11 +77,11 @@ public class ContainmentDeleteOtherVPropertyMigration extends Migrator {
                                }
                        }).iterate();
                } catch (Exception e) {
-                       logger.info("error encountered " + e.getClass() + " " + e.getMessage() + " " + ExceptionUtils.getFullStackTrace(e));
-                       logger.error("error encountered " + e.getClass() + " " + e.getMessage() + " " + ExceptionUtils.getFullStackTrace(e));
+                       logger.info("error encountered " + e.getClass() + " " + e.getMessage() + " " + ExceptionUtils.getStackTrace(e));
+                       logger.error("error encountered " + e.getClass() + " " + e.getMessage() + " " + ExceptionUtils.getStackTrace(e));
                        success = false;
                }
-               
+
        }
 
        @Override
index 97936d7..2da2703 100644 (file)
@@ -42,7 +42,7 @@ package org.onap.aai.migration.v12;
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.nio.file.Files;
-import java.nio.file.Paths;
+import java.nio.file.Path;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -113,7 +113,7 @@ public class MigrateHUBEvcInventory extends Migrator {
         logger.info("---------- Processing HUB Entries from file  ----------");
         try {
             String line;
-            List<String> lines = Files.readAllLines(Paths.get(fileName));
+            List<String> lines = Files.readAllLines(Path.of(fileName));
             Iterator<String> lineItr = lines.iterator();
             while (lineItr.hasNext()){
                line = lineItr.next();
index ade7ec3..2f86ef6 100644 (file)
@@ -55,7 +55,7 @@ import org.onap.aai.setup.SchemaVersions;
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.nio.file.Files;
-import java.nio.file.Paths;
+import java.nio.file.Path;
 import java.util.*;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.atomic.AtomicInteger;
@@ -211,7 +211,7 @@ public class MigrateINVPhysicalInventory extends Migrator {
         * @throws Exception
         */
        protected Map<String,Set<String>> loadFile(String fileName) throws Exception {
-               List<String> lines = Files.readAllLines(Paths.get(fileName));
+               List<String> lines = Files.readAllLines(Path.of(fileName));
                return this.getFileContents(lines);
        }
 
@@ -234,8 +234,7 @@ public class MigrateINVPhysicalInventory extends Migrator {
                        .map(line -> Arrays.stream(line.split(",", -1)).map(String::trim).collect(Collectors.toList()))
 //                     .filter(this::verifyLine)
                        .map(this::processLine)
-                       .filter(Optional::isPresent)
-                       .map(Optional::get)
+                       .flatMap(Optional::stream)
                        .forEach(p -> {
                                processedRowsCount.getAndIncrement();
                                String pnfName = p.getValue0();
index 28b5b7b..043997f 100644 (file)
@@ -42,7 +42,7 @@ package org.onap.aai.migration.v12;
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.nio.file.Files;
-import java.nio.file.Paths;
+import java.nio.file.Path;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -129,7 +129,7 @@ public class MigratePATHEvcInventory extends Migrator {
         logger.info(fileName);
         logger.info("---------- Processing PATH Entries from file  ----------");
         try {
-               List<String> lines = Files.readAllLines(Paths.get(fileName));
+               List<String> lines = Files.readAllLines(Path.of(fileName));
             Iterator<String> lineItr = lines.iterator();
             while (lineItr.hasNext()){
                 String line = lineItr.next().replace("\n", "").replace("\r", "");
index af7a845..0714052 100644 (file)
@@ -42,7 +42,7 @@ package org.onap.aai.migration.v12;
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.nio.file.Files;
-import java.nio.file.Paths;
+import java.nio.file.Path;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -127,7 +127,7 @@ public class MigrateSAREvcInventory extends Migrator {
         try  {
             String line;
             
-            List<String> lines = Files.readAllLines(Paths.get(fileName));
+            List<String> lines = Files.readAllLines(Path.of(fileName));
             Iterator<String> lineItr = lines.iterator();
             while (lineItr.hasNext()){
                line = lineItr.next().replace("\n", "").replace("\r", "");
index 4a55f71..23a66d5 100644 (file)
@@ -27,7 +27,7 @@ import java.util.Optional;
 import java.util.Set;
 import java.util.UUID;
 import java.util.stream.Collectors;
-import javax.ws.rs.core.UriBuilder;
+import jakarta.ws.rs.core.UriBuilder;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
index 6c2b795..39d3883 100644 (file)
@@ -42,7 +42,7 @@ package org.onap.aai.migration.v13;
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.nio.file.Files;
-import java.nio.file.Paths;
+import java.nio.file.Path;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
@@ -148,7 +148,7 @@ public class MigrateForwarderEvcCircuitId extends Migrator {
         logger.info(fileName);
         logger.info("---------- Processing Entries from file  ----------");
         try  {
-               List<String> lines = Files.readAllLines(Paths.get(fileName));
+               List<String> lines = Files.readAllLines(Path.of(fileName));
             Iterator<String> lineItr = lines.iterator();
             while (lineItr.hasNext()){
                 String line = lineItr.next().replace("\n", "").replace("\r", "");
index 1e0ef5e..bac3e93 100644 (file)
@@ -140,7 +140,7 @@ public class MigrateModelVer extends Migrator{
                 currentValueModelVersionID = getModelVersionIdNodeValue(vertex);
                 currrentValueModelInvariantID = getModelInvariantIdNodeValue(vertex);
                 
-                String uri = String.format("/service-design-and-creation/models/model/%s/model-vers/model-ver/%s", currrentValueModelInvariantID, currentValueModelVersionID);
+                String uri = "/service-design-and-creation/models/model/%s/model-vers/model-ver/%s".formatted(currrentValueModelInvariantID, currentValueModelVersionID);
                 String propertyKey = NODETYPEKEYMAP.get(nodeTypeString);
                 String propertyValue = vertex != null ? vertex.value(propertyKey).toString() : "";
                 logger.info("Processing "+nodeTypeString+ " vertex with key "+ propertyValue);
index 85325b7..a1f899b 100644 (file)
@@ -43,7 +43,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.P;
 import org.onap.aai.setup.SchemaVersions;
 import org.springframework.web.util.UriUtils;
 
-import javax.ws.rs.core.UriBuilder;
+import jakarta.ws.rs.core.UriBuilder;
 
 import java.io.UnsupportedEncodingException;
 import java.util.*;
index a8c2f72..5d73c3f 100644 (file)
@@ -23,7 +23,7 @@ import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.NoSuchFileException;
-import java.nio.file.Paths;
+import java.nio.file.Path;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -149,7 +149,7 @@ public class MigrateSdnaIvlanData extends Migrator {
         
                                
         try  {
-               List<String> lines = Files.readAllLines(Paths.get(fileName));
+               List<String> lines = Files.readAllLines(Path.of(fileName));
             Iterator<String> lineItr = lines.iterator();
             while (lineItr.hasNext()){
                 String line = lineItr.next().trim();
@@ -270,7 +270,7 @@ public class MigrateSdnaIvlanData extends Migrator {
                                                forwarderEvcId = forwarderEvcVtx.property("forwarder-evc-id").value().toString();
                                                try{
                                                        forwarderEvcVtx.property("ivlan", ivlanValue);
-                                                       logger.info(String.format("Updating Node Type forwarder-evc Property ivlan value %s", ivlanValue.toString()));
+                                                       logger.info("Updating Node Type forwarder-evc Property ivlan value %s".formatted(ivlanValue.toString()));
                                                        this.touchVertexProperties(forwarderEvcVtx, false);
                                                        updateDmaapList(forwarderEvcVtx);
                                                        migrationSuccess++;     
index ad3181b..74a0686 100644 (file)
@@ -40,7 +40,7 @@ import org.onap.aai.migration.Status;
 import org.onap.aai.serialization.engines.TransactionalGraphEngine;
 import org.springframework.web.util.UriUtils;
 
-import javax.ws.rs.core.UriBuilder;
+import jakarta.ws.rs.core.UriBuilder;
 
 import java.io.UnsupportedEncodingException;
 import java.util.*;
index fd8bf5b..b0fb619 100644 (file)
@@ -22,7 +22,7 @@ package org.onap.aai.migration.v15;
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.nio.file.Files;
-import java.nio.file.Paths;
+import java.nio.file.Path;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashMap;
@@ -187,7 +187,7 @@ public class MigrateCloudRegionUpgradeCycle extends Migrator {
         * @throws Exception
         */
        protected ArrayList loadFile(String fileName) throws Exception {
-               List<String> lines = Files.readAllLines(Paths.get(fileName));
+               List<String> lines = Files.readAllLines(Path.of(fileName));
                return this.getFileContents(lines);
        }
 
@@ -209,7 +209,7 @@ public class MigrateCloudRegionUpgradeCycle extends Migrator {
                logger.info("Total rows count excluding header: " + lines.size());
 
                lines.stream().filter(line -> !line.isEmpty()).map(line -> Arrays.stream(line.split(",", -1)).map(String::trim).collect(Collectors.toList()))
-                               .map(this::processRegionUpgradeCycle).filter(Optional::isPresent).map(Optional::get).forEach(p -> {
+                               .map(this::processRegionUpgradeCycle).flatMap(Optional::stream).forEach(p -> {
                                        processedRowsCount.getAndIncrement();
                                        String pnfName = p.getValue0();
                                        if (!regionMap.containsKey(pnfName)) {
@@ -220,7 +220,7 @@ public class MigrateCloudRegionUpgradeCycle extends Migrator {
                fileContent.add(regionMap);
 
                lines.stream().filter(line -> !line.isEmpty()).map(line -> Arrays.stream(line.split(",", -1)).map(String::trim).collect(Collectors.toList()))
-                               .map(this::processRegionAlias).filter(Optional::isPresent).map(Optional::get).forEach(p -> {
+                               .map(this::processRegionAlias).flatMap(Optional::stream).forEach(p -> {
                                        processedRowsCount.getAndIncrement();
                                        String pnfName = p.getValue0();
                                        if (!aliasMap.containsKey(pnfName)) {
index db523cd..5785381 100644 (file)
@@ -42,7 +42,7 @@ package org.onap.aai.migration.v15;
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.nio.file.Files;
-import java.nio.file.Paths;
+import java.nio.file.Path;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
@@ -176,7 +176,7 @@ public class MigrateRadcomChanges extends EdgeSwingMigrator {
         logger.info("---------- Reading all file types and vf-modules ----------");
         ArrayList<String> fileTypeList = new ArrayList<String>();
         try  {
-               List<String> lines = Files.readAllLines(Paths.get(fileName));
+               List<String> lines = Files.readAllLines(Path.of(fileName));
             Iterator<String> lineItr = lines.iterator();
             int typeFileLineCounter = 0;
             while (lineItr.hasNext()){
@@ -231,7 +231,7 @@ public class MigrateRadcomChanges extends EdgeSwingMigrator {
                logger.info(fileName);
                logger.info("---------- Processing Entries from file  ----------");
                try  {
-                       List<String> lines = Files.readAllLines(Paths.get(fileName));
+                       List<String> lines = Files.readAllLines(Path.of(fileName));
                        Iterator<String> lineItr = lines.iterator();
                        while (lineItr.hasNext()){
                                String line = lineItr.next().replace("\n", "").replace("\r", "");
@@ -254,7 +254,7 @@ public class MigrateRadcomChanges extends EdgeSwingMigrator {
                        fileName = feedDir+ "INPUT-VNF.csv";
                        logger.info(fileName);
                        logger.info("---------- Processing Entries from file  ----------");
-                       lines = Files.readAllLines(Paths.get(fileName));
+                       lines = Files.readAllLines(Path.of(fileName));
                        lineItr = lines.iterator();
                        while (lineItr.hasNext()){
                                String line = lineItr.next().replace("\n", "").replace("\r", "");
index aec7224..61cac13 100644 (file)
@@ -27,13 +27,12 @@ import org.onap.aai.restcore.RESTAPI;
 import org.onap.aai.util.AAIConstants;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
 
-import javax.ws.rs.*;
-import javax.ws.rs.core.*;
-import javax.ws.rs.core.Response.Status;
+import jakarta.ws.rs.*;
+import jakarta.ws.rs.core.*;
+import jakarta.ws.rs.core.Response.Status;
 
 @Component
 @Path("{version: v1}/audit-sql-db")
@@ -47,7 +46,6 @@ public class AuditSqlDbConsumer extends RESTAPI {
        private String rdbmsDbName;
        private AuditGraphson2Sql auditGraphson2Sql;
 
-       @Autowired
        public AuditSqlDbConsumer(
                AuditGraphson2Sql auditGraphson2Sql,
                @Value("${aperture.rdbmsname}") String rdbmsDbName
index 14c45da..25be192 100644 (file)
@@ -25,14 +25,14 @@ import com.sun.istack.SAXParseException2;
 import org.onap.aai.exceptions.AAIException;
 import org.onap.aai.logging.ErrorLogHelper;
 
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.HttpHeaders;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.ext.ExceptionMapper;
-import javax.ws.rs.ext.Provider;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.ws.rs.WebApplicationException;
+import jakarta.ws.rs.core.Context;
+import jakarta.ws.rs.core.HttpHeaders;
+import jakarta.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.Response;
+import jakarta.ws.rs.ext.ExceptionMapper;
+import jakarta.ws.rs.ext.Provider;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -59,8 +59,7 @@ public class ExceptionHandler implements ExceptionMapper<Exception> {
 
        //the general case is that cxf will give us a WebApplicationException
        //with a linked exception
-       if (exception instanceof WebApplicationException) { 
-               WebApplicationException e = (WebApplicationException) exception;
+       if (exception instanceof WebApplicationException e) {
                if (e.getCause() != null) {
                        if (e.getCause() instanceof SAXParseException2) {
                                templateVars.add("UnmarshalException");
@@ -93,8 +92,7 @@ public class ExceptionHandler implements ExceptionMapper<Exception> {
        if (response == null) { 
                
                Exception actual_e = exception;
-               if (exception instanceof WebApplicationException) { 
-                       WebApplicationException e = (WebApplicationException) exception;
+               if (exception instanceof WebApplicationException e) {
                        response = e.getResponse();
                } else { 
                        templateVars.add(request.getMethod());
index a0ba61a..c77fafd 100644 (file)
@@ -43,15 +43,14 @@ import org.onap.aai.setup.SchemaVersions;
 import org.onap.aai.util.AAIConstants;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
 
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.*;
-import javax.ws.rs.core.*;
-import javax.ws.rs.core.Response.Status;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.ws.rs.*;
+import jakarta.ws.rs.core.*;
+import jakarta.ws.rs.core.Response.Status;
 import java.util.List;
 
 @Component
@@ -74,7 +73,6 @@ public class QueryConsumer extends RESTAPI {
 
        private String basePath;
 
-       @Autowired
        public QueryConsumer(
                @Qualifier("traversalUriHttpEntry") HttpEntry traversalUriHttpEntry,
                DslQueryProcessor dslQueryProcessor,
index 50cbddb..3004b59 100644 (file)
@@ -19,9 +19,9 @@
  */
 package org.onap.aai.rest;
 
-import javax.ws.rs.Consumes;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
+import jakarta.ws.rs.Consumes;
+import jakarta.ws.rs.Produces;
+import jakarta.ws.rs.core.MediaType;
 
 import org.onap.aai.exceptions.AAIException;
 import org.onap.aai.service.SchemaJobStatusService;
index 226e681..ead12dc 100644 (file)
@@ -21,12 +21,11 @@ package org.onap.aai.rest.client;
 
 
 import com.google.gson.JsonObject;
-import org.apache.http.conn.ConnectTimeoutException;
+import org.apache.hc.client5.http.ConnectTimeoutException;
 import org.onap.aai.exceptions.AAIException;
 import org.onap.aai.restclient.RestClient;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.http.HttpMethod;
@@ -72,7 +71,6 @@ public class ApertureService {
     private final String appName;
 
 
-    @Autowired
     public ApertureService(
         @Qualifier("apertureRestClient") RestClient apertureRestClient,
         @Value("${spring.application.name}") String appName
index 703420e..8e1bd8b 100644 (file)
@@ -47,6 +47,7 @@ public class ApertureServiceNoAuthClient extends NoAuthRestClient {
     protected HttpComponentsClientHttpRequestFactory getHttpRequestFactory() throws Exception {
         HttpComponentsClientHttpRequestFactory requestFactory = super.getHttpRequestFactory();
         requestFactory.setConnectionRequestTimeout(timeout);
+        // Manual migration to `SocketConfig.Builder.setSoTimeout(Timeout)` necessary; see: https://docs.spring.io/spring-framework/docs/6.0.0/javadoc-api/org/springframework/http/client/HttpComponentsClientHttpRequestFactory.html#setReadTimeout(int)
         requestFactory.setReadTimeout(timeout);
         requestFactory.setConnectTimeout(timeout);
         return requestFactory;
index 5b4fa0d..4cc72f6 100644 (file)
@@ -54,6 +54,7 @@ public class ApertureServiceOneWayClient extends OneWaySSLRestClient {
     protected HttpComponentsClientHttpRequestFactory getHttpRequestFactory() throws Exception {
         HttpComponentsClientHttpRequestFactory requestFactory = super.getHttpRequestFactory();
         requestFactory.setConnectionRequestTimeout(timeout);
+        // Manual migration to `SocketConfig.Builder.setSoTimeout(Timeout)` necessary; see: https://docs.spring.io/spring-framework/docs/6.0.0/javadoc-api/org/springframework/http/client/HttpComponentsClientHttpRequestFactory.html#setReadTimeout(int)
         requestFactory.setReadTimeout(timeout);
         requestFactory.setConnectTimeout(timeout);
         return requestFactory;
index 19c32fb..095c7f9 100644 (file)
@@ -59,6 +59,7 @@ public class ApertureServiceRestClient extends TwoWaySSLRestClient {
     protected HttpComponentsClientHttpRequestFactory getHttpRequestFactory() throws Exception {
         HttpComponentsClientHttpRequestFactory requestFactory = super.getHttpRequestFactory();
         requestFactory.setConnectionRequestTimeout(timeout);
+        // Manual migration to `SocketConfig.Builder.setSoTimeout(Timeout)` necessary; see: https://docs.spring.io/spring-framework/docs/6.0.0/javadoc-api/org/springframework/http/client/HttpComponentsClientHttpRequestFactory.html#setReadTimeout(int)
         requestFactory.setReadTimeout(timeout);
         requestFactory.setConnectTimeout(timeout);
         return requestFactory;
index 70d8bf8..e806154 100644 (file)
@@ -29,7 +29,6 @@ import org.onap.aai.edges.EdgeRule;
 import org.onap.aai.edges.EdgeRuleQuery;
 import org.onap.aai.edges.exceptions.AmbiguousRuleChoiceException;
 import org.onap.aai.edges.exceptions.EdgeRuleNotFoundException;
-import org.springframework.beans.factory.annotation.Autowired;
 
 import java.util.HashMap;
 import java.util.List;
@@ -68,7 +67,6 @@ public class DslListener extends AAIDslBaseListener {
        /**
         * Instantiates a new DslListener.
         */
-       @Autowired
        public DslListener(EdgeIngestor edgeIngestor) {
                this.edgeRules = edgeIngestor;
        }
index 3e77e6c..b77c9f0 100644 (file)
@@ -27,7 +27,6 @@ import org.antlr.v4.runtime.tree.ParseTree;
 import org.antlr.v4.runtime.tree.ParseTreeWalker;
 import org.onap.aai.AAIDslLexer;
 import org.onap.aai.AAIDslParser;
-import org.springframework.beans.factory.annotation.Autowired;
 
 import java.io.ByteArrayInputStream;
 import java.io.InputStream;
@@ -42,7 +41,6 @@ public class DslQueryProcessor {
 
        private DslListener dslListener;
 
-       @Autowired
        public DslQueryProcessor(DslListener dslListener){
                this.dslListener = dslListener;
        }
index 85573fc..6fbf110 100644 (file)
@@ -32,8 +32,8 @@ import org.onap.aai.restcore.util.URITools;
 import org.onap.aai.serialization.engines.TransactionalGraphEngine;
 import org.onap.aai.serialization.queryformats.SubGraphStyle;
 
-import javax.ws.rs.core.MultivaluedHashMap;
-import javax.ws.rs.core.MultivaluedMap;
+import jakarta.ws.rs.core.MultivaluedHashMap;
+import jakarta.ws.rs.core.MultivaluedMap;
 import java.io.FileNotFoundException;
 import java.net.URI;
 import java.util.*;
index 12b62b3..2e18f38 100644 (file)
@@ -20,23 +20,22 @@ package org.onap.aai.rest.util;
 
 import java.util.ArrayList;
 
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.HttpHeaders;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Response.Status;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.ws.rs.GET;
+import jakarta.ws.rs.Path;
+import jakarta.ws.rs.Produces;
+import jakarta.ws.rs.QueryParam;
+import jakarta.ws.rs.core.Context;
+import jakarta.ws.rs.core.HttpHeaders;
+import jakarta.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.Response;
+import jakarta.ws.rs.core.Response.Status;
 
 import org.onap.aai.exceptions.AAIException;
 import org.onap.aai.logging.ErrorLogHelper;
 import org.onap.aai.restcore.RESTAPI;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 @Component
@@ -50,7 +49,6 @@ public class EchoResponse extends RESTAPI {
     private static final String UP_RESPONSE="{\"status\":\"UP\",\"groups\":[\"liveness\",\"readiness\"]}";
    
   
-    @Autowired
     public EchoResponse(AaiGraphChecker aaiGraphChecker ) {
         this.aaiGraphChecker = aaiGraphChecker;
     }
index 6443d43..cf82d19 100644 (file)
@@ -197,7 +197,7 @@ public class GenTester {
        private static void setSchemaInitializedToFalse(JanusGraph graph, Optional<Vertex> schemaInitializedVertex) {
                Vertex vertex = schemaInitializedVertex.get();
                Object schemaInitializedValueObj = vertex.property(SCHEMA_INITIALIZED).value();
-               Boolean schemaInitializedValue = schemaInitializedValueObj instanceof Boolean ? (Boolean) schemaInitializedValueObj : Boolean.FALSE;
+               Boolean schemaInitializedValue = schemaInitializedValueObj instanceof Boolean b ? b : Boolean.FALSE;
 
                //Setting schema-initialized vertex to False
                if (Boolean.TRUE.equals(schemaInitializedValue)) {
index 5989e31..b9d562f 100644 (file)
@@ -23,7 +23,7 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.context.annotation.PropertySource;
 import org.springframework.stereotype.Service;
 
-import javax.annotation.PostConstruct;
+import jakarta.annotation.PostConstruct;
 import java.util.Arrays;
 import java.util.List;
 import java.util.regex.Pattern;
index e8c9ede..bb6d867 100644 (file)
@@ -38,7 +38,7 @@ public class ExceptionTranslator {
                aai = new  AAIException("AAI_3025","Error parsing exception - Please Investigate" + 
                        LogFormatTools.getStackTop(ex));
         } else {
-               LOGGER.info(String.format("Exception is %sRoot cause is%s", ExceptionUtils.getRootCause(ex).getMessage(), ExceptionUtils.getRootCause(ex).toString()));
+               LOGGER.info("Exception is %sRoot cause is%s".formatted(ExceptionUtils.getRootCause(ex).getMessage(), ExceptionUtils.getRootCause(ex).toString()));
                if(ExceptionUtils.getRootCause(ex).getMessage().contains("NodeIngestor")){
                    aai = new  AAIException("AAI_3026","Error reading OXM from SchemaService - Investigate");
                }
index 0fd75dc..64ed39b 100644 (file)
@@ -43,7 +43,7 @@ import org.slf4j.MDC;
 import java.io.IOException;
 import java.net.URI;
 import java.nio.file.Files;
-import java.nio.file.Paths;
+import java.nio.file.Path;
 import java.util.*;
 import java.util.concurrent.atomic.AtomicInteger;
 
@@ -130,7 +130,7 @@ public class SendDeleteMigrationNotifications {
        }
 
        private Map<Integer,String> processFile() throws IOException {
-               List<String> lines = Files.readAllLines(Paths.get(path));
+               List<String> lines = Files.readAllLines(Path.of(path));
                final Map<Integer,String> data = new LinkedHashMap<>();
                AtomicInteger counter = new AtomicInteger(0);
                lines.stream().forEach(line -> {
index a138402..0c854dc 100644 (file)
@@ -45,7 +45,7 @@ import org.slf4j.MDC;
 import java.io.IOException;
 import java.net.URI;
 import java.nio.file.Files;
-import java.nio.file.Paths;
+import java.nio.file.Path;
 import java.util.*;
 
 public class SendMigrationNotifications {
@@ -142,7 +142,7 @@ public class SendMigrationNotifications {
        }
 
        private Map<String, String> processFile() throws IOException {
-               List<String> lines = Files.readAllLines(Paths.get(path));
+               List<String> lines = Files.readAllLines(Path.of(path));
                final Map<String,String> vertexIds = new LinkedHashMap<>();
                lines.stream().forEach(line -> {
                        if (line.contains("_")) {
index 99f304d..7c5fe6c 100644 (file)
@@ -23,9 +23,9 @@ import java.util.List;
 import java.util.Set;
 import java.util.logging.Logger;
 import java.util.stream.Collectors;
-import javax.annotation.Priority;
-import javax.ws.rs.container.ContainerRequestFilter;
-import javax.ws.rs.container.ContainerResponseFilter;
+import jakarta.annotation.Priority;
+import jakarta.ws.rs.container.ContainerRequestFilter;
+import jakarta.ws.rs.container.ContainerResponseFilter;
 import org.glassfish.jersey.logging.LoggingFeature;
 import org.glassfish.jersey.server.ResourceConfig;
 import org.glassfish.jersey.servlet.ServletProperties;
@@ -34,9 +34,9 @@ import org.onap.aai.rest.QueryConsumer;
 import org.onap.aai.rest.util.EchoResponse;
 import org.onap.logging.filter.base.AuditLogContainerFilter;
 import org.reflections8.Reflections;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Profile;
 import org.springframework.core.env.Environment;
+import org.springframework.core.env.Profiles;
 import org.springframework.stereotype.Component;
 
 @Component
@@ -46,7 +46,6 @@ public class JerseyConfiguration extends ResourceConfig {
 
     private Environment env;
 
-    @Autowired
     public JerseyConfiguration(Environment env) {
 
         this.env = env;
@@ -91,7 +90,7 @@ public class JerseyConfiguration extends ResourceConfig {
                 .stream()
                 .filter(f -> {
                     if (f.isAnnotationPresent(Profile.class)
-                            && !env.acceptsProfiles(f.getAnnotation(Profile.class).value())) {
+                            && !env.acceptsProfiles(Profiles.of(f.getAnnotation(Profile.class).value()))) {
                         return false;
                     }
                     return true;
diff --git a/src/main/java/org/onap/aai/web/LocalHostAccessLog.java b/src/main/java/org/onap/aai/web/LocalHostAccessLog.java
deleted file mode 100644 (file)
index eaee501..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-/**
- * ============LICENSE_START=======================================================
- * org.onap.aai
- * ================================================================================
- * Copyright Â© 2017-2018 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=========================================================
- */
-package org.onap.aai.web;
-
-import ch.qos.logback.access.jetty.RequestLogImpl;
-import org.eclipse.jetty.server.handler.HandlerCollection;
-import org.eclipse.jetty.server.handler.RequestLogHandler;
-import org.eclipse.jetty.util.thread.QueuedThreadPool;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.boot.web.embedded.jetty.JettyServerCustomizer;
-import org.springframework.boot.web.embedded.jetty.JettyServletWebServerFactory;
-import org.springframework.boot.web.servlet.server.AbstractServletWebServerFactory;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-import java.util.Arrays;
-
-@Configuration
-public class LocalHostAccessLog {
-
-    @Bean
-    public AbstractServletWebServerFactory jettyConfigBean(
-            @Value("${jetty.threadPool.maxThreads:200}") final String maxThreads,
-            @Value("${jetty.threadPool.minThreads:8}") final String minThreads
-    ){
-    JettyServletWebServerFactory jef = new JettyServletWebServerFactory();
-               jef.addServerCustomizers((JettyServerCustomizer) server -> {
-
-            HandlerCollection handlers = new HandlerCollection();
-
-            Arrays.stream(server.getHandlers()).forEach(handlers::addHandler);
-
-            RequestLogHandler requestLogHandler = new RequestLogHandler();
-            requestLogHandler.setServer(server);
-
-            RequestLogImpl requestLogImpl = new RequestLogImpl();
-            requestLogImpl.setResource("/localhost-access-logback.xml");
-            requestLogImpl.start();
-
-            requestLogHandler.setRequestLog(requestLogImpl);
-            handlers.addHandler(requestLogHandler);
-            server.setHandler(handlers);
-
-            final QueuedThreadPool threadPool = server.getBean(QueuedThreadPool.class);
-            threadPool.setMaxThreads(Integer.valueOf(maxThreads));
-            threadPool.setMinThreads(Integer.valueOf(minThreads));
-        });
-               return jef;
-       }
-}
index 66f0da5..0c40eb2 100644 (file)
@@ -79,7 +79,8 @@ management.server.port=8448
 management.endpoints.enabled-by-default=true
 #To Enable Actuator Endpoint, you can override this in OOM Charts
 management.endpoints.web.exposure.include=info, health, loggers, prometheus
-management.metrics.web.server.auto-time-requests=false
+# This property is deprecated: Should be applied at the ObservationRegistry level.
+# management.metrics.web.server.request.autotime.enabled=false
 management.info.env.enabled=true
 
 # If true, the actuator health check will be overriden
diff --git a/src/main/resources/localhost-access-logback.xml b/src/main/resources/localhost-access-logback.xml
deleted file mode 100644 (file)
index 6c89f23..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-<!--
-
-    ============LICENSE_START=======================================================
-    org.onap.aai
-    ================================================================================
-    Copyright Â© 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=========================================================
-
-    ECOMP is a trademark and service mark of AT&T Intellectual Property.
-
--->
-<configuration>
-       <property name="AJSC_HOME" value="${AJSC_HOME:-.}" />
-       <property name="maxHistory" value='7' />
-       <property name="totalSizeCap" value='1GB' />
-       <appender name="ACCESS"
-               class="ch.qos.logback.core.rolling.RollingFileAppender">
-               <file>${AJSC_HOME}/logs/ajsc-jetty/localhost_access.log</file>
-               <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
-                       <fileNamePattern>${AJSC_HOME}/logs/ajsc-jetty/localhost_access.log.%d{yyyy-MM-dd}
-                       </fileNamePattern>
-                       <maxHistory>${maxHistory}</maxHistory>
-                       <totalSizeCap>${totalSizeCap}</totalSizeCap>
-               </rollingPolicy>
-               <encoder class="org.onap.aai.logging.CustomLogPatternLayoutEncoder">
-                       <Pattern>%a %u %z [%t] "%m %U%q" %s %b %y %i{X-TransactionId} %i{X-FromAppId} %i{X-Forwarded-For} %i{X-AAI-SSL-Client-CN} %i{X-AAI-SSL-Client-OU} %i{X-AAI-SSL-Client-O} %i{X-AAI-SSL-Client-L} %i{X-AAI-SSL-Client-ST} %i{X-AAI-SSL-Client-C} %i{X-AAI-SSL-Client-NotBefore} %i{X-AAI-SSL-Client-NotAfter} %i{X-AAI-SSL-Client-DN} %D</Pattern>
-               </encoder>
-       </appender>
-       <appender-ref ref="ACCESS" />
-       <appender name="STDOUTACCESS" class="ch.qos.logback.core.ConsoleAppender">
-               <encoder class="org.onap.aai.logging.CustomLogPatternLayoutEncoder">
-                       <Pattern>%a %u %z [%t] "%m %U%q" %s %b %y %i{X-TransactionId} %i{X-FromAppId} %i{X-Forwarded-For} %i{X-AAI-SSL-Client-CN} %i{X-AAI-SSL-Client-OU} %i{X-AAI-SSL-Client-O} %i{X-AAI-SSL-Client-L} %i{X-AAI-SSL-Client-ST} %i{X-AAI-SSL-Client-C} %i{X-AAI-SSL-Client-NotBefore} %i{X-AAI-SSL-Client-NotAfter} %i{X-AAI-SSL-Client-DN} %D - "logType": "access"</Pattern>
-               </encoder>
-       </appender>
-       <appender-ref ref="STDOUTACCESS" />
-</configuration>
-
-<!-- 
-%a - Remote IP address
-%A - Local IP address
-%b - Bytes sent, excluding HTTP headers, or '-' if no bytes were sent
-%B - Bytes sent, excluding HTTP headers
-%h - Remote host name
-%H - Request protocol
-%l - Remote logical username from identd (always returns '-')
-%m - Request method
-%p - Local port
-%q - Query string (prepended with a '?' if it exists, otherwise an empty string
-%r - First line of the request
-%s - HTTP status code of the response
-%S - User session ID
-%t - Date and time, in Common Log Format format
-%u - Remote user that was authenticated
-%U - Requested URL path
-%v - Local server name
-%I - current request thread name (can compare later with stacktraces)
-
-%z - Custom pattern that parses the cert for the subject
-%y - Custom pattern determines rest or dme2
- -->
\ No newline at end of file
index 307dfaa..d71c94f 100644 (file)
@@ -31,11 +31,11 @@ import org.onap.aai.dbmap.AAIGraph;
 import org.onap.aai.exceptions.AAIException;
 import org.onap.aai.util.AAIConfig;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.web.server.LocalServerPort;
 import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
 import org.springframework.boot.autoconfigure.cassandra.CassandraAutoConfiguration;
 import org.springframework.boot.autoconfigure.data.cassandra.CassandraDataAutoConfiguration;
 import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.boot.test.web.server.LocalServerPort;
 import org.springframework.context.annotation.Import;
 import org.springframework.http.*;
 import org.springframework.test.context.TestPropertySource;
index f0b78f2..4368875 100644 (file)
@@ -128,7 +128,7 @@ public abstract class AAISetup {
                 .getClassLoader()
                 .getResourceAsStream(filename);
 
-        String message = String.format("Unable to find the %s in src/test/resources", filename);
+        String message = "Unable to find the %s in src/test/resources".formatted(filename);
         assertNotNull(inputStream, message);
 
         String resource = IOUtils.toString(inputStream);
index bdd2c36..24b6d1c 100644 (file)
@@ -21,14 +21,14 @@ package org.onap.aai;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-
-import org.apache.http.client.HttpClient;
-import org.apache.http.impl.client.HttpClients;
-import org.springframework.beans.factory.annotation.Autowired;
+import org.apache.hc.client5.http.classic.HttpClient;
+import org.apache.hc.client5.http.impl.classic.HttpClients;
+import org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager;
+import org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManagerBuilder;
+import org.apache.hc.client5.http.ssl.SSLConnectionSocketFactoryBuilder;
 import org.springframework.boot.test.context.TestConfiguration;
 import org.springframework.boot.web.client.RestTemplateBuilder;
 import org.springframework.context.annotation.Bean;
-import org.springframework.core.env.Environment;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.client.ClientHttpResponse;
 import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
@@ -51,15 +51,19 @@ public class GraphAdminTestConfiguration {
     RestTemplate restTemplate(RestTemplateBuilder builder) throws Exception {
 
         SSLContext sslContext = SSLContext.getDefault();
-
-        HttpClient client = HttpClients.custom()
-                .setSSLContext(sslContext)
-                .setSSLHostnameVerifier((s, sslSession) -> true)
-                .build();
-
-        RestTemplate restTemplate =  builder
-                .requestFactory(() -> new HttpComponentsClientHttpRequestFactory(client))
-                .build();
+        PoolingHttpClientConnectionManager connectionManager = PoolingHttpClientConnectionManagerBuilder.create()
+            .setSSLSocketFactory(
+                SSLConnectionSocketFactoryBuilder.create()
+                    .setSslContext(sslContext)
+                    .build()
+                )
+            .build();
+        HttpClient client = HttpClients
+            .custom()
+            .setConnectionManager(connectionManager)
+            .build();
+
+        RestTemplate restTemplate = builder.requestFactory(() -> new HttpComponentsClientHttpRequestFactory(client)).build();
 
         restTemplate.setErrorHandler(new ResponseErrorHandler() {
             @Override
index d0b833b..902c45a 100644 (file)
@@ -34,13 +34,13 @@ import org.junit.jupiter.api.Test;
 import org.onap.aai.config.SpringContextAware;
 import org.onap.aai.exceptions.AAIException;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.actuate.autoconfigure.web.server.LocalManagementPort;
 import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
 import org.springframework.boot.autoconfigure.cassandra.CassandraAutoConfiguration;
 import org.springframework.boot.autoconfigure.data.cassandra.CassandraDataAutoConfiguration;
 import org.springframework.boot.test.autoconfigure.actuate.metrics.AutoConfigureMetrics;
 import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.boot.web.server.LocalServerPort;
+import org.springframework.boot.test.web.server.LocalManagementPort;
+import org.springframework.boot.test.web.server.LocalServerPort;
 import org.springframework.context.annotation.Import;
 import org.springframework.http.*;
 import org.springframework.test.context.ContextConfiguration;
index 65f5d9f..b859c1e 100644 (file)
@@ -39,7 +39,7 @@ public class PayloadUtil {
 
         InputStream inputStream = PayloadUtil.class.getClassLoader().getResourceAsStream("payloads/expected/" + fileName);
 
-        String message = String.format("Unable to find the %s in src/test/resources", fileName);
+        String message = "Unable to find the %s in src/test/resources".formatted(fileName);
         assertNotNull(inputStream, message);
 
         String resource = IOUtils.toString(inputStream);
@@ -52,7 +52,7 @@ public class PayloadUtil {
 
         InputStream inputStream = PayloadUtil.class.getClassLoader().getResourceAsStream("payloads/resource/" + fileName);
 
-        String message = String.format("Unable to find the %s in src/test/resources", fileName);
+        String message = "Unable to find the %s in src/test/resources".formatted(fileName);
         assertNotNull(inputStream, message);
 
         String resource = IOUtils.toString(inputStream);
@@ -65,7 +65,7 @@ public class PayloadUtil {
 
         InputStream inputStream = PayloadUtil.class.getClassLoader().getResourceAsStream("payloads/templates/" + fileName);
 
-        String message = String.format("Unable to find the %s in src/test/resources", fileName);
+        String message = "Unable to find the %s in src/test/resources".formatted(fileName);
         assertNotNull(inputStream, message);
 
         String resource;
@@ -100,7 +100,7 @@ public class PayloadUtil {
 
         InputStream inputStream = PayloadUtil.class.getClassLoader().getResourceAsStream("payloads/named-queries/" + fileName);
 
-        String message = String.format("Unable to find the %s in src/test/resources/payloads/named-queries", fileName);
+        String message = "Unable to find the %s in src/test/resources/payloads/named-queries".formatted(fileName);
         assertNotNull(inputStream, message);
 
         String resource = IOUtils.toString(inputStream);
index b976fa8..e9f07e2 100644 (file)
@@ -51,7 +51,6 @@ import java.util.Map;
 import java.util.Set;
 import java.nio.file.Files;
 import java.nio.file.Path;
-import java.nio.file.Paths;
 import java.util.stream.Collectors;
 
 import static org.hamcrest.CoreMatchers.is;
@@ -144,7 +143,7 @@ public class DataSnapshot4HistInitTest extends AAISetup {
 
         String logsFolder     = System.getProperty("AJSC_HOME") + "/logs/data/dataSnapshots/";
 
-        Set<Path> preSnapshotFiles = Files.walk(Paths.get(logsFolder)).collect(Collectors.toSet());
+        Set<Path> preSnapshotFiles = Files.walk(Path.of(logsFolder)).collect(Collectors.toSet());
 
         // Run the clear dataSnapshot and this time it should fail
         //String [] args = {"JUST_TAKE_SNAPSHOT"};  >> default behavior is now to use 15 threads
@@ -155,7 +154,7 @@ public class DataSnapshot4HistInitTest extends AAISetup {
 
         // Add sleep so the file actually gets created with the data
 
-        Set<Path> postSnapshotFiles = Files.walk(Paths.get(logsFolder)).collect(Collectors.toSet());
+        Set<Path> postSnapshotFiles = Files.walk(Path.of(logsFolder)).collect(Collectors.toSet());
 
         assertThat(postSnapshotFiles.size(), is(preSnapshotFiles.size()+1));
         postSnapshotFiles.removeAll(preSnapshotFiles);
index c6c7b4b..cb5f114 100644 (file)
@@ -42,7 +42,6 @@ import java.io.File;
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
-import java.nio.file.Paths;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
@@ -137,7 +136,7 @@ public class DataSnapshotTest extends AAISetup {
 
         String logsFolder     = System.getProperty("AJSC_HOME") + "/logs/data/dataSnapshots/";
 
-        Set<Path> preSnapshotFiles = Files.walk(Paths.get(logsFolder)).collect(Collectors.toSet());
+        Set<Path> preSnapshotFiles = Files.walk(Path.of(logsFolder)).collect(Collectors.toSet());
 
         // Run the clear dataSnapshot and this time it should fail
         //String [] args = {"JUST_TAKE_SNAPSHOT"};  >> default behavior is now to use 15 threads
@@ -148,7 +147,7 @@ public class DataSnapshotTest extends AAISetup {
 
         // Add sleep so the file actually gets created with the data
 
-        Set<Path> postSnapshotFiles = Files.walk(Paths.get(logsFolder)).collect(Collectors.toSet());
+        Set<Path> postSnapshotFiles = Files.walk(Path.of(logsFolder)).collect(Collectors.toSet());
 
         assertThat(postSnapshotFiles.size(), is(preSnapshotFiles.size() +1));
         postSnapshotFiles.removeAll(preSnapshotFiles);
@@ -165,7 +164,7 @@ public class DataSnapshotTest extends AAISetup {
 
         String logsFolder = System.getProperty("AJSC_HOME") + "/logs/data/dataSnapshots/";
 
-        Set<Path> preSnapshotFiles = Files.walk(Paths.get(logsFolder)).collect(Collectors.toSet());
+        Set<Path> preSnapshotFiles = Files.walk(Path.of(logsFolder)).collect(Collectors.toSet());
 
         // previous test may have the same generated file name, this wait will ensure a new name is used for this test
         System.out.println("delay generation, seconds " + DELAYSINGLETHREADTEST);
@@ -179,7 +178,7 @@ public class DataSnapshotTest extends AAISetup {
 
         // Add sleep so the file actually gets created with the data
 
-        Set<Path> postSnapshotFiles = Files.walk(Paths.get(logsFolder)).collect(Collectors.toSet());
+        Set<Path> postSnapshotFiles = Files.walk(Path.of(logsFolder)).collect(Collectors.toSet());
 
         assertThat(postSnapshotFiles.size(), is(preSnapshotFiles.size() +1));
         boolean gryoSnapshotExists = postSnapshotFiles.stream()
index 7682cdb..5086861 100644 (file)
@@ -45,7 +45,6 @@ import java.io.File;
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
-import java.nio.file.Paths;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -144,7 +143,7 @@ public class DataSnapshotTest4HistInit extends AAISetup {
 
         String logsFolder     = System.getProperty("AJSC_HOME") + "/logs/data/dataSnapshots/";
 
-        Set<Path> preSnapshotFiles = Files.walk(Paths.get(logsFolder)).collect(Collectors.toSet());
+        Set<Path> preSnapshotFiles = Files.walk(Path.of(logsFolder)).collect(Collectors.toSet());
 
         // Run the clear dataSnapshot and this time it should fail
         //String [] args = {"JUST_TAKE_SNAPSHOT"};  >> default behavior is now to use 15 threads
@@ -155,7 +154,7 @@ public class DataSnapshotTest4HistInit extends AAISetup {
 
         // Add sleep so the file actually gets created with the data
 
-        Set<Path> postSnapshotFiles = Files.walk(Paths.get(logsFolder)).collect(Collectors.toSet());
+        Set<Path> postSnapshotFiles = Files.walk(Path.of(logsFolder)).collect(Collectors.toSet());
 
         assertThat(postSnapshotFiles.size(), is(preSnapshotFiles.size()+1));
         postSnapshotFiles.removeAll(preSnapshotFiles);
index ea7bf86..30e14d6 100644 (file)
@@ -170,8 +170,8 @@ public class VertexMergeTest extends AAISetup {
                assertEquals(true, g.V().has("hostname", "TEST1").both().has("interface-name", "p-interface2").has("special-prop", "value").hasNext(), "pserver skeleton child merged");
                assertEquals(true, g.V().has("hostname", "TEST1").both().has("interface-name", "p-interface2").both().has("interface-name", "l-interface1").has("special-prop", "value").hasNext(), "l-interface child merged");
                assertEquals(true, g.V().has("hostname", "TEST1").both().has("interface-name", "p-interface2").both().has("interface-name", "l-interface1").both().has("link-name", "logical-link1").hasNext(), "l-interface child cousin edge merged");
-               assertEquals(new Long(1), g.V().has("interface-name", "l-interface1").count().next(), "one l-interface1 found");
-               assertEquals(new Long(1), g.V().has("interface-name", "p-interface2").count().next(), "one p-interface2 found");
+               assertEquals(Long.valueOf(1), g.V().has("interface-name", "l-interface1").count().next(), "one l-interface1 found");
+               assertEquals(Long.valueOf(1), g.V().has("interface-name", "p-interface2").count().next(), "one p-interface2 found");
 
        }
 }
index 028cc22..4b8dd77 100644 (file)
@@ -105,7 +105,7 @@ public class MigrateINVPhysicalInventoryTest extends AAISetup {
        @Test
        public void pnfsExistTest() throws Exception {
                // check if pnf node gets created
-               assertEquals(new Long(2L),
+               assertEquals(Long.valueOf(2L),
                                g.V().has("aai-node-type", "pnf")
                                                .count().next(),
                                "2 PNFs exist");
@@ -114,7 +114,7 @@ public class MigrateINVPhysicalInventoryTest extends AAISetup {
        @Test
        public void pInterfacesExistTest() throws Exception {
 
-               assertEquals(new Long(4L),
+               assertEquals(Long.valueOf(4L),
                                g.V().has("aai-node-type", "p-interface")
                                                .count().next(),
                                "4 Pinterfaces exist");
@@ -145,7 +145,7 @@ public class MigrateINVPhysicalInventoryTest extends AAISetup {
                                .has("interface-name","1.7")
                                .hasNext(),
                                "p-interface 1.7 created for pnf-name-collector-1");
-               assertEquals(new Long(2L),
+               assertEquals(Long.valueOf(2L),
                                g.V().has("aai-node-type", "pnf")
                                .has("pnf-name", "pnf-name-1")
                                .in("tosca.relationships.network.BindsTo").count().next(),
index 74b9e0f..9765ce5 100644 (file)
@@ -288,7 +288,7 @@ public class MigrateModelVerTest extends AAISetup{
                                                .has("aai-node-type", "model-ver").has("model-version-id","model-version-id-1").hasNext(),
                                "Edge not created");
 
-               assertEquals(new Long(2L),
+               assertEquals(Long.valueOf(2L),
                                g.V().has("aai-node-type", "model-ver").has("model-version-id", "model-version-id-1")
                                                .in().count().next(),
                                "Edge exists to 2 connectors");
@@ -308,7 +308,7 @@ public class MigrateModelVerTest extends AAISetup{
                                                .has("aai-node-type", "model-ver").has("model-version-id","model-version-id-2").hasNext(),
                                "Edge not created");
 
-               assertEquals(new Long(2L),
+               assertEquals(Long.valueOf(2L),
                                g.V().has("aai-node-type", "model-ver").has("model-version-id", "model-version-id-2")
                                                .in().count().next(),
                                "Edge exists to only 2 service-instances");
@@ -327,7 +327,7 @@ public class MigrateModelVerTest extends AAISetup{
                                                .has("aai-node-type", "model-ver").has("model-version-id","model-version-id-3").hasNext(),
                                "Edge not created");
 
-               assertEquals(new Long(2L),
+               assertEquals(Long.valueOf(2L),
                                g.V().has("aai-node-type", "model-ver").has("model-version-id", "model-version-id-3")
                                                .in().count().next(),
                                "Edge exists to only 2 pnfs");
@@ -346,7 +346,7 @@ public class MigrateModelVerTest extends AAISetup{
                                                .has("aai-node-type", "model-ver").has("model-version-id","model-version-id-4").hasNext(),
                                "Edge not created");
 
-               assertEquals(new Long(2L),
+               assertEquals(Long.valueOf(2L),
                                g.V().has("aai-node-type", "model-ver").has("model-version-id", "model-version-id-4")
                                                .in().count().next(),
                                "Edge exists to only 2 logical-link");
@@ -365,7 +365,7 @@ public class MigrateModelVerTest extends AAISetup{
                                                .has("aai-node-type", "model-ver").has("model-version-id","model-version-id-5").hasNext(),
                                "Edge not created");
 
-               assertEquals(new Long(2L),
+               assertEquals(Long.valueOf(2L),
                                g.V().has("aai-node-type", "model-ver").has("model-version-id", "model-version-id-5")
                                                .in().count().next(),
                                "Edge exists to only 2 logical-link");
@@ -384,7 +384,7 @@ public class MigrateModelVerTest extends AAISetup{
                                                .has("aai-node-type", "model-ver").has("model-version-id","model-version-id-6").hasNext(),
                                "Edge not created");
 
-               assertEquals(new Long(2L),
+               assertEquals(Long.valueOf(2L),
                                g.V().has("aai-node-type", "model-ver").has("model-version-id", "model-version-id-6")
                                                .in().count().next(),
                                "Edge exists to only 2 generic-vnfs");
@@ -403,7 +403,7 @@ public class MigrateModelVerTest extends AAISetup{
                                                .has("aai-node-type", "model-ver").has("model-version-id","model-version-id-7").hasNext(),
                                "Edge not created");
 
-               assertEquals(new Long(2L),
+               assertEquals(Long.valueOf(2L),
                                g.V().has("aai-node-type", "model-ver").has("model-version-id", "model-version-id-7")
                                                .in().count().next(),
                                "Edge exists to only 2 configurations");
@@ -422,7 +422,7 @@ public class MigrateModelVerTest extends AAISetup{
                                                .has("aai-node-type", "model-ver").has("model-version-id","model-version-id-8").hasNext(),
                                "Edge not created");
 
-               assertEquals(new Long(2L),
+               assertEquals(Long.valueOf(2L),
                                g.V().has("aai-node-type", "model-ver").has("model-version-id", "model-version-id-8")
                                                .in().count().next(),
                                "Edge exists to only 2 l3-networks");
@@ -441,7 +441,7 @@ public class MigrateModelVerTest extends AAISetup{
                                                .has("aai-node-type", "model-ver").has("model-version-id","model-version-id-9").hasNext(),
                                "Edge not created");
 
-               assertEquals(new Long(2L),
+               assertEquals(Long.valueOf(2L),
                                g.V().has("aai-node-type", "model-ver").has("model-version-id", "model-version-id-9")
                                                .in().count().next(),
                                "Edge exists to only 2 vf-modules");
@@ -460,7 +460,7 @@ public class MigrateModelVerTest extends AAISetup{
                                                .has("aai-node-type", "model-ver").has("model-version-id","model-version-id-10").hasNext(),
                                "Edge not created");
 
-               assertEquals(new Long(2L),
+               assertEquals(Long.valueOf(2L),
                                g.V().has("aai-node-type", "model-ver").has("model-version-id", "model-version-id-10")
                                                .in().count().next(),
                                "Edge exists to only 2 collections");
@@ -479,7 +479,7 @@ public class MigrateModelVerTest extends AAISetup{
                                                .has("aai-node-type", "model-ver").has("model-version-id","model-version-id-11").hasNext(),
                                "Edge not created");
 
-               assertEquals(new Long(2L),
+               assertEquals(Long.valueOf(2L),
                                g.V().has("aai-node-type", "model-ver").has("model-version-id", "model-version-id-11")
                                                .in().count().next(),
                                "Edge exists to only 2 instance-group2");
@@ -498,7 +498,7 @@ public class MigrateModelVerTest extends AAISetup{
                                                .has("aai-node-type", "model-ver").has("model-version-id","model-version-id-12").hasNext(),
                                "Edge not created");
 
-               assertEquals(new Long(2L),
+               assertEquals(Long.valueOf(2L),
                                g.V().has("aai-node-type", "model-ver").has("model-version-id", "model-version-id-12")
                                                .in().count().next(),
                                "Edge exists to only 2 allotted-resource");
index 72ed591..fd9eb15 100644 (file)
@@ -130,7 +130,7 @@ public class MigrateNetworkTechToCloudRegionTest extends AAISetup{
                                "Edge not created");
                
                
-               assertEquals(new Long(2L),
+               assertEquals(Long.valueOf(2L),
                                g.V().has("aai-node-type", "network-technology").has("network-technology-id", "network-technology-1")
                                                .in().count().next(),
                                "Edge exists to 2 cloud regions");
index 99f2509..4638b84 100644 (file)
@@ -964,7 +964,7 @@ public class MigrateSameSourcedRCTROPServerDataTest extends AAISetup{
        assertEquals(true, g.V().has("aai-node-type", "p-interface").has("aai-uri","/cloud-infrastructure/pservers/pserver/rctP3/p-interfaces/p-interface/pint11").hasNext());
        
        //2. pint12 int-name matches with pint31. So, verify that p-int does not move from rctP1 to rctP3
-       assertEquals(new Long(1L), g.V().has("aai-node-type", "pserver").has("hostname","rctP3").in("tosca.relationships.network.BindsTo")
+       assertEquals(Long.valueOf(1L), g.V().has("aai-node-type", "pserver").has("hostname","rctP3").in("tosca.relationships.network.BindsTo")
                        .has("aai-node-type","p-interface").has("interface-name","pint12").count().next(), "rctP3 has only 1 pint with name pint12");
        
        //3. Verify that the p-interface from pserver is not moved to another pserver that has null fqdn
@@ -974,7 +974,7 @@ public class MigrateSameSourcedRCTROPServerDataTest extends AAISetup{
        //4. If the fqdn is "" within 2 RCT pservers, ignore that case. Don't move the p-int from old resource-version to new resource-version pserver
        assertEquals(false, g.V().has("aai-node-type", "pserver").has("hostname","rctP5").in("tosca.relationships.network.BindsTo")
                        .has("aai-node-type","p-interface").has("interface-name","pint41").hasNext());
-       assertEquals(new Long(1L), g.V().has("aai-node-type", "pserver").has("hostname","rctP5").in("tosca.relationships.network.BindsTo")
+       assertEquals(Long.valueOf(1L), g.V().has("aai-node-type", "pserver").has("hostname","rctP5").in("tosca.relationships.network.BindsTo")
                        .has("aai-node-type","p-interface").count().next(), "rctP5 has only 1 p-interface");            
        
        //5. plink is moved from pint3 on pserver fqdn1 to pint2 on pserver fqdn3. Both p-ints have the same interface-name
@@ -1001,7 +1001,7 @@ public class MigrateSameSourcedRCTROPServerDataTest extends AAISetup{
 
        
        //2. lagint12 int-name matches with lagint31. So, verify that lag-int does not move from rctP1 to rctP3
-       assertEquals(new Long(1L), g.V().has("aai-node-type", "pserver").has("hostname","rctP3").in("tosca.relationships.network.BindsTo")
+       assertEquals(Long.valueOf(1L), g.V().has("aai-node-type", "pserver").has("hostname","rctP3").in("tosca.relationships.network.BindsTo")
                        .has("aai-node-type","lag-interface").has("interface-name","lagint12").count().next(), "rctP3 has only 1 lag-interface with name lagint12");
        
     }
@@ -1009,7 +1009,7 @@ public class MigrateSameSourcedRCTROPServerDataTest extends AAISetup{
     @Test
     public void checkRCTPserverHasRelnToOnly1Zone() throws Exception {
 
-               assertEquals(new Long(1L), g.V().has("aai-node-type", "pserver").has("hostname","Scn6.pserverRCT1Scn6").out("org.onap.relationships.inventory.LocatedIn")
+               assertEquals(Long.valueOf(1L), g.V().has("aai-node-type", "pserver").has("hostname","Scn6.pserverRCT1Scn6").out("org.onap.relationships.inventory.LocatedIn")
                 .has("aai-node-type","zone").count().next(), "Edge to only 1 Zone exists");
                assertEquals(true, g.V().has("aai-node-type", "zone").has("zone-id","zone-62").hasNext());
                //Verify no edge exists from zone61 to lower resource-version RCT pserver
@@ -1019,7 +1019,7 @@ public class MigrateSameSourcedRCTROPServerDataTest extends AAISetup{
     @Test
     public void checkRCTPserverHasRelnTo2GenericVnfs() throws Exception {
 
-               assertEquals(new Long(2L), g.V().has("aai-node-type", "pserver").has("hostname","Scn6.pserverRCT1Scn6").in("tosca.relationships.HostedOn")
+               assertEquals(Long.valueOf(2L), g.V().has("aai-node-type", "pserver").has("hostname","Scn6.pserverRCT1Scn6").in("tosca.relationships.HostedOn")
                 .has("aai-node-type","generic-vnf").count().next(), "Edge to 2 generic-vnfs exists");
                assertEquals(true, g.V().has("aai-node-type", "generic-vnf").has("vnf-id","vnf-1").out().has("aai-node-type", "pserver").has("hostname", "Scn6.pserverRCT1Scn6").hasNext());
                //Verify no edge exists from vnf-1 to lower resource-version pserver
@@ -1036,7 +1036,7 @@ public class MigrateSameSourcedRCTROPServerDataTest extends AAISetup{
        assertEquals(true, g.V().has("aai-node-type", "pserver").has("hostname","pserverRo.NewOne.aaaa.ccccccccccc").in("tosca.relationships.network.BindsTo")
                        .has("aai-node-type","p-interface").has("interface-name","pintRo1").out().has("link-name","plinkROonOldRo1").hasNext());
        //Verify complex does not get attached to pserverRO5
-       assertEquals(new Long(1L), g.V().has("physical-location-id", "complexOldRO").in("org.onap.relationships.inventory.LocatedIn").count().next(), "Complex is related to only 1 pserver");
+       assertEquals(Long.valueOf(1L), g.V().has("physical-location-id", "complexOldRO").in("org.onap.relationships.inventory.LocatedIn").count().next(), "Complex is related to only 1 pserver");
     }
     
     @Test
index 27d8ff2..40052b8 100644 (file)
@@ -414,7 +414,7 @@ public class  PserverDedupWithDifferentSourcesOfTruthTest extends AAISetup{
         assertEquals("Scn4.pserverROSPlinkScn4",pserverRCTPlinkScn4.property("fqdn").value().toString());
         assertEquals(true, g.V().has("aai-node-type", "pserver").has("hostname","pserverRCTPlinkScn4").in("tosca.relationships.network.BindsTo")
                        .has("aai-node-type","p-interface").has("interface-name","pintPlinkScn4").hasNext());
-        assertEquals(new Long(1L), g.V().has("aai-node-type", "pserver").has("hostname","pserverRCTPlinkScn4").in("tosca.relationships.network.BindsTo")
+        assertEquals(Long.valueOf(1L), g.V().has("aai-node-type", "pserver").has("hostname","pserverRCTPlinkScn4").in("tosca.relationships.network.BindsTo")
                        .has("aai-node-type","p-interface").has("interface-name","pintPlinkScn4").count().next(), "only 1 p-int is present on RCT pserver");
         assertEquals("/cloud-infrastructure/pservers/pserver/pserverRCTPlinkScn4/p-interfaces/p-interface/pintPlinkScn4", samePintScn4RCT.property("aai-uri").value().toString());
         //plink is not  moved from RO to RCT when p-int matches
@@ -441,14 +441,14 @@ public class  PserverDedupWithDifferentSourcesOfTruthTest extends AAISetup{
     @Test
     public void checkRCTPserverHasRelnToOnly1Complex() throws Exception {
 
-               assertEquals(new Long(1L), g.V().has("aai-node-type", "pserver").has("hostname","pserverRCTScn3").out("org.onap.relationships.inventory.LocatedIn")
+               assertEquals(Long.valueOf(1L), g.V().has("aai-node-type", "pserver").has("hostname","pserverRCTScn3").out("org.onap.relationships.inventory.LocatedIn")
                 .has("aai-node-type","complex").count().next(), "Edge to only 1 complex exists");
     }
     
     @Test
     public void checkRCTPserverHasRelnToOnly1Zone() throws Exception {
 
-               assertEquals(new Long(1L), g.V().has("aai-node-type", "pserver").has("hostname","pserverRCTScn6").out("org.onap.relationships.inventory.LocatedIn")
+               assertEquals(Long.valueOf(1L), g.V().has("aai-node-type", "pserver").has("hostname","pserverRCTScn6").out("org.onap.relationships.inventory.LocatedIn")
                 .has("aai-node-type","zone").count().next(), "Edge to only 1 Zone exists");
                assertEquals(true, g.V().has("aai-node-type", "zone").has("zone-id","zone-62").hasNext());
                //Verify no edge exists from zone62 to RO pserver
@@ -459,7 +459,7 @@ public class  PserverDedupWithDifferentSourcesOfTruthTest extends AAISetup{
     @Test
     public void checkRCTPserverHasRelnTo2GenericVnfs() throws Exception {
 
-               assertEquals(new Long(2L), g.V().has("aai-node-type", "pserver").has("hostname","pserverRCTScn6").in("tosca.relationships.HostedOn")
+               assertEquals(Long.valueOf(2L), g.V().has("aai-node-type", "pserver").has("hostname","pserverRCTScn6").in("tosca.relationships.HostedOn")
                 .has("aai-node-type","generic-vnf").count().next(), "Edge to 2 generic-vnfs exists");
                assertEquals(true, g.V().has("aai-node-type", "generic-vnf").has("vnf-id","vnf-2").out().has("aai-node-type", "pserver").has("hostname", "pserverRCTScn6").hasNext());
                //Verify no edge exists from zone62 to RO pserver
@@ -485,7 +485,7 @@ public class  PserverDedupWithDifferentSourcesOfTruthTest extends AAISetup{
 
        
        //2. lagint12 int-name matches with lagint31. So, verify that lag-int does not move from rctP1 to rctP3
-       assertEquals(new Long(1L), g.V().has("aai-node-type", "pserver").has("hostname","rctP1").in("tosca.relationships.network.BindsTo")
+       assertEquals(Long.valueOf(1L), g.V().has("aai-node-type", "pserver").has("hostname","rctP1").in("tosca.relationships.network.BindsTo")
                        .has("aai-node-type","lag-interface").has("interface-name","lagint12").count().next(), "rctP1 has only 1 lag-interface with name lagint12");
        
     }
index af6ba46..2d98d37 100644 (file)
@@ -21,7 +21,7 @@ package org.onap.aai.rest.util;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
-import static org.mockito.ArgumentMatchers.anyObject;
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
@@ -32,12 +32,12 @@ import java.util.List;
 import java.util.Set;
 import java.util.UUID;
 
-import javax.ws.rs.core.HttpHeaders;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedHashMap;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.UriInfo;
+import jakarta.ws.rs.core.HttpHeaders;
+import jakarta.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.MultivaluedHashMap;
+import jakarta.ws.rs.core.MultivaluedMap;
+import jakarta.ws.rs.core.Response;
+import jakarta.ws.rs.core.UriInfo;
 
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
@@ -112,7 +112,7 @@ public class EchoResponseTest extends AAISetup {
         when(uriInfo.getQueryParameters(false)).thenReturn(queryParameters);
 
         // TODO - Check if this is valid since RemoveDME2QueryParameters seems to be very unreasonable
-        Mockito.doReturn(null).when(queryParameters).remove(anyObject());
+        Mockito.doReturn(null).when(queryParameters).remove(any());
 
         when(httpHeaders.getMediaType()).thenReturn(APPLICATION_JSON);
     }
index b7bb9c4..deed477 100644 (file)
@@ -90,15 +90,17 @@ public class ManageSchemaTest extends AAISetup {
        @Test
        public void addNewIndex() throws JsonParseException, JsonMappingException, IOException {
                ObjectMapper mapper = new ObjectMapper();
-               String content = " {\r\n" +
-                               "    \"name\" : \"equipment-name\",\r\n" +
-                               "    \"unique\" : false,\r\n" +
-                               "    \"properties\" : [ {\r\n" +
-                               "      \"name\" : \"equipment-name\",\r\n" +
-                               "      \"cardinality\" : \"SINGLE\",\r\n" +
-                               "      \"typeClass\" : \"java.lang.String\"\r\n" +
-                               "    } ]\r\n" +
-                               "  }";
+               String content = """
+                                {\r
+                                   "name" : "equipment-name",\r
+                                   "unique" : false,\r
+                                   "properties" : [ {\r
+                                     "name" : "equipment-name",\r
+                                     "cardinality" : "SINGLE",\r
+                                     "typeClass" : "java.lang.String"\r
+                                   } ]\r
+                                 }\
+                               """;
                DBIndex index = mapper.readValue(content, DBIndex.class);
                ManageJanusGraphSchema schema = new ManageJanusGraphSchema(graph, auditorFactory, schemaVersions, edgeIngestor);
                JanusGraphManagement mgmt = graph.openManagement();
index fa9980a..526e4a3 100644 (file)
@@ -38,7 +38,7 @@ import org.onap.aai.migration.EventAction;
 
 import java.io.IOException;
 import java.nio.file.Files;
-import java.nio.file.Paths;
+import java.nio.file.Path;
 import java.nio.file.StandardOpenOption;
 import java.util.concurrent.atomic.AtomicBoolean;
 
@@ -103,25 +103,25 @@ public class SendDeleteMigrationNotificationsTest extends AAISetup {
                        tx.commit();
                        
                        try{
-                               Files.createFile(Paths.get(FILE));
+                               Files.createFile(Path.of(FILE));
                        }catch(Exception e) {
                                System.out.println("Create File error : " + e.getMessage());
                        }
                        String finalStr = "";
                        finalStr = "pserver" + "#@#" + "/cloud-infrastructure/pservers/pserver/"+SendDeleteMigrationNotifications.class.getSimpleName()+"-pserver-1" + "#@#" + "{\"hostname\":\""+ SendDeleteMigrationNotifications.class.getSimpleName()+"-pserver-1\",\"resource-version\":\"333\"}" + "\n";
-                       Files.write(Paths.get(FILE), finalStr.getBytes(),StandardOpenOption.APPEND);
+                       Files.write(Path.of(FILE), finalStr.getBytes(),StandardOpenOption.APPEND);
                        finalStr = "pserver" + "#@#" + "/cloud-infrastructure/pservers/pserver/"+SendDeleteMigrationNotifications.class.getSimpleName()+"-pserver-2" + "#@#" + "{\"hostname\":\""+ SendDeleteMigrationNotifications.class.getSimpleName()+"-pserver-2\",\"resource-version\":\"334\"}" + "\n";
-                       Files.write(Paths.get(FILE), finalStr.getBytes(),StandardOpenOption.APPEND);
+                       Files.write(Path.of(FILE), finalStr.getBytes(),StandardOpenOption.APPEND);
                        finalStr = "pserver" + "#@#" + "/cloud-infrastructure/pservers/pserver/"+SendDeleteMigrationNotifications.class.getSimpleName()+"-pserver-3" + "#@#" + "{\"hostname\":\""+ SendDeleteMigrationNotifications.class.getSimpleName()+"-pserver-3\",\"resource-version\":\"335\"}" + "\n";
-                       Files.write(Paths.get(FILE), finalStr.getBytes(),StandardOpenOption.APPEND);
+                       Files.write(Path.of(FILE), finalStr.getBytes(),StandardOpenOption.APPEND);
                        finalStr = "pserver" + "#@#" + "/cloud-infrastructure/pservers/pserver/"+SendDeleteMigrationNotifications.class.getSimpleName()+"-pserver-4" + "#@#" + "{\"hostname\":\""+ SendDeleteMigrationNotifications.class.getSimpleName()+"-pserver-4\",\"resource-version\":\"336\"}" + "\n";
-                       Files.write(Paths.get(FILE), finalStr.getBytes(),StandardOpenOption.APPEND);
+                       Files.write(Path.of(FILE), finalStr.getBytes(),StandardOpenOption.APPEND);
                        graphCreated.compareAndSet(false, true);
                }
        }
        @AfterAll
        public static void cleanUp() throws IOException {
-               Files.delete(Paths.get(FILE));
+               Files.delete(Path.of(FILE));
        }
 
        @AfterEach
index dd22e91..4503c0f 100644 (file)
@@ -38,7 +38,7 @@ import org.onap.aai.migration.EventAction;
 
 import java.io.IOException;
 import java.nio.file.Files;
-import java.nio.file.Paths;
+import java.nio.file.Path;
 import java.util.*;
 import java.util.concurrent.atomic.AtomicBoolean;
 
@@ -118,13 +118,13 @@ public class SendMigrationNotificationsTest extends AAISetup {
                        list.add(pnf3.id().toString() + "_222"); // invalid: wrong resource version
                        list.add("345_345"); // invalid
                        list.add(pserver1.id().toString() + "_333"); // valid
-                       Files.write(Paths.get(FILE), (Iterable<String>)list.stream()::iterator);
+                       Files.write(Path.of(FILE), (Iterable<String>)list.stream()::iterator);
                        graphCreated.compareAndSet(false, true);
                }
        }
        @AfterAll
        public static void cleanUp() throws IOException {
-               Files.delete(Paths.get(FILE));
+               Files.delete(Path.of(FILE));
        }
 
        @AfterEach
index f85c97a..40a4156 100644 (file)
@@ -1,7 +1,7 @@
 
 spring.application.name=GraphAdmin
 
-server.contextPath=/
+server.servlet.context-path=/
 spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration
 
 # These two properties represent whether it should use component scan
@@ -31,7 +31,8 @@ server.local.startpath=src/main/resources
 server.basic.auth.location=${server.local.startpath}/etc/auth/realm.properties
 
 server.port=8449
-security.require-ssl=false
+# This property is deprecated: The security auto-configuration is no longer customizable. Provide your own WebSecurityConfigurer bean instead.
+# security.require-ssl=false
 server.ssl.enabled=false
 
 # Schema related attributes for the oxm and edges
@@ -75,7 +76,8 @@ aaf.cadi.file=${server.local.startpath}/cadi.properties
 management.server.port=0
 management.endpoints.enabled-by-default=true
 management.endpoints.web.exposure.include=info, health, loggers, prometheus
-management.metrics.web.server.auto-time-requests=false
+# This property is deprecated: Should be applied at the ObservationRegistry level.
+# management.metrics.web.server.request.autotime.enabled=false
 
 aai.notifications.enabled=false
 
index 4cc770c..85d1d0c 100644 (file)
@@ -4,8 +4,8 @@
 # because they are used in Jenkins, whose plug-in doesn't support
 
 major_version=1
-minor_version=15
-patch_version=6
+minor_version=16
+patch_version=0
 
 base_version=${major_version}.${minor_version}.${patch_version}