Search in sources :

Example 1 with RepositoryDeleteException

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

the class KvAttributeRepository method delete.

@Override
public //    @RequiresPermissions("tag_kv_attributes:delete,search")     
void delete(KvAttributeFilterCriteria criteria) {
    log.debug("KvAttribute:Delete - Got request to delete KvAttribute by search criteria.");
    KvAttributeCollection objCollection = search(criteria);
    try {
        for (KvAttribute obj : objCollection.getKvAttributes()) {
            KvAttributeLocator locator = new KvAttributeLocator();
            locator.id = obj.getId();
            delete(locator);
        }
    } catch (RepositoryException re) {
        throw re;
    } catch (Exception ex) {
        log.error("KvAttribute:Delete - Error during KvAttribute deletion.", ex);
        throw new RepositoryDeleteException(ex);
    }
}
Also used : RepositoryDeleteException(com.intel.mtwilson.datatypes.RepositoryDeleteException) KvAttributeCollection(com.intel.mtwilson.datatypes.KvAttributeCollection) KvAttribute(com.intel.mtwilson.datatypes.KvAttribute) RepositoryException(com.intel.mtwilson.datatypes.RepositoryException) KvAttributeLocator(com.intel.mtwilson.datatypes.KvAttributeLocator) 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)

Aggregations

KvAttribute (com.intel.mtwilson.datatypes.KvAttribute)1 KvAttributeCollection (com.intel.mtwilson.datatypes.KvAttributeCollection)1 KvAttributeLocator (com.intel.mtwilson.datatypes.KvAttributeLocator)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