コード例 #1
0
ファイル: AppCTR.java プロジェクト: sengwook81/hadoop-manager
  @Transactional(propagation = Propagation.REQUIRED)
  public Model updateApplications(@RequestBody ListWrap<T> param, Model model) {
    logger.debug("TX BEGIN add ServerApplication With {} ", param);
    for (T item : param.getList()) {
      if (!StringUtils.isEmpty(item.getServer_Id())
          || !StringUtils.isEmpty(item.getGroup_Id())
          || !StringUtils.isEmpty(item.getApp_Id())) {

        if (item.isRow_Flag() == false) {
          if (item.getApp_Ext_Opts() == null || item.getApp_Ext_Opts().isEmpty()) {
          } else {
            serverApplicationDao.insServerApplication(item);
          }
        } else {
          if (item.getApp_Ext_Opts() == null || item.getApp_Ext_Opts().isEmpty()) {
            serverApplicationDao.delServerApplication(item);
          } else {
            serverApplicationDao.uptServerApplication(item);
          }
        }
      } else {
        throw new RuntimeException("Has No Parent Application Config");
      }
    }
    logger.debug("TX FINISH add ServerApplication With {} ", model);
    return model;
  }
コード例 #2
0
  @RequestMapping("/application/installer/install")
  public Model installApplication(@RequestBody ListWrap<InstallerVo> params, Model model) {
    logger.debug("TX BEGIN get Installer Apps With {} ", params);

    String failItems = "";
    for (InstallerVo param : params.getList()) {
      if (param.isInstall_Chk()) {
        ServerApplicationVo appServer = serverApplicationDao.getServerApplication(param);
        logger.debug("Install Logic Check {} ", appServer);
        if (appServer != null && !appServer.getInstall_Flag().equals("F")) {

          if (appServer.getInstall_Flag().equals("P")) {
            failItems += param.getServer_Name();
            continue;
            // throw new RuntimeException(param.getServer_Name() +
            // " 설치 진행중");
          }

          // SetProcess Status
          appServer.setInstall_Flag(AppInstallStatus.NOW_PROCESSING);
          appServer.setInstall_Status("START");
          serverApplicationDao.uptServerApplication(appServer);

          // Application Installer Bean Info Select
          ApplicationVo application =
              applicationDao.getApplication(new ApplicationVo(appServer.getApp_Id()));

          // getApplicationInstallProcessor Bean
          AppInstallProcessor processorBean =
              applicationContext.getBean(
                  application.getApp_Processor_Name(), AppInstallProcessor.class);
          processorBean.setInstallFlag(true);
          processorBean.setParam(appServer);
          // Do Install Start
          installerPool.excuteJob(processorBean);
          // getInstall Processor Bean
        }
      }
    }

    if (!failItems.isEmpty()) {
      failItems += " 설치 진행중";
      model.addAttribute("_rslt", failItems);
    } else {
      model.addAttribute("_rslt", "SUCCESS");
    }
    logger.debug("TX FINISH get Installer Apps With {} ", model);
    return model;
  }