org.apache.james.transport.matchers
Class AbstractStorageQuota

java.lang.Object
  extended byorg.apache.mailet.GenericMatcher
      extended byorg.apache.james.transport.matchers.AbstractQuotaMatcher
          extended byorg.apache.james.transport.matchers.AbstractStorageQuota
All Implemented Interfaces:
Matcher, MatcherConfig
Direct Known Subclasses:
RecipientIsOverFixedQuota

public abstract class AbstractStorageQuota
extends AbstractQuotaMatcher

Abstract matcher checking whether a recipient has exceeded a maximum allowed storage quota for messages standing in his inbox.

"Storage quota" at this level is still an abstraction whose specific interpretation will be done by subclasses (e.g. could be specific for each user or common to all of them).

Since:
2.2.0
Version:
CVS $Revision: 382410 $ $Date: 2006-03-02 10:27:24 -0500 (Thu, 02 Mar 2006) $

Constructor Summary
AbstractStorageQuota()
           
 
Method Summary
protected  String getPrimaryName(String originalUsername)
          Gets the main name of a local customer, handling aliases.
protected  long getUsed(MailAddress recipient, Mail _)
          Gets the storage used in the recipient's inbox.
 void init()
          Standard matcher initialization.
protected  boolean isRecipientChecked(MailAddress recipient)
          Checks the recipient.
 
Methods inherited from class org.apache.james.transport.matchers.AbstractQuotaMatcher
getQuota, isOverQuota, isSenderChecked, match, parseQuota
 
Methods inherited from class org.apache.mailet.GenericMatcher
destroy, getCondition, getMailetContext, getMatcherConfig, getMatcherInfo, getMatcherName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractStorageQuota

public AbstractStorageQuota()
Method Detail

init

public void init()
          throws MessagingException
Standard matcher initialization. Overriding classes must do a super.init().

Overrides:
init in class GenericMatcher
Throws:
MessagingException

isRecipientChecked

protected boolean isRecipientChecked(MailAddress recipient)
                              throws MessagingException
Checks the recipient. Does a super.isRecipientChecked and checks that the recipient is a known user in the local server. If a subclass overrides this method it should "and" super.isRecipientChecked to its check.

Overrides:
isRecipientChecked in class AbstractQuotaMatcher
Parameters:
recipient - the recipient to check
Throws:
MessagingException

getUsed

protected long getUsed(MailAddress recipient,
                       Mail _)
                throws MessagingException
Gets the storage used in the recipient's inbox.

Specified by:
getUsed in class AbstractQuotaMatcher
Parameters:
recipient - the recipient to check
_ - the mail involved if needed
Throws:
MessagingException

getPrimaryName

protected String getPrimaryName(String originalUsername)
Gets the main name of a local customer, handling aliases.

Parameters:
originalUsername - the user name to look for; it can be already the primary name or an alias
Returns:
the primary name, or originalUsername unchanged if not found


"Copyright © 1999-2006 Apache Jakarta Project. All Rights Reserved."