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
 
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 java.lang.String toString(NotificationType type)
          Provides the appropriate Disposition header value for the type
static java.lang.String toString(SendType mode)
          Provides the appropriate Disposition header value for the mode
static java.lang.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
 

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 java.lang.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 java.lang.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 java.lang.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-2011 HNIN Direct. All Rights Reserved.