org.nhindirect.stagent.mail.notifications
Class MDNStandard

java.lang.Object
  extended by org.nhindirect.stagent.mail.MailStandard
      extended by org.nhindirect.stagent.mail.notifications.MDNStandard

public class MDNStandard
extends MailStandard

Provides constants and utility functions for working with MDN

Author:
Greg Meyer, Umesh Madan

Nested Class Summary
static class MDNStandard.Headers
          Standard header names for MDN headers
static class MDNStandard.MediaType
          MIME types for MDN
 
Field Summary
static String Action_Automatic
           
static String Action_Manual
           
static String Disposition_Deleted
           
static String Disposition_Denied
           
static String Disposition_Dispatched
           
static String Disposition_Displayed
           
static String Disposition_Error
           
static String Disposition_Processed
           
static String Modifier_Error
           
static String ReportType
           
static String ReportTypeValueNotification
           
static String Send_Automatic
           
static String Send_Manual
           
 
Fields inherited from class org.nhindirect.stagent.mail.MailStandard
DestinationHeaders, MailAddressSeparator, OriginHeaders
 
Constructor Summary
MDNStandard()
           
 
Method Summary
static boolean hasMDNRequest(MimeEntity entity)
          Tests the entity to see if it contains an MDN request.
static boolean hasMDNRequest(javax.mail.internet.MimeMessage msg)
          Tests the message to see if it contains an MDN request.
static boolean isNotification(MimeEntity entity)
          Tests the entity to determine if it is a disposition notification body part.
static boolean isNotification(javax.mail.internet.MimeMessage msg)
          Tests the message to determine if it is a disposition notification body part.
static boolean isReport(MimeEntity entity)
          Tests the entity to see if it is an MDN.
static boolean isReport(javax.mail.internet.MimeMessage msg)
          Tests the message to see if it is an MDN.
static String toString(NotificationType type)
          Provides the appropriate Disposition header value for the type
static String toString(SendType mode)
          Provides the appropriate Disposition header value for the mode
static String toString(TriggerType mode)
          Provides the appropriate Disposition header value for the mode.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Action_Manual

public static final String Action_Manual
See Also:
Constant Field Values

Action_Automatic

public static final String Action_Automatic
See Also:
Constant Field Values

Send_Manual

public static final String Send_Manual
See Also:
Constant Field Values

Send_Automatic

public static final String Send_Automatic
See Also:
Constant Field Values

Disposition_Displayed

public static final String Disposition_Displayed
See Also:
Constant Field Values

Disposition_Processed

public static final String Disposition_Processed
See Also:
Constant Field Values

Disposition_Dispatched

public static final String Disposition_Dispatched
See Also:
Constant Field Values

Disposition_Deleted

public static final String Disposition_Deleted
See Also:
Constant Field Values

Disposition_Denied

public static final String Disposition_Denied
See Also:
Constant Field Values

Disposition_Error

public static final String Disposition_Error
See Also:
Constant Field Values

Modifier_Error

public static final String Modifier_Error
See Also:
Constant Field Values

ReportType

public static final String ReportType
See Also:
Constant Field Values

ReportTypeValueNotification

public static final String ReportTypeValueNotification
See Also:
Constant Field Values
Constructor Detail

MDNStandard

public MDNStandard()
Method Detail

hasMDNRequest

public static boolean hasMDNRequest(MimeEntity entity)
Tests the entity to see if it contains an MDN request.

Parameters:
entity - The entity to test.
Returns:
true if the entity contains an MDN request. false otherwise.

hasMDNRequest

public static boolean hasMDNRequest(javax.mail.internet.MimeMessage msg)
Tests the message to see if it contains an MDN request.

Parameters:
The - message to test.
Returns:
true if the message contains an MDN request. false otherwise.

isReport

public static boolean isReport(MimeEntity entity)
Tests the entity to see if it is an MDN.

MDN status is indicated by the appropriate main body Content-Type. The multipart body will contain the actual disposition notification.

Parameters:
entity - The entity to test
Returns:
true if the entity is an MDN. false otherwise
See Also:
isNotification(MimeEntity)

isReport

public static boolean isReport(javax.mail.internet.MimeMessage msg)
Tests the message to see if it is an MDN.

MDN status is indicated by the appropriate main body Content-Type. The multipart body will contain the actual disposition notification.

Parameters:
msg - The message to test
Returns:
true if the message is an MDN. false otherwise
See Also:
isNotification(MimeMessage)

isNotification

public static boolean isNotification(MimeEntity entity)
Tests the entity to determine if it is a disposition notification body part.

Notification status is indicated by the appropriate Content-Type. The notification section will be a body part of the appropriate MDN report multipart body.

Parameters:
entity - The entity to test
Returns:
true if this body part is an MDN notification. false otherwise

isNotification

public static boolean isNotification(javax.mail.internet.MimeMessage msg)
Tests the message to determine if it is a disposition notification body part.

Notification status is indicated by the appropriate Content-Type. The notification section will be a body part of the appropriate MDN report multipart body.

Parameters:
msg - The message to test
Returns:
true if this body part is an MDN notification. false otherwise

toString

public static String toString(TriggerType mode)
Provides the appropriate Disposition header value for the mode.

Parameters:
mode - The mode to translate
Returns:
A string representation suitable for inclusion in the action mode section of the Disposition header value

toString

public static String toString(SendType mode)
Provides the appropriate Disposition header value for the mode

Parameters:
mode - The mode to translate
Returns:
A string representation suitable for inclusion in the sending mode section of the Disposition header value

toString

public static String toString(NotificationType type)
Provides the appropriate Disposition header value for the type

Parameters:
type - The type to translate
Returns:
A string representation suitable for inclusion in the disposition type section of the Disposition header value


Copyright © 2010-2013 NHIN Direct. All Rights Reserved.