anon.pay.xml
Class XMLEmail

java.lang.Object
  extended by anon.pay.xml.XMLEmail
All Implemented Interfaces:
IXMLEncodable

public class XMLEmail
extends java.lang.Object
implements IXMLEncodable

simple XML representation of the subject, return Address, sender name (not an email field, just to distinguish the sender from the rest of the body text) and body text Geared towards sending support emails form the Mixconfig tool to the BI (which then sends it on using a local smtp server), currently does not support attachments, and no server data For support messages, use the simplest constructor without receiver and subject, will be set to defaults for sending to jap support senderIdentification can be used to pass along some kind of information that allows the recipient of this object to look up more information on the sender (typically a public certificate), can be null

Author:
Elmar Schraml

Field Summary
private  java.lang.String m_bodyText
           
private  org.w3c.dom.Document m_docTheEmail
           
private  java.lang.String m_receiverAddress
           
private  java.lang.String m_replyAddress
           
private  java.lang.String m_senderIdentification
           
private  java.lang.String m_senderName
           
private  java.lang.String m_subject
           
static java.lang.String ms_strElemName
           
 
Fields inherited from interface anon.util.IXMLEncodable
FIELD_XML_ELEMENT_CONTAINER_NAME, FIELD_XML_ELEMENT_NAME, XML_ATTR_ID, XML_ATTR_LANGUAGE, XML_ATTR_VERSION
 
Constructor Summary
XMLEmail(byte[] xmldata)
           
XMLEmail(char[] xmldata)
           
XMLEmail(org.w3c.dom.Document xml)
           
XMLEmail(org.w3c.dom.Element xml)
           
XMLEmail(java.lang.String xml)
           
XMLEmail(java.lang.String senderName, java.lang.String replyAddress, java.lang.String bodyText, java.lang.String senderIdentification)
          A support email, sent to the JAP support team with a default subject
XMLEmail(java.lang.String senderName, java.lang.String replyAddress, java.lang.String bodyText, java.lang.String receiverAddress, java.lang.String subject, java.lang.String senderIdentification)
          A generic email with custom subject and receiver address
 
Method Summary
 java.lang.String getBodyText()
           
 java.lang.String getReceiverAddress()
           
 java.lang.String getReplyAddress()
           
 java.lang.String getSenderIdentification()
           
 java.lang.String getSenderName()
           
 java.lang.String getSubject()
           
private  org.w3c.dom.Node internal_toXmlElement(org.w3c.dom.Document a_doc)
           
private  void setDefaultValues()
          ensure that no empty xml elements are encoded (since that would throw an exception upon parsing the xml)
private  void setValues(org.w3c.dom.Element xml)
           
 org.w3c.dom.Element toXmlElement(org.w3c.dom.Document a_doc)
          Return an element that can be appended to the document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_senderName

private java.lang.String m_senderName

m_replyAddress

private java.lang.String m_replyAddress

m_bodyText

private java.lang.String m_bodyText

m_receiverAddress

private java.lang.String m_receiverAddress

m_subject

private java.lang.String m_subject

m_senderIdentification

private java.lang.String m_senderIdentification

m_docTheEmail

private org.w3c.dom.Document m_docTheEmail

ms_strElemName

public static java.lang.String ms_strElemName
Constructor Detail

XMLEmail

public XMLEmail(java.lang.String senderName,
                java.lang.String replyAddress,
                java.lang.String bodyText,
                java.lang.String senderIdentification)
A support email, sent to the JAP support team with a default subject

Parameters:
senderName - String
replyAddress - String
bodyText - String
senderIdentification: - can be null

XMLEmail

public XMLEmail(java.lang.String senderName,
                java.lang.String replyAddress,
                java.lang.String bodyText,
                java.lang.String receiverAddress,
                java.lang.String subject,
                java.lang.String senderIdentification)
A generic email with custom subject and receiver address

Parameters:
senderName - String
replyAddress - String
bodyText - String
receiverAddress - String
subject - String
senderIdentification: - can be null

XMLEmail

public XMLEmail(java.lang.String xml)
         throws java.lang.Exception
Throws:
java.lang.Exception

XMLEmail

public XMLEmail(char[] xmldata)
         throws java.lang.Exception
Throws:
java.lang.Exception

XMLEmail

public XMLEmail(byte[] xmldata)
         throws java.lang.Exception
Throws:
java.lang.Exception

XMLEmail

public XMLEmail(org.w3c.dom.Element xml)
         throws java.lang.Exception
Throws:
java.lang.Exception

XMLEmail

public XMLEmail(org.w3c.dom.Document xml)
         throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

setDefaultValues

private void setDefaultValues()
ensure that no empty xml elements are encoded (since that would throw an exception upon parsing the xml)


internal_toXmlElement

private org.w3c.dom.Node internal_toXmlElement(org.w3c.dom.Document a_doc)

getSenderName

public java.lang.String getSenderName()

getReplyAddress

public java.lang.String getReplyAddress()

getReceiverAddress

public java.lang.String getReceiverAddress()

getSubject

public java.lang.String getSubject()

getBodyText

public java.lang.String getBodyText()

getSenderIdentification

public java.lang.String getSenderIdentification()

setValues

private void setValues(org.w3c.dom.Element xml)
                throws java.lang.Exception
Throws:
java.lang.Exception

toXmlElement

public org.w3c.dom.Element toXmlElement(org.w3c.dom.Document a_doc)
Return an element that can be appended to the document.

Specified by:
toXmlElement in interface IXMLEncodable
Parameters:
a_doc - a document
Returns:
the interface as xml element