use of com.intel.mtwilson.tag.dao.jdbi.CertificateDAO in project OpenAttestation by OpenAttestation.
the class CertificateRepository method delete.
@Override
public // @RequiresPermissions("tag_certificates:delete")
void delete(CertificateLocator locator) {
if (locator == null || locator.id == null) {
return;
}
log.debug("Certificate:Delete - Got request to delete Certificate with id {}.", locator.id.toString());
try (CertificateDAO dao = TagJdbi.certificateDao()) {
Certificate obj = dao.findById(locator.id);
if (obj != null) {
dao.delete(locator.id);
log.debug("Certificate:Delete - Deleted the Certificate {} successfully.", locator.id.toString());
} else {
log.info("Certificate:Delete - Certificate does not exist in the system.");
}
} catch (Exception ex) {
log.error("Certificate:Delete - Error during certificate deletion.", ex);
throw new RepositoryDeleteException(ex, locator);
}
}
Aggregations