summaryrefslogtreecommitdiffstats
path: root/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/ReleaseNodeExecutor.java
diff options
context:
space:
mode:
Diffstat (limited to 'sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/ReleaseNodeExecutor.java')
-rw-r--r--sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/ReleaseNodeExecutor.java95
1 files changed, 34 insertions, 61 deletions
diff --git a/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/ReleaseNodeExecutor.java b/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/ReleaseNodeExecutor.java
index 58013cb8..c1ea9641 100644
--- a/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/ReleaseNodeExecutor.java
+++ b/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/ReleaseNodeExecutor.java
@@ -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));
+ }
}