summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2020-05-26 16:25:59 -0400
committerJim Hahn <jrh3@att.com>2020-05-27 09:56:56 -0400
commit2a79da3dc60dcf4329b76b32ce40b7af15b13578 (patch)
treecf7dcf00d65d9097c6452f78ea462c9e08bf795f
parentf3e77920d6219f2711b2f10f45d39599701bc189 (diff)
Make GSON the default serializer
The default serialization provider for HttpClient and HttpServletServer was Jackson. Modified to use GSON instead. Issue-ID: POLICY-1526 Change-Id: Ic6282d119fa63d12470903a4f1eb4da3afd6efe7 Signed-off-by: Jim Hahn <jrh3@att.com>
-rw-r--r--policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/client/internal/JerseyClient.java2
-rw-r--r--policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/internal/JettyJerseyServer.java12
2 files changed, 8 insertions, 6 deletions
diff --git a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/client/internal/JerseyClient.java b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/client/internal/JerseyClient.java
index ccbed5d9..ab19b7ef 100644
--- a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/client/internal/JerseyClient.java
+++ b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/client/internal/JerseyClient.java
@@ -59,7 +59,7 @@ public class JerseyClient implements HttpClient {
private static Logger logger = LoggerFactory.getLogger(JerseyClient.class);
protected static final String JERSEY_DEFAULT_SERIALIZATION_PROVIDER =
- "org.glassfish.jersey.jackson.internal.jackson.jaxrs.json.JacksonJsonProvider";
+ "org.onap.policy.common.gson.GsonMessageBodyHandler";
protected final String name;
protected final boolean https;
diff --git a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/internal/JettyJerseyServer.java b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/internal/JettyJerseyServer.java
index fb43ce4c..df6823a0 100644
--- a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/internal/JettyJerseyServer.java
+++ b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/internal/JettyJerseyServer.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* policy-endpoints
* ================================================================================
- * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved.
* Modifications Copyright (C) 2019-2020 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -27,6 +27,8 @@ import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.jetty.servlet.ServletHolder;
import org.glassfish.jersey.server.ServerProperties;
+import org.onap.policy.common.endpoints.http.server.JsonExceptionMapper;
+import org.onap.policy.common.gson.GsonMessageBodyHandler;
import org.onap.policy.common.utils.network.NetworkUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -62,10 +64,10 @@ public class JettyJerseyServer extends JettyServletServer {
protected static final String SWAGGER_PRETTY_PRINT = "swagger.pretty.print";
/**
- * Jersey Jackson Classes Init Param Value.
+ * Jersey GSON Classes Init Param Value.
*/
- protected static final String JERSEY_JACKSON_INIT_CLASSNAMES_PARAM_VALUE =
- "org.glassfish.jersey.jackson.internal.jackson.jaxrs.json.JacksonJsonProvider";
+ protected static final String JERSEY_GSON_INIT_CLASSNAMES_PARAM_VALUE =
+ String.join(",", GsonMessageBodyHandler.class.getName(), JsonExceptionMapper.class.getName());
/**
* Jersey Swagger Classes Init Param Value.
@@ -91,7 +93,7 @@ public class JettyJerseyServer extends JettyServletServer {
/**
* The serialization provider to be used when classes are added to the service.
*/
- private String classProvider = JERSEY_JACKSON_INIT_CLASSNAMES_PARAM_VALUE;
+ private String classProvider = JERSEY_GSON_INIT_CLASSNAMES_PARAM_VALUE;
/**
* Constructor.