com.jmo.mailmessager.utils.xml
Class MailMessagerXMLEngine

java.lang.Object
  extended by com.jmo.mailmessager.utils.xml.MailMessagerXMLEngine

public class MailMessagerXMLEngine
extends java.lang.Object

Manages read and write access of MailAccounts to settings.xml. Operations are synchronized on static "lock" Object

Version:
0.0.1
Author:
John Morales
See Also:
MailAccount

Constructor Summary
MailMessagerXMLEngine(java.lang.String xmlFilename)
          Creates a MailMessagerXMLEngine instance connected to the supplied filename
 
Method Summary
static MailAccount[] getAccounts()
          Parses settings.xml file into MailAccount[] array using DOMParser
static long getMailPollTime()
          Return Poll time saved on file as long.
static void writeSettingsToDisk(MailAccount[] mail, long polltime)
          Writes the settings.xml configuration file from the supplied MailAccount array and poll time.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MailMessagerXMLEngine

public MailMessagerXMLEngine(java.lang.String xmlFilename)
Creates a MailMessagerXMLEngine instance connected to the supplied filename

Parameters:
xmlFilename - Name of the configuration file, e.g. settings.xml
Method Detail

getAccounts

public static MailAccount[] getAccounts()
Parses settings.xml file into MailAccount[] array using DOMParser

Returns:
Returns MailAccount[] array from settings.xml.

getMailPollTime

public static long getMailPollTime()
Return Poll time saved on file as long.

Returns:
Returns Poll Time

writeSettingsToDisk

public static void writeSettingsToDisk(MailAccount[] mail,
                                       long polltime)
Writes the settings.xml configuration file from the supplied MailAccount array and poll time.

Parameters:
mail - MailAccount array from which to create the settings.xml file
polltime - Poll Time to save to settings.xml