Interface Auditor

  • All Superinterfaces:
    Closeable, Configurable
    All Known Implementing Classes:
    AuditLogger

    public interface Auditor
    extends Configurable, Closeable
    An auditor is responsible for recoding the audited information. OpenJPA runtime tracks the auditable instances and invoke implementation of this interface within a transaction.
    The user implementation of this interface is configurable via standard OpenJPA plug-in configuration framework.
    Since:
    2.2.0
    Author:
    Pinaki Poddar
    • Method Detail

      • audit

        void audit​(Broker broker,
                   java.util.Collection<Audited> newObjects,
                   java.util.Collection<Audited> updates,
                   java.util.Collection<Audited> deletes)
        OpenJPA runtime will invoke this method with the given parameters within a transaction.
        Parameters:
        broker - the active persistence context.
        newObjects - the set of auditable objects being created. Can be empty, but never null.
        updates - the set of auditable objects being updated. Can be empty, but never null.
        deletes - the set of auditable objects being deleted. Can be empty, but never null.
      • isRollbackOnError

        boolean isRollbackOnError()
        Affirm if the transaction be rolled back if audit operation fails with an exception.