diff options
author | Dan Timoney <dtimoney@att.com> | 2022-07-15 13:23:01 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2022-07-15 13:23:01 +0000 |
commit | e5d489a09606a97f537911f08e9274c0ce0bc17d (patch) | |
tree | 84619f04238d8850717854492d1fbb2645d08af5 /plugins/restapi-call-node/provider/src/main | |
parent | d3b56a45e948a2e3d0cf8c5514cdaf4e08a0b4fe (diff) | |
parent | 400408a5bf555ddca5521e1f7c44d256ab941c01 (diff) |
Merge "Restapi-call-node: Support for Empty Container {} in JSON"
Diffstat (limited to 'plugins/restapi-call-node/provider/src/main')
2 files changed, 6 insertions, 5 deletions
diff --git a/plugins/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java b/plugins/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java index 4236055dc..2064dc864 100755 --- a/plugins/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java +++ b/plugins/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java @@ -641,6 +641,8 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { if (format == Format.JSON) { req = XmlJsonUtil.removeLastCommaJson(req); + // Use 'EMPTY_CONTAINER' as keyword within template to have an empty container placeholder. + req = req.replaceAll("EMPTY_CONTAINER", "{}"); } long t2 = System.currentTimeMillis(); @@ -803,7 +805,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { URL proxyUrl = new URL(p.proxyUrl); HttpUrlConnectorProvider cp = new HttpUrlConnectorProvider(); config.connectorProvider(cp); - final Proxy proxy = + final Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyUrl.getHost(), proxyUrl.getPort())); cp.connectionFactory(new ConnectionFactory() { @@ -822,12 +824,12 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { ssl = createSSLContext(p); } - ClientBuilder builder = + ClientBuilder builder = ClientBuilder.newBuilder().hostnameVerifier(new AcceptIpAddressHostNameVerifier()); - if (ssl != null) { + if (ssl != null) { HttpsURLConnection.setDefaultSSLSocketFactory(ssl.getSocketFactory()); - builder = builder.sslContext(ssl); + builder = builder.sslContext(ssl); } if (config != null) { builder = builder.withConfig(config); diff --git a/plugins/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlJsonUtil.java b/plugins/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlJsonUtil.java index d6ef7463a..a4407c005 100644 --- a/plugins/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlJsonUtil.java +++ b/plugins/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/XmlJsonUtil.java @@ -443,7 +443,6 @@ public final class XmlJsonUtil { i5 = s.length(); } - /*If template mandates empty construct to be present, those should not be removed.*/ if (template != null && template.contains(s.substring(i4))) { k = i1 + 1; |