com.arsdigita.auditing
Class AuditingObserver

java.lang.Object
  extended bycom.arsdigita.auditing.AuditingObserver
All Implemented Interfaces:
DomainObjectObserver

public class AuditingObserver
extends Object
implements DomainObjectObserver

Implements DomainObjectObserver pattern so that it can be added to another DomainObject to provide automatic auditing.

Version:
1.0
Author:
Joseph Bank

Field Summary
static org.apache.log4j.Logger s_log
           
static String versionId
           
 
Constructor Summary
AuditingObserver(BasicAuditTrail audit_trail)
          Creates a new AuditingObserver using the passed in audit trail.
 
Method Summary
 void add(DomainObject dobj, String name, DataObject dataObject)
          Callback for an add operation on the observed DomainObject
 void afterDelete(DomainObject dobj)
          Callback after a delete operation on the observed DomainObject
 void afterSave(DomainObject dobj)
          Saves the modified audit trail.
 void beforeDelete(DomainObject dobj)
          Callback before a delete operation on the observed DomainObject
 void beforeSave(DomainObject dobj)
          Records some information about the save operation and modifies the audit trail.
 void clear(DomainObject dobj, String name)
          Callback for a clear operation on the observed DomainObject
 boolean equals(Object other)
           
protected  AuditingSaveInfo getSaveInfo()
           
 int hashCode()
           
 void remove(DomainObject dobj, String name, DataObject dataObject)
          Callback for a remove operation on the observed DomainObject
 void set(DomainObject dobj, String name, Object old_value, Object new_value)
          Callback for a set operation on the observed DomainObject
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

s_log

public static final org.apache.log4j.Logger s_log

versionId

public static final String versionId
See Also:
Constant Field Values
Constructor Detail

AuditingObserver

public AuditingObserver(BasicAuditTrail audit_trail)
Creates a new AuditingObserver using the passed in audit trail.

Method Detail

getSaveInfo

protected AuditingSaveInfo getSaveInfo()

beforeSave

public void beforeSave(DomainObject dobj)
                throws PersistenceException
Records some information about the save operation and modifies the audit trail.

Specified by:
beforeSave in interface DomainObjectObserver
Parameters:
dobj - the observed domain object
Throws:
PersistenceException

afterSave

public void afterSave(DomainObject dobj)
               throws PersistenceException
Saves the modified audit trail.

Specified by:
afterSave in interface DomainObjectObserver
Parameters:
dobj - the observed domain object
Throws:
PersistenceException

beforeDelete

public void beforeDelete(DomainObject dobj)
                  throws PersistenceException
Description copied from interface: DomainObjectObserver
Callback before a delete operation on the observed DomainObject

Specified by:
beforeDelete in interface DomainObjectObserver
Parameters:
dobj - the observed domain object
Throws:
PersistenceException

set

public void set(DomainObject dobj,
                String name,
                Object old_value,
                Object new_value)
Description copied from interface: DomainObjectObserver
Callback for a set operation on the observed DomainObject

Specified by:
set in interface DomainObjectObserver
Parameters:
dobj - the observed domain object
name - the name of the parameter being set
old_value - the old value of the parameter being set
new_value - the old value of the parameter being set

add

public void add(DomainObject dobj,
                String name,
                DataObject dataObject)
Description copied from interface: DomainObjectObserver
Callback for an add operation on the observed DomainObject

Specified by:
add in interface DomainObjectObserver
Parameters:
dobj - the observed domain object
name - the name of the parameter being set

remove

public void remove(DomainObject dobj,
                   String name,
                   DataObject dataObject)
Description copied from interface: DomainObjectObserver
Callback for a remove operation on the observed DomainObject

Specified by:
remove in interface DomainObjectObserver
Parameters:
dobj - the observed domain object
name - the name of the parameter being set

clear

public void clear(DomainObject dobj,
                  String name)
Description copied from interface: DomainObjectObserver
Callback for a clear operation on the observed DomainObject

Specified by:
clear in interface DomainObjectObserver
Parameters:
dobj - the observed domain object
name - the name of the parameter being set

afterDelete

public void afterDelete(DomainObject dobj)
                 throws PersistenceException
Description copied from interface: DomainObjectObserver
Callback after a delete operation on the observed DomainObject

Specified by:
afterDelete in interface DomainObjectObserver
Parameters:
dobj - the observed domain object
Throws:
PersistenceException

equals

public boolean equals(Object other)

hashCode

public int hashCode()


Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 20 2004:2337 UTC