Search in sources :

Example 1 with RepositoryRetrieveException

use of com.intel.mtwilson.tag.repository.RepositoryRetrieveException in project OpenAttestation by OpenAttestation.

the class CertificateRepository method retrieve.

@Override
public //    @RequiresPermissions("tag_certificates:retrieve") 
Certificate retrieve(CertificateLocator locator) {
    log.debug("Retrieving Certificate");
    if (locator == null || locator.id == null) {
        return null;
    }
    log.debug("Certificate:Retrieve - Got request to retrieve user with id {}.", locator.id);
    try (CertificateDAO dao = TagJdbi.certificateDao()) {
        Certificate obj = dao.findById(locator.id);
        if (obj != null)
            return obj;
    } catch (Exception ex) {
        log.error("Certificate:Retrieve - Error during certificate retrieval.", ex);
        throw new RepositoryRetrieveException(ex, locator);
    }
    return null;
}
Also used : CertificateDAO(com.intel.mtwilson.tag.dao.jdbi.CertificateDAO) RepositoryRetrieveException(com.intel.mtwilson.tag.repository.RepositoryRetrieveException) RepositoryCreateException(com.intel.mtwilson.tag.repository.RepositoryCreateException) RepositoryDeleteException(com.intel.mtwilson.tag.repository.RepositoryDeleteException) RepositoryStoreException(com.intel.mtwilson.tag.repository.RepositoryStoreException) RepositoryStoreConflictException(com.intel.mtwilson.tag.repository.RepositoryStoreConflictException) RepositoryRetrieveException(com.intel.mtwilson.tag.repository.RepositoryRetrieveException) RepositoryException(com.intel.mtwilson.tag.repository.RepositoryException) RepositorySearchException(com.intel.mtwilson.tag.repository.RepositorySearchException) RepositoryCreateConflictException(com.intel.mtwilson.tag.repository.RepositoryCreateConflictException) Certificate(com.intel.mtwilson.datatypes.Certificate) X509AttributeCertificate(com.intel.mtwilson.datatypes.X509AttributeCertificate)

Aggregations

Certificate (com.intel.mtwilson.datatypes.Certificate)1 X509AttributeCertificate (com.intel.mtwilson.datatypes.X509AttributeCertificate)1 CertificateDAO (com.intel.mtwilson.tag.dao.jdbi.CertificateDAO)1 RepositoryCreateConflictException (com.intel.mtwilson.tag.repository.RepositoryCreateConflictException)1 RepositoryCreateException (com.intel.mtwilson.tag.repository.RepositoryCreateException)1 RepositoryDeleteException (com.intel.mtwilson.tag.repository.RepositoryDeleteException)1 RepositoryException (com.intel.mtwilson.tag.repository.RepositoryException)1 RepositoryRetrieveException (com.intel.mtwilson.tag.repository.RepositoryRetrieveException)1 RepositorySearchException (com.intel.mtwilson.tag.repository.RepositorySearchException)1 RepositoryStoreConflictException (com.intel.mtwilson.tag.repository.RepositoryStoreConflictException)1 RepositoryStoreException (com.intel.mtwilson.tag.repository.RepositoryStoreException)1