org.openmrs.api.handler
Class BaseUnretireHandler

java.lang.Object
  extended by org.openmrs.api.handler.BaseUnretireHandler
All Implemented Interfaces:
RequiredDataHandler<Retireable>, UnretireHandler<Retireable>

@Handler(supports=Retireable.class)
public class BaseUnretireHandler
extends java.lang.Object
implements UnretireHandler<Retireable>

This is the super interface for all unretire* 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 unretire* method. If it is a unretire* method, this class is called to handle setting the Retireable.isRetired(), Retireable.setRetireReason(String), Retireable.setRetiredBy(User), and Retireable.setDateRetired(Date) all to null.

Child collections on this Retireable that are themselves a Retireable are looped over and also unretired by the RequiredDataAdvice class.

Since:
1.5
See Also:
RequiredDataAdvice, RetireHandler

Constructor Summary
BaseUnretireHandler()
           
 
Method Summary
 void handle(Retireable retireableObject, User retiringUser, java.util.Date origParentRetiredDate, java.lang.String unused)
          Called around every unretire* method to set Retireable attributes to null.

 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseUnretireHandler

public BaseUnretireHandler()
Method Detail

handle

public void handle(Retireable retireableObject,
                   User retiringUser,
                   java.util.Date origParentRetiredDate,
                   java.lang.String unused)
Called around every unretire* method to set Retireable attributes to null.

Specified by:
handle in interface RequiredDataHandler<Retireable>
Specified by:
handle in interface UnretireHandler<Retireable>
Parameters:
retireableObject - an OpenmrsObject that needs to have some required data set
retiringUser - the currently authenticated User
origParentRetiredDate - the current Date
unused - (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)
Expected behavior:
unset the retired bit, unset the retirer, unset the date retired, unset the retire reason, not act on already unretired objects, not act on retired objects with a different dateRetired

OpenMRS-1.7.x

Generated Apr 27 2012 10:06 PM. NOTE - these libraries are in active development and subject to change