diff options
author | Fiete Ostkamp <Fiete.Ostkamp@telekom.de> | 2024-09-21 21:53:49 +0200 |
---|---|---|
committer | Fiete Ostkamp <Fiete.Ostkamp@telekom.de> | 2024-09-22 18:18:29 +0200 |
commit | 51415ac5eb5c77809dc5eac5f50b5728b7dfd977 (patch) | |
tree | e0a37e7ac051a2f14cde4773a76382c4ad832bbd /aai-traversal/src/main/java | |
parent | bd91c546bf3089dff3c04fb096c9e2de58b1a6b6 (diff) |
Migrate JAXB to jakarta
- change javax.* JAXB packages to jakarta.*
- bump snapshot version to 1.15.0-SNAPSHOT
Issue-ID: AAI-4005
Change-Id: I5bf2735c5ef53c9162a56f6b5f78e02992a0e2a0
Signed-off-by: Fiete Ostkamp <Fiete.Ostkamp@telekom.de>
Diffstat (limited to 'aai-traversal/src/main/java')
4 files changed, 10 insertions, 11 deletions
diff --git a/aai-traversal/src/main/java/org/onap/aai/dbgraphgen/ModelBasedProcessing.java b/aai-traversal/src/main/java/org/onap/aai/dbgraphgen/ModelBasedProcessing.java index 005d3dc..f262ac4 100644 --- a/aai-traversal/src/main/java/org/onap/aai/dbgraphgen/ModelBasedProcessing.java +++ b/aai-traversal/src/main/java/org/onap/aai/dbgraphgen/ModelBasedProcessing.java @@ -269,7 +269,7 @@ public class ModelBasedProcessing { try { Optional<Vertex> result = dbMethHelper.searchVertexByIdentityMap(modTopNodeType, startNodeFilterArrayOfHashes.get(i)); - if (!result.isPresent()) { + if (result.isEmpty()) { throw new AAIException("AAI_6114", "No Node of type " + modTopNodeType + " found for properties"); } @@ -710,7 +710,7 @@ public class ModelBasedProcessing { Optional<Vertex> result = dbMethHelper.searchVertexByIdentityMap(topNodeTypeVal, startNodeFilterHash); - if (!result.isPresent()) { + if (result.isEmpty()) { throw new AAIException("AAI_6114", "No Node of type " + topNodeTypeVal + " found for properties"); } @@ -741,7 +741,7 @@ public class ModelBasedProcessing { } Optional<Vertex> result = dbMethHelper.locateUniqueVertex(widgModNodeType, startNodeFilterHash); - if (!result.isPresent()) { + if (result.isEmpty()) { throw new AAIException("AAI_6114", "No Node of type " + topNType + " found for properties"); } @@ -794,7 +794,7 @@ public class ModelBasedProcessing { // Locate the starting node that we'll use to start looking for instance data Optional<Vertex> result = dbMethHelper.searchVertexByIdentityMap(topNType, startNodeFilterHash); - if (!result.isPresent()) { + if (result.isEmpty()) { throw new AAIException("AAI_6114", "No Node of type " + topNType + " found for properties"); } @@ -2093,7 +2093,7 @@ public class ModelBasedProcessing { propHash.put(targetProp, valFromInstance); Optional<Vertex> result = dbMethHelper.locateUniqueVertex(targetNodeType, propHash); - if (!result.isPresent()) { + if (result.isEmpty()) { // If it can't find the lookup node, don't fail, just log that it couldn't be found // --- logger.debug("WARNING - Could not find lookup node that corresponds to nodeType [" diff --git a/aai-traversal/src/main/java/org/onap/aai/rest/CQ2GremlinTest.java b/aai-traversal/src/main/java/org/onap/aai/rest/CQ2GremlinTest.java index bade2cd..76da9d8 100644 --- a/aai-traversal/src/main/java/org/onap/aai/rest/CQ2GremlinTest.java +++ b/aai-traversal/src/main/java/org/onap/aai/rest/CQ2GremlinTest.java @@ -204,7 +204,7 @@ public class CQ2GremlinTest extends RESTAPI { protected void addStartNode(GraphTraversal<Vertex, Vertex> g, CustomQueryTestDTO content) { Optional<LinkedHashMap<String, String>> startNodeVertex = content.getVerticesDtos().stream() .filter(map -> map.containsKey("start-node")).findFirst(); - if (!startNodeVertex.isPresent()) { + if (startNodeVertex.isEmpty()) { throw new IllegalArgumentException("start-node was not specified"); } startNodeVertex.get().forEach((k, v) -> { diff --git a/aai-traversal/src/main/java/org/onap/aai/rest/search/LocalCQConfig.java b/aai-traversal/src/main/java/org/onap/aai/rest/search/LocalCQConfig.java index ebf49d7..ad5eb4e 100644 --- a/aai-traversal/src/main/java/org/onap/aai/rest/search/LocalCQConfig.java +++ b/aai-traversal/src/main/java/org/onap/aai/rest/search/LocalCQConfig.java @@ -25,7 +25,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.Date; import java.util.Timer; import java.util.TimerTask; @@ -56,7 +55,7 @@ public class LocalCQConfig extends CQConfig { String filepath = storedQueriesLocation + AAIConstants.AAI_FILESEP + "stored-queries.json"; logger.info("Using the Local stored queries"); - Path path = Paths.get(filepath); + Path path = Path.of(filepath); String customQueryConfigJson = new String(Files.readAllBytes(path)); queryConfig = new GetCustomQueryConfig(customQueryConfigJson); @@ -72,7 +71,7 @@ public class LocalCQConfig extends CQConfig { protected void onChange(File file) { try { String filepath = storedQueriesLocation; - Path path = Paths.get(filepath); + Path path = Path.of(filepath); String customQueryConfigJson = new String(Files.readAllBytes(path)); queryConfig = new GetCustomQueryConfig(customQueryConfigJson); diff --git a/aai-traversal/src/main/java/org/onap/aai/service/AuthorizationService.java b/aai-traversal/src/main/java/org/onap/aai/service/AuthorizationService.java index 10bee2b..c291551 100644 --- a/aai-traversal/src/main/java/org/onap/aai/service/AuthorizationService.java +++ b/aai-traversal/src/main/java/org/onap/aai/service/AuthorizationService.java @@ -22,7 +22,7 @@ package org.onap.aai.service; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.nio.file.Files; -import java.nio.file.Paths; +import java.nio.file.Path; import java.util.Base64; import java.util.HashMap; import java.util.Map; @@ -53,7 +53,7 @@ public class AuthorizationService { String basicAuthFile = getBasicAuthFilePath(); - try (Stream<String> stream = Files.lines(Paths.get(basicAuthFile))) { + try (Stream<String> stream = Files.lines(Path.of(basicAuthFile))) { stream.filter(line -> !line.startsWith("#")).forEach(str -> { byte[] bytes = null; |