|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.mailet.GenericMatcher org.apache.james.transport.matchers.AbstractQuotaMatcher org.apache.james.transport.matchers.AbstractStorageQuota
public abstract class AbstractStorageQuota
Experimental: 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).
This matcher need to calculate the mailbox size everytime it is called. This can slow down things if there are many mails in the mailbox. Some users also report big problems with the matcher if a JDBC based mailrepository is used.
Constructor Summary | |
---|---|
AbstractStorageQuota()
|
Method Summary | |
---|---|
protected java.lang.String |
getPrimaryName(java.lang.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 |
---|
public AbstractStorageQuota()
Method Detail |
---|
public void init() throws javax.mail.MessagingException
super.init()
.
init
in class GenericMatcher
javax.mail.MessagingException
protected boolean isRecipientChecked(MailAddress recipient) throws javax.mail.MessagingException
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.
isRecipientChecked
in class AbstractQuotaMatcher
recipient
- the recipient to check
javax.mail.MessagingException
protected long getUsed(MailAddress recipient, Mail _) throws javax.mail.MessagingException
getUsed
in class AbstractQuotaMatcher
recipient
- the recipient to check_
- the mail involved if needed
javax.mail.MessagingException
protected java.lang.String getPrimaryName(java.lang.String originalUsername)
originalUsername
- the user name to look for; it can be already the primary name or an alias
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |