org.openmrs.api.handler
Interface RetireHandler<R extends Retireable>
- All Superinterfaces:
- RequiredDataHandler<R>
- All Known Implementing Classes:
- BaseRetireHandler
public interface RetireHandler<R extends Retireable>
- extends RequiredDataHandler<R>
This is the super interface for all retire* actions that take place on all services. The
RequiredDataAdvice
class uses AOP around each method in every service to check to see if
its a retire* method. If it is a retire* method, this class is called to handle setting the
Retireable.isRetired()
, Retireable.setRetireReason(String)
,
Retireable.setRetiredBy(User)
, and Retireable.setDateRetired(Date)
.
Child collections on this Retireable
that are themselves a Retireable
are looped
over and also retired by the RequiredDataAdvice
class.
- Since:
- 1.5
- See Also:
BaseRetireHandler
,
RequiredDataAdvice
Method Summary |
void |
handle(R retireableObject,
User retiringUser,
java.util.Date retireDate,
java.lang.String retireReason)
Implementing methods should set "retired" to true, the retired reason, and the
retiredBy/dateRetired (if those are non-null). |
handle
void handle(R retireableObject,
User retiringUser,
java.util.Date retireDate,
java.lang.String retireReason)
- Implementing methods should set "retired" to true, the retired reason, and the
retiredBy/dateRetired (if those are non-null).
- Specified by:
handle
in interface RequiredDataHandler<R extends Retireable>
- Parameters:
retireableObject
- an OpenmrsObject
that needs to have some required data setretiringUser
- the currently authenticated User
retireDate
- the current Date
retireReason
- (optional) would be the second argument in the save/void/unvoid/etc method, if
exists- See Also:
RequiredDataHandler.handle(org.openmrs.OpenmrsObject,
org.openmrs.User, java.util.Date, java.lang.String)
Generated Apr 27 2012 10:06 PM. NOTE - these libraries are in active development and subject to change