aboutsummaryrefslogtreecommitdiffstats
path: root/common/src
diff options
context:
space:
mode:
authorSteve Smokowski <ss835w@att.com>2020-03-19 13:04:48 +0000
committerGerrit Code Review <gerrit@onap.org>2020-03-19 13:04:48 +0000
commitc1fcea306877deed8ec05e3608b2a7534b345900 (patch)
treec8432ff804fdd923631bba995c4d6b83fe490846 /common/src
parent8eae882cfb0219fb73536660f4d565ac4656cd54 (diff)
parentd0b46ad269c870c72e228a9617615b0a828a940c (diff)
Merge "Correct object provider for jersey"
Diffstat (limited to 'common/src')
-rw-r--r--common/src/main/java/org/onap/so/client/RestClient.java3
-rw-r--r--common/src/main/java/org/onap/so/client/aai/AAIVersion.java11
-rw-r--r--common/src/main/java/org/onap/so/client/policy/CommonObjectMapperProvider.java11
3 files changed, 21 insertions, 4 deletions
diff --git a/common/src/main/java/org/onap/so/client/RestClient.java b/common/src/main/java/org/onap/so/client/RestClient.java
index 077ba24c2b..30389de742 100644
--- a/common/src/main/java/org/onap/so/client/RestClient.java
+++ b/common/src/main/java/org/onap/so/client/RestClient.java
@@ -188,8 +188,7 @@ public abstract class RestClient {
client.register(new PayloadLoggingClientFilter(this.getMaxPayloadSize()));
}
CommonObjectMapperProvider provider = this.getCommonObjectMapperProvider();
- client.register(new JacksonJsonProvider(provider.getMapper()));
-
+ client.register(provider).register(new JacksonJsonProvider(provider.getMapper()));
metricLogClientFilter = new SOMetricLogClientFilter();
mdcSetup.setTargetEntity(getTargetEntity());
client.register(metricLogClientFilter);
diff --git a/common/src/main/java/org/onap/so/client/aai/AAIVersion.java b/common/src/main/java/org/onap/so/client/aai/AAIVersion.java
index 4f06b787f7..42887884db 100644
--- a/common/src/main/java/org/onap/so/client/aai/AAIVersion.java
+++ b/common/src/main/java/org/onap/so/client/aai/AAIVersion.java
@@ -23,7 +23,16 @@ package org.onap.so.client.aai;
import org.onap.so.client.graphinventory.GraphInventoryVersion;
public enum AAIVersion implements GraphInventoryVersion {
- V13("v13"), V14("v14"), V15("v15"), V16("v16"), V17("v17"), V18("v18"), V19("v19");
+ V10("V10"),
+ V11("V11"),
+ V12("V12"),
+ V13("v13"),
+ V14("v14"),
+ V15("v15"),
+ V16("v16"),
+ V17("v17"),
+ V18("v18"),
+ V19("v19");
public static final AAIVersion LATEST = AAIVersion.values()[AAIVersion.values().length - 1];
private final String value;
diff --git a/common/src/main/java/org/onap/so/client/policy/CommonObjectMapperProvider.java b/common/src/main/java/org/onap/so/client/policy/CommonObjectMapperProvider.java
index c55370f7dc..334e0f7231 100644
--- a/common/src/main/java/org/onap/so/client/policy/CommonObjectMapperProvider.java
+++ b/common/src/main/java/org/onap/so/client/policy/CommonObjectMapperProvider.java
@@ -20,13 +20,16 @@
package org.onap.so.client.policy;
+import javax.ws.rs.ext.ContextResolver;
+import javax.ws.rs.ext.Provider;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.MapperFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
-public class CommonObjectMapperProvider {
+@Provider
+public class CommonObjectMapperProvider implements ContextResolver<ObjectMapper> {
protected ObjectMapper mapper;
@@ -43,4 +46,10 @@ public class CommonObjectMapperProvider {
public ObjectMapper getMapper() {
return mapper;
}
+
+ @Override
+ public ObjectMapper getContext(Class<?> type) {
+
+ return mapper;
+ }
}