/************************************************************************* * * * CESeCore: CE Security Core * * * * This software is free software; you can redistribute it and/or * * modify it under the terms of the GNU Lesser General Public * * License as published by the Free Software Foundation; either * * version 2.1 of the License, or any later version. * * * * See terms of license at gnu.org. * * * *************************************************************************/ package org.cesecore.certificates.certificate; import java.util.List; import javax.ejb.EJB; import javax.ejb.Stateless; import javax.ejb.TransactionAttribute; import javax.ejb.TransactionAttributeType; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import org.cesecore.certificates.crl.CRLData; import org.cesecore.certificates.crl.CrlStoreSessionLocal; import org.cesecore.config.CesecoreConfiguration; import org.cesecore.jndi.JndiConstants; /** * @version $Id: InternalCrlStoreSessionBean.java 30504 2018-11-14 14:46:08Z mikekushner $ */ @Stateless(mappedName = JndiConstants.APP_JNDI_PREFIX + "InternalCrlStoreSessionRemote") @TransactionAttribute(TransactionAttributeType.REQUIRED) public class InternalCrlStoreSessionBean implements InternalCrlStoreSessionRemote { @PersistenceContext(unitName = CesecoreConfiguration.PERSISTENCE_UNIT) private EntityManager entityManager; @EJB private CrlStoreSessionLocal crlStoreSession; @Override public void removeCrl(final String issuerDN) { List crls = CRLData.findByIssuerDN(entityManager, issuerDN); for(CRLData crlData : crls) { this.entityManager.remove(crlData); } } }