/**
- * Copyright 2020 - 2021 Fujitsu Limited.
+ * Copyright 2020 - 2023 Fujitsu Limited, ZTE Corporation
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
-import org.jvnet.hk2.annotations.Service;
+import jakarta.ws.rs.client.Entity;
+import jakarta.ws.rs.core.MultivaluedHashMap;
+import jakarta.ws.rs.core.MultivaluedMap;
import org.onap.holmes.common.aai.config.AaiConfig;
import org.onap.holmes.common.config.MicroServiceConfig;
import org.onap.holmes.common.exception.CorrelationException;
import org.onap.holmes.common.utils.JerseyClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
-import javax.ws.rs.client.Entity;
-import javax.ws.rs.core.MultivaluedHashMap;
-import javax.ws.rs.core.MultivaluedMap;
import java.util.HashMap;
import java.util.Map;
private String getResponse(String url) throws CorrelationException {
try {
- return new JerseyClient().headers(getHeaders()).get(url);
+ return JerseyClient.newInstance().headers(getHeaders()).get(url);
} catch (Exception e) {
throw new CorrelationException("Failed to get data from aai", e);
}
private void put(String url, String content) throws CorrelationException {
try {
- new JerseyClient().headers(getHeaders()).put(url, Entity.json(content));
+ JerseyClient.newInstance().headers(getHeaders()).put(url, Entity.json(content));
} catch (Exception e) {
throw new CorrelationException("Failed to put data in AAI", e);
}