|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectsrc.server.Alerter
Adds support for sending alerts to users. An alert is a kind of notification of when an event occurs. An alert could for instance be a message generated from within the server which is then sent out to all users that have registered that they want that kind of alert/notification. E.g. a message telling the user that the latest math exam has been graded. Implements singelton pattern.
| Method Summary | |
void |
deregisterTranslator(java.lang.String translatorId)
Removes all alert registrations with the specified translator id. |
boolean |
deregisterUser(java.lang.String userId,
java.lang.String translatorId,
java.lang.String alertName)
Removes a user from the alert list for a specific alert and translator. |
java.util.Vector |
getAlertList(java.lang.String userId,
java.lang.String translatorId)
Lists all alerts that a user has registered for. |
static Alerter |
getInstance()
Used to get the object in singelton patterns. |
java.util.HashSet |
getRegisteredAlerts()
Gets a set with all alerts that are valid. |
void |
registerAlert(java.lang.String alertName)
Registers an alert so that the alerter will accept it when notified with said alert. |
boolean |
registerUser(java.lang.String userId,
java.lang.String translatorId,
java.lang.String alertName)
Registers an user for a specific module generated alert through a specific translator. |
void |
triggerAlert(java.lang.String alertName,
OutputPackage output)
Triggers an alert and sends the specified output package to all the users that have registered for the specific alert. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static Alerter getInstance()
public boolean registerUser(java.lang.String userId,
java.lang.String translatorId,
java.lang.String alertName)
userId - The user identifier, a single user id can be connected to multiple
translators and user specific details (e.g. email adresses, cell phon number).translatorId - The translator identifier for the translator that the alert
should be sent through.alertName - The name of the alert that the user wants.
public boolean deregisterUser(java.lang.String userId,
java.lang.String translatorId,
java.lang.String alertName)
userId - The user identifier, a single user id can be connected to multiple
translators and user specific details (e.g. email adresses, cell phone number).translatorId - The translator identifier for the translator that the alert
should be sent through.alertName - The name of the alert that the user wants.
public void triggerAlert(java.lang.String alertName,
OutputPackage output)
alertName - The name of the alert that should be triggered.output - The package containing the message that should be sent out.
The translatorId and userId contained in the package are irrelevant, the
alerter substitutes them with the real recipients' identification.public void deregisterTranslator(java.lang.String translatorId)
translatorId - The id of the translator to remove.
public java.util.Vector getAlertList(java.lang.String userId,
java.lang.String translatorId)
userId - The user identifier, a single user id can be connected to multiple
translators and user specific details (e.g. email adresses, cell phone number).translatorId - The translator identifier for the translator that the alert
should be sent through.
public void registerAlert(java.lang.String alertName)
alertName - The name of the alert to register.public java.util.HashSet getRegisteredAlerts()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||