From 8e778b6ca74e1ca22ff4380b5cd9dacfd90b68b6 Mon Sep 17 00:00:00 2001 From: Fiete Ostkamp Date: Fri, 12 Jan 2024 14:01:07 +0100 Subject: Update aai-common dependency to 1.13.1 in traversal - contains HttpEntry request-scope fix - updates jackson - updates antlr4 - disable tracing in tests Issue-ID: AAI-3728 Change-Id: I58f834a4d52284184a410a1e81f10ac12b3e6221 Signed-off-by: Fiete Ostkamp --- .../java/org/onap/aai/dbgraphmap/SearchGraph.java | 2 -- .../main/java/org/onap/aai/rest/DslConsumer.java | 25 +++++++++++----------- .../onap/aai/rest/search/NodeQueryProcessor.java | 3 +-- .../java/org/onap/aai/rest/util/EchoResponse.java | 2 +- .../src/test/resources/application-test.properties | 3 +++ 5 files changed, 18 insertions(+), 17 deletions(-) (limited to 'aai-traversal/src') diff --git a/aai-traversal/src/main/java/org/onap/aai/dbgraphmap/SearchGraph.java b/aai-traversal/src/main/java/org/onap/aai/dbgraphmap/SearchGraph.java index 8e925a5..23e82e5 100644 --- a/aai-traversal/src/main/java/org/onap/aai/dbgraphmap/SearchGraph.java +++ b/aai-traversal/src/main/java/org/onap/aai/dbgraphmap/SearchGraph.java @@ -22,8 +22,6 @@ package org.onap.aai.dbgraphmap; import com.google.common.base.CaseFormat; import com.google.common.collect.Multimap; -import edu.emory.mathcs.backport.java.util.Collections; - import java.io.UnsupportedEncodingException; import java.net.URI; import java.util.*; diff --git a/aai-traversal/src/main/java/org/onap/aai/rest/DslConsumer.java b/aai-traversal/src/main/java/org/onap/aai/rest/DslConsumer.java index 2a02ff5..7c1411e 100644 --- a/aai-traversal/src/main/java/org/onap/aai/rest/DslConsumer.java +++ b/aai-traversal/src/main/java/org/onap/aai/rest/DslConsumer.java @@ -61,6 +61,7 @@ import org.onap.aai.util.TraversalConstants; 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.HttpHeaders; import org.springframework.http.MediaType; @@ -88,7 +89,7 @@ public class DslConsumer extends TraversalConsumer { private static final QueryProcessorType processorType = QueryProcessorType.LOCAL_GROOVY; private static final QueryVersion DEFAULT_VERSION = QueryVersion.V1; - private final HttpEntry traversalUriHttpEntry; + private final HttpEntry httpEntry; private final SchemaVersions schemaVersions; private final String basePath; private final GremlinServerSingleton gremlinServerSingleton; @@ -100,12 +101,12 @@ public class DslConsumer extends TraversalConsumer { private QueryVersion dslApiVersion = DEFAULT_VERSION; @Autowired - public DslConsumer(HttpEntry traversalUriHttpEntry, + public DslConsumer(@Qualifier("requestScopedTraversalUriHttpEntry") HttpEntry requestScopedTraversalUriHttpEntry, SchemaVersions schemaVersions, GremlinServerSingleton gremlinServerSingleton, XmlFormatTransformer xmlFormatTransformer, EdgeIngestor edgeIngestor, LoaderFactory loaderFactory, @Value("${schema.uri.base.path}") String basePath) { - this.traversalUriHttpEntry = traversalUriHttpEntry; + this.httpEntry = requestScopedTraversalUriHttpEntry; this.schemaVersions = schemaVersions; this.gremlinServerSingleton = gremlinServerSingleton; this.xmlFormatTransformer = xmlFormatTransformer; @@ -161,10 +162,10 @@ public class DslConsumer extends TraversalConsumer { result = xmlFormatTransformer.transform(result); } - if (traversalUriHttpEntry.isPaginated()) { + if (httpEntry.isPaginated()) { return ResponseEntity.ok() - .header("total-results", String.valueOf(traversalUriHttpEntry.getTotalVertices())) - .header("total-pages", String.valueOf(traversalUriHttpEntry.getTotalPaginationBuckets())) + .header("total-results", String.valueOf(httpEntry.getTotalVertices())) + .header("total-pages", String.valueOf(httpEntry.getTotalPaginationBuckets())) .body(result); } else { return ResponseEntity.ok(result); @@ -177,8 +178,8 @@ public class DslConsumer extends TraversalConsumer { throws AAIException, FileNotFoundException { final String serverBase = req.getRequestURL().toString().replaceAll("/(v[0-9]+|latest)/.*", "/"); - traversalUriHttpEntry.setHttpEntryProperties(version, serverBase); - traversalUriHttpEntry.setPaginationParameters(resultIndex, resultSize); + httpEntry.setHttpEntryProperties(version, serverBase); + httpEntry.setPaginationParameters(resultIndex, resultSize); JsonObject input = JsonParser.parseString(content).getAsJsonObject(); JsonElement dslElement = input.get("dsl"); @@ -213,7 +214,7 @@ public class DslConsumer extends TraversalConsumer { validateHistoryParams(format, queryParameters); } - final TransactionalGraphEngine dbEngine = traversalUriHttpEntry.getDbEngine(); + final TransactionalGraphEngine dbEngine = httpEntry.getDbEngine(); GraphTraversalSource traversalSource = getTraversalSource(dbEngine, format, queryParameters, roles); @@ -231,15 +232,15 @@ public class DslConsumer extends TraversalConsumer { // Dedup if duplicate objects are returned in each array in the aggregate format // scenario. List vertTempDedupedObjectList = dedupObjectInAggregateFormatResult(vertTemp); - vertices = traversalUriHttpEntry + vertices = httpEntry .getPaginatedVertexListForAggregateFormat(vertTempDedupedObjectList); } else { - vertices = traversalUriHttpEntry.getPaginatedVertexList(vertTemp); + vertices = httpEntry.getPaginatedVertexList(vertTemp); } DBSerializer serializer = new DBSerializer(version, dbEngine, ModelType.MOXY, sourceOfTruth); - FormatFactory ff = new FormatFactory(traversalUriHttpEntry.getLoader(), serializer, + FormatFactory ff = new FormatFactory(httpEntry.getLoader(), serializer, schemaVersions, this.basePath, serverBase); MultivaluedMap mvm = new MultivaluedHashMap<>(); diff --git a/aai-traversal/src/main/java/org/onap/aai/rest/search/NodeQueryProcessor.java b/aai-traversal/src/main/java/org/onap/aai/rest/search/NodeQueryProcessor.java index fc3847e..910102a 100644 --- a/aai-traversal/src/main/java/org/onap/aai/rest/search/NodeQueryProcessor.java +++ b/aai-traversal/src/main/java/org/onap/aai/rest/search/NodeQueryProcessor.java @@ -19,10 +19,9 @@ */ package org.onap.aai.rest.search; -import edu.emory.mathcs.backport.java.util.concurrent.TimeUnit; - import java.io.FileNotFoundException; import java.util.*; +import java.util.concurrent.TimeUnit; import java.util.regex.Pattern; import javax.ws.rs.core.MultivaluedHashMap; diff --git a/aai-traversal/src/main/java/org/onap/aai/rest/util/EchoResponse.java b/aai-traversal/src/main/java/org/onap/aai/rest/util/EchoResponse.java index 5665b86..df677d5 100644 --- a/aai-traversal/src/main/java/org/onap/aai/rest/util/EchoResponse.java +++ b/aai-traversal/src/main/java/org/onap/aai/rest/util/EchoResponse.java @@ -111,7 +111,7 @@ public class EchoResponse extends RESTAPI { try { return Response.status(Status.OK) .entity( - ErrorLogHelper.getRESTAPIInfoResponse(headers.getAcceptableMediaTypes(), exceptionList)) + ErrorLogHelper.getRESTAPIInfoResponse(new ArrayList<>(headers.getAcceptableMediaTypes()), exceptionList)) .build(); } catch (Exception e) { AAIException aaiException = new AAIException("AAI_4000", e); diff --git a/aai-traversal/src/test/resources/application-test.properties b/aai-traversal/src/test/resources/application-test.properties index d77532d..00720c8 100644 --- a/aai-traversal/src/test/resources/application-test.properties +++ b/aai-traversal/src/test/resources/application-test.properties @@ -18,6 +18,9 @@ spring.autoconfigure.exclude=\ spring.jersey.application-path=/ spring.profiles.active=production + +spring.sleuth.enabled=false + #The max number of active threads in this pool server.tomcat.threads.max=200 #The minimum number of threads always kept alive -- cgit 1.2.3-korg