Package org.ejbca.core.model.approval

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


          throw new AuthorizationDeniedException();
        }
      }

    if(ar != null && isRejectedStep1){
      throw new ApprovalRequestExecutionException("The approval for id " + ar.generateApprovalId() + " have been rejected.");
    }
   
    if(ar != null && !approvalSuccessfullStep1){
      throw new WaitingForApprovalException("The approval for id " + ar.generateApprovalId() + " have not yet been approved", ar.generateApprovalId());
    }
View Full Code Here


        throw e;
      }
    }
   
    if(ar != null && isRejectedStep0){
      throw new ApprovalRequestExecutionException("The approval for id " + ar.generateApprovalId() + " have been rejected.");
    }
   
    if(ar != null && ! isApprovedStep0){
      throw new WaitingForApprovalException("The approval for id " + ar.generateApprovalId() + " have not yet been approved", ar.generateApprovalId());
    }
View Full Code Here

        default:
          log.error("Unknown approval type " + approvalType);
          break;
      }
    } catch (AuthorizationDeniedException e) {
      throw new ApprovalRequestExecutionException("Authorization Denied :" + e.getMessage(), e);
    } catch (ApprovalException e) {
      throw new EJBException("This should never happen",e);
    } catch (WaitingForApprovalException e) {
      throw new EJBException("This should never happen",e);
    } catch (AlreadyRevokedException e) {
      throw new ApprovalRequestExecutionException("End entity " + username + " was already revoked at execution time.");
    } catch (FinderException e) {
      throw new ApprovalRequestExecutionException("Could not find object.",e);
    } catch (NotFoundException e) {
      throw new ApprovalRequestExecutionException("Could not find object.",e);
    } catch (RemoveException e) {
      throw new ApprovalRequestExecutionException("Could not remove object.",e);
    }
  }
View Full Code Here

  public void execute(UserAdminSession userAdminSession) throws ApprovalRequestExecutionException {
    log.debug("Executing Change Status  for user:" + username);
    try{
      userAdminSession.setUserStatus(getRequestAdmin(), username, newstatus);
    } catch (AuthorizationDeniedException e) {
      throw new ApprovalRequestExecutionException("Authorization Denied :" + e.getMessage(), e);
    } catch (FinderException e) {
      throw new ApprovalRequestExecutionException("User with username + " + username  + " doesn't exist.", e);
    } catch (ApprovalException e) {
      throw new EJBException("This should never happen",e);
    } catch (WaitingForApprovalException e) {
      throw new EJBException("This should never happen",e);
    }
View Full Code Here

                userAdminSession.prepareForKeyRecovery(getRequestAdmin(), username, getEndEntityProfileId(), null);
            } else {
                userAdminSession.prepareForKeyRecovery(getRequestAdmin(), username, getEndEntityProfileId(), cert);
            }
        } catch (AuthorizationDeniedException e) {
            throw new ApprovalRequestExecutionException("Authorization Denied :" + e.getMessage(), e);
        } catch (ApprovalException e) {
            throw new EJBException("This should never happen", e);
        } catch (WaitingForApprovalException e) {
            throw new EJBException("This should never happen", e);
        }
View Full Code Here

    public void execute(UserAdminSession userAdminSession) throws ApprovalRequestExecutionException {
        log.debug("Executing ChangeEndEntity for user:" + newuserdata.getUsername());
        try {
          userAdminSession.changeUser(getRequestAdmin(), newuserdata, clearpwd);
        } catch (AuthorizationDeniedException e) {
            throw new ApprovalRequestExecutionException("Authorization Denied :" + e.getMessage(), e);
        } catch (UserDoesntFullfillEndEntityProfile e) {
            throw new ApprovalRequestExecutionException("User Doesn't fullfil end entity profile :" + e.getMessage() + e.getMessage(), e);
        } catch (ApprovalException e) {
            throw new EJBException("This should never happen", e);
        } catch (WaitingForApprovalException e) {
            throw new EJBException("This should never happen", e);
        } catch (EjbcaException e) {
            throw new ApprovalRequestExecutionException("Error with the SubjectDN serialnumber :" + e.getErrorCode() + e.getMessage(), e);
        }
    }
View Full Code Here

    log.debug("Executing " + ApprovalDataVO.APPROVALTYPENAMES[getApprovalType()] + " (" + getApprovalType() + ").");
    try {
      // Use 'null' for GlobalConfiguration here since it's only used to extract approval information in the underlying code..
      caAdminSession.activateCAToken(getRequestAdmin(), getCAId(), authenticationCode, null);
    } catch (CATokenAuthenticationFailedException e) {
      throw new ApprovalRequestExecutionException("CA Token Authentication Failed :" + e.getMessage(), e);
    } catch (AuthorizationDeniedException e) {
      throw new ApprovalRequestExecutionException("Authorization denied to activate CA Token :" + e.getMessage(), e);
    } catch (CATokenOfflineException e) {
      throw new ApprovalRequestExecutionException("CA Token still off-line :" + e.getMessage(), e);
    } catch (ApprovalException e) {
      throw new EJBException("This should never happen",e);
    } catch (WaitingForApprovalException e) {
      throw new EJBException("This should never happen",e);
    } finally{
View Full Code Here

  public void execute(UserAdminSession userAdminSession) throws ApprovalRequestExecutionException {
    log.debug("Executing AddEndEntity for user:" + userdata.getUsername());
    try{
      userAdminSession.addUser(getRequestAdmin(), userdata, clearpwd);
    } catch( PersistenceException e){
      throw new ApprovalRequestExecutionException("Error, user already exists or a database error ocurred", e);   
    } catch (AuthorizationDeniedException e) {
      throw new ApprovalRequestExecutionException("Authorization Denied :" + e.getMessage(), e);
    } catch (UserDoesntFullfillEndEntityProfile e) {
      throw new ApprovalRequestExecutionException("User Doesn't fullfil end entity profile :" + e.getMessage()  + e.getMessage(), e);     
    } catch (ApprovalException e) {
      throw new EJBException("This should never happen",e);
    } catch (WaitingForApprovalException e) {
      throw new EJBException("This should never happen",e);
    } catch (CADoesntExistsException e) {
      throw new ApprovalRequestExecutionException("CA does not exist :" + e.getMessage(), e);
    } catch (EjbcaException e){
      throw new ApprovalRequestExecutionException("Failed adding user :" + e.getErrorCode() + e.getMessage(), e);
    }
  }
View Full Code Here

TOP

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

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.