FileDocCategorySizeDatePackage
Account.javaAPI DocApache James 2.3.19404Fri Jan 12 12:56:24 GMT 2007org.apache.james.fetchmail

Account

public class Account extends Object implements Comparable

Class Account encapsulates the account details required to fetch mail from a message store.

Instances are Comparable based on their sequence number.

Creation Date: 05-Jun-03

Fields Summary
private String
fieldPassword
The user password for this account
private org.apache.mailet.MailAddress
fieldRecipient
The user to send the fetched mail to
private String
fieldUser
The user name for this account
private ParsedConfiguration
fieldParsedConfiguration
The ParsedConfiguration
private List
fieldDeferredRecipientNotFoundMessageIDs
List of MessageIDs for which processing has been deferred because the intended recipient could not be found.
private int
fieldSequenceNumber
The sequence number for this account
private boolean
fieldIgnoreRecipientHeader
Ignore the recipient deduced from the header and use 'fieldRecipient'
private Session
fieldSession
The JavaMail Session for this Account.
private String
customRecipientHeader
A custom header to be used as the recipient address
Constructors Summary
private Account()
Constructor for Account.

        super();
    
public Account(int sequenceNumber, ParsedConfiguration parsedConfiguration, String user, String password, String recipient, boolean ignoreRecipientHeader, String customRecipientHeader, Session session)
Constructor for Account.

param
sequenceNumber
param
parsedConfiguration
param
user
param
password
param
recipient
param
ignoreRecipientHeader
param
session
throws
ConfigurationException

        this();
        setSequenceNumber(sequenceNumber);
        setParsedConfiguration(parsedConfiguration);
        setUser(user);
        setPassword(password);
        setRecipient(recipient);
        setIgnoreRecipientHeader(ignoreRecipientHeader);
        setCustomRecipientHeader(customRecipientHeader);
        setSession(session);
    
Methods Summary
public intcompareTo(java.lang.Object o)
Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer if this object is less than, equal to, or greater than the specified object.

see
java.lang.Comparable#compareTo(Object)

        return getSequenceNumber() - ((Account) o).getSequenceNumber();
    
protected java.util.ListcomputeDeferredRecipientNotFoundMessageIDs()
Returns a new List of deferredRecipientNotFoundMessageIDs.

return
List

        return new ArrayList(16);
    
public java.lang.StringgetCustomRecipientHeader()
Returns the custom recipient header.

return
String

        return this.customRecipientHeader;
    
public java.util.ListgetDeferredRecipientNotFoundMessageIDs()
Returns the deferredRecipientNotFoundMessageIDs. lazily initialised.

return
List

        List messageIDs = null;
        if (null
            == (messageIDs = getDeferredRecipientNotFoundMessageIDsBasic()))
        {
            updateDeferredRecipientNotFoundMessageIDs();
            return getDeferredRecipientNotFoundMessageIDs();
        }
        return messageIDs;
    
private java.util.ListgetDeferredRecipientNotFoundMessageIDsBasic()
Returns the deferredRecipientNotFoundMessageIDs.

return
List

        return fieldDeferredRecipientNotFoundMessageIDs;
    
public ParsedConfigurationgetParsedConfiguration()
Returns the parsedConfiguration.

return
ParsedConfiguration

        return fieldParsedConfiguration;
    
public java.lang.StringgetPassword()
Returns the password.

return
String

        return fieldPassword;
    
public org.apache.mailet.MailAddressgetRecipient()
Returns the recipient.

return
MailAddress

        return fieldRecipient;
    
public intgetSequenceNumber()
Returns the sequenceNumber.

return
int

        return fieldSequenceNumber;
    
public javax.mail.SessiongetSession()
Returns the session.

return
Session

        return fieldSession;
    
public java.lang.StringgetUser()
Returns the user.

return
String

        return fieldUser;
    
public booleanisIgnoreRecipientHeader()
Returns the ignoreRecipientHeader.

return
boolean

        return fieldIgnoreRecipientHeader;
    
public voidsetCustomRecipientHeader(java.lang.String customRecipientHeader)
Sets the custom recipient header.

param
customRecipientHeader The header to be used

        this.customRecipientHeader = customRecipientHeader;
    
protected voidsetDeferredRecipientNotFoundMessageIDs(java.util.List defferedRecipientNotFoundMessageIDs)
Sets the defferedRecipientNotFoundMessageIDs.

param
defferedRecipientNotFoundMessageIDs The defferedRecipientNotFoundMessageIDs to set

        fieldDeferredRecipientNotFoundMessageIDs =
            defferedRecipientNotFoundMessageIDs;
    
protected voidsetIgnoreRecipientHeader(boolean ignoreRecipientHeader)
Sets the ignoreRecipientHeader.

param
ignoreRecipientHeader The ignoreRecipientHeader to set

        fieldIgnoreRecipientHeader = ignoreRecipientHeader;
    
protected voidsetParsedConfiguration(ParsedConfiguration parsedConfiguration)
Sets the parsedConfiguration.

param
parsedConfiguration The parsedConfiguration to set

        fieldParsedConfiguration = parsedConfiguration;
    
protected voidsetPassword(java.lang.String password)
Sets the password.

param
password The password to set

        fieldPassword = password;
    
protected voidsetRecipient(java.lang.String recipient)
Sets the recipient.

param
recipient The recipient to set

        if (null == recipient)
        {
            fieldRecipient = null;
            return;
        }
            
        try
        {
            setRecipient(new MailAddress(recipient));
        }
        catch (ParseException pe)
        {
            throw new ConfigurationException(
                "Invalid recipient address specified: " + recipient);
        }
    
protected voidsetRecipient(org.apache.mailet.MailAddress recipient)
Sets the recipient.

param
recipient The recipient to set

        fieldRecipient = recipient;
    
protected voidsetSequenceNumber(int sequenceNumber)
Sets the sequenceNumber.

param
sequenceNumber The sequenceNumber to set

        fieldSequenceNumber = sequenceNumber;
    
protected voidsetSession(javax.mail.Session session)
Sets the session.

param
session The session to set

        fieldSession = session;
    
protected voidsetUser(java.lang.String user)
Sets the user.

param
user The user to set

        fieldUser = user;
    
protected voidupdateDeferredRecipientNotFoundMessageIDs()
Updates the deferredRecipientNotFoundMessageIDs.

        setDeferredRecipientNotFoundMessageIDs(computeDeferredRecipientNotFoundMessageIDs());