Ejemplo n.º 1
0
  protected MocamResult launchDeleteAppSdOrNext(
      LocalTransaction localTransaction, int sessionStatus) {
    CardInfo card = cardInfoManager.getByCardNo(localTransaction.getCardNo());
    Application application = applicationManager.getByAid(localTransaction.getAid());
    SecurityDomain sd = application.getSd();
    CardApplication cardApplication =
        cardApplicationManager.getByCardNoAid(
            localTransaction.getCardNo(), localTransaction.getAid());

    MocamResult result;

    Integer currentStatus = cardApplication.getStatus(); // 保存当前卡上应用状态
    cardApplication.setStatus(
        CardApplication.STATUS_UNDOWNLOAD); // 将卡上应用状态设置为“未下载”,防止干扰判断应用所属安全域是否自动删除

    if (transactionHelper.isSdNeedAutoDelete(card, sd)) { // 如果需要删除应用所属安全域,执行删除安全域子流程
      buildSubTransaction(localTransaction, sd.getAid(), null, Operation.DELETE_SD);
      localTransaction.setSessionStatus(sessionStatus);
      result = process(localTransaction);
      cardApplication.setStatus(currentStatus); // 恢复卡上应用状态
    } else { // 否则同步卡空间
      cardApplication.setStatus(currentStatus); // 如果当前运行环境为cms2ac,同步安全域的空间信息
      if (SystemConfigUtils.isCms2acRuntimeEnvironment()) { //
        localTransaction.setSessionStatus(SessionStatus.SYN_CAED_SPACE_START);
        result = processTrans(localTransaction);
      } else { // 如果当前运行环境不是cms2ac,通知业务平台操作结果
        result = launchOperationNotify(localTransaction);
      }
    }

    return result;
  }
Ejemplo n.º 2
0
  protected MocamResult launchReadPesoDataOrStartDeleteApp(LocalTransaction localTransaction) {
    localTransaction.setSessionStatus(SessionStatus.DELETE_APP_READ_PERSO_DATA);

    CardApplication cardApplication =
        cardApplicationManager.getByCardNoAid(
            localTransaction.getCardNo(), localTransaction.getAid());
    if (CardApplication.STATUS_PERSO_DATA_READABLE.contains(cardApplication.getStatus())
        && localTransaction.hasPersonalizationsToExecute()) { // 如果有个人化数据且业务平台需要读取,读取数据
      LocalTransaction subTransaction =
          buildSubTransaction(
              localTransaction, localTransaction.getAid(), Operation.DELETE_APP_READ_PERSO_DATA);

      transactionHelper.buildSubPersonalizedAppTransaction(localTransaction, subTransaction);

      subTransaction.setSessionStatus(SessionStatus.PRE_OPERATION_SUCCESS);
    }

    return process(localTransaction);
  }
Ejemplo n.º 3
0
  protected MocamResult synCardSpace(LocalTransaction localTransaction) {
    Application application = applicationManager.getByAid(localTransaction.getAid());
    SecurityDomain sd = application.getSd();
    CardSecurityDomain cardSecurityDomain =
        cardSecurityDomainManager.getByCardNoAid(
            localTransaction.getCardNo(), application.getSd().getAid());

    if (CardSecurityDomain.STATUS_PERSO
        == cardSecurityDomain.getStatus().intValue()) { // 如果应用所属安全域没有被自动删除,同步应用所属安全域空间
      return launchSelectSdForSynCardSpace(
          localTransaction, sd, SessionStatus.SYNC_CARD_SELECT_ISD_CMD);
    } else {
      localTransaction.setSessionStatus(SessionStatus.OPERATE_NOTIFY);
      return processTrans(localTransaction);
    }
  }
Ejemplo n.º 4
0
 protected MocamResult startDelApp(LocalTransaction localTransaction) {
   MocamResult result = new MocamResult();
   if (isAllLoadFileDelete(localTransaction)) { // 所有文件都删除,进入后续流程
     localTransaction.setSessionStatus(SessionStatus.DELETE_APP_END_DELETE_LOAD_FILE);
     result = processTrans(localTransaction);
   } else {
     CardInfo card = cardInfoManager.getByCardNo(localTransaction.getCardNo());
     LoadFileVersion loadFileVersion =
         transactionHelper.getCurrentLoadFileVersionToDelete(localTransaction);
     if (transactionHelper.isLoadFileVersionExistOnCard(card, loadFileVersion)) { // 当前加载文件在卡上
       return launchDealCurrentLoadFile(localTransaction);
     } else { // 当前加载文件没在卡上,删除下一个文件
       return launchDealNextLoadFile(localTransaction);
     }
   }
   return result;
 }
Ejemplo n.º 5
0
 protected MocamResult startupDelete(LocalTransaction localTransaction) {
   check(localTransaction);
   localTransaction.setSessionStatus(SessionStatus.OPEN_RW_WAIT_OPEN_REQ);
   localTransactionManager.saveOrUpdate(localTransaction);
   return processTrans(localTransaction);
 }
Ejemplo n.º 6
0
 protected MocamResult launchOperationNotify(LocalTransaction localTransaction) {
   localTransaction.setSessionStatus(SessionStatus.OPERATE_NOTIFY);
   return processTrans(localTransaction);
 }