Search in sources :

Example 1 with PurgeActionsAction

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

the class StandardAuditService method purgeActions.

@Override
public void purgeActions(Date end, Action purgeAction) {
    Transaction transaction = null;
    writeLock.lock();
    try {
        // start the transaction
        transaction = transactionBuilder.start();
        // purge the action database
        PurgeActionsAction purgeActions = new PurgeActionsAction(end, purgeAction);
        transaction.execute(purgeActions);
        // 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) PurgeActionsAction(org.apache.nifi.admin.service.action.PurgeActionsAction) 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 PurgeActionsAction (org.apache.nifi.admin.service.action.PurgeActionsAction)1 Transaction (org.apache.nifi.admin.service.transaction.Transaction)1 TransactionException (org.apache.nifi.admin.service.transaction.TransactionException)1