public class NotificationHelper extends Object
| Constructor and Description |
|---|
NotificationHelper() |
| Modifier and Type | Method and Description |
|---|---|
static String |
asString(NotificationType type)
Provides the appropriate Disposition header value for the type
|
static String |
asString(NotificationType type,
boolean cap)
Provides the appropriate Disposition header value for the type
|
static String |
asString(SendType type)
Provides the appropriate Disposition header value for the type
|
static String |
asString(TriggerType type)
Provides the appropriate Disposition header value for the type.
|
static NotificationMessage |
createNotificationMessage(Message message,
javax.mail.internet.InternetAddress from,
Notification notification)
Creates an MDN Notification message for the given message
|
static Collection<NotificationMessage> |
createNotificationMessages(Message message,
Collection<javax.mail.internet.InternetAddress> senders,
NotificationCreator notificationCreator)
Creates a notification message (MDN) for the given message to the senders.
|
static String |
getNotificationDestination(Message message)
Gets the value of the Disposition-Notification-To header, which indicates where
the original UA requested notification be sent.
|
static Collection<javax.mail.internet.InternetAddress> |
getNotificationDestinationAddresses(Message message)
Gets the mail addresses contained in the Disposition-Notification-To header, which indicates where
the original UA requested notification be sent.
|
static boolean |
hasNotificationRequest(Message message)
Tests if this message has requested MDN notification.
|
static boolean |
isMDN(Message message)
Tests if this message is an MDN
|
static void |
requestNotification(Message message)
Sets the header values for this message to request message disposition notification.
|
static boolean |
shouldIssueNotification(Message message)
Deprecated.
as of version 1.1.
The Direct Project model infers that a notification message should be sent regardless if
a notification request is requested. The gateway agent model should now determine whether or not to send a notification
based on the following criteria:
1) A preference in the gateway indicates that the agent/gateway should send notifications.
2) This message is not a MDN messages. This can be determined by calling
isMDN(Message). |
public static boolean hasNotificationRequest(Message message)
The received message may be tested to see if it has a message disposition notification request, based on the Disposition-Notification-To header.
message - The message to test.public static boolean isMDN(Message message)
message - The message to test.public static boolean shouldIssueNotification(Message message)
isMDN(Message).Tests the message to see if it has a message disposition notification request, based on the Disposition-Notification-To header Additionally, verifies that the message is NOT itself an MDN. As per RFC 3798, agents should never issue an MDN in response to an MDN
message - The message to test.public static String getNotificationDestination(Message message)
message - The message to get the destination from.public static Collection<javax.mail.internet.InternetAddress> getNotificationDestinationAddresses(Message message)
message - The message to get the destination from.public static void requestNotification(Message message)
message - The message for which to set the disposition request headers.public static NotificationMessage createNotificationMessage(Message message, javax.mail.internet.InternetAddress from, Notification notification)
message - source messagefrom - Address this notification is fromnotification - The notification to be embedded in the messagepublic static Collection<NotificationMessage> createNotificationMessages(Message message, Collection<javax.mail.internet.InternetAddress> senders, NotificationCreator notificationCreator)
message - The message for which to send notificationsenders - The message senders to which to send notificationnotificationCreator - Interface for creating notification objects from addressespublic static String asString(TriggerType type)
type - The mode to translatepublic static String asString(SendType type)
type - The mode to translatepublic static String asString(NotificationType type)
type - The type to translatepublic static String asString(NotificationType type, boolean cap)
type - The type to translateCopyright © 2010-2016 NHIN Direct. All Rights Reserved.