Package org.ejbca.core.model.ra

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


      final Admin admin = ejbhelper.getAdmin();       
            logAdminName(admin,logger);
      // check authorization to CAID
      final UserDataVO userdata = userAdminSession.findUser(admin, username);
      if (userdata == null) {
        throw new NotFoundException(intres.getLocalizedMessage("ra.errorentitynotexist", username));
      }
      final int caid = userdata.getCAId();
      caAdminSession.verifyExistenceOfCA(caid);
      if (!authorizationSession.isAuthorizedNoLog(admin, AccessRulesConstants.CAPREFIX +caid)) {
          Authorizer.throwAuthorizationException(admin, AccessRulesConstants.CAPREFIX +caid, null);
View Full Code Here


        // check CAID
        UserDataVO userdata = userAdminSession.findUser(admin,username);
        if(userdata == null){
          String msg = intres.getLocalizedMessage("ra.errorentitynotexist", username);             
          throw new NotFoundException(msg);
        }
        int caid = userdata.getCAId();
        caAdminSession.verifyExistenceOfCA(caid);
        if(!authorizationSession.isAuthorized(admin, AccessRulesConstants.CAPREFIX +caid)) {
            Authorizer.throwAuthorizationException(admin, AccessRulesConstants.CAPREFIX +caid, null);
View Full Code Here

      // that was permanently revoked
      userAdminSession.revokeCert(admin, serno, issuerDN, reason);
    } catch (AuthorizationDeniedException e) {
      throw e;
    } catch (FinderException e) {
      throw new NotFoundException(e.getMessage());
        } catch (RuntimeException e) {  // EJBException, ClassCastException, ...
            throw EjbcaWSHelper.getInternalException(e, logger);
        } finally {
            logger.writeln();
            logger.flush();
View Full Code Here

      // check username
      UserDataVO userdata = userAdminSession.findUser(admin,username);
      if(userdata == null){
        String msg = intres.getLocalizedMessage("ra.errorentitynotexist", username);             
        throw new NotFoundException(msg);
      }
      // Check caid
      int caid = userdata.getCAId();
      caAdminSession.verifyExistenceOfCA(caid);
      if(!authorizationSession.isAuthorizedNoLog(admin, AccessRulesConstants.CAPREFIX +caid)) {
          Authorizer.throwAuthorizationException(admin, AccessRulesConstants.CAPREFIX +caid, null);
      }
      if (deleteUser) {
        userAdminSession.revokeAndDeleteUser(admin,username,reason);
      } else {
        userAdminSession.revokeUser(admin,username,reason);
      }
    }catch(AuthorizationDeniedException e){
      throw e;
    catch (FinderException e) {
      throw new NotFoundException(e.getMessage());
    } catch (RemoveException e) {
            throw EjbcaWSHelper.getInternalException(e, logger);
        } catch (RuntimeException e) {  // EJBException, ClassCastException, ...
            throw EjbcaWSHelper.getInternalException(e, logger);
        } finally {
View Full Code Here

                                        logger, ErrorCode.KEY_RECOVERY_NOT_AVAILABLE, null);
            }  
      UserDataVO userdata = userAdminSession.findUser(admin, username);
      if(userdata == null){
        String msg = intres.getLocalizedMessage("ra.errorentitynotexist", username);             
        throw new NotFoundException(msg);
      }
      if(keyRecoverySession.isUserMarked(admin, username)){
        // User is already marked for recovery.
        return;                    
      }
View Full Code Here

    }catch(AuthorizationDeniedException e){
      throw e;
    } catch (AlreadyRevokedException e) {
            throw EjbcaWSHelper.getEjbcaException(e.getMessage(), logger, ErrorCode.CERT_WRONG_STATUS, null);
    } catch (FinderException e) {
      throw new NotFoundException(e.getMessage());
        } catch (RuntimeException e) {  // EJBException, ClassCastException, ...
            throw EjbcaWSHelper.getInternalException(e, logger);
    }
  }
View Full Code Here

        // Exists an GenTokenCertificates
          Admin intAdmin = Admin.getInternalAdmin();
          UserDataVO userData = userAdminSession.findUser(intAdmin, hardTokenData.getUsername());
          if (userData == null) {
            String msg = intres.getLocalizedMessage("ra.errorentitynotexist", hardTokenData.getUsername());             
            throw new NotFoundException(msg);
          }
          int caid = userData.getCAId();
          caAdminSession.verifyExistenceOfCA(caid);
          ar = new GenerateTokenApprovalRequest(userData.getUsername(), userData.getDN(), hardTokenData.getHardToken().getLabel(),admin,null,WebServiceConfiguration.getNumberOfRequiredApprovals(),caid,userData.getEndEntityProfileId());
          int status = ApprovalDataVO.STATUS_REJECTED;          
View Full Code Here

    } catch (CreateException e) {
            throw EjbcaWSHelper.getInternalException(e, logger);
    } catch (IOException e) {
            throw EjbcaWSHelper.getInternalException(e, logger);
    } catch (FinderException e) {
      throw new NotFoundException(e.getMessage());
        } catch (RuntimeException e) {  // EJBException, ClassCastException, ...
            throw EjbcaWSHelper.getInternalException(e, logger);
        } finally {
            logger.writeln();
            logger.flush();
View Full Code Here

    } catch (CreateException e) {
            throw EjbcaWSHelper.getInternalException(e, logger);
    } catch (IOException e) {
            throw EjbcaWSHelper.getInternalException(e, logger);
    } catch (FinderException e) {
      throw new NotFoundException(e.getMessage());
        } catch (InvalidAlgorithmParameterException e) {
           throw EjbcaWSHelper.getInternalException(e, logger);
        } catch (RuntimeException e) {  // EJBException, ...
            throw EjbcaWSHelper.getInternalException(e, logger);
    } finally {
View Full Code Here

                    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

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.