class OozieConfigCalculation extends AbstractUpgradeServerAction {

  @Override
  public CommandReport execute(ConcurrentMap<String, Object> requestSharedDataContext)
    throws AmbariException, InterruptedException {
    String clusterName = getExecutionCommand().getClusterName();
    Cluster cluster = getClusters().getCluster(clusterName);
    StringBuilder stdOutBuilder = new StringBuilder();

    try {
      changeOozieEnv(cluster, stdOutBuilder);
    } catch (Exception e) {
      return  createCommandReport(0, HostRoleStatus.FAILED,"{}",
          String.format("Source type %s not found", OOZIE_ENV_TARGET_CONFIG_TYPE), "");
    }

    UpgradeContext upgradeContext = getUpgradeContext(cluster);
    StackId targetStackId = upgradeContext.getTargetStack();


    if (!serviceComponentSupport.isServiceSupported(FALCON_SERVICE_NAME, targetStackId.getStackName(), targetStackId.getStackVersion())) {
      try {
        removeFalconPropertiesFromOozieSize(cluster, stdOutBuilder);
      } catch (AmbariException e) {
        return createCommandReport(0, HostRoleStatus.FAILED, "{}",
            String.format("Source type %s not found", OOZIE_SITE_TARGET_CONFIG_TYPE), "");
      }
    }

    if (oozie_env_updated || oozie_site_updated) {
      agentConfigsHolder.updateData(cluster.getClusterId(), cluster.getHosts().stream().map(Host::getHostId).collect(Collectors.toList()));
    }

    return createCommandReport(0, HostRoleStatus.COMPLETED, "{}",
                  stdOutBuilder.toString(), "");
  }

}