org.apache.openjpa.audit
Class AuditLogger
java.lang.Object
org.apache.openjpa.audit.AuditLogger
- All Implemented Interfaces:
- Auditor, Configurable, Closeable
public class AuditLogger
- extends Object
- implements Auditor
A default auditor that simply prints the audited instances.
The output could be directed to a file, defaults to System.out.
- Author:
- Pinaki Poddar
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AuditLogger
public AuditLogger()
audit
public void audit(Broker broker,
Collection<Audited> newObjects,
Collection<Audited> updates,
Collection<Audited> deletes)
- Description copied from interface:
Auditor
- OpenJPA runtime will invoke this method with the given parameters
within a transaction.
- Specified by:
audit in interface Auditor
- 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.
setFile
public void setFile(String file)
throws FileNotFoundException
- Throws:
FileNotFoundException
getFile
public String getFile()
isRollbackOnError
public boolean isRollbackOnError()
- Description copied from interface:
Auditor
- Affirm if the transaction be rolled back if
audit
operation fails with an exception.
- Specified by:
isRollbackOnError in interface Auditor
setConfiguration
public void setConfiguration(Configuration conf)
- Specified by:
setConfiguration in interface Configurable
startConfiguration
public void startConfiguration()
- Specified by:
startConfiguration in interface Configurable
endConfiguration
public void endConfiguration()
- Specified by:
endConfiguration in interface Configurable
close
public void close()
throws Exception
- Specified by:
close in interface Closeable
- Throws:
Exception
Copyright © 2006–2013 Apache Software Foundation. All rights reserved.