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

ProcessorAbstract

public abstract class ProcessorAbstract extends Object

Class ProcessorAbstract is an abstract class that provides support for JavaMail processors. Concrete implementations are required to implement the abstract method void process() to process a JavaMail element.

Typically, processors are chained. A Store processor delegates to a Folder processor that delegates to a Message processor.

ProcessorAbstract wraps an Account - see org.apache.james.fetchmail.Account - providing contextual information about the environment for the processor.

Creation Date: 27-May-03

Fields Summary
private String
fieldAttributePrefix
The prefix to place in front of any mail attributes used by this Processor.
private Account
fieldAccount
The Account for this task
Constructors Summary
private ProcessorAbstract()
Constructor for ProcessorAbstract.

        super();
    
protected ProcessorAbstract(Account account)
Constructor for ProcessorAbstract.

param
account The Account to be processed

        this();
        setAccount(account);        
    
Methods Summary
protected java.lang.StringcomputeAttributePrefix()
Returns the computed attributePrefix.

return
String

        return getClass().getPackage().getName() + ".";
    
public AccountgetAccount()
Returns the account.

return
Account

        return fieldAccount;
    
protected java.lang.StringgetAttributePrefix()
Returns a lazy initialised attributePrefix.

return
String

        String value = null;
        if (null == (value = getAttributePrefixBasic()))
        {
            updateAttributePrefix();
            return getAttributePrefix();
        }    
        return value;
    
private java.lang.StringgetAttributePrefixBasic()
Returns the attributePrefix.

return
String

        return fieldAttributePrefix;
    
protected java.util.SetgetBlacklist()
Returns the blacklist.

return
Set

        return getConfiguration().getBlacklist();
    
protected ParsedConfigurationgetConfiguration()
Returns the ParsedConfiguration from the Account.

return
ParsedConfiguration

        return getAccount().getParsedConfiguration();
    
protected java.lang.StringgetCustomRecipientHeader()
Returns the customRecipientHeader.

return
String

        return getAccount().getCustomRecipientHeader();
    
protected java.lang.StringgetDefaultDomainName()
Returns the defaultDomainName.

return
String

        return getConfiguration().getDefaultDomainName();
    
protected java.lang.StringgetDefaultLocalPart()
Returns the defaultLocalPart.

return
String

        // TODO Consider making this configurable
        return "FETCHMAIL-SERVICE";
    
protected java.util.ListgetDeferredRecipientNotFoundMessageIDs()
Returns the message ids. of messages for which processing has been deferred as the recipient could not be found

return
List

        return getAccount().getDeferredRecipientNotFoundMessageIDs();
    
protected java.lang.StringgetFetchTaskName()
Returns the fetchTaskName.

return
String

        return getConfiguration().getFetchTaskName();
    
protected java.lang.StringgetHost()
Returns the host.

return
String

        return getConfiguration().getHost();
    
protected java.lang.StringgetJavaMailFolderName()
Returns the javaMailFolderName.

return
String

        return getConfiguration().getJavaMailFolderName();
    
protected java.lang.StringgetJavaMailProviderName()
Returns the javaMailProviderName.

return
String

        return getConfiguration().getJavaMailProviderName();
    
protected org.apache.james.services.UsersRepositorygetLocalUsers()
Returns the repository of local users.

return
UsersRepository

        return getConfiguration().getLocalUsers();
    
protected org.apache.avalon.framework.logger.LoggergetLogger()
Returns the logger.

return
Logger

        return getConfiguration().getLogger();
    
protected intgetMaxMessageSizeLimit()
Returns the getMaxMessageSizeLimit.

return
int

        return getConfiguration().getMaxMessageSizeLimit();
    
protected java.lang.StringgetPassword()
Returns the password.

return
String

        return getAccount().getPassword();
    
protected org.apache.mailet.MailAddressgetRecipient()
Returns the recipient.

return
MailAddress

        return getAccount().getRecipient();
    
protected intgetRemoteReceivedHeaderIndex()
Method getRemoteReceivedHeaderIndex.

return
int

        return getConfiguration().getRemoteReceivedHeaderIndex();    
    
protected org.apache.james.services.MailServergetServer()
Returns the server.

return
MailServer

        return getConfiguration().getServer();
    
protected javax.mail.SessiongetSession()
Returns the session.

return
Session

        return getAccount().getSession();
    
protected java.lang.StringgetUser()
Returns the user.

return
String

        return getAccount().getUser();
    
protected booleanisDeferRecipientNotFound()
Returns the isDeferRecipientNotFound.

return
boolean

        return getConfiguration().isDeferRecipientNotFound();
    
protected booleanisFetchAll()
Returns the fetchAll.

return
boolean

        return getConfiguration().isFetchAll();
    
protected booleanisIgnoreRecipientHeader()
Returns the ignoreOriginalRecipient.

return
boolean

        return getAccount().isIgnoreRecipientHeader();
    
protected booleanisLeave()
Returns the leave.

return
boolean

        return getConfiguration().isLeave();
    
protected booleanisLeaveBlacklisted()
Returns the leaveBlacklisted.

return
boolean

        return getConfiguration().isLeaveBlacklisted();
    
protected booleanisLeaveMaxMessageSizeExceeded()
Returns the LeaveMaxMessageSizeExceeded.

return
boolean

        return getConfiguration().isLeaveMaxMessageSizeExceeded();
    
protected booleanisLeaveRecipientNotFound()
Returns the leaveRecipientNotFound.

return
boolean

        return getConfiguration().isLeaveRecipientNotFound();
    
protected booleanisLeaveRemoteReceivedHeaderInvalid()
Returns the leaveRemoteReceivedHeaderInvalid.

return
boolean

        return getConfiguration().isLeaveRemoteReceivedHeaderInvalid();
    
protected booleanisLeaveRemoteRecipient()
Returns the leaveRemoteRecipient.

return
boolean

        return getConfiguration().isLeaveRemoteRecipient();
    
protected booleanisLeaveUndeliverable()
Returns the leaveUndeliverable.

return
boolean

        return getConfiguration().isLeaveUndeliverable();
    
protected booleanisLeaveUserUndefined()
Returns the leaveUserUndefinded.

return
boolean

        return getConfiguration().isLeaveUserUndefined();
    
protected booleanisMarkBlacklistedSeen()
Returns the markBlacklistedSeen.

return
boolean

        return getConfiguration().isMarkBlacklistedSeen();
    
protected booleanisMarkMaxMessageSizeExceededSeen()
Returns the MarkMaxMessageSizeExceededSeen.

return
boolean

        return getConfiguration().isMarkMaxMessageSizeExceededSeen();
    
protected booleanisMarkRecipientNotFoundSeen()
Returns the markRecipientNotFoundSeen.

return
boolean

        return getConfiguration().isMarkRecipientNotFoundSeen();
    
protected booleanisMarkRemoteReceivedHeaderInvalidSeen()
Returns the markRemoteReceivedHeaderInvalidSeen.

return
boolean

        return getConfiguration().isMarkRemoteReceivedHeaderInvalidSeen();
    
protected booleanisMarkRemoteRecipientSeen()
Returns the markRemoteRecipientSeen.

return
boolean

        return getConfiguration().isMarkRemoteRecipientSeen();
    
protected booleanisMarkSeen()
Returns the markSeen.

return
boolean

        return getConfiguration().isMarkSeen();
    
protected booleanisMarkUndeliverableSeen()
Returns the markUndeliverableSeen.

return
boolean

        return getConfiguration().isMarkUndeliverableSeen();
    
protected booleanisMarkUserUndefinedSeen()
Returns the markUserUndefindedSeen.

return
boolean

        return getConfiguration().isMarkUserUndefinedSeen();
    
protected booleanisOpenReadOnly()
Answers true if the folder should be opened read only. For this to be true... - isKeep() must be true - isMarkSeen() must be false

return
boolean

        return getConfiguration().isOpenReadOnly();
    
protected booleanisRecurse()
Returns the recurse.

return
boolean

        return getConfiguration().isRecurse();
    
protected booleanisRejectBlacklisted()
Returns the RejectUserBlacklisted.

return
boolean

        return getConfiguration().isRejectBlacklisted();
    
protected booleanisRejectMaxMessageSizeExceeded()
Returns the RejectMaxMessageSizeExceeded.

return
boolean

        return getConfiguration().isRejectMaxMessageSizeExceeded();
    
protected booleanisRejectRecipientNotFound()
Returns the rejectRecipientNotFound.

return
boolean

        return getConfiguration().isRejectRecipientNotFound();
    
protected booleanisRejectRemoteReceivedHeaderInvalid()
Returns the RejectRemoteReceivedHeaderInvalid.

return
boolean

        return getConfiguration().isRejectRemoteReceivedHeaderInvalid();
    
protected booleanisRejectRemoteRecipient()
Returns the RejectRemoteRecipient.

return
boolean

        return getConfiguration().isRejectRemoteRecipient();
    
protected booleanisRejectUserUndefined()
Returns the RejectUserUndefinded.

return
boolean

        return getConfiguration().isRejectUserUndefined();
    
public abstract voidprocess()
Process the mail elements of the receiver

protected voidsetAccount(Account account)
Sets the account.

param
account The account to set

        fieldAccount = account;
    
protected voidsetAttributePrefix(java.lang.String attributePrefix)
Sets the attributePrefix.

param
attributePrefix The attributePrefix to set

        fieldAttributePrefix = attributePrefix;
    
protected voidupdateAttributePrefix()
Updates the attributePrefix.

        setAttributePrefix(computeAttributePrefix());