org.openmrs.notification.impl
Class AlertServiceImpl

java.lang.Object
  extended by org.openmrs.api.impl.BaseOpenmrsService
      extended by org.openmrs.notification.impl.AlertServiceImpl
All Implemented Interfaces:
java.io.Serializable, OpenmrsService, AlertService

public class AlertServiceImpl
extends BaseOpenmrsService
implements java.io.Serializable, AlertService

This class should not be instantiated by itself.

See Also:
AlertService, Serialized Form

Constructor Summary
AlertServiceImpl()
          Default constructor
 
Method Summary
 void createAlert(Alert alert)
          Deprecated.  
 void createAlert(java.lang.String text, java.util.Collection<User> users)
          Deprecated.  
 void createAlert(java.lang.String text, User user)
          Deprecated.  
 Alert getAlert(java.lang.Integer alertId)
          Get alert by internal identifier
 java.util.List<Alert> getAlerts()
          Deprecated.  
 java.util.List<Alert> getAlerts(User user)
          Deprecated.  
 java.util.List<Alert> getAlerts(User user, boolean includeRead, boolean includeExpired)
          Finds alerts for the given user with the given status
 java.util.List<Alert> getAlertsByUser(User user)
          Find the alerts that are not read and have not expired for a user This will probably be the most commonly called method If null is passed in for user, find alerts for the currently authenticated user.
 java.util.List<Alert> getAllActiveAlerts(User user)
          Find all alerts for a user that have not expired
 java.util.List<Alert> getAllAlerts()
          Get all unexpired alerts for all users
 java.util.List<Alert> getAllAlerts(boolean includeExpired)
          Get alerts for all users while obeying includeExpired
 java.util.List<Alert> getAllAlerts(User user)
          Deprecated.  
 void markAlertRead(Alert alert)
          Deprecated.  
 void purgeAlert(Alert alert)
          Completely delete the given alert from the database
 Alert saveAlert(Alert alert)
          Save the given alert in the database
 void setAlertDAO(AlertDAO dao)
          Used by Spring to set the specific/chosen database access implementation
 void updateAlert(Alert alert)
          Deprecated.  
 
Methods inherited from class org.openmrs.api.impl.BaseOpenmrsService
onShutdown, onStartup
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.openmrs.api.OpenmrsService
onShutdown, onStartup
 

Constructor Detail

AlertServiceImpl

public AlertServiceImpl()
Default constructor

Method Detail

setAlertDAO

public void setAlertDAO(AlertDAO dao)
Description copied from interface: AlertService
Used by Spring to set the specific/chosen database access implementation

Specified by:
setAlertDAO in interface AlertService
Parameters:
dao - The dao implementation to use
See Also:
AlertService.setAlertDAO(org.openmrs.notification.db.AlertDAO)

createAlert

public void createAlert(Alert alert)
                 throws APIException
Deprecated. 

Specified by:
createAlert in interface AlertService
Throws:
APIException
See Also:
AlertService.createAlert(org.openmrs.notification.Alert)

saveAlert

public Alert saveAlert(Alert alert)
                throws APIException
Description copied from interface: AlertService
Save the given alert in the database

Specified by:
saveAlert in interface AlertService
Parameters:
alert - the Alert object to save
Returns:
The saved alert object
Throws:
APIException
See Also:
AlertService.saveAlert(org.openmrs.notification.Alert)

createAlert

public void createAlert(java.lang.String text,
                        User user)
                 throws APIException
Deprecated. 

Description copied from interface: AlertService
Use AlertService.saveAlert(new Alert(text, user))

Specified by:
createAlert in interface AlertService
Throws:
APIException
See Also:
AlertService.createAlert(java.lang.String, org.openmrs.User)

createAlert

public void createAlert(java.lang.String text,
                        java.util.Collection<User> users)
                 throws APIException
Deprecated. 

Description copied from interface: AlertService
Use AlertService.saveAlert(new Alert(text, users))

Specified by:
createAlert in interface AlertService
Throws:
APIException
See Also:
AlertService.createAlert(java.lang.String, java.util.Collection)

getAlert

public Alert getAlert(java.lang.Integer alertId)
               throws APIException
Description copied from interface: AlertService
Get alert by internal identifier

Specified by:
getAlert in interface AlertService
Parameters:
alertId - internal alert identifier
Returns:
alert with given internal identifier
Throws:
APIException
See Also:
AlertService.getAlert(java.lang.Integer)

updateAlert

public void updateAlert(Alert alert)
                 throws APIException
Deprecated. 

Specified by:
updateAlert in interface AlertService
Throws:
APIException
See Also:
AlertService.updateAlert(org.openmrs.notification.Alert)

purgeAlert

public void purgeAlert(Alert alert)
                throws APIException
Description copied from interface: AlertService
Completely delete the given alert from the database

Specified by:
purgeAlert in interface AlertService
Parameters:
alert - the Alert to purge/delete
Throws:
APIException
See Also:
AlertService.purgeAlert(org.openmrs.notification.Alert)

markAlertRead

public void markAlertRead(Alert alert)
                   throws APIException
Deprecated. 

Description copied from interface: AlertService
Use AlertService.saveAlert(alert.markAlertRead())

Specified by:
markAlertRead in interface AlertService
Throws:
APIException
See Also:
AlertService.markAlertRead(org.openmrs.notification.Alert)

getAllAlerts

public java.util.List<Alert> getAllAlerts(User user)
                                   throws APIException
Deprecated. 

Specified by:
getAllAlerts in interface AlertService
Throws:
APIException
See Also:
AlertService.getAllAlerts(org.openmrs.User)

getAllActiveAlerts

public java.util.List<Alert> getAllActiveAlerts(User user)
                                         throws APIException
Description copied from interface: AlertService
Find all alerts for a user that have not expired

Specified by:
getAllActiveAlerts in interface AlertService
Returns:
alerts that are unread _or_ read that have not expired
Throws:
APIException
See Also:
AlertService.getAllActiveAlerts(org.openmrs.User)

getAlerts

public java.util.List<Alert> getAlerts(User user)
                                throws APIException
Deprecated. 

Specified by:
getAlerts in interface AlertService
Throws:
APIException
See Also:
AlertService.getAlerts(org.openmrs.User)

getAlertsByUser

public java.util.List<Alert> getAlertsByUser(User user)
                                      throws APIException
Description copied from interface: AlertService
Find the alerts that are not read and have not expired for a user This will probably be the most commonly called method If null is passed in for user, find alerts for the currently authenticated user. If no user is authenticated, search on "new User()" (for "Anonymous" role alert possibilities)

Specified by:
getAlertsByUser in interface AlertService
Parameters:
user - the user that is assigned to the returned alerts
Returns:
alerts that are unread and not expired
Throws:
APIException
See Also:
AlertService.getAlertsByUser(org.openmrs.User)

getAlerts

public java.util.List<Alert> getAlerts()
                                throws APIException
Deprecated. 

Specified by:
getAlerts in interface AlertService
Throws:
APIException
See Also:
AlertService.getAlerts()

getAlerts

public java.util.List<Alert> getAlerts(User user,
                                       boolean includeRead,
                                       boolean includeExpired)
                                throws APIException
Description copied from interface: AlertService
Finds alerts for the given user with the given status

Specified by:
getAlerts in interface AlertService
Parameters:
user - to restrict to
Returns:
alerts for this user with these options
Throws:
APIException
See Also:
AlertService.getAlerts(org.openmrs.User, boolean, boolean)

getAllAlerts

public java.util.List<Alert> getAllAlerts()
                                   throws APIException
Description copied from interface: AlertService
Get all unexpired alerts for all users

Specified by:
getAllAlerts in interface AlertService
Returns:
list of unexpired alerts
Throws:
APIException
See Also:
AlertService.getAllAlerts()

getAllAlerts

public java.util.List<Alert> getAllAlerts(boolean includeExpired)
                                   throws APIException
Description copied from interface: AlertService
Get alerts for all users while obeying includeExpired

Specified by:
getAllAlerts in interface AlertService
Returns:
list of alerts
Throws:
APIException
See Also:
AlertService.getAllAlerts(boolean)

OpenMRS-1.7.x

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