public abstract class AbstractStorageQuota
extends org.apache.james.transport.matchers.AbstractQuotaMatcher
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 and Description |
---|
AbstractStorageQuota() |
Modifier and Type | Method and Description |
---|---|
protected long |
getUsed(org.apache.mailet.MailAddress recipient,
org.apache.mailet.Mail _)
Gets the storage used in the recipient's inbox.
|
void |
init() |
protected boolean |
isRecipientChecked(org.apache.mailet.MailAddress recipient)
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. |
void |
setMailboxManager(org.apache.james.mailbox.MailboxManager manager) |
void |
setUsersRepository(UsersRepository localusers) |
getQuota, isOverQuota, isSenderChecked, match, parseQuota
public void setMailboxManager(org.apache.james.mailbox.MailboxManager manager)
public void setUsersRepository(UsersRepository localusers)
protected boolean isRecipientChecked(org.apache.mailet.MailAddress recipient) throws javax.mail.MessagingException
super.isRecipientChecked
and checks that the
recipient is a known user in the local server.super.isRecipientChecked
to its check.isRecipientChecked
in class org.apache.james.transport.matchers.AbstractQuotaMatcher
recipient
- the recipient to checkjavax.mail.MessagingException
public void init() throws javax.mail.MessagingException
init
in class org.apache.mailet.base.GenericMatcher
javax.mail.MessagingException
protected long getUsed(org.apache.mailet.MailAddress recipient, org.apache.mailet.Mail _) throws javax.mail.MessagingException
getUsed
in class org.apache.james.transport.matchers.AbstractQuotaMatcher
recipient
- the recipient to checkjavax.mail.MessagingException
Copyright © 2002-2012 The Apache Software Foundation. All Rights Reserved.