summaryrefslogtreecommitdiffstats
path: root/restapi-call-node/provider/src/main/java
diff options
context:
space:
mode:
authoras005h <as005h@att.com>2018-05-08 14:01:50 -0400
committerTimoney, Dan (dt5972) <dt5972@att.com>2018-07-13 16:08:24 -0400
commit6603a6b208f454e87215047a3116ca6d40cc56c2 (patch)
tree2af01b69e3b8ec24fa30bdbe1a25394251c35dff /restapi-call-node/provider/src/main/java
parentce77db4e145f4d4bb00ee830bb63d2cc23962d77 (diff)
Share http payload of restapi-call-node
Changes to save request payload to context variable based on returnRequestPayload flag Change-Id: I75069f700f34848904204049d6160251ea43578d Issue-ID: CCSDK-365 Signed-off-by: Timoney, Dan (dt5972) <dt5972@att.com>
Diffstat (limited to 'restapi-call-node/provider/src/main/java')
-rw-r--r--restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java1
-rw-r--r--restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java6
2 files changed, 7 insertions, 0 deletions
diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java
index c170cfc7d..d3fec37ee 100644
--- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java
+++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java
@@ -49,4 +49,5 @@ public class Parameters {
public String oAuthSignatureMethod;
public String oAuthVersion;
public AuthType authtype;
+ public Boolean returnRequestPayload;
}
diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java
index d215d9092..5168b3ec1 100644
--- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java
+++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java
@@ -112,6 +112,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin {
* <tr><td>customHttpHeaders</td><td>Optional</td><td>a list additional http headers to be passed in, follow the format in the example</td><td>X-CSI-MessageId=messageId,headerFieldName=headerFieldValue</td></tr>
* <tr><td>dumpHeaders</td><td>Optional</td><td>when true writes http header content to context memory</td><td>true or false</td></tr>
* <tr><td>partner</td><td>Optional</td><td>needed for DME2 calls</td><td>dme2proxy</td></tr>
+ * <tr><td>returnRequestPayload</td><td>Optional</td><td>used to return payload built in the request</td><td>true or false</td></tr>
* </tbody>
* </table>
* @param ctx Reference to context memory
@@ -150,6 +151,10 @@ public class RestapiCallNode implements SvcLogicJavaPlugin {
ctx.setAttribute(pp + "header." + a.getKey(), StringUtils.join(a.getValue(), ","));
}
}
+
+ if (p.returnRequestPayload && req != null) {
+ ctx.setAttribute(pp + "httpRequest", req);
+ }
if (r.body != null && r.body.trim().length() > 0) {
ctx.setAttribute(pp + "httpResponse", r.body);
@@ -246,6 +251,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin {
p.customHttpHeaders = parseParam(paramMap, "customHttpHeaders", false, null);
p.partner = parseParam(paramMap, "partner", false, null);
p.dumpHeaders = Boolean.valueOf(parseParam(paramMap, "dumpHeaders", false, null));
+ p.returnRequestPayload = Boolean.valueOf(parseParam(paramMap, "returnRequestPayload", false, null));
return p;
}