aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--appc-config/appc-flow-controller/provider/src/main/java/org/onap/appc/flow/controller/executorImpl/GraphExecutor.java78
1 files changed, 27 insertions, 51 deletions
diff --git a/appc-config/appc-flow-controller/provider/src/main/java/org/onap/appc/flow/controller/executorImpl/GraphExecutor.java b/appc-config/appc-flow-controller/provider/src/main/java/org/onap/appc/flow/controller/executorImpl/GraphExecutor.java
index 0ce249ff2..206c3083b 100644
--- a/appc-config/appc-flow-controller/provider/src/main/java/org/onap/appc/flow/controller/executorImpl/GraphExecutor.java
+++ b/appc-config/appc-flow-controller/provider/src/main/java/org/onap/appc/flow/controller/executorImpl/GraphExecutor.java
@@ -21,8 +21,10 @@
*/
package org.onap.appc.flow.controller.executorImpl;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
import java.util.Enumeration;
-import java.util.HashMap;
+import java.util.Map;
import java.util.Properties;
import org.onap.appc.flow.controller.data.Transaction;
import org.onap.appc.flow.controller.interfaces.FlowExecutorInterface;
@@ -33,13 +35,12 @@ import org.onap.ccsdk.sli.core.sli.provider.SvcLogicService;
import org.osgi.framework.BundleContext;
import org.osgi.framework.FrameworkUtil;
import org.osgi.framework.ServiceReference;
-import com.att.eelf.configuration.EELFLogger;
-import com.att.eelf.configuration.EELFManager;
public class GraphExecutor implements FlowExecutorInterface {
private static final EELFLogger log = EELFManager.getInstance().getLogger(GraphExecutor.class);
+ private static final String SVC_LOGIC_STATUS_PARAM = "SvcLogic.status";
private SvcLogicService svcLogic = null;
@@ -49,8 +50,6 @@ public class GraphExecutor implements FlowExecutorInterface {
ServiceReference sref = bctx.getServiceReference(SvcLogicService.NAME);
if (sref != null) {
svcLogic = (SvcLogicService) bctx.getService(sref);
-
-
} else {
log.warn("Cannot find service reference for " + SvcLogicService.NAME);
}
@@ -58,20 +57,13 @@ public class GraphExecutor implements FlowExecutorInterface {
}
public boolean hasGraph(String module, String rpc, String version, String mode) throws SvcLogicException {
- return (svcLogic.hasGraph(module, rpc, version, mode));
+ return svcLogic.hasGraph(module, rpc, version, mode);
}
public Properties executeGraph(String module, String rpc, String version, String mode, Properties parms)
- throws SvcLogicException {
+ throws SvcLogicException {
log.debug("Parameters passed to SLI");
- // for (Object key : parms.keySet()) {
- // String parmName = (String) key;
- // String parmValue = parms.getProperty(parmName);
- //
- // log.debug(parmName + " = " + parmValue);
- // }
-
Properties respProps = svcLogic.execute(module, rpc, version, mode, parms);
if (log.isDebugEnabled()) {
log.debug("Parameters returned by SLI");
@@ -82,14 +74,11 @@ public class GraphExecutor implements FlowExecutorInterface {
log.debug(parmName + " = " + parmValue);
}
}
- if ("failure".equalsIgnoreCase(respProps.getProperty("SvcLogic.status"))) {
- return (respProps);
- }
- return (respProps);
+ return respProps;
}
@Override
- public HashMap<String, String> execute(Transaction transaction, SvcLogicContext ctx) throws Exception {
+ public Map<String, String> execute(Transaction transaction, SvcLogicContext ctx) throws Exception {
String fn = "GraphExecutor.execute ";
log.debug(fn + "About to execute graph : " + transaction.getExecutionRPC());
@@ -103,12 +92,10 @@ public class GraphExecutor implements FlowExecutorInterface {
}
Properties returnParams =
- executeGraph(transaction.getExecutionModule(), transaction.getExecutionRPC(), null, "sync", parms);
-
- // log.debug("Return Params executing DG :" + returnParams.toString());
+ executeGraph(transaction.getExecutionModule(), transaction.getExecutionRPC(), null, "sync", parms);
log.debug("Returned Params from DG Module: " + transaction.getExecutionModule() + "and DG NAME: "
- + transaction.getExecutionRPC() + returnParams.toString());
+ + transaction.getExecutionRPC() + returnParams.toString());
Enumeration e = returnParams.propertyNames();
@@ -119,49 +106,38 @@ public class GraphExecutor implements FlowExecutorInterface {
ctx.setAttribute(key, returnParams.getProperty(key));
}
-
- // Get the correct code from the SVC Logic and set it in transaction
- // transaction.setStatusCode(returnParams.getProperty("SvcLogic.code"));
-
- if (FlowControllerConstants.FAILURE.equalsIgnoreCase(returnParams.getProperty("SvcLogic.status"))) {
+ if (FlowControllerConstants.FAILURE.equalsIgnoreCase(returnParams.getProperty(SVC_LOGIC_STATUS_PARAM))) {
transaction.setStatus(FlowControllerConstants.FAILURE);
ctx.setAttribute(
- ctx.getAttribute(FlowControllerConstants.RESPONSE_PREFIX)
- + FlowControllerConstants.OUTPUT_PARAM_STATUS,
- FlowControllerConstants.OUTPUT_STATUS_FAILURE);
+ ctx.getAttribute(FlowControllerConstants.RESPONSE_PREFIX)
+ + FlowControllerConstants.OUTPUT_PARAM_STATUS,
+ FlowControllerConstants.OUTPUT_STATUS_FAILURE);
ctx.setAttribute(ctx.getAttribute(FlowControllerConstants.RESPONSE_PREFIX)
- + FlowControllerConstants.OUTPUT_STATUS_MESSAGE, returnParams.getProperty("error-message"));
+ + FlowControllerConstants.OUTPUT_STATUS_MESSAGE, returnParams.getProperty("error-message"));
transaction.setStatusCode("401");
- transaction.setState((ctx.getAttribute(transaction.getExecutionModule() + "."
- + transaction.getExecutionRPC() + "." + FlowControllerConstants.OUTPUT_STATUS_MESSAGE)) != null
- ? ctx.getAttribute(transaction.getExecutionModule() + "." + transaction.getExecutionRPC()
- + "." + FlowControllerConstants.OUTPUT_STATUS_MESSAGE)
- : null);
+ transaction.setState(ctx.getAttribute(transaction.getExecutionModule() + "." + transaction.getExecutionRPC()
+ + "." + FlowControllerConstants.OUTPUT_STATUS_MESSAGE));
// Get error code from above instead setting here ...its for testing purpose
-
- } else if (FlowControllerConstants.SUCCESS.equalsIgnoreCase(returnParams.getProperty("SvcLogic.status"))) {
+ } else if (FlowControllerConstants.SUCCESS.equalsIgnoreCase(returnParams.getProperty(SVC_LOGIC_STATUS_PARAM))) {
transaction.setStatus(FlowControllerConstants.SUCCESS);
transaction.setStatusCode("400");
ctx.setAttribute(
- ctx.getAttribute(FlowControllerConstants.RESPONSE_PREFIX)
- + FlowControllerConstants.OUTPUT_PARAM_STATUS,
- FlowControllerConstants.OUTPUT_STATUS_SUCCESS);
- transaction.setState((ctx.getAttribute(transaction.getExecutionModule() + "."
- + transaction.getExecutionRPC() + "." + FlowControllerConstants.OUTPUT_STATUS_MESSAGE)) != null
- ? ctx.getAttribute(transaction.getExecutionModule() + "." + transaction.getExecutionRPC()
- + "." + FlowControllerConstants.OUTPUT_STATUS_MESSAGE)
- : null);
+ ctx.getAttribute(FlowControllerConstants.RESPONSE_PREFIX)
+ + FlowControllerConstants.OUTPUT_PARAM_STATUS,
+ FlowControllerConstants.OUTPUT_STATUS_SUCCESS);
+ transaction.setState(ctx.getAttribute(transaction.getExecutionModule() + "." + transaction.getExecutionRPC()
+ + "." + FlowControllerConstants.OUTPUT_STATUS_MESSAGE));
// Get error code from above instead setting here ...its for testing purpose
} else {
transaction.setStatus(FlowControllerConstants.OTHERS);
ctx.setAttribute(
- ctx.getAttribute(FlowControllerConstants.RESPONSE_PREFIX)
- + FlowControllerConstants.OUTPUT_PARAM_STATUS,
- FlowControllerConstants.OUTPUT_STATUS_FAILURE);
+ ctx.getAttribute(FlowControllerConstants.RESPONSE_PREFIX)
+ + FlowControllerConstants.OUTPUT_PARAM_STATUS,
+ FlowControllerConstants.OUTPUT_STATUS_FAILURE);
transaction.setStatusCode("401");
ctx.setAttribute(ctx.getAttribute(FlowControllerConstants.RESPONSE_PREFIX)
- + FlowControllerConstants.OUTPUT_STATUS_MESSAGE, returnParams.getProperty("error-message"));
+ + FlowControllerConstants.OUTPUT_STATUS_MESSAGE, returnParams.getProperty("error-message"));
}
return null;
> border: none; height: 2px; background-color: #dce1e7; margin-bottom: 20px; } .select { margin-bottom: 15px; width: 100%; .query_criteria { width: 100%; .query_item { width: 20%; display: inline-block; span { display: inline-block; font: 500 13px "ArialMT"; color: #3C4F8C; } nz-dropdown { vertical-align: middle; width: 55%; :hover{ border-color: #48C6EF; } button { width: 100%; height: 30px; background-color: #fff; text-align: left; border-color: #EEEEEE ; border-radius: 2px; span { font-weight: 400; color:rgba(60,79,140,0.5); display: inline-block; overflow: hidden; text-overflow: ellipsis; padding-top: 2px; } i { position: absolute; top: 10px; right: 10px; } } } } .query_time{ display: inline-block; span { font: 500 13px "ArialMT"; color: #3C4F8C; } } .search { margin-left: 0.8%; height: 30px; padding: 0 10px; span { color: #fff; font-weight: 400; } } } } .charts{ width: 100%; height: 250px; margin-bottom: 25px; .chartsleft { width: 30%; height: 100%; float: left; margin-right: 2%; color: #fff; font-family:"ArialMT"; .sctive_closed { height: 48.75%; padding: 12px; width: 100%; :first-child{ font-size: 14px; } :nth-child(2) { font-size: 18px; } :nth-child(3) { font-size: 12px; } } .active { margin-bottom: 5px; background: -webkit-linear-gradient(left, #FB7788 , #FB93C2); /* Safari 5.1 - 6.0 */ background: -o-linear-gradient(right, #FB7788, #FB93C2); /* Opera 11.1 - 12.0 */ background: -moz-linear-gradient(right, #FB7788, #FB93C2); /* Firefox 3.6 - 15 */ background: linear-gradient(to right, #FB7788 , #FB93C2); /* 标准的语法(必须放在最后) */ } .closed { margin-top: 2px; background: -webkit-linear-gradient(left, #7A8BAE , #A6BFE4); /* Safari 5.1 - 6.0 */ background: -o-linear-gradient(right, #7A8BAE , #A6BFE4); /* Opera 11.1 - 12.0 */ background: -moz-linear-gradient(right, #7A8BAE , #A6BFE4); /* Firefox 3.6 - 15 */ background: linear-gradient(to right, #7A8BAE , #A6BFE4); /* 标准的语法(必须放在最后) */ } } .chartsright { background-color: #fff; width: 68%; padding: 20px; float: left; height: 100%; .picker { float: right; margin-right: 3%; } .datapicker { padding-left: 700px; } } } .content { .title { border-radius: 5px 5px 0 0; background-color: #fff; height: 106px; border-bottom: 1px solid #f0f0f0; margin-bottom: 0; ul { display: flex; display: -webkit-flex; justify-content: space-around; align-items: center; padding: 0; margin: 0; height: 100%; li { list-style: none; padding-left: 32px; width: 100%; border-left: 1px solid #eceff4; h5 { font: 500 14px "Arial"; color: #3d4d65; } p { font: 500 24px "Arial"; color: #3fa8eb; margin-bottom: 0; } } li:nth-child(1){ border: none; } } } .chart { background-color: #fff; position: relative; padding-bottom: 24px; h3 { font: 700 18px/18px "思源黑体"; color: #4c5e70; padding: 20px 15px; margin: 0; width: 12%; display: inline-block; } .AlarmChart { height: 0px; overflow: hidden; border-bottom: 1px solid #f5f5f5; transition: all 0.3s linear; } .alarmChart-active { height: 386px; } .open-close { width: 50px; height: 25px; position: absolute; left: 50%; bottom: 0px; transform: translate(-25px,0); border: none; outline: none; cursor: pointer; background-color: #fff; background: url(../../../assets/images/open-close.png) no-repeat center -27px; &:hover { background: url(../../../assets/images/open-close.png) no-repeat center -79px; } } .open-close-active { background: url(../../../assets/images/open-close.png) center -1px; &:hover { background: url(../../../assets/images/open-close.png) no-repeat center -53px; } } } .tablelist { // background-color: #fff; // padding: 24px 10px 0px; border-radius: 0 0 5px 5px; .action{ padding: 10px 0 0 20px; .details{ display: inline-block; width: 16px; height: 16px; background: url(../../../assets/images/icon.png) center -113px; &:hover { background: url(../../../assets/images/icon.png) no-repeat center -128px; } } } } }