summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--common-parameters/pom.xml5
-rw-r--r--gson/pom.xml14
-rw-r--r--policy-endpoints/pom.xml3
-rw-r--r--policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/internal/JettyServletServer.java12
-rw-r--r--utils/src/main/java/org/onap/policy/common/utils/coder/YamlJsonTranslator.java7
5 files changed, 21 insertions, 20 deletions
diff --git a/common-parameters/pom.xml b/common-parameters/pom.xml
index 7ec87736..1db1b7c2 100644
--- a/common-parameters/pom.xml
+++ b/common-parameters/pom.xml
@@ -68,11 +68,6 @@
<artifactId>gson</artifactId>
</dependency>
<dependency>
- <groupId>org.yaml</groupId>
- <artifactId>snakeyaml</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
</dependency>
diff --git a/gson/pom.xml b/gson/pom.xml
index be8ef286..4c8a6176 100644
--- a/gson/pom.xml
+++ b/gson/pom.xml
@@ -18,20 +18,20 @@
limitations under the License.
============LICENSE_END=========================================================
-->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project
+ xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+ http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
-
<parent>
<groupId>org.onap.policy.common</groupId>
<artifactId>common-modules</artifactId>
<version>1.12.1-SNAPSHOT</version>
</parent>
-
<artifactId>gson</artifactId>
<description>Common Utilities</description>
<packaging>jar</packaging>
-
<dependencies>
<dependency>
<groupId>com.google.re2j</groupId>
@@ -51,6 +51,10 @@
<artifactId>gson</artifactId>
</dependency>
<dependency>
+ <groupId>javax.ws.rs</groupId>
+ <artifactId>javax.ws.rs-api</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
diff --git a/policy-endpoints/pom.xml b/policy-endpoints/pom.xml
index b39943d4..6f70754d 100644
--- a/policy-endpoints/pom.xml
+++ b/policy-endpoints/pom.xml
@@ -39,8 +39,6 @@
<properties>
<cambria.version>1.2.1-oss</cambria.version>
- <http.client.version>4.5.5</http.client.version>
- <http.core.version>4.4.4</http.core.version>
</properties>
<dependencies>
@@ -187,7 +185,6 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
- <version>4.4</version>
</dependency>
<dependency>
diff --git a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/internal/JettyServletServer.java b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/internal/JettyServletServer.java
index c5af20cb..d74760b6 100644
--- a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/internal/JettyServletServer.java
+++ b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/internal/JettyServletServer.java
@@ -239,32 +239,32 @@ public abstract class JettyServletServer implements HttpServletServer, Runnable
* @return the server connector
*/
public ServerConnector httpsConnector() {
- SslContextFactory sslContextFactory = new SslContextFactory.Server();
+ SslContextFactory.Server sslContextFactoryServer = new SslContextFactory.Server();
String keyStore = System.getProperty(SYSTEM_KEYSTORE_PROPERTY_NAME);
if (keyStore != null) {
- sslContextFactory.setKeyStorePath(keyStore);
+ sslContextFactoryServer.setKeyStorePath(keyStore);
String ksPassword = System.getProperty(SYSTEM_KEYSTORE_PASSWORD_PROPERTY_NAME);
if (ksPassword != null) {
- sslContextFactory.setKeyStorePassword(ksPassword);
+ sslContextFactoryServer.setKeyStorePassword(ksPassword);
}
}
String trustStore = System.getProperty(SYSTEM_TRUSTSTORE_PROPERTY_NAME);
if (trustStore != null) {
- sslContextFactory.setTrustStorePath(trustStore);
+ sslContextFactoryServer.setTrustStorePath(trustStore);
String tsPassword = System.getProperty(SYSTEM_TRUSTSTORE_PASSWORD_PROPERTY_NAME);
if (tsPassword != null) {
- sslContextFactory.setTrustStorePassword(tsPassword);
+ sslContextFactoryServer.setTrustStorePassword(tsPassword);
}
}
var https = new HttpConfiguration();
https.addCustomizer(new SecureRequestCustomizer());
- return new ServerConnector(jettyServer, sslContextFactory, new HttpConnectionFactory(https));
+ return new ServerConnector(jettyServer, sslContextFactoryServer, new HttpConnectionFactory(https));
}
public ServerConnector httpConnector() {
diff --git a/utils/src/main/java/org/onap/policy/common/utils/coder/YamlJsonTranslator.java b/utils/src/main/java/org/onap/policy/common/utils/coder/YamlJsonTranslator.java
index 417e2cf2..077246bf 100644
--- a/utils/src/main/java/org/onap/policy/common/utils/coder/YamlJsonTranslator.java
+++ b/utils/src/main/java/org/onap/policy/common/utils/coder/YamlJsonTranslator.java
@@ -21,6 +21,7 @@
package org.onap.policy.common.utils.coder;
import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonNull;
@@ -31,10 +32,12 @@ import java.io.Reader;
import java.io.StringReader;
import java.io.StringWriter;
import java.io.Writer;
+import java.time.Instant;
import java.util.ArrayList;
import java.util.List;
import java.util.Map.Entry;
import lombok.AllArgsConstructor;
+import org.onap.policy.common.gson.InstantTypeAdapter;
import org.yaml.snakeyaml.DumperOptions;
import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.emitter.Emitter;
@@ -69,7 +72,9 @@ public class YamlJsonTranslator {
* Constructs the object.
*/
public YamlJsonTranslator() {
- this(new Gson());
+ GsonBuilder builder = new GsonBuilder();
+ builder.registerTypeAdapter(Instant.class, new InstantTypeAdapter());
+ gson = builder.create();
}
/**