diff options
Diffstat (limited to 'aai-traversal')
6 files changed, 28 insertions, 18 deletions
diff --git a/aai-traversal/pom.xml b/aai-traversal/pom.xml index b2da78a..ef7b2a9 100644 --- a/aai-traversal/pom.xml +++ b/aai-traversal/pom.xml @@ -100,6 +100,7 @@ <spring.test.version>${spring.version}</spring.test.version> <spring.jms.version>${spring.version}</spring.jms.version> <javax.servlet.version>4.0.1</javax.servlet.version> + <antlr.version>4.9.3</antlr.version> <keycloak.version>11.0.2</keycloak.version> <micrometer-spring-legacy.version>1.3.19</micrometer-spring-legacy.version> <micrometer-core.version>1.6.6</micrometer-core.version> @@ -808,6 +809,14 @@ <type>pom</type> <scope>import</scope> </dependency> + <!-- Keeping guava at 19 is necessary here, since the janusgraph-cql driver in version + 2.3 has a dependency on it. Remove this override, once we are using janusgraph > 0.2.3/tinkerpop > 3.2.3 + --> + <dependency> + <groupId>com.google.guava</groupId> + <artifactId>guava</artifactId> + <version>19.0</version> + </dependency> </dependencies> </dependencyManagement> <build> @@ -1010,7 +1019,7 @@ <plugin> <groupId>org.antlr</groupId> <artifactId>antlr4-maven-plugin</artifactId> - <version>4.7.2</version> + <version>${antlr.version}</version> <executions> <execution> <goals> 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); 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 |