summaryrefslogtreecommitdiffstats
path: root/aai-traversal/src/main/java
diff options
context:
space:
mode:
authorFiete Ostkamp <Fiete.Ostkamp@telekom.de>2024-01-12 14:01:07 +0100
committerFiete Ostkamp <Fiete.Ostkamp@telekom.de>2024-01-15 17:25:46 +0100
commit8e778b6ca74e1ca22ff4380b5cd9dacfd90b68b6 (patch)
treedeb2938227b4307a1b9634e59a4fcef0729b98f7 /aai-traversal/src/main/java
parentb9020c089c69337a7057eeb6a967e7c81ae35474 (diff)
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 <Fiete.Ostkamp@telekom.de>
Diffstat (limited to 'aai-traversal/src/main/java')
-rw-r--r--aai-traversal/src/main/java/org/onap/aai/dbgraphmap/SearchGraph.java2
-rw-r--r--aai-traversal/src/main/java/org/onap/aai/rest/DslConsumer.java25
-rw-r--r--aai-traversal/src/main/java/org/onap/aai/rest/search/NodeQueryProcessor.java3
-rw-r--r--aai-traversal/src/main/java/org/onap/aai/rest/util/EchoResponse.java2
4 files changed, 15 insertions, 17 deletions
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<Object> 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<String, String> 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);