Package org.ejbca.core.model.approval

Examples of org.ejbca.core.model.approval.ApprovalException


  private void reject(final ApprovalData approvalData, final Approval approval) throws ApprovalRequestExpiredException,  ApprovalException {
    if(approvalData.haveRequestOrApprovalExpired()){
      throw new ApprovalRequestExpiredException();
    }
    if(approvalData.getStatus() != ApprovalDataVO.STATUS_WAITINGFORAPPROVAL){
      throw new ApprovalException("Wrong status of approval request.");
    }
    final int numberofapprovalsleft = approvalData.getRemainingapprovals() -1;
    if(numberofapprovalsleft < 0){
      throw new ApprovalException("Error already enough approvals have been done on this request.");
    }
    approvalData.setRemainingapprovals(0);
    final Collection<Approval> approvals = getApprovals(approvalData);
    approvals.add(approval);
    setApprovals(approvalData, approvals);
View Full Code Here


  private void approve(final ApprovalData approvalData, final Approval approval) throws ApprovalRequestExpiredException, ApprovalRequestExecutionException, ApprovalException {
    if(approvalData.haveRequestOrApprovalExpired()){
      throw new ApprovalRequestExpiredException();
    }
    if(approvalData.getStatus() != ApprovalDataVO.STATUS_WAITINGFORAPPROVAL){
      throw new ApprovalException("Wrong status of approval request.");
    }
    final int numberofapprovalsleft = approvalData.getRemainingapprovals() -1;
    if(numberofapprovalsleft < 0){
      throw new ApprovalException("Error already enough approvals have been done on this request.");
    }
    approvalData.setRemainingapprovals(numberofapprovalsleft);
    final Collection<Approval> approvals = approvalSession.getApprovals(approvalData);
    approvals.add(approval);
    approvalSession.setApprovals(approvalData, approvals);
View Full Code Here

      }
    } catch (WaitingForApprovalException e) {
      sessionContext.setRollbackOnly()// This is an application exception so it wont trigger a roll-back automatically
      String msg = "Single transaction enrollment request rejected since approvals are enabled for this CA ("+caid+") or Certificate Profile ("+userdata.getCertificateProfileId()+").";
      log.info(msg);
      throw new ApprovalException(msg);
    }
  }
View Full Code Here

TOP

Related Classes of org.ejbca.core.model.approval.ApprovalException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.