Rakesh API

org.rakeshv.mail
Class UserPreferences

java.lang.Object
  extended by org.rakeshv.BaseObject
      extended by org.rakeshv.mail.UserPreferences

public class UserPreferences
extends BaseObject

A wrapper bean that provides easy access to all the properties configured in the application wide mail server preferences XML file. This class provides convenience methods that serve the purpose of hiding the complexity of the XML and object model from the application.

Copyright 2004, Rakesh Vidyadharan

Version:
$Id: UserPreferences.java,v 1.1 2005/04/26 11:30:36 rakesh Exp $
Author:
Rakesh Vidyadharan 7th November, 2004

Field Summary
static boolean COPY_SENT_MESSAGES
          A flag that is used to indicate that messages being sent should be copied to the WebMailBean.sentFolderName.
static int DELETE_PERMANENTLY
          A constant that is used to indicate that message being deleted should be deleted permanently from the store.
static boolean DO_NOT_COPY_SENT_MESSAGES
          A flag that is used to indicate that messages being sent should not be copied to the WebMailBean.sentFolderName.
private  java.lang.String fileName
          The fully qualified path to the file that contains the preferences.
private  org.rakeshv.xml.mail.MailUserPreferences mailUserPreferences
          The reference to the MailUserPreferences object that is wrapped by this object.
static int MARK_AS_DELETED
          A constant that is used to indicate that the message being deleted should be marked as deleted (while left in the current folder).
static int MOVE_TO_TRASH
          A constant that is used to indicate that messages being deleted should be moved to the WebMailBean.trashFolderName folder.
 
Fields inherited from class org.rakeshv.BaseObject
END_OF_LINE
 
Constructor Summary
UserPreferences()
          Default constructor.
 
Method Summary
 boolean getCopySentMessages()
          Wrapper method that returns the copySentMessages element value.
 int getDaysToKeepDeletedMessages()
          Wrapper method that returns the daysToKeepDeletedMessages element value.
 int getDaysToKeepSentMessages()
          Wrapper method that returns the daysToKeepSentMessages element value.
 int getDeleteAction()
          Wrapper method that returns the deleteAction element value.
 java.lang.String getFileName()
          Returns fileName.
 org.rakeshv.xml.mail.MailUserPreferences getMailUserPreferences()
          Returns mailUserPreferences.
 int getMessagesPerPage()
          Wrapper method that returns the messagesPerPage element value.
 java.lang.String getReplyTo()
          Wrapper method that returns the replyTo element value.
 java.lang.String getSentFolder()
          Wrapper method that returns the sentFolder element value.
 java.lang.String getTrashFolder()
          Wrapper method that returns the trashFolder element value.
 void setFileName(java.lang.String fileName)
          Set fileName.
 void setMailUserPreferences(org.rakeshv.xml.mail.MailUserPreferences mailUserPreferences)
          Set mailUserPreferences.
 
Methods inherited from class org.rakeshv.BaseObject
printCollection, printMap, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MOVE_TO_TRASH

public static final int MOVE_TO_TRASH
A constant that is used to indicate that messages being deleted should be moved to the WebMailBean.trashFolderName folder. This constant is currently defined as 0.


DELETE_PERMANENTLY

public static final int DELETE_PERMANENTLY
A constant that is used to indicate that message being deleted should be deleted permanently from the store. This constant is currently defined as 1.


MARK_AS_DELETED

public static final int MARK_AS_DELETED
A constant that is used to indicate that the message being deleted should be marked as deleted (while left in the current folder). This constant is currently defined as 2.


COPY_SENT_MESSAGES

public static final boolean COPY_SENT_MESSAGES
A flag that is used to indicate that messages being sent should be copied to the WebMailBean.sentFolderName. At present a value of true indicates that messages should be copied to the folder.


DO_NOT_COPY_SENT_MESSAGES

public static final boolean DO_NOT_COPY_SENT_MESSAGES
A flag that is used to indicate that messages being sent should not be copied to the WebMailBean.sentFolderName. At present a value of true indicates that messages should not be copied to the folder.


fileName

private java.lang.String fileName
The fully qualified path to the file that contains the preferences.


mailUserPreferences

private org.rakeshv.xml.mail.MailUserPreferences mailUserPreferences
The reference to the MailUserPreferences object that is wrapped by this object.

Constructor Detail

UserPreferences

public UserPreferences()
Default constructor. No special actions required.

Method Detail

getFileName

public final java.lang.String getFileName()
Returns fileName.

Returns:
String The value/reference of/to fileName.

setFileName

public final void setFileName(java.lang.String fileName)
                       throws MailException
Set fileName. After setting the fileName, create the appropriate instance of mailUserPreferences with the contents of the specified file.

Parameters:
fileName - The value to set.
Throws:
MailException - If errors are encountered while reading or parsing the properties file.

getMailUserPreferences

public final org.rakeshv.xml.mail.MailUserPreferences getMailUserPreferences()
Returns mailUserPreferences.

Returns:
MailUserPreferences The value/reference of/to mailUserPreferences.

setMailUserPreferences

public final void setMailUserPreferences(org.rakeshv.xml.mail.MailUserPreferences mailUserPreferences)
Set mailUserPreferences.

Parameters:
mailUserPreferences - The value to set.

getTrashFolder

public final java.lang.String getTrashFolder()
Wrapper method that returns the trashFolder element value.

Returns:
String - The name to use for the trash folder.

getDeleteAction

public final int getDeleteAction()
Wrapper method that returns the deleteAction element value.

Returns:
int - The way to handle message deletes.
See Also:
MOVE_TO_TRASH, DELETE_PERMANENTLY, MARK_AS_DELETED

getDaysToKeepDeletedMessages

public final int getDaysToKeepDeletedMessages()
Wrapper method that returns the daysToKeepDeletedMessages element value.

Returns:
int - The number of days to retain deleted messages.

getSentFolder

public final java.lang.String getSentFolder()
Wrapper method that returns the sentFolder element value.

Returns:
String - The name to use for the sent folder.

getCopySentMessages

public final boolean getCopySentMessages()
Wrapper method that returns the copySentMessages element value.

Returns:
boolean - Indicates whether messages being sent are to be stored in the getSentFolder().
See Also:
COPY_SENT_MESSAGES, DO_NOT_COPY_SENT_MESSAGES

getDaysToKeepSentMessages

public final int getDaysToKeepSentMessages()
Wrapper method that returns the daysToKeepSentMessages element value.

Returns:
int - The number of days to retain copies of sent messages.

getReplyTo

public final java.lang.String getReplyTo()
Wrapper method that returns the replyTo element value.

Returns:
String - The reply-to address to use when sending mail.

getMessagesPerPage

public final int getMessagesPerPage()
Wrapper method that returns the messagesPerPage element value.

Returns:
int - The number of messages to display on a page.

Rakesh API

Copyright © 2002-2005 - Rakesh Vidyadharan