summaryrefslogtreecommitdiffstats
path: root/aai-traversal/src/main
diff options
context:
space:
mode:
authorLukasz Rajewski <lukasz.rajewski@t-mobile.pl>2023-12-04 13:48:41 +0000
committerGerrit Code Review <gerrit@onap.org>2023-12-04 13:48:41 +0000
commitd59c2445f0bd8ce8763147acf02d8143df9ca955 (patch)
tree68102ec67c4d2d95b30f6c72d537db1ea23e21b1 /aai-traversal/src/main
parent910089e0fccfe468891ddabcf9f4a866b83c5bed (diff)
parentd63391e88b8f87a169e3468669cd6268014b1da8 (diff)
Merge "Update spring-boot to 2.2"
Diffstat (limited to 'aai-traversal/src/main')
-rw-r--r--aai-traversal/src/main/java/org/onap/aai/TraversalApp.java5
-rw-r--r--aai-traversal/src/main/java/org/onap/aai/TraversalProfiles.java (renamed from aai-traversal/src/main/java/org/onap/aai/Profiles.java)4
-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/interceptors/pre/OneWaySslAuthorization.java4
-rw-r--r--aai-traversal/src/main/java/org/onap/aai/rest/CQ2Gremlin.java6
-rw-r--r--aai-traversal/src/main/java/org/onap/aai/rest/CQ2GremlinTest.java20
-rw-r--r--aai-traversal/src/main/java/org/onap/aai/rest/DslConsumer.java37
-rw-r--r--aai-traversal/src/main/java/org/onap/aai/rest/QueryConsumer.java37
-rw-r--r--aai-traversal/src/main/java/org/onap/aai/rest/RecentAPIConsumer.java17
-rw-r--r--aai-traversal/src/main/java/org/onap/aai/rest/dsl/DslQueryProcessor.java2
-rw-r--r--aai-traversal/src/main/java/org/onap/aai/rest/dsl/v1/DslListener.java2
-rw-r--r--aai-traversal/src/main/java/org/onap/aai/rest/dsl/v2/DslListener.java2
-rw-r--r--aai-traversal/src/main/java/org/onap/aai/rest/search/GetCustomQueryConfig.java11
-rw-r--r--aai-traversal/src/main/java/org/onap/aai/rest/search/GremlinServerSingleton.java2
-rw-r--r--aai-traversal/src/main/java/org/onap/aai/rest/search/ModelAndNamedQueryRestProvider.java6
-rw-r--r--aai-traversal/src/main/java/org/onap/aai/rest/search/SearchProvider.java16
-rw-r--r--aai-traversal/src/main/java/org/onap/aai/rest/security/WebSecurityConfig.java2
-rw-r--r--aai-traversal/src/main/java/org/onap/aai/rest/util/EchoResponse.java2
-rw-r--r--aai-traversal/src/main/java/org/onap/aai/service/AuthorizationService.java4
-rw-r--r--aai-traversal/src/main/java/org/onap/aai/web/JerseyConfiguration.java2
-rw-r--r--aai-traversal/src/main/resources/application.properties6
21 files changed, 123 insertions, 66 deletions
diff --git a/aai-traversal/src/main/java/org/onap/aai/TraversalApp.java b/aai-traversal/src/main/java/org/onap/aai/TraversalApp.java
index 5ac3ff1..14bfca0 100644
--- a/aai-traversal/src/main/java/org/onap/aai/TraversalApp.java
+++ b/aai-traversal/src/main/java/org/onap/aai/TraversalApp.java
@@ -45,6 +45,7 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerA
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.core.env.Environment;
+import org.springframework.core.env.Profiles;
@SpringBootApplication(
exclude = {DataSourceAutoConfiguration.class,
@@ -96,8 +97,8 @@ public class TraversalApp {
logger.debug("Starting AAIGraph connections and the NodeInjestor");
- if (env.acceptsProfiles(Profiles.TWO_WAY_SSL)
- && env.acceptsProfiles(Profiles.ONE_WAY_SSL)) {
+ if (env.acceptsProfiles(Profiles.of(TraversalProfiles.TWO_WAY_SSL))
+ && env.acceptsProfiles(Profiles.of(TraversalProfiles.ONE_WAY_SSL))) {
logger.debug("You have seriously misconfigured your application");
}
diff --git a/aai-traversal/src/main/java/org/onap/aai/Profiles.java b/aai-traversal/src/main/java/org/onap/aai/TraversalProfiles.java
index 0a886af..c1cb6ea 100644
--- a/aai-traversal/src/main/java/org/onap/aai/Profiles.java
+++ b/aai-traversal/src/main/java/org/onap/aai/TraversalProfiles.java
@@ -19,7 +19,7 @@
*/
package org.onap.aai;
-public final class Profiles {
+public final class TraversalProfiles {
public static final String DMAAP = "dmaap";
public static final String DME2 = "dme2";
@@ -31,6 +31,6 @@ public final class Profiles {
public static final String AAF_CERT_AUTHENTICATION = "aaf-cert-auth";
public static final String TWO_WAY_SSL = "two-way-ssl";
- private Profiles() {
+ private TraversalProfiles() {
}
}
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 1dc8ac1..8e925a5 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
@@ -73,7 +73,6 @@ import org.onap.aai.util.GenericQueryBuilder;
import org.onap.aai.util.NodesQueryBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
/**
* Database Mapping class which acts as the middle man between the REST interface objects for the
@@ -90,7 +89,6 @@ public class SearchGraph {
private SchemaVersions schemaVersions;
- @Autowired
public SearchGraph(LoaderFactory loaderFactory, EdgeIngestor edgeIngestor,
SchemaVersions schemaVersions) {
this.loaderFactory = loaderFactory;
diff --git a/aai-traversal/src/main/java/org/onap/aai/interceptors/pre/OneWaySslAuthorization.java b/aai-traversal/src/main/java/org/onap/aai/interceptors/pre/OneWaySslAuthorization.java
index 78ab1a9..4cd6548 100644
--- a/aai-traversal/src/main/java/org/onap/aai/interceptors/pre/OneWaySslAuthorization.java
+++ b/aai-traversal/src/main/java/org/onap/aai/interceptors/pre/OneWaySslAuthorization.java
@@ -31,7 +31,7 @@ import javax.ws.rs.container.PreMatching;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
-import org.onap.aai.Profiles;
+import org.onap.aai.TraversalProfiles;
import org.onap.aai.exceptions.AAIException;
import org.onap.aai.interceptors.AAIContainerFilter;
import org.onap.aai.logging.ErrorLogHelper;
@@ -39,7 +39,7 @@ import org.onap.aai.service.AuthorizationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Profile;
-@Profile(Profiles.ONE_WAY_SSL)
+@Profile(TraversalProfiles.ONE_WAY_SSL)
@PreMatching
@Priority(AAIRequestFilterPriority.AUTHORIZATION)
public class OneWaySslAuthorization extends AAIContainerFilter implements ContainerRequestFilter {
diff --git a/aai-traversal/src/main/java/org/onap/aai/rest/CQ2Gremlin.java b/aai-traversal/src/main/java/org/onap/aai/rest/CQ2Gremlin.java
index 6e76c29..c8f1f0b 100644
--- a/aai-traversal/src/main/java/org/onap/aai/rest/CQ2Gremlin.java
+++ b/aai-traversal/src/main/java/org/onap/aai/rest/CQ2Gremlin.java
@@ -27,7 +27,11 @@ import javax.ws.rs.Consumes;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
-import javax.ws.rs.core.*;
+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.UriInfo;
import org.onap.aai.config.SpringContextAware;
import org.onap.aai.introspection.LoaderFactory;
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 626c5f3..8c6477f 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
@@ -19,10 +19,13 @@
*/
package org.onap.aai.rest;
-import com.beust.jcommander.internal.Lists;
-import com.beust.jcommander.internal.Maps;
-
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
@@ -30,7 +33,11 @@ import javax.ws.rs.Consumes;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
-import javax.ws.rs.core.*;
+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.UriInfo;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
@@ -59,6 +66,9 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.RequestBody;
+import com.beust.jcommander.internal.Lists;
+import com.beust.jcommander.internal.Maps;
+
@Path("/cq2gremlintest")
public class CQ2GremlinTest extends RESTAPI {
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 2b6bbb9..bbb1aea 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
@@ -19,19 +19,30 @@
*/
package org.onap.aai.rest;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
-import com.google.gson.JsonParser;
-
-import io.micrometer.core.annotation.Timed;
-
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.*;
-import javax.ws.rs.core.*;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DefaultValue;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+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.MultivaluedHashMap;
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
+import javax.ws.rs.core.UriInfo;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
import org.janusgraph.core.SchemaViolationException;
@@ -61,6 +72,12 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
+import com.google.gson.JsonParser;
+
+import io.micrometer.core.annotation.Timed;
+
@Path("{version: v[1-9][0-9]*|latest}/dsl")
@Timed
public class DslConsumer extends TraversalConsumer {
@@ -147,7 +164,7 @@ public class DslConsumer extends TraversalConsumer {
traversalUriHttpEntry.setHttpEntryProperties(version, serverBase);
traversalUriHttpEntry.setPaginationParameters(resultIndex, resultSize);
dbEngine = traversalUriHttpEntry.getDbEngine();
- JsonObject input = new JsonParser().parse(content).getAsJsonObject();
+ JsonObject input = JsonParser.parseString(content).getAsJsonObject();
JsonElement dslElement = input.get("dsl");
String dsl = "";
if (dslElement != null) {
diff --git a/aai-traversal/src/main/java/org/onap/aai/rest/QueryConsumer.java b/aai-traversal/src/main/java/org/onap/aai/rest/QueryConsumer.java
index 460065e..cade20c 100644
--- a/aai-traversal/src/main/java/org/onap/aai/rest/QueryConsumer.java
+++ b/aai-traversal/src/main/java/org/onap/aai/rest/QueryConsumer.java
@@ -19,20 +19,30 @@
*/
package org.onap.aai.rest;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
-import com.google.gson.JsonParser;
-
-import io.micrometer.core.annotation.Timed;
-
import java.net.URI;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Optional;
+import java.util.Set;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.*;
-import javax.ws.rs.core.*;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DefaultValue;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+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.MultivaluedHashMap;
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
+import javax.ws.rs.core.UriInfo;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
import org.apache.tinkerpop.gremlin.structure.Vertex;
@@ -64,6 +74,12 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
+import com.google.gson.JsonParser;
+
+import io.micrometer.core.annotation.Timed;
+
@Path("{version: v[1-9][0-9]*|latest}/query")
@Timed
public class QueryConsumer extends TraversalConsumer {
@@ -134,8 +150,7 @@ public class QueryConsumer extends TraversalConsumer {
}
SubGraphStyle subGraphStyle = SubGraphStyle.valueOf(subgraph);
- JsonParser parser = new JsonParser();
- JsonObject input = parser.parse(content).getAsJsonObject();
+ JsonObject input = JsonParser.parseString(content).getAsJsonObject();
JsonElement startElement = input.get("start");
JsonElement queryElement = input.get("query");
JsonElement gremlinElement = input.get("gremlin");
diff --git a/aai-traversal/src/main/java/org/onap/aai/rest/RecentAPIConsumer.java b/aai-traversal/src/main/java/org/onap/aai/rest/RecentAPIConsumer.java
index 7f40979..5f2f161 100644
--- a/aai-traversal/src/main/java/org/onap/aai/rest/RecentAPIConsumer.java
+++ b/aai-traversal/src/main/java/org/onap/aai/rest/RecentAPIConsumer.java
@@ -19,15 +19,22 @@
*/
package org.onap.aai.rest;
-import io.micrometer.core.annotation.Timed;
-
import java.util.List;
import java.util.concurrent.TimeUnit;
import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.*;
-import javax.ws.rs.core.*;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
+import javax.ws.rs.core.UriInfo;
import org.onap.aai.concurrent.AaiCallable;
import org.onap.aai.exceptions.AAIException;
@@ -55,6 +62,8 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
+import io.micrometer.core.annotation.Timed;
+
@Path("/recents/{version: v[1-9][0-9]*|latest}")
@Timed
public class RecentAPIConsumer extends RESTAPI {
diff --git a/aai-traversal/src/main/java/org/onap/aai/rest/dsl/DslQueryProcessor.java b/aai-traversal/src/main/java/org/onap/aai/rest/dsl/DslQueryProcessor.java
index a21ca04..ffffaa6 100644
--- a/aai-traversal/src/main/java/org/onap/aai/rest/dsl/DslQueryProcessor.java
+++ b/aai-traversal/src/main/java/org/onap/aai/rest/dsl/DslQueryProcessor.java
@@ -39,7 +39,6 @@ import org.onap.aai.rest.dsl.validation.DslValidator;
import org.onap.aai.rest.enums.QueryVersion;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
/**
* The Class DslQueryProcessor.
@@ -58,7 +57,6 @@ public class DslQueryProcessor {
private boolean isAggregate = false;
- @Autowired
public DslQueryProcessor(Map<QueryVersion, ParseTreeListener> dslListeners) {
this.dslListeners = dslListeners;
}
diff --git a/aai-traversal/src/main/java/org/onap/aai/rest/dsl/v1/DslListener.java b/aai-traversal/src/main/java/org/onap/aai/rest/dsl/v1/DslListener.java
index ad2899c..1987310 100644
--- a/aai-traversal/src/main/java/org/onap/aai/rest/dsl/v1/DslListener.java
+++ b/aai-traversal/src/main/java/org/onap/aai/rest/dsl/v1/DslListener.java
@@ -39,7 +39,6 @@ import org.onap.aai.rest.dsl.validation.DslValidatorRule;
import org.onap.aai.setup.SchemaVersions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
/**
* The Class DslListener.
@@ -73,7 +72,6 @@ public class DslListener extends AAIDslBaseListener {
/**
* Instantiates a new DslListener.
*/
- @Autowired
public DslListener(EdgeIngestor edgeIngestor, SchemaVersions schemaVersions,
LoaderFactory loaderFactory) {
this.loader = loaderFactory.createLoaderForVersion(ModelType.MOXY,
diff --git a/aai-traversal/src/main/java/org/onap/aai/rest/dsl/v2/DslListener.java b/aai-traversal/src/main/java/org/onap/aai/rest/dsl/v2/DslListener.java
index 7e46c0b..5395af0 100644
--- a/aai-traversal/src/main/java/org/onap/aai/rest/dsl/v2/DslListener.java
+++ b/aai-traversal/src/main/java/org/onap/aai/rest/dsl/v2/DslListener.java
@@ -42,7 +42,6 @@ import org.onap.aai.rest.enums.EdgeDirection;
import org.onap.aai.setup.SchemaVersions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
/**
* The Class DslListener.
@@ -86,7 +85,6 @@ public class DslListener extends AAIDslBaseListener {
/**
* Instantiates a new DslListener.
*/
- @Autowired
public DslListener(EdgeIngestor edgeIngestor, SchemaVersions schemaVersions,
LoaderFactory loaderFactory) {
this.loader = loaderFactory.createLoaderForVersion(ModelType.MOXY,
diff --git a/aai-traversal/src/main/java/org/onap/aai/rest/search/GetCustomQueryConfig.java b/aai-traversal/src/main/java/org/onap/aai/rest/search/GetCustomQueryConfig.java
index 98eb551..edd882c 100644
--- a/aai-traversal/src/main/java/org/onap/aai/rest/search/GetCustomQueryConfig.java
+++ b/aai-traversal/src/main/java/org/onap/aai/rest/search/GetCustomQueryConfig.java
@@ -19,6 +19,10 @@
*/
package org.onap.aai.rest.search;
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.List;
+
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
@@ -26,10 +30,6 @@ import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.google.gson.reflect.TypeToken;
-import java.lang.reflect.Type;
-import java.util.ArrayList;
-import java.util.List;
-
public class GetCustomQueryConfig {
private JsonArray storedQueries = null;
@@ -46,8 +46,7 @@ public class GetCustomQueryConfig {
}
private void init(String customQueryJson) {
- JsonParser parser = new JsonParser();
- JsonObject queriesObject = parser.parse(customQueryJson).getAsJsonObject();
+ JsonObject queriesObject = JsonParser.parseString(customQueryJson).getAsJsonObject();
if (queriesObject.has(STORED_QUERIES_CONFIG)) {
storedQueries = queriesObject.getAsJsonArray(STORED_QUERIES_CONFIG);
diff --git a/aai-traversal/src/main/java/org/onap/aai/rest/search/GremlinServerSingleton.java b/aai-traversal/src/main/java/org/onap/aai/rest/search/GremlinServerSingleton.java
index a3bb074..8ddf815 100644
--- a/aai-traversal/src/main/java/org/onap/aai/rest/search/GremlinServerSingleton.java
+++ b/aai-traversal/src/main/java/org/onap/aai/rest/search/GremlinServerSingleton.java
@@ -40,7 +40,6 @@ import org.onap.aai.logging.LogFormatTools;
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;
public class GremlinServerSingleton {
@@ -61,7 +60,6 @@ public class GremlinServerSingleton {
* the properties object
*
*/
- @Autowired
public GremlinServerSingleton(CQConfig customQueryInfo) {
this.customQueryInfo = customQueryInfo;
}
diff --git a/aai-traversal/src/main/java/org/onap/aai/rest/search/ModelAndNamedQueryRestProvider.java b/aai-traversal/src/main/java/org/onap/aai/rest/search/ModelAndNamedQueryRestProvider.java
index 5c8b055..cb31d1a 100644
--- a/aai-traversal/src/main/java/org/onap/aai/rest/search/ModelAndNamedQueryRestProvider.java
+++ b/aai-traversal/src/main/java/org/onap/aai/rest/search/ModelAndNamedQueryRestProvider.java
@@ -28,8 +28,12 @@ import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.*;
+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 javax.ws.rs.core.UriInfo;
import org.onap.aai.aailog.logs.AaiDBTraversalMetricLog;
import org.onap.aai.concurrent.AaiCallable;
diff --git a/aai-traversal/src/main/java/org/onap/aai/rest/search/SearchProvider.java b/aai-traversal/src/main/java/org/onap/aai/rest/search/SearchProvider.java
index 17edbc5..27fccb8 100644
--- a/aai-traversal/src/main/java/org/onap/aai/rest/search/SearchProvider.java
+++ b/aai-traversal/src/main/java/org/onap/aai/rest/search/SearchProvider.java
@@ -19,17 +19,23 @@
*/
package org.onap.aai.rest.search;
-import io.micrometer.core.annotation.Timed;
-
import java.net.URI;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.*;
-import javax.ws.rs.core.*;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+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 javax.ws.rs.core.UriInfo;
import org.onap.aai.aailog.logs.AaiDBTraversalMetricLog;
import org.onap.aai.concurrent.AaiCallable;
@@ -57,6 +63,8 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
+import io.micrometer.core.annotation.Timed;
+
/**
* Implements the search subdomain in the REST API. All API calls must include X-FromAppId and
* X-TransactionId in the header.
diff --git a/aai-traversal/src/main/java/org/onap/aai/rest/security/WebSecurityConfig.java b/aai-traversal/src/main/java/org/onap/aai/rest/security/WebSecurityConfig.java
index e24013b..e77c3b3 100644
--- a/aai-traversal/src/main/java/org/onap/aai/rest/security/WebSecurityConfig.java
+++ b/aai-traversal/src/main/java/org/onap/aai/rest/security/WebSecurityConfig.java
@@ -72,7 +72,7 @@ public class WebSecurityConfig extends KeycloakWebSecurityConfigurerAdapter {
}
@Override
- public void configure(WebSecurity web) throws Exception {
+ public void configure(WebSecurity web) {
web.ignoring().regexMatchers("^.*/util/echo$");
}
}
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 2e42e4c..c3409f8 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
@@ -36,6 +36,7 @@ import javax.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.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
@@ -51,6 +52,7 @@ public class EchoResponse extends RESTAPI {
private AaiGraphChecker aaiGraphChecker;
+ @Autowired
public EchoResponse(AaiGraphChecker aaiGraphChecker) {
this.aaiGraphChecker = aaiGraphChecker;
}
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 b448bc8..10bee2b 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
@@ -31,7 +31,7 @@ import java.util.stream.Stream;
import javax.annotation.PostConstruct;
import org.eclipse.jetty.util.security.Password;
-import org.onap.aai.Profiles;
+import org.onap.aai.TraversalProfiles;
import org.onap.aai.util.AAIConstants;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -39,7 +39,7 @@ import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Service;
@Service
-@Profile(Profiles.ONE_WAY_SSL)
+@Profile(TraversalProfiles.ONE_WAY_SSL)
public class AuthorizationService {
private static final Logger logger = LoggerFactory.getLogger(AuthorizationService.class);
diff --git a/aai-traversal/src/main/java/org/onap/aai/web/JerseyConfiguration.java b/aai-traversal/src/main/java/org/onap/aai/web/JerseyConfiguration.java
index 87d6d8f..feb8d1d 100644
--- a/aai-traversal/src/main/java/org/onap/aai/web/JerseyConfiguration.java
+++ b/aai-traversal/src/main/java/org/onap/aai/web/JerseyConfiguration.java
@@ -38,7 +38,6 @@ import org.onap.aai.rest.search.ModelAndNamedQueryRestProvider;
import org.onap.aai.rest.search.SearchProvider;
import org.onap.aai.rest.util.EchoResponse;
import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
@@ -56,7 +55,6 @@ public class JerseyConfiguration {
private final Environment environment;
- @Autowired
public JerseyConfiguration(Environment environment) {
this.environment = environment;
}
diff --git a/aai-traversal/src/main/resources/application.properties b/aai-traversal/src/main/resources/application.properties
index 97b93e1..c86fa8a 100644
--- a/aai-traversal/src/main/resources/application.properties
+++ b/aai-traversal/src/main/resources/application.properties
@@ -27,8 +27,8 @@ server.tomcat.max-idle-time=60000
# If you get an application startup failure that the port is already taken
# If thats not it, please check if the key-store file path makes sense
-server.local.startpath=aai-traversal/src/main/resources/
-server.basic.auth.location=${server.local.startpath}etc/auth/realm.properties
+server.local.startpath=aai-traversal/src/main/resources
+server.basic.auth.location=${server.local.startpath}/etc/auth/realm.properties
server.port=8446
server.ssl.enabled-protocols=TLSv1.1,TLSv1.2
@@ -45,7 +45,7 @@ spring.profiles.active=production,one-way-ssl
# Switch to keycloak
#spring.profiles.active=production, keycloak
###
-server.certs.location=${server.local.startpath}etc/auth/
+server.certs.location=${server.local.startpath}/etc/auth/
server.keystore.name.pkcs12=aai_keystore
server.keystore.name=aai_keystore
server.truststore.name=aai_keystore