diff options
author | Dan Timoney <dtimoney@att.com> | 2019-04-16 13:34:43 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-04-16 13:34:43 +0000 |
commit | f0a0a77f3b1caec7a3b61bef9c4988ae1ec8a054 (patch) | |
tree | f483ee2996dddaa2040490383de5277e7ba59543 | |
parent | dc1ac454bb77359e466395a4a92891f7cebda2a2 (diff) | |
parent | cd856c935cd050be3c3d3a657830853fd57f9147 (diff) |
Merge "Add missing payload in output of callDG in LcmProvider"
-rw-r--r-- | lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java b/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java index d1f3ba53f..0074dfc65 100644 --- a/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java +++ b/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java @@ -59,10 +59,18 @@ public class LcmProvider implements AutoCloseable, LCMService { private class CommonLcmFields { private StatusBuilder statusBuilder; private CommonHeaderBuilder commonHeaderBuilder; + private Payload payload; public CommonLcmFields(StatusBuilder statusBuilder, CommonHeaderBuilder commonHeaderBuilder) { this.statusBuilder = statusBuilder; this.commonHeaderBuilder = commonHeaderBuilder; + this.payload = null; + } + + public CommonLcmFields(StatusBuilder statusBuilder, CommonHeaderBuilder commonHeaderBuilder, Payload payload) { + this.statusBuilder = statusBuilder; + this.commonHeaderBuilder = commonHeaderBuilder; + this.payload = payload; } public StatusBuilder getStatusBuilder() { @@ -72,6 +80,10 @@ public class LcmProvider implements AutoCloseable, LCMService { public CommonHeaderBuilder getCommonHeaderBuilder() { return commonHeaderBuilder; } + + public Payload getPayload() { + return payload; + } } private static final Logger LOG = LoggerFactory.getLogger(LcmProvider.class); @@ -205,6 +217,9 @@ public class LcmProvider implements AutoCloseable, LCMService { CommonLcmFields retval = callDG("rollback", iBuilder.build()); oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + if (retval.getPayload() != null) { + oBuilder.setPayload(retval.getPayload()); + } } catch (LcmRpcInvocationException e) { LOG.debug(exceptionMessage, e); oBuilder.setCommonHeader(e.getCommonHeader()); @@ -415,6 +430,9 @@ public class LcmProvider implements AutoCloseable, LCMService { CommonLcmFields retval = callDG("upgrade-pre-check", iBuilder.build()); oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + if (retval.getPayload() != null) { + oBuilder.setPayload(retval.getPayload()); + } } catch (LcmRpcInvocationException e) { LOG.debug(exceptionMessage, e); oBuilder.setCommonHeader(e.getCommonHeader()); @@ -814,6 +832,9 @@ public class LcmProvider implements AutoCloseable, LCMService { CommonLcmFields retval = callDG("upgrade-post-check", iBuilder.build()); oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + if (retval.getPayload() != null) { + oBuilder.setPayload(retval.getPayload()); + } } catch (LcmRpcInvocationException e) { LOG.debug(exceptionMessage, e); oBuilder.setCommonHeader(e.getCommonHeader()); @@ -1036,6 +1057,12 @@ public class LcmProvider implements AutoCloseable, LCMService { MdsalHelper.toBuilder(respProps, sBuilder); MdsalHelper.toBuilder(respProps, hBuilder); + Payload payload = null; + String payloadValue = respProps.getProperty("payload"); + if (payloadValue != null) { + payload = new Payload(payloadValue); + } + String statusCode = sBuilder.getCode().toString(); if (!"400".equals(statusCode)) { @@ -1044,7 +1071,7 @@ public class LcmProvider implements AutoCloseable, LCMService { LOG.info("Returned SUCCESS for "+rpcName+" "); } - return new CommonLcmFields(sBuilder,hBuilder); + return new CommonLcmFields(sBuilder, hBuilder, payload); } |