public abstract class AbstractRecipientRewriteTable extends Object implements RecipientRewriteTable, LogEnabled, Configurable
RecipientRewriteTable.ErrorMappingException
ALIASDOMAIN_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
Configurable
configure
in interface Configurable
org.apache.commons.configuration.ConfigurationException
Configurable.configure(HierarchicalConfiguration)
public void setLog(org.slf4j.Logger logger)
LogEnabled
setLog
in interface LogEnabled
logger
- not nullprotected void doConfigure(org.apache.commons.configuration.HierarchicalConfiguration conf) throws org.apache.commons.configuration.ConfigurationException
conf
- org.apache.commons.configuration.ConfigurationException
public 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
RecipientRewriteTable
getMappings
in interface RecipientRewriteTable
user
- the MailAddressRecipientRewriteTable.ErrorMappingException
- get thrown if an error mapping was foundRecipientRewriteTableException
RecipientRewriteTable.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
RecipientRewriteTable
addRegexMapping
in interface RecipientRewriteTable
user
- the username. Null if no username should be useddomain
- the domain. Null if no domain should be usedregex
- the regex.RecipientRewriteTableException
RecipientRewriteTable.addRegexMapping(java.lang.String,
java.lang.String, java.lang.String)
public void removeRegexMapping(String user, String domain, String regex) throws RecipientRewriteTableException
RecipientRewriteTable
removeRegexMapping
in interface RecipientRewriteTable
user
- the username. Null if no username should be useddomain
- the domain. Null if no domain should be usedregex
- the regex.RecipientRewriteTableException
RecipientRewriteTable.removeRegexMapping(java.lang.String,
java.lang.String, java.lang.String)
public void addAddressMapping(String user, String domain, String address) throws RecipientRewriteTableException
RecipientRewriteTable
addAddressMapping
in interface RecipientRewriteTable
user
- the username. Null if no username should be useddomain
- the domain. Null if no domain should be usedRecipientRewriteTableException
RecipientRewriteTable.addAddressMapping(java.lang.String,
java.lang.String, java.lang.String)
public void removeAddressMapping(String user, String domain, String address) throws RecipientRewriteTableException
RecipientRewriteTable
removeAddressMapping
in interface RecipientRewriteTable
user
- the username. Null if no username should be useddomain
- the domain. Null if no domain should be usedRecipientRewriteTableException
RecipientRewriteTable.removeAddressMapping(java.lang.String,
java.lang.String, java.lang.String)
public void addErrorMapping(String user, String domain, String error) throws RecipientRewriteTableException
RecipientRewriteTable
addErrorMapping
in interface RecipientRewriteTable
user
- the username. Null if no username should be useddomain
- the domain. Null if no domain should be usederror
- the regex.RecipientRewriteTableException
RecipientRewriteTable.addErrorMapping(java.lang.String,
java.lang.String, java.lang.String)
public void removeErrorMapping(String user, String domain, String error) throws RecipientRewriteTableException
RecipientRewriteTable
removeErrorMapping
in interface RecipientRewriteTable
user
- the username. Null if no username should be useddomain
- the domain. Null if no domain should be usedRecipientRewriteTableException
RecipientRewriteTable.removeErrorMapping(java.lang.String,
java.lang.String, java.lang.String)
public void addMapping(String user, String domain, String mapping) throws RecipientRewriteTableException
RecipientRewriteTable
addMapping
in interface RecipientRewriteTable
user
- the username. Null if no username should be useddomain
- the domain. Null if no domain should be usedmapping
- the mappingRecipientRewriteTableException
RecipientRewriteTable.addMapping(java.lang.String,
java.lang.String, java.lang.String)
public void removeMapping(String user, String domain, String mapping) throws RecipientRewriteTableException
RecipientRewriteTable
removeMapping
in interface RecipientRewriteTable
user
- the username. Null if no username should be useddomain
- the domain. Null if no domain should be usedmapping
- the mappingRecipientRewriteTableException
RecipientRewriteTable.removeMapping(java.lang.String,
java.lang.String, java.lang.String)
public Map<String,Collection<String>> getAllMappings() throws RecipientRewriteTableException
RecipientRewriteTable
getAllMappings
in interface RecipientRewriteTable
RecipientRewriteTableException
RecipientRewriteTable.getAllMappings()
public Collection<String> getUserDomainMappings(String user, String domain) throws RecipientRewriteTableException
RecipientRewriteTable
getUserDomainMappings
in interface RecipientRewriteTable
user
- the usernamedomain
- the domainRecipientRewriteTableException
RecipientRewriteTable.getUserDomainMappings(java.lang.String,
java.lang.String)
public void addAliasDomainMapping(String aliasDomain, String realDomain) throws RecipientRewriteTableException
RecipientRewriteTable
addAliasDomainMapping
in interface RecipientRewriteTable
aliasDomain
- the aliasdomain which should be mapped to the realDomainrealDomain
- the realDomainRecipientRewriteTableException
RecipientRewriteTable.addAliasDomainMapping(java.lang.String,
java.lang.String)
public void removeAliasDomainMapping(String aliasDomain, String realDomain) throws RecipientRewriteTableException
RecipientRewriteTable
removeAliasDomainMapping
in interface RecipientRewriteTable
aliasDomain
- the aliasdomain which should be mapped to the realDomainrealDomain
- the realDomainRecipientRewriteTableException
RecipientRewriteTable.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 mappingInvalidMappingException
RecipientRewriteTableException
protected abstract void removeMappingInternal(String user, String domain, String mapping) throws RecipientRewriteTableException
user
- the userdomain
- the domainmapping
- the mappingInvalidMappingException
RecipientRewriteTableException
protected abstract Collection<String> getUserDomainMappingsInternal(String user, String domain) throws RecipientRewriteTableException
user
- the userdomain
- the domainRecipientRewriteTableException
protected abstract Map<String,Collection<String>> getAllMappingsInternal() throws RecipientRewriteTableException
RecipientRewriteTableException
protected 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
MailAddress
es to String
s.RecipientRewriteTableException
protected String getFixedUser(String user)
user
- the given user StringInvalidMappingException
- get thrown on invalid argumentCopyright © 2002-2012 The Apache Software Foundation. All Rights Reserved.