public abstract class AbstractRecipientRewriteTable extends Object implements RecipientRewriteTable, LogEnabled, Configurable
RecipientRewriteTable.ErrorMappingExceptionALIASDOMAIN_PREFIX, ERROR_PREFIX, REGEX_PREFIX, WILDCARD| Constructor and Description |
|---|
AbstractRecipientRewriteTable() |
| Modifier and Type | Method and Description |
|---|---|
void |
addAddressMapping(String user,
String domain,
String address)
Add address mapping
|
void |
addAliasDomainMapping(String aliasDomain,
String realDomain)
Add aliasDomain mapping
|
void |
addErrorMapping(String user,
String domain,
String error)
Add error mapping
|
void |
addMapping(String user,
String domain,
String mapping)
Add mapping
|
protected abstract void |
addMappingInternal(String user,
String domain,
String mapping)
Add new mapping
|
void |
addRegexMapping(String user,
String domain,
String regex)
Add regex mapping
|
void |
configure(org.apache.commons.configuration.HierarchicalConfiguration config)
Configure the object.
|
protected void |
doConfigure(org.apache.commons.configuration.HierarchicalConfiguration conf)
Override to handle config
|
Map<String,Collection<String>> |
getAllMappings()
Return a Map which holds all mappings.
|
protected abstract Map<String,Collection<String>> |
getAllMappingsInternal()
Return a Map which holds all Mappings
|
protected String |
getFixedDomain(String domain)
Fix the domain for the given argument.
|
protected String |
getFixedUser(String user)
Return user String for the given argument.
|
protected org.slf4j.Logger |
getLogger() |
Collection<String> |
getMappings(String user,
String domain)
Return the mapped MailAddress for the given address.
|
Collection<String> |
getMappings(String user,
String domain,
int mappingLimit) |
Collection<String> |
getUserDomainMappings(String user,
String domain)
Return the explicit mapping stored for the given user and domain.
|
protected abstract Collection<String> |
getUserDomainMappingsInternal(String user,
String domain)
Return Collection of all mappings for the given username and domain
|
protected abstract String |
mapAddressInternal(String user,
String domain)
Override to map virtual recipients to real recipients, both local and
non-local.
|
void |
removeAddressMapping(String user,
String domain,
String address)
Remove address mapping
|
void |
removeAliasDomainMapping(String aliasDomain,
String realDomain)
Remove aliasDomain mapping
|
void |
removeErrorMapping(String user,
String domain,
String error)
Remove error mapping
|
void |
removeMapping(String user,
String domain,
String mapping)
Remove mapping
|
protected abstract void |
removeMappingInternal(String user,
String domain,
String mapping)
Remove mapping
|
void |
removeRegexMapping(String user,
String domain,
String regex)
Remove regex mapping
|
void |
setDomainList(DomainList domainList) |
void |
setLog(org.slf4j.Logger logger)
Sets the service log.
|
void |
setMappingLimit(int mappingLimit)
Set the mappingLimit
|
void |
setRecursiveMapping(boolean recursive) |
public void setDomainList(DomainList domainList)
public void configure(org.apache.commons.configuration.HierarchicalConfiguration config)
throws org.apache.commons.configuration.ConfigurationException
Configurableconfigure in interface Configurableorg.apache.commons.configuration.ConfigurationExceptionConfigurable.configure(HierarchicalConfiguration)public void setLog(org.slf4j.Logger logger)
LogEnabledsetLog in interface LogEnabledlogger - not nullprotected void doConfigure(org.apache.commons.configuration.HierarchicalConfiguration conf)
throws org.apache.commons.configuration.ConfigurationException
conf - org.apache.commons.configuration.ConfigurationExceptionpublic void setRecursiveMapping(boolean recursive)
public void setMappingLimit(int mappingLimit)
throws IllegalArgumentException
mappingLimit - the mappingLimitIllegalArgumentException - get thrown if mappingLimit smaller then 1 is usedpublic Collection<String> getMappings(String user, String domain) throws RecipientRewriteTable.ErrorMappingException, RecipientRewriteTableException
RecipientRewriteTablegetMappings in interface RecipientRewriteTableuser - the MailAddressRecipientRewriteTable.ErrorMappingException - get thrown if an error mapping was foundRecipientRewriteTableExceptionRecipientRewriteTable.getMappings(String,
String)public Collection<String> getMappings(String user, String domain, int mappingLimit) throws RecipientRewriteTable.ErrorMappingException, RecipientRewriteTableException
public void addRegexMapping(String user, String domain, String regex) throws RecipientRewriteTableException
RecipientRewriteTableaddRegexMapping in interface RecipientRewriteTableuser - the username. Null if no username should be useddomain - the domain. Null if no domain should be usedregex - the regex.RecipientRewriteTableExceptionRecipientRewriteTable.addRegexMapping(java.lang.String,
java.lang.String, java.lang.String)public void removeRegexMapping(String user, String domain, String regex) throws RecipientRewriteTableException
RecipientRewriteTableremoveRegexMapping in interface RecipientRewriteTableuser - the username. Null if no username should be useddomain - the domain. Null if no domain should be usedregex - the regex.RecipientRewriteTableExceptionRecipientRewriteTable.removeRegexMapping(java.lang.String,
java.lang.String, java.lang.String)public void addAddressMapping(String user, String domain, String address) throws RecipientRewriteTableException
RecipientRewriteTableaddAddressMapping in interface RecipientRewriteTableuser - the username. Null if no username should be useddomain - the domain. Null if no domain should be usedRecipientRewriteTableExceptionRecipientRewriteTable.addAddressMapping(java.lang.String,
java.lang.String, java.lang.String)public void removeAddressMapping(String user, String domain, String address) throws RecipientRewriteTableException
RecipientRewriteTableremoveAddressMapping in interface RecipientRewriteTableuser - the username. Null if no username should be useddomain - the domain. Null if no domain should be usedRecipientRewriteTableExceptionRecipientRewriteTable.removeAddressMapping(java.lang.String,
java.lang.String, java.lang.String)public void addErrorMapping(String user, String domain, String error) throws RecipientRewriteTableException
RecipientRewriteTableaddErrorMapping in interface RecipientRewriteTableuser - the username. Null if no username should be useddomain - the domain. Null if no domain should be usederror - the regex.RecipientRewriteTableExceptionRecipientRewriteTable.addErrorMapping(java.lang.String,
java.lang.String, java.lang.String)public void removeErrorMapping(String user, String domain, String error) throws RecipientRewriteTableException
RecipientRewriteTableremoveErrorMapping in interface RecipientRewriteTableuser - the username. Null if no username should be useddomain - the domain. Null if no domain should be usedRecipientRewriteTableExceptionRecipientRewriteTable.removeErrorMapping(java.lang.String,
java.lang.String, java.lang.String)public void addMapping(String user, String domain, String mapping) throws RecipientRewriteTableException
RecipientRewriteTableaddMapping in interface RecipientRewriteTableuser - the username. Null if no username should be useddomain - the domain. Null if no domain should be usedmapping - the mappingRecipientRewriteTableExceptionRecipientRewriteTable.addMapping(java.lang.String,
java.lang.String, java.lang.String)public void removeMapping(String user, String domain, String mapping) throws RecipientRewriteTableException
RecipientRewriteTableremoveMapping in interface RecipientRewriteTableuser - the username. Null if no username should be useddomain - the domain. Null if no domain should be usedmapping - the mappingRecipientRewriteTableExceptionRecipientRewriteTable.removeMapping(java.lang.String,
java.lang.String, java.lang.String)public Map<String,Collection<String>> getAllMappings() throws RecipientRewriteTableException
RecipientRewriteTablegetAllMappings in interface RecipientRewriteTableRecipientRewriteTableExceptionRecipientRewriteTable.getAllMappings()public Collection<String> getUserDomainMappings(String user, String domain) throws RecipientRewriteTableException
RecipientRewriteTablegetUserDomainMappings in interface RecipientRewriteTableuser - the usernamedomain - the domainRecipientRewriteTableExceptionRecipientRewriteTable.getUserDomainMappings(java.lang.String,
java.lang.String)public void addAliasDomainMapping(String aliasDomain, String realDomain) throws RecipientRewriteTableException
RecipientRewriteTableaddAliasDomainMapping in interface RecipientRewriteTablealiasDomain - the aliasdomain which should be mapped to the realDomainrealDomain - the realDomainRecipientRewriteTableExceptionRecipientRewriteTable.addAliasDomainMapping(java.lang.String,
java.lang.String)public void removeAliasDomainMapping(String aliasDomain, String realDomain) throws RecipientRewriteTableException
RecipientRewriteTableremoveAliasDomainMapping in interface RecipientRewriteTablealiasDomain - the aliasdomain which should be mapped to the realDomainrealDomain - the realDomainRecipientRewriteTableExceptionRecipientRewriteTable.removeAliasDomainMapping(java.lang.String,
java.lang.String)protected org.slf4j.Logger getLogger()
protected abstract void addMappingInternal(String user, String domain, String mapping) throws RecipientRewriteTableException
user - the userdomain - the domainmapping - the mappingInvalidMappingExceptionRecipientRewriteTableExceptionprotected abstract void removeMappingInternal(String user, String domain, String mapping) throws RecipientRewriteTableException
user - the userdomain - the domainmapping - the mappingInvalidMappingExceptionRecipientRewriteTableExceptionprotected abstract Collection<String> getUserDomainMappingsInternal(String user, String domain) throws RecipientRewriteTableException
user - the userdomain - the domainRecipientRewriteTableExceptionprotected abstract Map<String,Collection<String>> getAllMappingsInternal() throws RecipientRewriteTableException
RecipientRewriteTableExceptionprotected abstract String mapAddressInternal(String user, String domain) throws RecipientRewriteTableException
MailAddress object.
Translate virtual recipients to real recipients by mapping a string
containing the address of the real recipient as a value to a key. Leave
the value null
if no mapping should be performed. Multiple recipients may be specified by delineating
the mapped string with commas, semi-colons or colons.user - the mapping of virtual to real recipients, as
MailAddresses to Strings.RecipientRewriteTableExceptionprotected String getFixedUser(String user)
user - the given user StringInvalidMappingException - get thrown on invalid argumentCopyright © 2002-2012 The Apache Software Foundation. All Rights Reserved.