class ApplicationControllerAction {

    public void runAppCCommand(Action action, String msoRequestId, String vnfId, Optional<String> payload,
            Map<String, String> payloadInfo, String controllerType) {
        Status appCStatus = null;
        try {
            String vnfName = payloadInfo.getOrDefault("vnfName", "");
            String aicIdentity = payloadInfo.getOrDefault("vnfName", "");
            String vnfHostIpAddress = payloadInfo.getOrDefault("vnfHostIpAddress", "");
            String vmIdList = payloadInfo.getOrDefault("vmIdList", "");
            String vserverIdList = payloadInfo.getOrDefault("vserverIdList", "");
            String identityUrl = payloadInfo.getOrDefault("identityUrl", "");
            switch (action) {
                case ResumeTraffic:
                    appCStatus = resumeTrafficAction(msoRequestId, vnfId, vnfName, controllerType);
                    break;
                case Start:
                case Stop:
                    appCStatus = startStopAction(action, msoRequestId, vnfId, aicIdentity, controllerType);
                    break;
                case Unlock:
                case Lock:
                    appCStatus = client.vnfCommand(action, msoRequestId, vnfId, Optional.empty(), Optional.empty(),
                            controllerType);
                    break;
                case QuiesceTraffic:
                    appCStatus = quiesceTrafficAction(msoRequestId, vnfId, payload, vnfName, controllerType);
                    break;
                case DistributeTraffic:
                    appCStatus = distributeTrafficAction(msoRequestId, vnfId, payload, vnfName, controllerType);
                    break;
                case DistributeTrafficCheck:
                    appCStatus = distributeTrafficCheckAction(msoRequestId, vnfId, payload, vnfName, controllerType);
                    break;
                case HealthCheck:
                    appCStatus = healthCheckAction(msoRequestId, vnfId, vnfName, vnfHostIpAddress, controllerType);
                    break;
                case Snapshot:
                    if (vmIdList.isEmpty()) {
                        logger.warn("vmIdList is Empty in AppCClient");
                        break;
                    }
                    String vmIds = JsonUtils.getJsonValue(vmIdList, "vmIds");
                    if (vmIds == null) {
                        logger.warn("vmIds null in AppCClient");
                        break;
                    }
                    if (vserverIdList.isEmpty()) {
                        logger.warn("vserverIdList is empty in AppCClient");
                        break;
                    }
                    String vserverIds = JsonUtils.getJsonValue(vserverIdList, "vserverIds");
                    if (vserverIds == null) {
                        logger.warn("vserverIds  null in AppCClient");
                        break;
                    }
                    appCStatus = getSnapshotActionAppcStatus(msoRequestId, vnfId, controllerType, identityUrl, vmIds,
                            vserverIds);
                    break;
                case ConfigModify:
                case ConfigScaleOut:
                    appCStatus = payloadAction(action, msoRequestId, vnfId, payload, controllerType);
                    break;
                case UpgradePreCheck:
                case UpgradePostCheck:
                case UpgradeSoftware:
                case UpgradeBackup:
                    appCStatus = upgradeAction(action, msoRequestId, vnfId, payload, vnfName, controllerType);
                    break;
                default:
                    errorMessage = "Unable to idenify Action request for AppCClient";
                    break;
            }
            if (appCStatus != null) {
                errorCode = Integer.toString(appCStatus.getCode());
                errorMessage = appCStatus.getMessage();

                if (ApplicationControllerSupport.getCategoryOf(appCStatus).equals(StatusCategory.NORMAL)) {
                    errorCode = "0";
                }
            }
        } catch (JsonProcessingException e) {
            logger.error("Incorrect Payload format for action request: {}", action.toString(), e);
            errorMessage = e.getMessage();
        } catch (ApplicationControllerOrchestratorException e) {
            logger.error("Error building Appc request: {}", e.getMessage(), e);
            errorCode = "1002";
            errorMessage = e.getMessage();
        } catch (Exception e) {
            logger.error("Error building Appc request: {}", e.getMessage(), e);
            errorMessage = e.getMessage();
        }
    }

}