Package org.ejbca.core.model.ra

Examples of org.ejbca.core.model.ra.NotFoundException


                log.debug("Creating a STATUS_FAILED message (or throwing an exception).");
                if (failInfo.equals(FailInfo.WRONG_AUTHORITY)) {
                  throw new SignRequestException(failText);           
                }
                if (failInfo.equals(FailInfo.INCORRECT_DATA)) {
                  throw new NotFoundException(failText);
                }

            } else {
                log.debug("Creating a STATUS_PENDING message.");
            }              
View Full Code Here


    }
    ret = endEntityProfileSession.getEndEntityProfileId(admin, endEntityProfile);
    if (ret == 0) {
      final String msg = "No end entity profile found with name: "+endEntityProfile;
      LOG.info(msg);
      throw new NotFoundException(msg);
    }
    return ret;
  }
View Full Code Here

      }
      // Use keyId as CA name
      final CAInfo info = caAdminSession.getCAInfo(admin, keyId);
      if (info == null) {
        LOG.info("No CA found matching keyId: "+keyId);
        throw new NotFoundException("CA with name '"+keyId+"' not found");
      }
      if (LOG.isDebugEnabled()) {
        LOG.debug("Using CA: "+info.getName());
      }
      ret = info.getCAId();                                 
    } else {
      final CAInfo info = caAdminSession.getCAInfo(admin, caName);
      if (info == null) {
        LOG.info("No CA found matching caName: "+caName);
        throw new NotFoundException("CA with name '"+caName+"' not found");
      }
      ret = info.getCAId();         
      if (LOG.isDebugEnabled()) {
        LOG.debug("Using fixed caName when adding users in RA mode: "+caName+"("+ret+")");
      }
View Full Code Here

  protected int getUsedCertProfileId(final String certificateProfile) throws NotFoundException {
    final int ret = this.certificateProfileSession.getCertificateProfileId(this.admin, certificateProfile);         
    if (ret == 0) {
      final String msg = "No certificate profile found with name: "+certificateProfile;
      LOG.info(msg);
      throw new NotFoundException(msg);
    }
    return ret;
  }
View Full Code Here

              assertAuthorizedToEndEntityProfile(admin, data1.getEndEntityProfileId(), AccessRulesConstants.DELETE_RIGHTS, caid, username, LogConstants.EVENT_ERROR_DELETEENDENTITY);
            }
        } else {
            String msg = intres.getLocalizedMessage("ra.errorentitynotexist", username);
            logSession.log(admin, caid, LogConstants.MODULE_RA, new Date(), username, null, LogConstants.EVENT_ERROR_DELETEENDENTITY, msg);
            throw new NotFoundException(msg);
        }
        try {
            entityManager.remove(data1);
            String msg = intres.getLocalizedMessage("ra.removedentity", username);
            logSession.log(admin, caid, LogConstants.MODULE_RA, new Date(), username, null, LogConstants.EVENT_INFO_DELETEDENDENTITY, msg);
View Full Code Here

    @Override
    public void revokeAndDeleteUser(Admin admin, String username, int reason) throws AuthorizationDeniedException, ApprovalException,
            WaitingForApprovalException, RemoveException, NotFoundException {
        final UserData data = UserData.findByUsername(entityManager, username);
        if (data == null) {
            throw new NotFoundException("User '" + username + "' not found.");
        }
        // Authorized?
        final int caid = data.getCaId();
        assertAuthorizedToCA(admin, caid, username, LogConstants.EVENT_ERROR_REVOKEDENDENTITY);
        if (getGlobalConfiguration(admin).getEnableEndEntityProfileLimitations()) {
          assertAuthorizedToEndEntityProfile(admin, data.getEndEntityProfileId(), AccessRulesConstants.REVOKE_RIGHTS, caid, username, LogConstants.EVENT_ERROR_REVOKEDENDENTITY);
        }
        try {
            if (data.getStatus() != UserDataConstants.STATUS_REVOKED) {
                // Check if approvals is required.
                final int numOfReqApprovals = getNumOfApprovalRequired(admin, CAInfo.REQ_APPROVAL_REVOCATION, caid, data.getCertificateProfileId());
                if (numOfReqApprovals > 0) {
                    final RevocationApprovalRequest ar = new RevocationApprovalRequest(true, username, reason, admin, numOfReqApprovals, caid, data.getEndEntityProfileId());
                    if (ApprovalExecutorUtil.requireApproval(ar, NONAPPROVABLECLASSNAMES_REVOKEANDDELETEUSER)) {
                        approvalSession.addApprovalRequest(admin, ar, getGlobalConfiguration(admin));
                        throw new WaitingForApprovalException(intres.getLocalizedMessage("ra.approvalrevoke"));
                    }
                }
                try {
                    revokeUser(admin, username, reason);
                } catch (AlreadyRevokedException e) {
                    // This just means that the end entity was revoked before
                    // this request could be completed. No harm.
                }
            }
        } catch (FinderException e) {
            throw new NotFoundException("User " + username + "not found.");
        }
        deleteUser(admin, username);
    }
View Full Code Here

TOP

Related Classes of org.ejbca.core.model.ra.NotFoundException

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.