X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=sli%2Fprovider%2Fsrc%2Fmain%2Fjava%2Forg%2Fopenecomp%2Fsdnc%2Fsli%2Fprovider%2FRecordNodeExecutor.java;fp=sli%2Fprovider%2Fsrc%2Fmain%2Fjava%2Forg%2Fopenecomp%2Fsdnc%2Fsli%2Fprovider%2FRecordNodeExecutor.java;h=f75752bb96c2b975a056eedc4b226ab93c2e6f1d;hb=974b67dd4021e6e839eaad25366bffe6d7a414c8;hp=d07a4d6d98a45c4a10c25c536cb9b7f3ab274160;hpb=e0451f75b26082418757f279351c2d3e29c0a5c8;p=sdnc%2Fcore.git diff --git a/sli/provider/src/main/java/org/openecomp/sdnc/sli/provider/RecordNodeExecutor.java b/sli/provider/src/main/java/org/openecomp/sdnc/sli/provider/RecordNodeExecutor.java index d07a4d6..f75752b 100644 --- a/sli/provider/src/main/java/org/openecomp/sdnc/sli/provider/RecordNodeExecutor.java +++ b/sli/provider/src/main/java/org/openecomp/sdnc/sli/provider/RecordNodeExecutor.java @@ -50,8 +50,8 @@ public class RecordNodeExecutor extends SvcLogicNodeExecutor { node.getAttribute("plugin"), node, ctx); String outValue = "failure"; - if (LOG.isDebugEnabled()) { - LOG.debug(node.getNodeType() + if (LOG.isTraceEnabled()) { + LOG.trace(node.getNodeType() + " node encountered - looking for recorder class " + plugin); } @@ -71,21 +71,15 @@ public class RecordNodeExecutor extends SvcLogicNodeExecutor { String curExprValue = SvcLogicExpressionResolver.evaluate(curExpr, node, ctx); - if (LOG.isDebugEnabled()) { - LOG.debug("executeRecordNode : parameter " + curName + " = " + if (LOG.isTraceEnabled()) { + LOG.trace("executeRecordNode : parameter " + curName + " = " + curExpr + " => " + curExprValue); } parmMap.put(curName, curExprValue); } - BundleContext bctx = FrameworkUtil.getBundle(this.getClass()) - .getBundleContext(); - - ServiceReference sref = bctx.getServiceReference(plugin); - if (sref != null) { - SvcLogicRecorder recorder = (SvcLogicRecorder) bctx - .getService(sref); + SvcLogicRecorder recorder = getSvcLogicResource(plugin); if (recorder != null) { @@ -99,9 +93,6 @@ public class RecordNodeExecutor extends SvcLogicNodeExecutor { LOG.warn("Could not find SvcLogicRecorder object for plugin " + plugin); } - } else { - LOG.warn("Cound not find service reference for plugin " + plugin); - } SvcLogicNode nextNode = node.getOutcomeValue(outValue); if (nextNode != null) { @@ -117,13 +108,28 @@ public class RecordNodeExecutor extends SvcLogicNodeExecutor { LOG.debug("about to execute Other branch"); } } else { - if (LOG.isDebugEnabled()) { - LOG.debug("no failure or Other branch found"); + if (LOG.isTraceEnabled()) { + LOG.trace("no failure or Other branch found"); } } return (nextNode); } + protected SvcLogicRecorder getSvcLogicResource(String plugin) { + BundleContext bctx = FrameworkUtil.getBundle(this.getClass()) + .getBundleContext(); + + ServiceReference sref = bctx.getServiceReference(plugin); + if (sref != null) { + SvcLogicRecorder resourcePlugin = (SvcLogicRecorder) bctx + .getService(sref); + return resourcePlugin; + } + else { + return null; + } + } + }