org.nhindirect.stagent.mail.notifications
Class Notification

java.lang.Object
  extended by org.nhindirect.stagent.mail.notifications.Notification

public class Notification
extends java.lang.Object

Represents notification (MDN) content.

The NotificationMessage represents the actually sendable MDN.

Author:
Greg Meyer, Umesh Madan

Constructor Summary
Notification(Disposition disposition)
          Initializes a new instance with the supplied Disposition
Notification(NotificationType notification)
          Initializes a new instance of the supplied notification type.
 
Method Summary
 javax.mail.internet.MimeMultipart getAsMultipart()
          Gets the notification object as a MimeMultipart object;
 Disposition getDisposition()
          Gets the Disposition for this instance.
 java.lang.String getError()
          Gets the value of the error header.
 java.lang.String getExplanation()
          Gets the body part corresponding to the notification explanation.
 java.lang.String getFinalRecipeint()
          Gets the final recipient for this instance.
 MdnGateway getGateway()
          Gets the gateway that triggered this notification (optional).
 java.io.InputStream getInputStream()
          Gets an input stream of this notification that can be serialized.
 java.lang.String getOriginalMessageId()
          Gets the ID of the message that triggered this notification (optional).
 java.util.Collection<MimeEntity> getParts()
          Returns a collection of body parts of the multipart report for this notification.
 ReportingUserAgent getReportingAgent()
          Gets the reporting agent that triggered this notification (optional).
 byte[] serializeToBytes()
          Serializes the notification to an array of bytes.
 void setDisposition(Disposition disposition)
          Sets the Disposition for this instance.
 void setError(java.lang.String error)
          Sets the value of the error header.
 void setExplanation(java.lang.String explanation)
          Sets the body part corresponding to the notification explanation.
 void setFinalRecipient(java.lang.String recip)
          Sets final recipient.
 void setGateway(MdnGateway gateway)
          Sets the gateway that triggered this notification (optional).
 void setOriginalMessageId(java.lang.String messageId)
          Sets the ID of the message that triggered this notification (optional).
 void setReportingAgent(ReportingUserAgent reportingAgent)
          Sets the reporting agent that triggered this notification (optional).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Notification

public Notification(NotificationType notification)
Initializes a new instance of the supplied notification type.

Parameters:
notification - The notification disposition for this instance.

Notification

public Notification(Disposition disposition)
Initializes a new instance with the supplied Disposition

Parameters:
disposition - The notification disposition for this instance.
Method Detail

getExplanation

public java.lang.String getExplanation()
Gets the body part corresponding to the notification explanation.

From RFC 3798, section 3, item b:

The first component of the multipart/report contains a human- readable explanation of the MDN, as described in [RFC-REPORT].

Returns:
The body part corresponding to the notification explanation.

setExplanation

public void setExplanation(java.lang.String explanation)
Sets the body part corresponding to the notification explanation.

Parameters:
explanation - The body part corresponding to the notification explanation.

getReportingAgent

public ReportingUserAgent getReportingAgent()
Gets the reporting agent that triggered this notification (optional).

Returns:
The reporting agent that triggered this notification.

setReportingAgent

public void setReportingAgent(ReportingUserAgent reportingAgent)
Sets the reporting agent that triggered this notification (optional).

Parameters:
reportingAgent - The reporting agent that triggered this notification

getGateway

public MdnGateway getGateway()
Gets the gateway that triggered this notification (optional).

Returns:
The gateway that triggered this notification

setGateway

public void setGateway(MdnGateway gateway)
Sets the gateway that triggered this notification (optional).

Parameters:
gateway - The gateway that triggered this notification

getOriginalMessageId

public java.lang.String getOriginalMessageId()
Gets the ID of the message that triggered this notification (optional).

Returns:
The ID of the message that triggered this notification

setOriginalMessageId

public void setOriginalMessageId(java.lang.String messageId)
Sets the ID of the message that triggered this notification (optional).

Parameters:
messageId - The ID of the message that triggered this notification

getFinalRecipeint

public java.lang.String getFinalRecipeint()
Gets the final recipient for this instance.

Returns:
the final recipient for this instance

setFinalRecipient

public void setFinalRecipient(java.lang.String recip)
Sets final recipient.

Parameters:
messageId - The final recipient.

getDisposition

public Disposition getDisposition()
Gets the Disposition for this instance.

Returns:
the Disposition for this instance

setDisposition

public void setDisposition(Disposition disposition)
Sets the Disposition for this instance.

Parameters:
disposition - The Disposition for this instance

getError

public java.lang.String getError()
Gets the value of the error header.

Returns:
The value of the error header.

setError

public void setError(java.lang.String error)
Sets the value of the error header.

Parameters:
error - The value of the error header.

getParts

public java.util.Collection<MimeEntity> getParts()
Returns a collection of body parts of the multipart report for this notification.

Returns:
A collection of body parts of the multipart report for this notification.

getAsMultipart

public javax.mail.internet.MimeMultipart getAsMultipart()
Gets the notification object as a MimeMultipart object;

Returns:
The notification object as a MimeMultipart object;

serializeToBytes

public byte[] serializeToBytes()
Serializes the notification to an array of bytes.

Returns:
byte array serialized form on this notification.

getInputStream

public java.io.InputStream getInputStream()
Gets an input stream of this notification that can be serialized.

Returns:
An input stream of this notification


Copyright © 2010-2011 HNIN Direct. All Rights Reserved.