public class StatusNotificationHelper
extends java.lang.Object
| Constructor and Description |
|---|
StatusNotificationHelper(org.apache.log4j.Logger log,
NotifiableI sender,
NotifiableI receiver,
java.lang.String culprit,
java.lang.String statusSectionTitle) |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
getTextForStatusNotification(java.lang.String culprit,
java.lang.String msg,
java.lang.String statusSectionTitle,
java.lang.String statusDetails,
java.lang.Throwable t)
Convenience helper method that gets the full message body text for a generic "status notification" mail to be used
for services and similar things where some admin etc. should be informed.
|
java.lang.String |
getTextForStatusNotification(java.lang.String msg,
java.lang.String statusDetails,
java.lang.Throwable t) |
void |
sendFailureNotification(Transaction tx,
java.lang.String msg,
java.lang.String statusDetails,
java.lang.Throwable t)
Sends out (by creating a notification order) a status notification about a problem/failure.
|
void |
sendRecoveryNotification(Transaction tx,
java.lang.String msg,
java.lang.String statusDetails)
Sends out (by creating a notification order) a status notification about a recovery from a problem/failure.
|
void |
sendStatusNotification(Transaction tx,
java.lang.String subject,
java.lang.String msg,
java.lang.String statusDetails,
java.lang.Throwable t)
Sends out (by creating a notification order) a status notification with the given subject and a message text
which is created from the other info.
|
public StatusNotificationHelper(org.apache.log4j.Logger log,
NotifiableI sender,
NotifiableI receiver,
java.lang.String culprit,
java.lang.String statusSectionTitle)
public void sendFailureNotification(Transaction tx, java.lang.String msg, java.lang.String statusDetails, java.lang.Throwable t)
tx - the Transaction to create the notification order inmsg - some custom message text; if null or empty a default placeholder will be usedstatusDetails - some text that will describe what the actual status is; might be some error response from an
external API or whatever; if null or empty the "status info" section will be omittedt - a Throwable which might be available if this notification is about a problempublic void sendRecoveryNotification(Transaction tx, java.lang.String msg, java.lang.String statusDetails)
tx - the Transaction to create the notification order inmsg - some custom message text; if null or empty a default placeholder will be usedstatusDetails - some text that will describe what the actual status is; might be some error response from an
external API or whatever; if null or empty the "status info" section will be omittedpublic void sendStatusNotification(Transaction tx, java.lang.String subject, java.lang.String msg, java.lang.String statusDetails, java.lang.Throwable t)
subject - the subject for the notificationmsg - some custom message text; if null or empty a default placeholder will be usedstatusDetails - some text that will describe what the actual status is; might be some error response from an
external API or whatever; if null or empty the "status info" section will be omittedt - a Throwable which might be available if this notification is about a problempublic java.lang.String getTextForStatusNotification(java.lang.String msg,
java.lang.String statusDetails,
java.lang.Throwable t)
public static java.lang.String getTextForStatusNotification(java.lang.String culprit,
java.lang.String msg,
java.lang.String statusSectionTitle,
java.lang.String statusDetails,
java.lang.Throwable t)
Will look something like:
From <originDesc>:
Something happened which is described here in some detail blablabla...
=== Exception info: ===
SomeException: Exception message
at some.stack.trace(123)
at some.other.stack.trace(456)
=== <statusTitle>: ===
Computer says "no"
culprit - some name or description from what the notification is coming frommsg - some custom message text; if null or empty a default placeholder will be usedstatusSectionTitle - a possible custom header title for the "status info section" of the notification; if
null or empty will use a defaultstatusDetails - some text that will describe what the actual status is; might be some error response from an
external API or whatever; if null or empty the "status info" section will be omittedt - an exception which might have occurred in the service or whatever; may be null, in that case the body
text will not include the "exception info section"Copyright © 2000-2026 OAshi S.à r.l. All Rights Reserved.