org.openmrs.api.handler
Class AuditableSaveHandler
java.lang.Object
org.openmrs.api.handler.AuditableSaveHandler
- All Implemented Interfaces:
- RequiredDataHandler<Auditable>, SaveHandler<Auditable>
@Handler(supports=Auditable.class)
public class AuditableSaveHandler
- extends java.lang.Object
- implements SaveHandler<Auditable>
This class deals with any object that implements Auditable
. When an Auditable
is
saved (via a save* method in a service), this handler is automatically called by the
RequiredDataAdvice
AOP class.
This sets the changedBy and dateChanged on the object if it has been saved previously (aka, it
has an id).
- Since:
- 1.5
- See Also:
RequiredDataHandler
Method Summary |
void |
handle(Auditable auditable,
User currentUser,
java.util.Date currentDate,
java.lang.String reason)
This sets the changedBy and dateChanged on the object if it has been saved already (aka, it
has an id). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AuditableSaveHandler
public AuditableSaveHandler()
handle
public void handle(Auditable auditable,
User currentUser,
java.util.Date currentDate,
java.lang.String reason)
- This sets the changedBy and dateChanged on the object if it has been saved already (aka, it
has an id).
- Specified by:
handle
in interface RequiredDataHandler<Auditable>
- Specified by:
handle
in interface SaveHandler<Auditable>
- Parameters:
auditable
- an OpenmrsObject that needs to have some required data setcurrentUser
- the user who is saving this objectcurrentDate
- the datetime this object is being savedreason
- (optional) would be the second argument in the save method, if exists- See Also:
RequiredDataHandler.handle(org.openmrs.OpenmrsObject,
org.openmrs.User, java.util.Date, java.lang.String)
- Expected behavior:
- set creator if null, not set creator if non null, set dateCreated if null, not set dateCreated if non null
Generated Apr 27 2012 10:06 PM. NOTE - these libraries are in active development and subject to change