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);
}
}
Aggregations