Package javax.ejb

Examples of javax.ejb.FinderException


            AdminGroupData agl = AdminGroupData.findByGroupName(entityManager, newname);
            if (agl == null) {
                try {
                    agl = AdminGroupData.findByGroupName(entityManager, oldname);
                    if (agl == null) {
                        throw new FinderException("Cant find admin group w name " + oldname);
                    }
                    agl.setAdminGroupName(newname);
                    authTreeSession.signalForAuthorizationTreeUpdate();
                    success = true;
                } catch (Exception e) {
View Full Code Here


    public void removeAdminEntities(final Admin admin, final String admingroupname, final Collection<AdminEntity> adminentities) {
        if (!admingroupname.equals(AdminGroup.DEFAULTGROUPNAME)) {
            try {
                final AdminGroupData agdl = AdminGroupData.findByGroupName(entityManager, admingroupname);
                if (agdl == null) {
                    throw new FinderException("Could not find admin group " + admingroupname);
                }
                agdl.removeAdminEntities(entityManager, adminentities);
                authTreeSession.signalForAuthorizationTreeUpdate();
                final String msg = INTRES.getLocalizedMessage("authorization.adminremoved", admingroupname);
                logSession.log(admin, LogConstants.INTERNALCAID, LogConstants.MODULE_RA, new java.util.Date(), null, null,
View Full Code Here

                                Date revDate = data.getRevocationDate();
                                if (revDate == null) {
                                        data.setRevocationDate(now);
                                        CertificateData certdata = CertificateData.findByFingerprint(entityManager, data.getCertificateFingerprint());
                                        if (certdata == null) {
                                                throw new FinderException("No certificate with fingerprint " + data.getCertificateFingerprint());
                                        }
                                        // Set revocation date in the database
                                        certdata.setRevocationDate(now);
                                }
                        }
View Full Code Here

        }
        int caid = LogConstants.INTERNALCAID;
        try {
            org.ejbca.core.ejb.hardtoken.HardTokenData htd = org.ejbca.core.ejb.hardtoken.HardTokenData.findByTokenSN(entityManager, tokensn);
            if (htd == null) {
                throw new FinderException();
            }
            htd.setTokenType(tokentype);
            htd.setData(setHardToken(admin, globalConfigurationSession.getCachedGlobalConfiguration(admin).getHardTokenEncryptCA(), hardtokendata));
            htd.setModifyTime(new java.util.Date());
            caid = htd.getSignificantIssuerDN().hashCode();
View Full Code Here

                        // actual cert or a native query w SqlResultSetMapping..
                  
                        CertificateData cd = CertificateData.findByFingerprint(entityManager, fingerprint);

                        if (cd == null) {
                            throw new FinderException();
                        }
                        try {
                          published = publisherQueueSession.storeCertificateNonTransactional(publisher, admin, cd.getCertificate(), username, password, userDataDN,
                              cd.getCaFingerprint(), cd.getStatus(), cd.getType(), cd.getRevocationDate(), cd.getRevocationReason(), cd.getTag(), cd
                              .getCertificateProfileId(), cd.getUpdateTime(), ei);
                        } catch (EJBException e) {
                          final Throwable t = e.getCause();
                          if (t instanceof PublisherException) {
                            throw (PublisherException)t;
                          } else {
                            throw e;
                          }
                        }
                    } else {
                        String msg = intres.getLocalizedMessage("publisher.nopublisher", publisherId);
                        log.info(msg);
                    }
                } else if (publishType == PublisherConst.PUBLISH_TYPE_CRL) {

                    if (log.isDebugEnabled()) {
                        log.debug("Publishing CRL");
                    }
                    CRLData crlData = CRLData.findByFingerprint(entityManager, fingerprint);

                    if (crlData == null) {
                        throw new FinderException();
                    }
                    published = publisherQueueSession.storeCRLNonTransactional(publisher, admin, crlData.getCRLBytes(), crlData.getCaFingerprint(), crlData.getCrlNumber(), userDataDN);
                } else {
                    String msg = intres.getLocalizedMessage("publisher.unknowntype", publishType);
                    log.error(msg);
View Full Code Here

        final String hexSerial = certificate.getSerialNumber().toString(16);
        final String dn = CertTools.getIssuerDN(certificate);
        try {
          org.ejbca.core.ejb.keyrecovery.KeyRecoveryData krd = org.ejbca.core.ejb.keyrecovery.KeyRecoveryData.findByPK(entityManager, new KeyRecoveryDataPK(hexSerial, dn));
          if (krd == null) {
            throw new FinderException();
          }
            krd.setMarkedAsRecoverable(markedasrecoverable);
            int caid = dn.hashCode();
            KeyRecoveryCAServiceResponse response = (KeyRecoveryCAServiceResponse) caAdminSession.extendedService(admin, caid,
                    new KeyRecoveryCAServiceRequest(KeyRecoveryCAServiceRequest.COMMAND_ENCRYPTKEYS, keypair));
View Full Code Here

        final String dn = CertTools.getIssuerDN(certificate);
        try {
            String username = null;
          org.ejbca.core.ejb.keyrecovery.KeyRecoveryData krd = org.ejbca.core.ejb.keyrecovery.KeyRecoveryData.findByPK(entityManager, new KeyRecoveryDataPK(hexSerial, dn));
          if (krd == null) {
            throw new FinderException();
          }
            username = krd.getUsername();
            entityManager.remove(krd);
            String msg = intres.getLocalizedMessage("keyrecovery.removeddata", hexSerial, dn);             
            logSession.log(admin, certificate, LogConstants.MODULE_KEYRECOVERY, new java.util.Date(), username,
View Full Code Here

          data1.setExtendedInformation(ei);
        }
      } else {
        String msg = intres.getLocalizedMessage("ra.errorentitynotexist", username);
        logSession.log(admin, caid, LogConstants.MODULE_RA, new Date(), username, null, LogConstants.EVENT_INFO_CHANGEDENDENTITY, msg);
        throw new FinderException(msg);
      }
      if (log.isTraceEnabled()) {
        log.trace("<resetRamainingLoginAttempts(" + username + "): " + resetValue);
      }
    }
View Full Code Here

              }
            }
        } else {
            String msg = intres.getLocalizedMessage("ra.errorentitynotexist", username);
            logSession.log(admin, caid, LogConstants.MODULE_RA, new Date(), username, null, LogConstants.EVENT_INFO_CHANGEDENDENTITY, msg);
            throw new FinderException(msg);
        }
        if (log.isTraceEnabled()) {
            log.trace("<decRemainingLoginAttempts(" + username + "): " + counter);
        }
    }
View Full Code Here

                }
            }
        } else {
            String msg = intres.getLocalizedMessage("ra.errorentitynotexist", username);
            logSession.log(admin, caid, LogConstants.MODULE_RA, new Date(), username, null, LogConstants.EVENT_INFO_CHANGEDENDENTITY, msg);
            throw new FinderException(msg);
        }
        if (counter <= 0) {
            setUserStatus(admin, data1, UserDataConstants.STATUS_GENERATED);
        }
        if (log.isTraceEnabled()) {
View Full Code Here

TOP

Related Classes of javax.ejb.FinderException

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.