Search in sources :

Example 1 with DeleteKeysAction

use of org.apache.nifi.admin.service.action.DeleteKeysAction in project nifi by apache.

the class StandardKeyService method deleteKey.

@Override
public void deleteKey(String identity) {
    Transaction transaction = null;
    writeLock.lock();
    try {
        // start the transaction
        transaction = transactionBuilder.start();
        // delete the keys
        DeleteKeysAction deleteKeys = new DeleteKeysAction(identity);
        transaction.execute(deleteKeys);
        // commit the transaction
        transaction.commit();
    } catch (TransactionException | DataAccessException te) {
        rollback(transaction);
        throw new AdministrationException(te);
    } catch (Throwable t) {
        rollback(transaction);
        throw t;
    } finally {
        closeQuietly(transaction);
        writeLock.unlock();
    }
}
Also used : TransactionException(org.apache.nifi.admin.service.transaction.TransactionException) Transaction(org.apache.nifi.admin.service.transaction.Transaction) DeleteKeysAction(org.apache.nifi.admin.service.action.DeleteKeysAction) AdministrationException(org.apache.nifi.admin.service.AdministrationException) DataAccessException(org.apache.nifi.admin.dao.DataAccessException)

Aggregations

DataAccessException (org.apache.nifi.admin.dao.DataAccessException)1 AdministrationException (org.apache.nifi.admin.service.AdministrationException)1 DeleteKeysAction (org.apache.nifi.admin.service.action.DeleteKeysAction)1 Transaction (org.apache.nifi.admin.service.transaction.Transaction)1 TransactionException (org.apache.nifi.admin.service.transaction.TransactionException)1