|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectsk.baka.webvm.misc.BackgroundService
sk.baka.webvm.misc.NotificationDelivery
public final class NotificationDelivery
Delivers miscellaneous notifications (mail, jabber).
| Field Summary |
|---|
| Fields inherited from class sk.baka.webvm.misc.BackgroundService |
|---|
maxThreads, name |
| Constructor Summary | |
|---|---|
NotificationDelivery()
Creates new deliverer. |
|
| Method Summary | |
|---|---|
void |
configure(Config config)
Sets the new configuration file. |
void |
deliverAsync(List<ProblemReport> reports)
Delivers given report asynchronously. |
static boolean |
isEmailEnabled(Config config)
Checks if sending mail is enabled in given config object. |
static boolean |
isJabberEnabled(Config config)
Checks if sending mail is enabled in given config object. |
static void |
sendEmail(Config config,
boolean testing,
List<ProblemReport> reports)
Sends a mail with given report. |
static void |
sendJabber(Config config,
boolean testing,
List<ProblemReport> reports)
Sends a Jabber message with the Problems analysis. |
protected void |
started(ScheduledExecutorService executor)
Invoked when the service is started. |
protected void |
stopped()
Invoked after the service has been stopped. |
| Methods inherited from class sk.baka.webvm.misc.BackgroundService |
|---|
getExecutor, newDaemonFactory, start, stop |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public NotificationDelivery()
| Method Detail |
|---|
public static boolean isEmailEnabled(Config config)
config - the configuration object
Config.mailSmtpHost is non-empty, false otherwise.public static boolean isJabberEnabled(Config config)
config - the configuration object
Config.mailSmtpHost is non-empty, false otherwise.
public static void sendEmail(Config config,
boolean testing,
List<ProblemReport> reports)
throws org.apache.commons.mail.EmailException
config - the mail server configuration.testing - if true then a testing mail is sentreports - the current reports
org.apache.commons.mail.EmailException - if sending mail fails.
public static void sendJabber(Config config,
boolean testing,
List<ProblemReport> reports)
throws org.jivesoftware.smack.XMPPException
config - use this config.testing - if true then a (testing) string is appended to the messagereports - use these reports
org.jivesoftware.smack.XMPPException - when send failspublic void deliverAsync(List<ProblemReport> reports)
reports - the reports to deliver.protected void started(ScheduledExecutorService executor)
BackgroundService
started in class BackgroundServiceexecutor - executes tasks.public void configure(Config config)
config - the new config file.protected void stopped()
BackgroundService
stopped in class BackgroundService
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||