Search in sources :

Example 1 with RepositoryCreateException

use of com.intel.mtwilson.datatypes.RepositoryCreateException in project OpenAttestation by OpenAttestation.

the class KvAttributeRepository method create.

@Override
public //    @RequiresPermissions("tag_kv_attributes:create")     
void create(KvAttribute item) {
    log.debug("KvAttribute:Create - Got request to create a new KvAttribute {}.", item.getId().toString());
    CertificateLocator locator = new CertificateLocator();
    locator.id = item.getId();
    try (KvAttributeDAO dao = TagJdbi.kvAttributeDao()) {
        dao.insert(item.getId(), item.getName(), item.getValue());
        log.debug("KvAttribute:Create - Created the KvAttribute {} successfully.", item.getId().toString());
    } catch (RepositoryException re) {
        throw re;
    } catch (Exception ex) {
        log.error("KvAttribute:Create - Error during KvAttribute creation.", ex);
        throw new RepositoryCreateException(ex, locator);
    }
}
Also used : CertificateLocator(com.intel.mtwilson.datatypes.CertificateLocator) KvAttributeDAO(com.intel.mtwilson.tag.dao.jdbi.KvAttributeDAO) RepositoryException(com.intel.mtwilson.datatypes.RepositoryException) RepositoryCreateException(com.intel.mtwilson.datatypes.RepositoryCreateException) RepositoryDeleteException(com.intel.mtwilson.datatypes.RepositoryDeleteException) RepositoryRetrieveException(com.intel.mtwilson.datatypes.RepositoryRetrieveException) RepositoryException(com.intel.mtwilson.datatypes.RepositoryException) RepositorySearchException(com.intel.mtwilson.datatypes.RepositorySearchException) RepositoryStoreConflictException(com.intel.mtwilson.datatypes.RepositoryStoreConflictException) RepositoryStoreException(com.intel.mtwilson.datatypes.RepositoryStoreException) RepositoryCreateException(com.intel.mtwilson.datatypes.RepositoryCreateException)

Aggregations

CertificateLocator (com.intel.mtwilson.datatypes.CertificateLocator)1 RepositoryCreateException (com.intel.mtwilson.datatypes.RepositoryCreateException)1 RepositoryDeleteException (com.intel.mtwilson.datatypes.RepositoryDeleteException)1 RepositoryException (com.intel.mtwilson.datatypes.RepositoryException)1 RepositoryRetrieveException (com.intel.mtwilson.datatypes.RepositoryRetrieveException)1 RepositorySearchException (com.intel.mtwilson.datatypes.RepositorySearchException)1 RepositoryStoreConflictException (com.intel.mtwilson.datatypes.RepositoryStoreConflictException)1 RepositoryStoreException (com.intel.mtwilson.datatypes.RepositoryStoreException)1 KvAttributeDAO (com.intel.mtwilson.tag.dao.jdbi.KvAttributeDAO)1