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 {