diff options
Diffstat (limited to 'common/src/main')
-rw-r--r-- | common/src/main/java/org/onap/so/client/HttpClient.java | 4 | ||||
-rw-r--r-- | common/src/main/java/org/onap/so/client/HttpClientFactory.java | 13 |
2 files changed, 13 insertions, 4 deletions
diff --git a/common/src/main/java/org/onap/so/client/HttpClient.java b/common/src/main/java/org/onap/so/client/HttpClient.java index 66e970a154..6f13a86237 100644 --- a/common/src/main/java/org/onap/so/client/HttpClient.java +++ b/common/src/main/java/org/onap/so/client/HttpClient.java @@ -34,10 +34,10 @@ public class HttpClient extends RestClient { protected final Logger log = LoggerFactory.getLogger(HttpClient.class); private TargetEntity targetEntity; - public HttpClient(URL host, String contentType, TargetEntity targetEntity) { + + HttpClient(URL host, String contentType, TargetEntity targetEntity) { super(host, contentType); this.targetEntity = targetEntity; - } @Override diff --git a/common/src/main/java/org/onap/so/client/HttpClientFactory.java b/common/src/main/java/org/onap/so/client/HttpClientFactory.java index 9705d7d0c4..d02c18ff56 100644 --- a/common/src/main/java/org/onap/so/client/HttpClientFactory.java +++ b/common/src/main/java/org/onap/so/client/HttpClientFactory.java @@ -20,11 +20,20 @@ package org.onap.so.client; import java.net.URL; +import javax.ws.rs.core.MediaType; import org.onap.so.utils.TargetEntity; public class HttpClientFactory { - public HttpClient create(URL host, String contentType, TargetEntity targetEntity) { - return new HttpClient(host, contentType, targetEntity); + public HttpClient newJsonClient(URL host, TargetEntity targetEntity) { + return new HttpClient(host, MediaType.APPLICATION_JSON, targetEntity); + } + + public HttpClient newXmlClient(URL host, TargetEntity targetEntity) { + return new HttpClient(host, MediaType.APPLICATION_XML, targetEntity); + } + + public HttpClient newTextXmlClient(URL host, TargetEntity targetEntity) { + return new HttpClient(host, MediaType.TEXT_XML, targetEntity); } } |