@Handler(supports=Retireable.class) public class BaseUnretireHandler extends Object implements UnretireHandler<Retireable>
RequiredDataAdvice class uses AOP around each method in every service to check to see if
its a unretire* method. If it is a unretire* method, this class is called to handle setting the
Retireable.getRetired(), Retireable.setRetireReason(String),
Retireable.setRetiredBy(User), and Retireable.setDateRetired(Date) all to null.
Retireable that are themselves a Retireable are looped
over and also unretired by the RequiredDataAdvice class. RequiredDataAdvice,
RetireHandler| Constructor and Description |
|---|
BaseUnretireHandler() |
| Modifier and Type | Method and Description |
|---|---|
void |
handle(Retireable retireableObject,
User retiringUser,
Date origParentRetiredDate,
String unused)
Called around every unretire* method to set
Retireable attributes to null. |
public void handle(Retireable retireableObject, User retiringUser, Date origParentRetiredDate, String unused)
handle in interface RequiredDataHandler<Retireable>handle in interface UnretireHandler<Retireable>retireableObject - an OpenmrsObject that needs to have some required data setretiringUser - the currently authenticated UserorigParentRetiredDate - the current Dateunused - (optional) would be the second argument in the save/void/unvoid/etc method, if
existsShould unset the retired bit
Should unset the retirer
Should unset the date retired
Should unset the retire reason
Should not act on already unretired objects
Should not act on retired objects with a different dateRetiredCopyright © 2024 OpenMRS Inc.. All rights reserved.