| java.lang.Object org.apache.mailet.GenericMatcher org.apache.james.transport.matchers.AbstractQuotaMatcher
All known Subclasses: org.apache.james.transport.matchers.AbstractStorageQuota,
AbstractQuotaMatcher | abstract public class AbstractQuotaMatcher extends GenericMatcher (Code) | | Abstract matcher checking whether a recipient has exceeded a maximum allowed quota.
"Quota" at this level is an abstraction whose specific interpretation
will be done by subclasses.
Although extending GenericMatcher, its logic is recipient oriented.
version: CVS $Revision: 494012 $ $Date: 2007-01-08 11:23:58 +0100 (Mo, 08 Jan 2007) $ since: 2.2.0 |
getQuota | abstract protected long getQuota(MailAddress address, Mail mail) throws MessagingException(Code) | | Gets the quota to check against.
Parameters: address - the address holding the quota if applicable Parameters: mail - the mail involved if needed |
getUsed | abstract protected long getUsed(MailAddress address, Mail mail) throws MessagingException(Code) | | Gets the used amount to check against the quota.
Parameters: address - the address involved Parameters: mail - the mail involved if needed |
isRecipientChecked | protected boolean isRecipientChecked(MailAddress recipient) throws MessagingException(Code) | | Checks the recipient.
The default behaviour is to check that the recipient is not the local postmaster.
If a subclass overrides this method it should "and" super.isRecipientChecked
to its check.
Parameters: recipient - the recipient to check |
isSenderChecked | protected boolean isSenderChecked(MailAddress sender) throws MessagingException(Code) | | Checks the sender.
The default behaviour is to check that the sender is not null nor the local postmaster.
If a subclass overrides this method it should "and" super.isSenderChecked
to its check.
Parameters: sender - the sender to check |
parseQuota | protected long parseQuota(String amount) throws MessagingException(Code) | | Utility method that parses an amount string.
You can use 'k' and 'm' as optional postfixes to the amount (both upper and lowercase).
In other words, "1m" is the same as writing "1024k", which is the same as
"1048576".
Parameters: amount - the amount string to parse |
|
|