Package org.ejbca.core.ejb.ca.caadmin

Examples of org.ejbca.core.ejb.ca.caadmin.CertificateProfileData


        }

        if (isFreeCertificateProfileId(profileid)) {
            if (CertificateProfileData.findByProfileName(entityManager, profilename) == null) {
                try {
                    entityManager.persist(new CertificateProfileData(Integer.valueOf(profileid), profilename, profile));
                    flushProfileCache();
                    final String msg = INTRES.getLocalizedMessage("store.addedcertprofile", profilename);
                    logSession.log(admin, admin.getCaId(), LogConstants.MODULE_CA, new Date(), null, null,
                            LogConstants.EVENT_INFO_CERTPROFILE, msg);
                } catch (Exception e) {
View Full Code Here


    }

    @TransactionAttribute(TransactionAttributeType.REQUIRED)
    @Override
    public void internalChangeCertificateProfileNoFlushCache(final Admin admin, final String profilename, final CertificateProfile profile) {
        final CertificateProfileData pdl = CertificateProfileData.findByProfileName(entityManager, profilename);
        if (pdl == null) {
            final String msg = INTRES.getLocalizedMessage("store.erroreditprofile", profilename);             
            logSession.log(admin, admin.getCaId(), LogConstants.MODULE_CA, new Date(), null, null, LogConstants.EVENT_ERROR_CERTPROFILE, msg);
        } else {
          pdl.setCertificateProfile(profile);
          final String msg = INTRES.getLocalizedMessage("store.editedprofile", profilename);                
          logSession.log(admin, admin.getCaId(), LogConstants.MODULE_CA, new Date(), null, null, LogConstants.EVENT_INFO_CERTPROFILE, msg);
        }
    }
View Full Code Here

            if (!issuperadmin && profile.isApplicableToAnyCA()) {
                // Not superadministrator, do not use ANYCA;
                profile.setAvailableCAs(authorizedCaIds);
            }
            if (CertificateProfileData.findByProfileName(entityManager, newprofilename) == null) {
                entityManager.persist(new CertificateProfileData(findFreeCertificateProfileId(), newprofilename, profile));
                flushProfileCache();
                final String msg = INTRES.getLocalizedMessage("store.addedprofilewithtempl", newprofilename, orgprofilename);
                logSession.log(admin, admin.getCaId(), LogConstants.MODULE_CA, new Date(), null, null, LogConstants.EVENT_INFO_CERTPROFILE, msg);
            } else {
                final String msg = INTRES.getLocalizedMessage("store.erroraddprofilewithtempl", newprofilename, orgprofilename);
View Full Code Here

            logSession.log(admin, admin.getCaId(), LogConstants.MODULE_CA, new Date(), null, null, LogConstants.EVENT_ERROR_CERTPROFILE,
                    msg);
            throw new CertificateProfileExistsException(msg);
        }
        if (CertificateProfileData.findByProfileName(entityManager, newprofilename) == null) {
            final CertificateProfileData pdl = CertificateProfileData.findByProfileName(entityManager, oldprofilename);
            if (pdl == null) {
                final String msg = INTRES.getLocalizedMessage("store.errorrenameprofile", oldprofilename, newprofilename);
                logSession.log(admin, admin.getCaId(), LogConstants.MODULE_CA, new Date(), null, null,
                        LogConstants.EVENT_ERROR_CERTPROFILE, msg);
            } else {
                pdl.setCertificateProfileName(newprofilename);
                flushProfileCache();
                final String msg = INTRES.getLocalizedMessage("store.renamedprofile", oldprofilename, newprofilename);
                logSession.log(admin, admin.getCaId(), LogConstants.MODULE_CA, new Date(), null, null, LogConstants.EVENT_INFO_CERTPROFILE, msg);
            }
        } else {
View Full Code Here

    @Override
    public void initializeAndUpgradeProfiles(final Admin admin) {
        final Collection<CertificateProfileData> result = CertificateProfileData.findAll(entityManager);
        final Iterator<CertificateProfileData> iter = result.iterator();
        while(iter.hasNext()) {
                final CertificateProfileData pdata = iter.next();
                final String name = pdata.getCertificateProfileName();
                pdata.upgradeProfile();
                final float version = pdata.getCertificateProfile().getVersion();
                if (LOG.isDebugEnabled()) {
                    LOG.debug("Loaded certificate profile: "+name+" with version "+version);                 
                }
        }
        flushProfileCache();
View Full Code Here

    @TransactionAttribute(TransactionAttributeType.REQUIRED)
    @Override
    public void removeCertificateProfile(final Admin admin, final String profilename) {
        try {
          final CertificateProfileData pdl = CertificateProfileData.findByProfileName(entityManager, profilename);
          if (pdl == null) {
            if (LOG.isDebugEnabled()) {
              LOG.debug("Trying to remove a certificate profile that does not exist: "+profilename);                   
            }
          } else {
View Full Code Here

  }

  public void testCertificateProfileData() {
    LOG.trace(">testCertificateProfileData");
    logMemStats();
    CertificateProfileData entity = new CertificateProfileData();
    entity.setCertificateProfileName(VARCHAR_250B);
    entity.setDataUnsafe(HASHMAP_1M);
    entity.setId(BOGUS_INTEGER);
    entity.setRowProtection(CLOB_10KiB);
    entity.setRowVersion(0);
    storeAndRemoveEntity(entity);
    LOG.trace("<testCertificateProfileData");
  }
View Full Code Here

TOP

Related Classes of org.ejbca.core.ejb.ca.caadmin.CertificateProfileData

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.