aboutsummaryrefslogtreecommitdiffstats
path: root/sli/provider-base/src/main/java/org/onap/ccsdk/sli/core/sli/provider/base/SvcLogicServiceImplBase.java
diff options
context:
space:
mode:
Diffstat (limited to 'sli/provider-base/src/main/java/org/onap/ccsdk/sli/core/sli/provider/base/SvcLogicServiceImplBase.java')
-rw-r--r--sli/provider-base/src/main/java/org/onap/ccsdk/sli/core/sli/provider/base/SvcLogicServiceImplBase.java26
1 files changed, 19 insertions, 7 deletions
diff --git a/sli/provider-base/src/main/java/org/onap/ccsdk/sli/core/sli/provider/base/SvcLogicServiceImplBase.java b/sli/provider-base/src/main/java/org/onap/ccsdk/sli/core/sli/provider/base/SvcLogicServiceImplBase.java
index 80d992f2..75673f75 100644
--- a/sli/provider-base/src/main/java/org/onap/ccsdk/sli/core/sli/provider/base/SvcLogicServiceImplBase.java
+++ b/sli/provider-base/src/main/java/org/onap/ccsdk/sli/core/sli/provider/base/SvcLogicServiceImplBase.java
@@ -142,25 +142,37 @@ public class SvcLogicServiceImplBase implements SvcLogicServiceBase {
@Override
public Properties execute(String module, String rpc, String version, String mode, Properties props)
throws SvcLogicException {
+
+ SvcLogicContext ctx = new SvcLogicContext(props);
+
+ return(execute(module, rpc, version, mode, ctx).toProperties());
+ }
+
+ @Override
+ public SvcLogicContext execute(String module, String rpc, String version, String mode, SvcLogicContext ctx) throws SvcLogicException {
SvcLogicGraph graph = store.fetch(module, rpc, version, mode);
+ if (ctx == null) {
+ ctx = new SvcLogicContext();
+ }
+
if (graph == null) {
- Properties retProps = new Properties();
- retProps.setProperty("error-code", "401");
- retProps.setProperty("error-message",
+ ctx.setAttribute("error-code", "401");
+ ctx.setAttribute("error-message",
"No service logic found for [" + module + "," + rpc + "," + version + "," + mode + "]");
- return (retProps);
+ return (ctx);
}
- SvcLogicContext ctx = new SvcLogicContext(props);
+
+
ctx.setAttribute(CURRENT_GRAPH, graph.toString());
// To support legacy code we should not stop populating X-ECOMP-RequestID
ctx.setAttribute("X-ECOMP-RequestID", MDC.get(ONAPLogConstants.MDCs.REQUEST_ID));
execute(graph, ctx);
- return (ctx.toProperties());
+ return (ctx);
}
- @Override
+ @Override
public SvcLogicStore getStore() throws SvcLogicException {
return this.store;
}