Reset MDC after invoking node
authorKevin Smokowski <ks6305@att.com>
Fri, 9 Feb 2018 21:36:38 +0000 (21:36 +0000)
committerDan Timoney <dtimoney@att.com>
Sat, 10 Feb 2018 00:13:58 +0000 (19:13 -0500)
collapse get node into a common metho, reset MDC right before getting next node for certain executor

Change-Id: I85b1cf0dfd595deee42dc93f4095ecbc6c831998
Issue-ID: CCSDK-187
Signed-off-by: Kevin Smokowski <ks6305@att.com>
13 files changed:
sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/MetricLogger.java
sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/DeleteNodeExecutor.java
sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/ExecuteNodeExecutor.java
sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/ExistsNodeExecutor.java
sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/GetResourceNodeExecutor.java
sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/IsAvailableNodeExecutor.java
sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/NotifyNodeExecutor.java
sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/RecordNodeExecutor.java
sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/ReleaseNodeExecutor.java
sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/ReserveNodeExecutor.java
sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SaveNodeExecutor.java
sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicNodeExecutor.java
sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/UpdateNodeExecutor.java

index 394ec0a..9d26345 100644 (file)
@@ -304,4 +304,13 @@ public class MetricLogger {
        str = str.replaceAll("\\|","%7C"); //log records should not contain a pipe, encode the pipe character
        return str;
     }
+    
+    public static void resetContext() {
+        MDC.remove(TARGET_ENTITY);
+        MDC.remove(TARGET_SERVICE_NAME);
+        MDC.remove(TARGET_VIRTUAL_ENTITY);
+        MDC.remove(STATUS_CODE);
+        MDC.remove(RESPONSE_CODE);
+        MDC.remove(RESPONSE_DESCRIPTION);
+    }
 }
index 4eba29d..a7c3c8e 100644 (file)
@@ -30,72 +30,44 @@ import org.slf4j.LoggerFactory;
 
 public class DeleteNodeExecutor extends SvcLogicNodeExecutor {
 
-       private static final Logger LOG = LoggerFactory
-                       .getLogger(DeleteNodeExecutor.class);
-       @Override
-       public SvcLogicNode execute(SvcLogicServiceImpl svc, SvcLogicNode node,
-                       SvcLogicContext ctx) throws SvcLogicException {
+    private static final Logger LOG = LoggerFactory.getLogger(DeleteNodeExecutor.class);
 
-               String plugin = SvcLogicExpressionResolver.evaluate(
-                               node.getAttribute("plugin"), node, ctx);
-               String resourceType = SvcLogicExpressionResolver.evaluate(
-                               node.getAttribute("resource"), node, ctx);
-               String key = SvcLogicExpressionResolver.evaluateAsKey(
-                               node.getAttribute("key"), node, ctx);
+    @Override
+    public SvcLogicNode execute(SvcLogicServiceImpl svc, SvcLogicNode node, SvcLogicContext ctx)
+            throws SvcLogicException {
 
-               String outValue = "failure";
+        String plugin = SvcLogicExpressionResolver.evaluate(node.getAttribute("plugin"), node, ctx);
+        String resourceType = SvcLogicExpressionResolver.evaluate(node.getAttribute("resource"), node, ctx);
+        String key = SvcLogicExpressionResolver.evaluateAsKey(node.getAttribute("key"), node, ctx);
 
-               if (LOG.isDebugEnabled()) {
-                       LOG.debug("delete node encountered - looking for resource class "
-                                       + plugin);
-               }
+        String outValue = "failure";
 
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("delete node encountered - looking for resource class " + plugin);
+        }
 
-               SvcLogicResource resourcePlugin = getSvcLogicResource(plugin);
-                       if (resourcePlugin != null) {
-
-                               try {
-
-                                       switch (resourcePlugin.delete(resourceType, key, ctx)) {
-                                       case SUCCESS:
-                                               outValue = "success";
-                                               break;
-                                       case NOT_FOUND:
-                                               outValue = "not-found";
-                                               break;
-                                       case FAILURE:
-                                       default:
-                                               outValue = "failure";
-                                       }
-                               } catch (SvcLogicException e) {
-                                       LOG.error("Caught exception from resource plugin", e);
-                                       outValue = "failure";
-                               }
-                       } else {
-                               LOG.warn("Could not find SvcLogicResource object for plugin "
-                                               + plugin);
-                       }
-
-
-               SvcLogicNode nextNode = node.getOutcomeValue(outValue);
-               if (nextNode != null) {
-                       if (LOG.isDebugEnabled()) {
-                               LOG.debug("about to execute " + outValue + " branch");
-                       }
-                       return (nextNode);
-               }
-
-               nextNode = node.getOutcomeValue("Other");
-               if (nextNode != null) {
-                       if (LOG.isDebugEnabled()) {
-                               LOG.debug("about to execute Other branch");
-                       }
-               } else {
-                       if (LOG.isDebugEnabled()) {
-                               LOG.debug("no "+outValue+" or Other branch found");
-                       }
-               }
-               return (nextNode);
-       }
+        SvcLogicResource resourcePlugin = getSvcLogicResource(plugin);
+        if (resourcePlugin != null) {
+            try {
+                switch (resourcePlugin.delete(resourceType, key, ctx)) {
+                    case SUCCESS:
+                        outValue = "success";
+                        break;
+                    case NOT_FOUND:
+                        outValue = "not-found";
+                        break;
+                    case FAILURE:
+                    default:
+                        outValue = "failure";
+                }
+            } catch (SvcLogicException e) {
+                LOG.error("Caught exception from resource plugin", e);
+                outValue = "failure";
+            }
+        } else {
+            LOG.warn("Could not find SvcLogicResource object for plugin " + plugin);
+        }
+        return (getNextNode(node, outValue));
+    }
 
 }
index eb06f66..2da0241 100644 (file)
@@ -118,26 +118,7 @@ public class ExecuteNodeExecutor extends SvcLogicNodeExecutor {
                        }
 
                }
-
-               SvcLogicNode nextNode = node.getOutcomeValue(outValue);
-               if (nextNode != null) {
-                       if (LOG.isDebugEnabled()) {
-                               LOG.debug("about to execute " + outValue + " branch");
-                       }
-                       return (nextNode);
-               }
-
-               nextNode = node.getOutcomeValue("Other");
-               if (nextNode != null) {
-                       if (LOG.isDebugEnabled()) {
-                               LOG.debug("about to execute Other branch");
-                       }
-               } else {
-                       if (LOG.isDebugEnabled()) {
-                               LOG.debug("no " + outValue + " or Other branch found");
-                       }
-               }
-               return (nextNode);
+        return (getNextNode(node, outValue));
        }
 
        protected String evaluate(SvcLogicExpression expr, SvcLogicNode node, SvcLogicContext ctx) throws SvcLogicException {
@@ -152,7 +133,6 @@ public class ExecuteNodeExecutor extends SvcLogicNodeExecutor {
             } else {
                 return "success";
             }
-
         } else {
             return "success";
         }
index 3a59a2d..69b1132 100644 (file)
@@ -30,76 +30,46 @@ import org.slf4j.LoggerFactory;
 
 public class ExistsNodeExecutor extends SvcLogicNodeExecutor {
 
-       private static final Logger LOG = LoggerFactory
-                       .getLogger(ExistsNodeExecutor.class);
-       @Override
-       public SvcLogicNode execute(SvcLogicServiceImpl svc, SvcLogicNode node,
-                       SvcLogicContext ctx) throws SvcLogicException {
-
-               String plugin = SvcLogicExpressionResolver.evaluate(
-                               node.getAttribute("plugin"), node, ctx);
-               String resourceType = SvcLogicExpressionResolver.evaluate(
-                               node.getAttribute("resource"), node, ctx);
-               String key = SvcLogicExpressionResolver.evaluateAsKey(
-                               node.getAttribute("key"), node, ctx);
-               String pfx = SvcLogicExpressionResolver.evaluate(
-                               node.getAttribute("pfx"), node, ctx);
-
-               String outValue = "failure";
-
-               if (LOG.isDebugEnabled()) {
-                       LOG.debug("exists node encountered - looking for resource class "
-                                       + plugin);
-               }
-
-
-
-                       SvcLogicResource resourcePlugin = getSvcLogicResource(plugin);
-
-                       if (resourcePlugin != null) {
-
-                               try {
-
-                                       switch (resourcePlugin.exists(resourceType, key, pfx, ctx)) {
-                                       case SUCCESS:
-                                               outValue = "true";
-                                               break;
-                                       case NOT_FOUND:
-                                               outValue = "false";
-                                               break;
-                                       case FAILURE:
-                                       default:
-                                               outValue = "false";
-                                       }
-                               } catch (SvcLogicException e) {
-                                       LOG.error("Caught exception from resource plugin", e);
-                                       outValue = "failure";
-                               }
-                       } else {
-                               LOG.warn("Could not find SvcLogicResource object for plugin "
-                                               + plugin);
-                       }
-
-               SvcLogicNode nextNode = node.getOutcomeValue(outValue);
-               if (nextNode != null) {
-                       if (LOG.isDebugEnabled()) {
-                               LOG.debug("about to execute " + outValue + " branch");
-                       }
-                       return (nextNode);
-               }
-
-               nextNode = node.getOutcomeValue("Other");
-               if (nextNode != null) {
-                       if (LOG.isDebugEnabled()) {
-                               LOG.debug("about to execute Other branch");
-                       }
-               } else {
-                       if (LOG.isDebugEnabled()) {
-
-                               LOG.debug("no "+outValue+" or Other branch found");
-                       }
-               }
-               return (nextNode);
-       }
+    private static final Logger LOG = LoggerFactory.getLogger(ExistsNodeExecutor.class);
+
+    @Override
+    public SvcLogicNode execute(SvcLogicServiceImpl svc, SvcLogicNode node, SvcLogicContext ctx)
+            throws SvcLogicException {
+
+        String plugin = SvcLogicExpressionResolver.evaluate(node.getAttribute("plugin"), node, ctx);
+        String resourceType = SvcLogicExpressionResolver.evaluate(node.getAttribute("resource"), node, ctx);
+        String key = SvcLogicExpressionResolver.evaluateAsKey(node.getAttribute("key"), node, ctx);
+        String pfx = SvcLogicExpressionResolver.evaluate(node.getAttribute("pfx"), node, ctx);
+
+        String outValue = "failure";
+
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("exists node encountered - looking for resource class " + plugin);
+        }
+
+        SvcLogicResource resourcePlugin = getSvcLogicResource(plugin);
+
+        if (resourcePlugin != null) {
+            try {
+                switch (resourcePlugin.exists(resourceType, key, pfx, ctx)) {
+                    case SUCCESS:
+                        outValue = "true";
+                        break;
+                    case NOT_FOUND:
+                        outValue = "false";
+                        break;
+                    case FAILURE:
+                    default:
+                        outValue = "false";
+                }
+            } catch (SvcLogicException e) {
+                LOG.error("Caught exception from resource plugin", e);
+                outValue = "failure";
+            }
+        } else {
+            LOG.warn("Could not find SvcLogicResource object for plugin " + plugin);
+        }
+        return (getNextNode(node, outValue));
+    }
 
 }
index 82734af..64cf5bc 100644 (file)
@@ -31,104 +31,69 @@ import org.slf4j.LoggerFactory;
 
 public class GetResourceNodeExecutor extends SvcLogicNodeExecutor {
 
-       private static final Logger LOG = LoggerFactory
-                       .getLogger(GetResourceNodeExecutor.class);
-       
-       public SvcLogicNode execute(SvcLogicServiceImpl svc, SvcLogicNode node,
-                       SvcLogicContext ctx) throws SvcLogicException {
-
-               String plugin = SvcLogicExpressionResolver.evaluate(
-                               node.getAttribute("plugin"), node, ctx);
-               String resourceType = SvcLogicExpressionResolver.evaluate(
-                               node.getAttribute("resource"), node, ctx);
-               String key = SvcLogicExpressionResolver.evaluateAsKey(
-                               node.getAttribute("key"), node, ctx);
-               String pfx = SvcLogicExpressionResolver.evaluate(
-                               node.getAttribute("pfx"), node, ctx);
-
-               String localOnlyStr = SvcLogicExpressionResolver.evaluate(
-                               node.getAttribute("local-only"), node, ctx);
-
-               // Note: for get-resource, only refresh from A&AI if the DG explicitly set
-               // local-only to false.  Otherwise, just read from local database.
-               boolean localOnly = true;
-               
-               if ("false".equalsIgnoreCase(localOnlyStr)) {
-                       localOnly = false;
-               } 
-
-               SvcLogicExpression selectExpr = node.getAttribute("select");
-               String select = null;
-
-               if (selectExpr != null) {
-                       select = SvcLogicExpressionResolver.evaluateAsKey(selectExpr, node,
-                                       ctx);
-               }
-               
-               SvcLogicExpression orderByExpr = node.getAttribute("order-by");
-               String orderBy = null;
-
-               if (orderByExpr != null) {
-                       orderBy = SvcLogicExpressionResolver.evaluateAsKey(orderByExpr, node,
-                                       ctx);
-               }
-
-               String outValue = "failure";
-
-               if (LOG.isDebugEnabled()) {
-                       LOG.debug(node.getNodeType()
-                                       + " node encountered - looking for resource class "
-                                       + plugin);
-               }
-
-
-                       SvcLogicResource resourcePlugin = getSvcLogicResource(plugin);
-
-                       if (resourcePlugin != null) {
-
-                               try {
-                                       switch (resourcePlugin.query(resourceType, localOnly, select, key,
-                                                       pfx, orderBy, ctx)) {
-                                       case SUCCESS:
-                                               outValue = "success";
-                                               break;
-                                       case NOT_FOUND:
-                                               outValue = "not-found";
-                                               break;
-                                       case FAILURE:
-                                       default:
-                                               outValue = "failure";
-                                       }
-                               } catch (SvcLogicException e) {
-                                       LOG.error("Caught exception from resource plugin", e);
-                                       outValue = "failure";
-                               }
-                       } else {
-                               LOG.warn("Could not find SvcLogicResource object for plugin "
-                                               + plugin);
-                       }
-
-
-               SvcLogicNode nextNode = node.getOutcomeValue(outValue);
-               if (nextNode != null) {
-                       if (LOG.isDebugEnabled()) {
-                               LOG.debug("about to execute " + outValue + " branch");
-                       }
-                       return (nextNode);
-               }
-
-               nextNode = node.getOutcomeValue("Other");
-               if (nextNode != null) {
-                       if (LOG.isDebugEnabled()) {
-                               LOG.debug("about to execute Other branch");
-                       }
-               } else {
-                       if (LOG.isDebugEnabled()) {
-
-                               LOG.debug("no "+outValue+" or Other branch found");
-                       }
-               }
-               return (nextNode);
-       }
+    private static final Logger LOG = LoggerFactory.getLogger(GetResourceNodeExecutor.class);
+
+    public SvcLogicNode execute(SvcLogicServiceImpl svc, SvcLogicNode node, SvcLogicContext ctx)
+            throws SvcLogicException {
+
+        String plugin = SvcLogicExpressionResolver.evaluate(node.getAttribute("plugin"), node, ctx);
+        String resourceType = SvcLogicExpressionResolver.evaluate(node.getAttribute("resource"), node, ctx);
+        String key = SvcLogicExpressionResolver.evaluateAsKey(node.getAttribute("key"), node, ctx);
+        String pfx = SvcLogicExpressionResolver.evaluate(node.getAttribute("pfx"), node, ctx);
+
+        String localOnlyStr = SvcLogicExpressionResolver.evaluate(node.getAttribute("local-only"), node, ctx);
+
+        // Note: for get-resource, only refresh from A&AI if the DG explicitly set
+        // local-only to false. Otherwise, just read from local database.
+        boolean localOnly = true;
+
+        if ("false".equalsIgnoreCase(localOnlyStr)) {
+            localOnly = false;
+        }
+
+        SvcLogicExpression selectExpr = node.getAttribute("select");
+        String select = null;
+
+        if (selectExpr != null) {
+            select = SvcLogicExpressionResolver.evaluateAsKey(selectExpr, node, ctx);
+        }
+
+        SvcLogicExpression orderByExpr = node.getAttribute("order-by");
+        String orderBy = null;
+
+        if (orderByExpr != null) {
+            orderBy = SvcLogicExpressionResolver.evaluateAsKey(orderByExpr, node, ctx);
+        }
+
+        String outValue = "failure";
+
+        if (LOG.isDebugEnabled()) {
+            LOG.debug(node.getNodeType() + " node encountered - looking for resource class " + plugin);
+        }
+
+        SvcLogicResource resourcePlugin = getSvcLogicResource(plugin);
+
+        if (resourcePlugin != null) {
+            try {
+                switch (resourcePlugin.query(resourceType, localOnly, select, key, pfx, orderBy, ctx)) {
+                    case SUCCESS:
+                        outValue = "success";
+                        break;
+                    case NOT_FOUND:
+                        outValue = "not-found";
+                        break;
+                    case FAILURE:
+                    default:
+                        outValue = "failure";
+                }
+            } catch (SvcLogicException e) {
+                LOG.error("Caught exception from resource plugin", e);
+                outValue = "failure";
+            }
+        } else {
+            LOG.warn("Could not find SvcLogicResource object for plugin " + plugin);
+        }
+        return (getNextNode(node, outValue));
+    }
 
 }
index 2d8377c..d2a4bfa 100644 (file)
@@ -30,74 +30,42 @@ import org.slf4j.LoggerFactory;
 
 public class IsAvailableNodeExecutor extends SvcLogicNodeExecutor {
 
-       private static final Logger LOG = LoggerFactory
-                       .getLogger(IsAvailableNodeExecutor.class);
-       
-       @Override
-       public SvcLogicNode execute(SvcLogicServiceImpl svc, SvcLogicNode node,
-                       SvcLogicContext ctx) throws SvcLogicException {
+    private static final Logger LOG = LoggerFactory.getLogger(IsAvailableNodeExecutor.class);
 
-               String plugin = SvcLogicExpressionResolver.evaluate(
-                               node.getAttribute("plugin"), node, ctx);
-               String resourceType = SvcLogicExpressionResolver.evaluate(
-                               node.getAttribute("resource"), node, ctx);
-               String key = SvcLogicExpressionResolver.evaluateAsKey(
-                               node.getAttribute("key"), node, ctx);
-               String pfx = SvcLogicExpressionResolver.evaluate(
-                               node.getAttribute("pfx"), node, ctx);
+    @Override
+    public SvcLogicNode execute(SvcLogicServiceImpl svc, SvcLogicNode node, SvcLogicContext ctx)
+            throws SvcLogicException {
 
-               String outValue = "failure";
+        String plugin = SvcLogicExpressionResolver.evaluate(node.getAttribute("plugin"), node, ctx);
+        String resourceType = SvcLogicExpressionResolver.evaluate(node.getAttribute("resource"), node, ctx);
+        String key = SvcLogicExpressionResolver.evaluateAsKey(node.getAttribute("key"), node, ctx);
+        String pfx = SvcLogicExpressionResolver.evaluate(node.getAttribute("pfx"), node, ctx);
 
-               if (LOG.isDebugEnabled()) {
-                       LOG.debug("is-available node encountered - looking for resource class "
-                                       + plugin);
-               }
+        String outValue = "failure";
 
-            SvcLogicResource resourcePlugin = getSvcLogicResource(plugin);
+        SvcLogicResource resourcePlugin = getSvcLogicResource(plugin);
 
-
-                       if (resourcePlugin != null) {
-                               try {
-                                       switch (resourcePlugin.isAvailable(resourceType, key, pfx, ctx)) {
-                                       case SUCCESS:
-                                               outValue = "true";
-                                               break;
-                                       case NOT_FOUND:
-                                               outValue = "false";
-                                               break;
-                                       case FAILURE:
-                                       default:
-                                               outValue = "false";
-                                       }
-                               } catch (SvcLogicException e) {
-                                       LOG.error("Caught exception from resource plugin", e);
-                                       outValue = "failure";
-                               }
-                       } else {
-                               LOG.warn("Could not find SvcLogicResource object for plugin "
-                                               + plugin);
-                       }
-
-               SvcLogicNode nextNode = node.getOutcomeValue(outValue);
-               if (nextNode != null) {
-                       if (LOG.isDebugEnabled()) {
-                               LOG.debug("about to execute " + outValue + " branch");
-                       }
-                       return (nextNode);
-               }
-
-               nextNode = node.getOutcomeValue("Other");
-               if (nextNode != null) {
-                       if (LOG.isDebugEnabled()) {
-                               LOG.debug("about to execute Other branch");
-                       }
-               } else {
-                       if (LOG.isDebugEnabled()) {
-
-                               LOG.debug("no "+outValue+" or Other branch found");
-                       }
-               }
-               return (nextNode);
-       }
+        if (resourcePlugin != null) {
+            try {
+                switch (resourcePlugin.isAvailable(resourceType, key, pfx, ctx)) {
+                    case SUCCESS:
+                        outValue = "true";
+                        break;
+                    case NOT_FOUND:
+                        outValue = "false";
+                        break;
+                    case FAILURE:
+                    default:
+                        outValue = "false";
+                }
+            } catch (SvcLogicException e) {
+                LOG.error("Caught exception from resource plugin", e);
+                outValue = "failure";
+            }
+        } else {
+            LOG.warn("Could not find SvcLogicResource object for plugin " + plugin);
+        }
+        return (getNextNode(node, outValue));
+    }
 
 }
index ba8d9ba..cfeab79 100644 (file)
@@ -30,73 +30,45 @@ import org.slf4j.LoggerFactory;
 
 public class NotifyNodeExecutor extends SvcLogicNodeExecutor {
 
-       private static final Logger LOG = LoggerFactory
-                       .getLogger(NotifyNodeExecutor.class);
-       
-       @Override
-       public SvcLogicNode execute(SvcLogicServiceImpl svc, SvcLogicNode node,
-                       SvcLogicContext ctx) throws SvcLogicException {
+    private static final Logger LOG = LoggerFactory.getLogger(NotifyNodeExecutor.class);
 
-               String plugin = SvcLogicExpressionResolver.evaluate(
-                               node.getAttribute("plugin"), node, ctx);
-               String resourceType = SvcLogicExpressionResolver.evaluate(
-                               node.getAttribute("resource"), node, ctx);
-               String action = SvcLogicExpressionResolver.evaluateAsKey(
-                               node.getAttribute("action"), node, ctx);
-               String key = SvcLogicExpressionResolver.evaluateAsKey(
-                               node.getAttribute("key"), node, ctx);
+    @Override
+    public SvcLogicNode execute(SvcLogicServiceImpl svc, SvcLogicNode node, SvcLogicContext ctx)
+            throws SvcLogicException {
 
-               String outValue = "failure";
+        String plugin = SvcLogicExpressionResolver.evaluate(node.getAttribute("plugin"), node, ctx);
+        String resourceType = SvcLogicExpressionResolver.evaluate(node.getAttribute("resource"), node, ctx);
+        String action = SvcLogicExpressionResolver.evaluateAsKey(node.getAttribute("action"), node, ctx);
+        String key = SvcLogicExpressionResolver.evaluateAsKey(node.getAttribute("key"), node, ctx);
 
-               if (LOG.isDebugEnabled()) {
-                       LOG.debug("release node encountered - looking for resource class "
-                                       + plugin);
-               }
+        String outValue = "failure";
 
-        SvcLogicResource resourcePlugin = getSvcLogicResource(plugin);
-                       if (resourcePlugin != null) {
-
-                               try {
-
-                                       switch (resourcePlugin.notify(resourceType, action, key, ctx)) {
-                                       case SUCCESS:
-                                               outValue = "success";
-                                               break;
-                                       case NOT_FOUND:
-                                               outValue = "not-found";
-                                               break;
-                                       case FAILURE:
-                                       default:
-                                               outValue = "failure";
-                                       }
-                               } catch (SvcLogicException e) {
-                                       LOG.error("Caught exception from resource plugin", e);
-                                       outValue = "failure";
-                               }
-                       } else {
-                               LOG.warn("Could not find SvcLogicResource object for plugin "
-                                               + plugin);
-                       }
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("release node encountered - looking for resource class " + plugin);
+        }
 
-               SvcLogicNode nextNode = node.getOutcomeValue(outValue);
-               if (nextNode != null) {
-                       if (LOG.isDebugEnabled()) {
-                               LOG.debug("about to execute " + outValue + " branch");
-                       }
-                       return (nextNode);
-               }
-
-               nextNode = node.getOutcomeValue("Other");
-               if (nextNode != null) {
-                       if (LOG.isDebugEnabled()) {
-                               LOG.debug("about to execute Other branch");
-                       }
-               } else {
-                       if (LOG.isDebugEnabled()) {
-                               LOG.debug("no "+outValue+" or Other branch found");
-                       }
-               }
-               return (nextNode);
-       }
+        SvcLogicResource resourcePlugin = getSvcLogicResource(plugin);
+        if (resourcePlugin != null) {
+            try {
+                switch (resourcePlugin.notify(resourceType, action, key, ctx)) {
+                    case SUCCESS:
+                        outValue = "success";
+                        break;
+                    case NOT_FOUND:
+                        outValue = "not-found";
+                        break;
+                    case FAILURE:
+                    default:
+                        outValue = "failure";
+                }
+            } catch (SvcLogicException e) {
+                LOG.error("Caught exception from resource plugin", e);
+                outValue = "failure";
+            }
+        } else {
+            LOG.warn("Could not find SvcLogicResource object for plugin " + plugin);
+        }
+        return (getNextNode(node, outValue));
+    }
 
 }
index 9ed28d7..42e2153 100644 (file)
@@ -25,7 +25,6 @@ import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
-
 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
 import org.onap.ccsdk.sli.core.sli.SvcLogicException;
 import org.onap.ccsdk.sli.core.sli.SvcLogicExpression;
@@ -36,84 +35,48 @@ import org.slf4j.LoggerFactory;
 
 public class RecordNodeExecutor extends SvcLogicNodeExecutor {
 
-       private static final Logger LOG = LoggerFactory
-                       .getLogger(RecordNodeExecutor.class);
-       
-       @Override
-       public SvcLogicNode execute(SvcLogicServiceImpl svc, SvcLogicNode node,
-                       SvcLogicContext ctx) throws SvcLogicException {
-
-               String plugin = SvcLogicExpressionResolver.evaluate(
-                               node.getAttribute("plugin"), node, ctx);
-               String outValue = "failure";
-
-               if (LOG.isTraceEnabled()) {
-                       LOG.trace(node.getNodeType()
-                                       + " node encountered - looking for recorder class "
-                                       + plugin);
-               }
-
-               Map<String, String> parmMap = new HashMap<String, String>();
-
-               Set<Map.Entry<String, SvcLogicExpression>> parmSet = node
-                               .getParameterSet();
-               boolean hasParms = false;
-
-               for (Iterator<Map.Entry<String, SvcLogicExpression>> iter = parmSet
-                               .iterator(); iter.hasNext();) {
-                       hasParms = true;
-                       Map.Entry<String, SvcLogicExpression> curEnt = iter.next();
-                       String curName = curEnt.getKey();
-                       SvcLogicExpression curExpr = curEnt.getValue();
-                       String curExprValue = SvcLogicExpressionResolver.evaluate(curExpr,
-                                       node, ctx);
-
-                       if (LOG.isTraceEnabled()) {
-                               LOG.trace("executeRecordNode : parameter " + curName + " = "
-                                               + curExpr + " => " + curExprValue);
-                       }
-                       parmMap.put(curName, curExprValue);
-               }
-
-
-                       SvcLogicRecorder recorder = getSvcLogicRecorder(plugin);
-
-                       if (recorder != null) {
-
-                               try {
-                                       recorder.record(parmMap);
-                               } catch (SvcLogicException e) {
-                                       LOG.error("Caught exception from recorder plugin", e);
-                                       outValue = "failure";
-                               }
-                       } else {
-                               LOG.warn("Could not find SvcLogicRecorder object for plugin "
-                                               + plugin);
-                       }
-
-               SvcLogicNode nextNode = node.getOutcomeValue(outValue);
-               if (nextNode != null) {
-                       if (LOG.isDebugEnabled()) {
-                               LOG.debug("about to execute " + outValue + " branch");
-                       }
-                       return (nextNode);
-               }
-
-               nextNode = node.getOutcomeValue("Other");
-               if (nextNode != null) {
-                       if (LOG.isDebugEnabled()) {
-                               LOG.debug("about to execute Other branch");
-                       }
-               } else {
-                       if (LOG.isTraceEnabled()) {
-                               LOG.trace("no failure or Other branch found");
-                       }
-               }
-               return (nextNode);
-       }
-
-
-
-
-
+    private static final Logger LOG = LoggerFactory.getLogger(RecordNodeExecutor.class);
+
+    @Override
+    public SvcLogicNode execute(SvcLogicServiceImpl svc, SvcLogicNode node, SvcLogicContext ctx)
+            throws SvcLogicException {
+
+        String plugin = SvcLogicExpressionResolver.evaluate(node.getAttribute("plugin"), node, ctx);
+        String outValue = "failure";
+
+        if (LOG.isTraceEnabled()) {
+            LOG.trace(node.getNodeType() + " node encountered - looking for recorder class " + plugin);
+        }
+
+        Map<String, String> parmMap = new HashMap<String, String>();
+
+        Set<Map.Entry<String, SvcLogicExpression>> parmSet = node.getParameterSet();
+        boolean hasParms = false;
+
+        for (Iterator<Map.Entry<String, SvcLogicExpression>> iter = parmSet.iterator(); iter.hasNext();) {
+            hasParms = true;
+            Map.Entry<String, SvcLogicExpression> curEnt = iter.next();
+            String curName = curEnt.getKey();
+            SvcLogicExpression curExpr = curEnt.getValue();
+            String curExprValue = SvcLogicExpressionResolver.evaluate(curExpr, node, ctx);
+
+            if (LOG.isTraceEnabled()) {
+                LOG.trace("executeRecordNode : parameter " + curName + " = " + curExpr + " => " + curExprValue);
+            }
+            parmMap.put(curName, curExprValue);
+        }
+
+        SvcLogicRecorder recorder = getSvcLogicRecorder(plugin);
+        if (recorder != null) {
+            try {
+                recorder.record(parmMap);
+            } catch (SvcLogicException e) {
+                LOG.error("Caught exception from recorder plugin", e);
+                outValue = "failure";
+            }
+        } else {
+            LOG.warn("Could not find SvcLogicRecorder object for plugin " + plugin);
+        }
+        return (getNextNode(node, outValue));
+    }
 }
index 58013cb..c1ea964 100644 (file)
@@ -30,71 +30,44 @@ import org.slf4j.LoggerFactory;
 
 public class ReleaseNodeExecutor extends SvcLogicNodeExecutor {
 
-       private static final Logger LOG = LoggerFactory
-                       .getLogger(ReleaseNodeExecutor.class);
-       @Override
-       public SvcLogicNode execute(SvcLogicServiceImpl svc, SvcLogicNode node,
-                       SvcLogicContext ctx) throws SvcLogicException {
+    private static final Logger LOG = LoggerFactory.getLogger(ReleaseNodeExecutor.class);
 
-               String plugin = SvcLogicExpressionResolver.evaluate(
-                               node.getAttribute("plugin"), node, ctx);
-               String resourceType = SvcLogicExpressionResolver.evaluate(
-                               node.getAttribute("resource"), node, ctx);
-               String key = SvcLogicExpressionResolver.evaluateAsKey(
-                               node.getAttribute("key"), node, ctx);
+    @Override
+    public SvcLogicNode execute(SvcLogicServiceImpl svc, SvcLogicNode node, SvcLogicContext ctx)
+            throws SvcLogicException {
 
-               String outValue = "failure";
+        String plugin = SvcLogicExpressionResolver.evaluate(node.getAttribute("plugin"), node, ctx);
+        String resourceType = SvcLogicExpressionResolver.evaluate(node.getAttribute("resource"), node, ctx);
+        String key = SvcLogicExpressionResolver.evaluateAsKey(node.getAttribute("key"), node, ctx);
 
-               if (LOG.isDebugEnabled()) {
-                       LOG.debug("release node encountered - looking for resource class "
-                                       + plugin);
-               }
+        String outValue = "failure";
 
-        SvcLogicResource resourcePlugin = getSvcLogicResource(plugin);
-                       if (resourcePlugin != null) {
-
-                               try {
-
-                                       switch (resourcePlugin.release(resourceType, key, ctx)) {
-                                       case SUCCESS:
-                                               outValue = "success";
-                                               break;
-                                       case NOT_FOUND:
-                                               outValue = "not-found";
-                                               break;
-                                       case FAILURE:
-                                       default:
-                                               outValue = "failure";
-                                       }
-                               } catch (SvcLogicException e) {
-                                       LOG.error("Caught exception from resource plugin", e);
-                                       outValue = "failure";
-                               }
-                       } else {
-                               LOG.warn("Could not find SvcLogicResource object for plugin "
-                                               + plugin);
-                       }
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("release node encountered - looking for resource class " + plugin);
+        }
 
-               SvcLogicNode nextNode = node.getOutcomeValue(outValue);
-               if (nextNode != null) {
-                       if (LOG.isDebugEnabled()) {
-                               LOG.debug("about to execute " + outValue + " branch");
-                       }
-                       return (nextNode);
-               }
-
-               nextNode = node.getOutcomeValue("Other");
-               if (nextNode != null) {
-                       if (LOG.isDebugEnabled()) {
-                               LOG.debug("about to execute Other branch");
-                       }
-               } else {
-                       if (LOG.isDebugEnabled()) {
-
-                               LOG.debug("no "+outValue+" or Other branch found");
-                       }
-               }
-               return (nextNode);
-       }
+        SvcLogicResource resourcePlugin = getSvcLogicResource(plugin);
+        if (resourcePlugin != null) {
+            try {
+                switch (resourcePlugin.release(resourceType, key, ctx)) {
+                    case SUCCESS:
+                        outValue = "success";
+                        break;
+                    case NOT_FOUND:
+                        outValue = "not-found";
+                        break;
+                    case FAILURE:
+                    default:
+                        outValue = "failure";
+                }
+            } catch (SvcLogicException e) {
+                LOG.error("Caught exception from resource plugin", e);
+                outValue = "failure";
+            }
+        } else {
+            LOG.warn("Could not find SvcLogicResource object for plugin " + plugin);
+        }
+        return (getNextNode(node, outValue));
+    }
 
 }
index fc180a7..646650c 100644 (file)
@@ -31,84 +31,57 @@ import org.slf4j.LoggerFactory;
 
 public class ReserveNodeExecutor extends SvcLogicNodeExecutor {
 
-       private static final Logger LOG = LoggerFactory
-                       .getLogger(ReserveNodeExecutor.class);
-       
-       @Override
-       public SvcLogicNode execute(SvcLogicServiceImpl svc, SvcLogicNode node,
-                       SvcLogicContext ctx) throws SvcLogicException {
-
-               String plugin = SvcLogicExpressionResolver.evaluate(
-                               node.getAttribute("plugin"), node, ctx);
-               String resourceType = SvcLogicExpressionResolver.evaluate(
-                               node.getAttribute("resource"), node, ctx);
-               String key = SvcLogicExpressionResolver.evaluateAsKey(
-                               node.getAttribute("key"), node, ctx);
-               String pfx = SvcLogicExpressionResolver.evaluate(node.getAttribute("pfx"),node,ctx);
-
-               
+    private static final Logger LOG = LoggerFactory.getLogger(ReserveNodeExecutor.class);
+
+    @Override
+    public SvcLogicNode execute(SvcLogicServiceImpl svc, SvcLogicNode node, SvcLogicContext ctx)
+            throws SvcLogicException {
+
+        String plugin = SvcLogicExpressionResolver.evaluate(node.getAttribute("plugin"), node, ctx);
+        String resourceType = SvcLogicExpressionResolver.evaluate(node.getAttribute("resource"), node, ctx);
+        String key = SvcLogicExpressionResolver.evaluateAsKey(node.getAttribute("key"), node, ctx);
+        String pfx = SvcLogicExpressionResolver.evaluate(node.getAttribute("pfx"), node, ctx);
+
+
         SvcLogicExpression selectExpr = node.getAttribute("select");
         String select = null;
 
-        if (selectExpr != null)
-        {
-                select = SvcLogicExpressionResolver.evaluateAsKey(selectExpr, node, ctx);
+        if (selectExpr != null) {
+            select = SvcLogicExpressionResolver.evaluateAsKey(selectExpr, node, ctx);
         }
 
-               String outValue = "failure";
+        String outValue = "failure";
 
-               if (LOG.isDebugEnabled()) {
-                       LOG.debug("reserve node encountered - looking for resource class "
-                                       + plugin);
-               }
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("reserve node encountered - looking for resource class " + plugin);
+        }
 
 
 
         SvcLogicResource resourcePlugin = getSvcLogicResource(plugin);
 
-                       if (resourcePlugin != null) {
-
-                               try {
-                                       switch (resourcePlugin.reserve(resourceType, select, key, pfx, ctx)) {
-                                       case SUCCESS:
-                                               outValue = "success";
-                                               break;
-                                       case NOT_FOUND:
-                                               outValue = "not-found";
-                                               break;
-                                       case FAILURE:
-                                       default:
-                                               outValue = "failure";
-                                       }
-                               } catch (SvcLogicException e) {
-                                       LOG.error("Caught exception from resource plugin", e);
-                                       outValue = "failure";
-                               }
-                       } else {
-                               LOG.warn("Could not find SvcLogicResource object for plugin "
-                                               + plugin);
-                       }
-
-               SvcLogicNode nextNode = node.getOutcomeValue(outValue);
-               if (nextNode != null) {
-                       if (LOG.isDebugEnabled()) {
-                               LOG.debug("about to execute " + outValue + " branch");
-                       }
-                       return (nextNode);
-               }
-
-               nextNode = node.getOutcomeValue("Other");
-               if (nextNode != null) {
-                       if (LOG.isDebugEnabled()) {
-                               LOG.debug("about to execute Other branch");
-                       }
-               } else {
-                       if (LOG.isDebugEnabled()) {
-
-                               LOG.debug("no "+outValue+" or Other branch found");
-                       }
-               }
-               return (nextNode);
-       }
+        if (resourcePlugin != null) {
+
+            try {
+                switch (resourcePlugin.reserve(resourceType, select, key, pfx, ctx)) {
+                    case SUCCESS:
+                        outValue = "success";
+                        break;
+                    case NOT_FOUND:
+                        outValue = "not-found";
+                        break;
+                    case FAILURE:
+                    default:
+                        outValue = "failure";
+                }
+            } catch (SvcLogicException e) {
+                LOG.error("Caught exception from resource plugin", e);
+                outValue = "failure";
+            }
+        } else {
+            LOG.warn("Could not find SvcLogicResource object for plugin " + plugin);
+        }
+        return (getNextNode(node, outValue));
+    }
 
 }
index 2df85ac..d2b8b0a 100644 (file)
@@ -25,7 +25,6 @@ import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
-
 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
 import org.onap.ccsdk.sli.core.sli.SvcLogicException;
 import org.onap.ccsdk.sli.core.sli.SvcLogicExpression;
@@ -36,107 +35,73 @@ import org.slf4j.LoggerFactory;
 
 public class SaveNodeExecutor extends SvcLogicNodeExecutor {
 
-       private static final Logger LOG = LoggerFactory
-                       .getLogger(SaveNodeExecutor.class);
+    private static final Logger LOG = LoggerFactory.getLogger(SaveNodeExecutor.class);
 
-       @Override
-       public SvcLogicNode execute(SvcLogicServiceImpl svc, SvcLogicNode node,
-                       SvcLogicContext ctx) throws SvcLogicException {
+    @Override
+    public SvcLogicNode execute(SvcLogicServiceImpl svc, SvcLogicNode node, SvcLogicContext ctx)
+            throws SvcLogicException {
 
-               String plugin = SvcLogicExpressionResolver.evaluate(
-                               node.getAttribute("plugin"), node, ctx);
-               String resourceType = SvcLogicExpressionResolver.evaluate(
-                               node.getAttribute("resource"), node, ctx);
-               String key = SvcLogicExpressionResolver.evaluateAsKey(
-                               node.getAttribute("key"), node, ctx);
-               String forceStr = SvcLogicExpressionResolver.evaluate(
-                               node.getAttribute("force"), node, ctx);
-               String localOnlyStr = SvcLogicExpressionResolver.evaluate(
-                               node.getAttribute("local-only"), node, ctx);
-               String pfx = SvcLogicExpressionResolver.evaluate(
-                               node.getAttribute("pfx"), node, ctx);
+        String plugin = SvcLogicExpressionResolver.evaluate(node.getAttribute("plugin"), node, ctx);
+        String resourceType = SvcLogicExpressionResolver.evaluate(node.getAttribute("resource"), node, ctx);
+        String key = SvcLogicExpressionResolver.evaluateAsKey(node.getAttribute("key"), node, ctx);
+        String forceStr = SvcLogicExpressionResolver.evaluate(node.getAttribute("force"), node, ctx);
+        String localOnlyStr = SvcLogicExpressionResolver.evaluate(node.getAttribute("local-only"), node, ctx);
+        String pfx = SvcLogicExpressionResolver.evaluate(node.getAttribute("pfx"), node, ctx);
 
-               boolean force = "true".equalsIgnoreCase(forceStr);
-               boolean localOnly = "true".equalsIgnoreCase(localOnlyStr);
+        boolean force = "true".equalsIgnoreCase(forceStr);
+        boolean localOnly = "true".equalsIgnoreCase(localOnlyStr);
 
-               Map<String, String> parmMap = new HashMap<String, String>();
+        Map<String, String> parmMap = new HashMap<String, String>();
 
-               Set<Map.Entry<String, SvcLogicExpression>> parmSet = node
-                               .getParameterSet();
-               boolean hasParms = false;
+        Set<Map.Entry<String, SvcLogicExpression>> parmSet = node.getParameterSet();
+        boolean hasParms = false;
 
-               for (Iterator<Map.Entry<String, SvcLogicExpression>> iter = parmSet
-                               .iterator(); iter.hasNext();) {
-                       hasParms = true;
-                       Map.Entry<String, SvcLogicExpression> curEnt = iter.next();
-                       String curName = curEnt.getKey();
-                       SvcLogicExpression curExpr = curEnt.getValue();
-                       if (curExpr != null) {
-                               String curExprValue = SvcLogicExpressionResolver.evaluate(
-                                               curExpr, node, ctx);
+        for (Iterator<Map.Entry<String, SvcLogicExpression>> iter = parmSet.iterator(); iter.hasNext();) {
+            hasParms = true;
+            Map.Entry<String, SvcLogicExpression> curEnt = iter.next();
+            String curName = curEnt.getKey();
+            SvcLogicExpression curExpr = curEnt.getValue();
+            if (curExpr != null) {
+                String curExprValue = SvcLogicExpressionResolver.evaluate(curExpr, node, ctx);
 
-                               LOG.debug("Parameter " + curName + " = "
-                                               + curExpr.asParsedExpr() + " resolves to "
-                                               + curExprValue);
+                LOG.debug("Parameter " + curName + " = " + curExpr.asParsedExpr() + " resolves to " + curExprValue);
 
-                               parmMap.put(curName, curExprValue);
-                       }
-               }
+                parmMap.put(curName, curExprValue);
+            }
+        }
 
-               String outValue = "failure";
+        String outValue = "failure";
 
-               if (LOG.isDebugEnabled()) {
-                       LOG.debug("save node encountered - looking for resource class "
-                                       + plugin);
-               }
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("save node encountered - looking for resource class " + plugin);
+        }
 
 
 
         SvcLogicResource resourcePlugin = getSvcLogicResource(plugin);
 
-                       if (resourcePlugin != null) {
-
-                               try {
-                                       switch (resourcePlugin.save(resourceType, force, localOnly, key,
-                                                       parmMap, pfx, ctx)) {
-                                       case SUCCESS:
-                                               outValue = "success";
-                                               break;
-                                       case NOT_FOUND:
-                                               outValue = "not-found";
-                                               break;
-                                       case FAILURE:
-                                       default:
-                                               outValue = "failure";
-                                       }
-                               } catch (SvcLogicException e) {
-                                       LOG.error("Caught exception from resource plugin", e);
-                                       outValue = "failure";
-                               }
-                       } else {
-                               LOG.warn("Could not find SvcLogicResource object for plugin "
-                                               + plugin);
-                       }
-
-               SvcLogicNode nextNode = node.getOutcomeValue(outValue);
-               if (nextNode != null) {
-                       if (LOG.isDebugEnabled()) {
-                               LOG.debug("about to execute " + outValue + " branch");
-                       }
-                       return (nextNode);
-               }
-
-               nextNode = node.getOutcomeValue("Other");
-               if (nextNode != null) {
-                       if (LOG.isDebugEnabled()) {
-                               LOG.debug("about to execute Other branch");
-                       }
-               } else {
-                       if (LOG.isDebugEnabled()) {
-                               LOG.debug("no "+outValue+" or Other branch found");
-                       }
-               }
-               return (nextNode);
-       }
+        if (resourcePlugin != null) {
+
+            try {
+                switch (resourcePlugin.save(resourceType, force, localOnly, key, parmMap, pfx, ctx)) {
+                    case SUCCESS:
+                        outValue = "success";
+                        break;
+                    case NOT_FOUND:
+                        outValue = "not-found";
+                        break;
+                    case FAILURE:
+                    default:
+                        outValue = "failure";
+                }
+            } catch (SvcLogicException e) {
+                LOG.error("Caught exception from resource plugin", e);
+                outValue = "failure";
+            }
+        } else {
+            LOG.warn("Could not find SvcLogicResource object for plugin " + plugin);
+        }
+        return (getNextNode(node, outValue));
+    }
 
 }
index 951536b..0cfcfb9 100644 (file)
@@ -21,6 +21,7 @@
 
 package org.onap.ccsdk.sli.core.sli.provider;
 
+import org.onap.ccsdk.sli.core.sli.MetricLogger;
 import org.onap.ccsdk.sli.core.sli.SvcLogicAdaptor;
 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
 import org.onap.ccsdk.sli.core.sli.SvcLogicException;
@@ -28,7 +29,6 @@ import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin;
 import org.onap.ccsdk.sli.core.sli.SvcLogicNode;
 import org.onap.ccsdk.sli.core.sli.SvcLogicRecorder;
 import org.onap.ccsdk.sli.core.sli.SvcLogicResource;
-import org.onap.ccsdk.sli.core.sli.SvcLogicStore;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.FrameworkUtil;
 import org.osgi.framework.ServiceReference;
@@ -103,5 +103,26 @@ public abstract class SvcLogicNodeExecutor {
              return plugin;
          }
  }
+    protected SvcLogicNode getNextNode(SvcLogicNode node, String outValue) {
+        MetricLogger.resetContext();
+        SvcLogicNode nextNode = node.getOutcomeValue(outValue);
+        if (nextNode != null) {
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("about to execute " + outValue + " branch");
+            }
+            return (nextNode);
+        }
 
+        nextNode = node.getOutcomeValue("Other");
+        if (nextNode != null) {
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("about to execute Other branch");
+            }
+        } else {
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("no " + outValue + " or Other branch found");
+            }
+        }
+        return (nextNode);
+    }
 }
index 9206b5d..148745f 100644 (file)
@@ -25,7 +25,6 @@ import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
-
 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
 import org.onap.ccsdk.sli.core.sli.SvcLogicException;
 import org.onap.ccsdk.sli.core.sli.SvcLogicExpression;
@@ -36,101 +35,69 @@ import org.slf4j.LoggerFactory;
 
 public class UpdateNodeExecutor extends SvcLogicNodeExecutor {
 
-       private static final Logger LOG = LoggerFactory
-                       .getLogger(UpdateNodeExecutor.class);
+    private static final Logger LOG = LoggerFactory.getLogger(UpdateNodeExecutor.class);
 
-       @Override
-       public SvcLogicNode execute(SvcLogicServiceImpl svc, SvcLogicNode node,
-                       SvcLogicContext ctx) throws SvcLogicException {
+    @Override
+    public SvcLogicNode execute(SvcLogicServiceImpl svc, SvcLogicNode node, SvcLogicContext ctx)
+            throws SvcLogicException {
 
-               String plugin = SvcLogicExpressionResolver.evaluate(
-                               node.getAttribute("plugin"), node, ctx);
-               String resourceType = SvcLogicExpressionResolver.evaluate(
-                               node.getAttribute("resource"), node, ctx);
-               String key = SvcLogicExpressionResolver.evaluateAsKey(
-                               node.getAttribute("key"), node, ctx);
-               String pfx = SvcLogicExpressionResolver.evaluate(
-                               node.getAttribute("pfx"), node, ctx);
+        String plugin = SvcLogicExpressionResolver.evaluate(node.getAttribute("plugin"), node, ctx);
+        String resourceType = SvcLogicExpressionResolver.evaluate(node.getAttribute("resource"), node, ctx);
+        String key = SvcLogicExpressionResolver.evaluateAsKey(node.getAttribute("key"), node, ctx);
+        String pfx = SvcLogicExpressionResolver.evaluate(node.getAttribute("pfx"), node, ctx);
 
 
-               Map<String, String> parmMap = new HashMap<String, String>();
+        Map<String, String> parmMap = new HashMap<String, String>();
 
-               Set<Map.Entry<String, SvcLogicExpression>> parmSet = node
-                               .getParameterSet();
-               boolean hasParms = false;
+        Set<Map.Entry<String, SvcLogicExpression>> parmSet = node.getParameterSet();
+        boolean hasParms = false;
 
-               for (Iterator<Map.Entry<String, SvcLogicExpression>> iter = parmSet
-                               .iterator(); iter.hasNext();) {
-                       hasParms = true;
-                       Map.Entry<String, SvcLogicExpression> curEnt = iter.next();
-                       String curName = curEnt.getKey();
-                       SvcLogicExpression curExpr = curEnt.getValue();
-                       if (curExpr != null) {
-                               String curExprValue = SvcLogicExpressionResolver.evaluate(
-                                               curExpr, node, ctx);
+        for (Iterator<Map.Entry<String, SvcLogicExpression>> iter = parmSet.iterator(); iter.hasNext();) {
+            hasParms = true;
+            Map.Entry<String, SvcLogicExpression> curEnt = iter.next();
+            String curName = curEnt.getKey();
+            SvcLogicExpression curExpr = curEnt.getValue();
+            if (curExpr != null) {
+                String curExprValue = SvcLogicExpressionResolver.evaluate(curExpr, node, ctx);
 
-                               LOG.debug("Parameter " + curName + " = "
-                                               + curExpr.asParsedExpr() + " resolves to "
-                                               + curExprValue);
+                LOG.debug("Parameter " + curName + " = " + curExpr.asParsedExpr() + " resolves to " + curExprValue);
 
-                               parmMap.put(curName, curExprValue);
-                       }
-               }
+                parmMap.put(curName, curExprValue);
+            }
+        }
 
-               String outValue = "failure";
+        String outValue = "failure";
 
-               if (LOG.isDebugEnabled()) {
-                       LOG.debug("save node encountered - looking for resource class "
-                                       + plugin);
-               }
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("save node encountered - looking for resource class " + plugin);
+        }
 
 
         SvcLogicResource resourcePlugin = getSvcLogicResource(plugin);
 
 
-                       if (resourcePlugin != null) {
-
-                               try {
-                                       switch (resourcePlugin.update(resourceType, key,
-                                                       parmMap, pfx, ctx)) {
-                                       case SUCCESS:
-                                               outValue = "success";
-                                               break;
-                                       case NOT_FOUND:
-                                               outValue = "not-found";
-                                               break;
-                                       case FAILURE:
-                                       default:
-                                               outValue = "failure";
-                                       }
-                               } catch (SvcLogicException e) {
-                                       LOG.error("Caught exception from resource plugin", e);
-                                       outValue = "failure";
-                               }
-                       } else {
-                               LOG.warn("Could not find SvcLogicResource object for plugin "
-                                               + plugin);
-                       }
-
-               SvcLogicNode nextNode = node.getOutcomeValue(outValue);
-               if (nextNode != null) {
-                       if (LOG.isDebugEnabled()) {
-                               LOG.debug("about to execute " + outValue + " branch");
-                       }
-                       return (nextNode);
-               }
-
-               nextNode = node.getOutcomeValue("Other");
-               if (nextNode != null) {
-                       if (LOG.isDebugEnabled()) {
-                               LOG.debug("about to execute Other branch");
-                       }
-               } else {
-                       if (LOG.isDebugEnabled()) {
-                               LOG.debug("no "+outValue+" or Other branch found");
-                       }
-               }
-               return (nextNode);
-       }
+        if (resourcePlugin != null) {
+
+            try {
+                switch (resourcePlugin.update(resourceType, key, parmMap, pfx, ctx)) {
+                    case SUCCESS:
+                        outValue = "success";
+                        break;
+                    case NOT_FOUND:
+                        outValue = "not-found";
+                        break;
+                    case FAILURE:
+                    default:
+                        outValue = "failure";
+                }
+            } catch (SvcLogicException e) {
+                LOG.error("Caught exception from resource plugin", e);
+                outValue = "failure";
+            }
+        } else {
+            LOG.warn("Could not find SvcLogicResource object for plugin " + plugin);
+        }
+        return (getNextNode(node, outValue));
+    }
 
 }