Package org.apache.openjpa.audit
Class AuditLogger
java.lang.Object
org.apache.openjpa.audit.AuditLogger
- All Implemented Interfaces:
Auditor,Configurable,Closeable
A default auditor that simply prints the audited instances.
The output could be directed to a file, defaults to System.out.
- Author:
- Pinaki Poddar
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaudit(Broker broker, Collection<Audited> newObjects, Collection<Audited> updates, Collection<Audited> deletes) OpenJPA runtime will invoke this method with the given parameters within a transaction.voidclose()voidInvoked upon completion of bean property configuration for this object.getFile()booleanAffirm if the transaction be rolled back ifauditoperation fails with an exception.voidInvoked prior to setting bean properties.voidvoidInvoked before bean property configuration is begun on this object.
-
Constructor Details
-
AuditLogger
public AuditLogger()
-
-
Method Details
-
audit
public void audit(Broker broker, Collection<Audited> newObjects, Collection<Audited> updates, Collection<Audited> deletes) Description copied from interface:AuditorOpenJPA runtime will invoke this method with the given parameters within a transaction.- Specified by:
auditin interfaceAuditor- 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
- Throws:
FileNotFoundException
-
getFile
-
isRollbackOnError
public boolean isRollbackOnError()Description copied from interface:AuditorAffirm if the transaction be rolled back ifauditoperation fails with an exception.- Specified by:
isRollbackOnErrorin interfaceAuditor
-
setConfiguration
Description copied from interface:ConfigurableInvoked prior to setting bean properties.- Specified by:
setConfigurationin interfaceConfigurable
-
startConfiguration
public void startConfiguration()Description copied from interface:ConfigurableInvoked before bean property configuration is begun on this object.- Specified by:
startConfigurationin interfaceConfigurable
-
endConfiguration
public void endConfiguration()Description copied from interface:ConfigurableInvoked upon completion of bean property configuration for this object.- Specified by:
endConfigurationin interfaceConfigurable
-
close
-