@Transactional public interface AlertService extends OpenmrsService
Alert alert = new Alert(); alert.set___(___); ...etc Context.getAlertService().saveAlert(alert);
| Modifier and Type | Method and Description |
|---|---|
void |
createAlert(Alert alert)
Deprecated.
use
saveAlert(Alert) |
void |
createAlert(java.lang.String text,
java.util.Collection<User> users)
Deprecated.
use
saveAlert(Alert) |
void |
createAlert(java.lang.String text,
User user)
Deprecated.
use
saveAlert(Alert) |
Alert |
getAlert(java.lang.Integer alertId)
Get alert by internal identifier
|
java.util.List<Alert> |
getAlerts()
Deprecated.
use
getAlertsByUser(User) and pass "null" as the parameter for
user |
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.
use #getAlerts(User, boolean, boolean)
|
void |
markAlertRead(Alert alert)
Deprecated.
use
saveAlert(Alert) |
void |
notifySuperUsers(java.lang.String messageCode,
java.lang.Exception cause,
java.lang.Object... messageArguments)
Sends an alert to all superusers
|
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.
use
saveAlert(Alert) |
onShutdown, onStartupvoid setAlertDAO(AlertDAO dao)
dao - The dao implementation to use@Authorized(value="Manage Alerts") Alert saveAlert(Alert alert) throws APIException
alert in the databasealert - the Alert object to saveAPIException@Deprecated void createAlert(Alert alert) throws APIException
saveAlert(Alert)APIException@Deprecated
void createAlert(java.lang.String text,
User user)
throws APIException
saveAlert(Alert)APIException@Deprecated
void createAlert(java.lang.String text,
java.util.Collection<User> users)
throws APIException
saveAlert(Alert)APIException@Transactional(readOnly=true) Alert getAlert(java.lang.Integer alertId) throws APIException
alertId - internal alert identifierAPIException@Deprecated void updateAlert(Alert alert) throws APIException
saveAlert(Alert)APIException@Authorized(value="Manage Alerts") void purgeAlert(Alert alert) throws APIException
alert - the Alert to purge/deleteAPIException@Deprecated void markAlertRead(Alert alert) throws APIException
saveAlert(Alert)APIException@Deprecated @Transactional(readOnly=true) java.util.List<Alert> getAllAlerts(User user) throws APIException
APIException@Transactional(readOnly=true) java.util.List<Alert> getAllActiveAlerts(User user) throws APIException
user - APIExceptiongetAlerts(User, boolean, boolean)@Deprecated @Transactional(readOnly=true) java.util.List<Alert> getAlerts(User user) throws APIException
getAlertsByUser(User)APIException@Transactional(readOnly=true) java.util.List<Alert> getAlertsByUser(User user) throws APIException
user, find alerts for the
currently authenticated user. If no user is authenticated, search on "new
User()" (for "Anonymous" role alert possibilities)user - the user that is assigned to the returned alertsAPIException@Deprecated @Transactional(readOnly=true) java.util.List<Alert> getAlerts() throws APIException
getAlertsByUser(User) and pass "null" as the parameter for
userAPIException@Transactional(readOnly=true) java.util.List<Alert> getAlerts(User user, boolean includeRead, boolean includeExpired) throws APIException
user - to restrict toincludeRead - includeExpired - APIException@Transactional(readOnly=true) java.util.List<Alert> getAllAlerts() throws APIException
APIException@Transactional(readOnly=true) java.util.List<Alert> getAllAlerts(boolean includeExpired) throws APIException
includeExpired - APIException@Authorized(value="Manage Alerts") void notifySuperUsers(java.lang.String messageCode, java.lang.Exception cause, java.lang.Object... messageArguments)
messageCode - The alert message code from messages.propertiescause - The exception that was thrown, method will work if cause is nullmessageArguments - The arguments for the coded messageCopyright © 2018 OpenMRS Inc.. All Rights Reserved.