org.apache.james.vut
Class JDBCVirtualUserTable

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.james.impl.vut.AbstractVirtualUserTable
          extended by org.apache.james.vut.JDBCVirtualUserTable
All Implemented Interfaces:
org.apache.avalon.framework.activity.Initializable, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.logger.LogEnabled, org.apache.avalon.framework.service.Serviceable, DomainList, VirtualUserTableManagement, VirtualUserTable

public class JDBCVirtualUserTable
extends AbstractVirtualUserTable
implements org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.service.Serviceable, org.apache.avalon.framework.activity.Initializable


Field Summary
protected  java.lang.String datasourceName
           
protected  SqlResources sqlQueries
          Contains all of the sql strings for this component.
 
Fields inherited from interface org.apache.james.api.vut.management.VirtualUserTableManagement
ROLE
 
Fields inherited from interface org.apache.james.api.domainlist.DomainList
ROLE
 
Constructor Summary
JDBCVirtualUserTable()
           
 
Method Summary
 boolean addMappingInternal(java.lang.String user, java.lang.String domain, java.lang.String regex)
          Add new mapping
 void configure(org.apache.avalon.framework.configuration.Configuration arg0)
           
 boolean containsDomain(java.lang.String domain)
          Return true if the domain exists in the service
 java.util.Map getAllMappingsInternal()
          Return a Map which holds all Mappings
protected  java.util.List getDomainsInternal()
          Return List of all domains for which email should accepted
protected  java.util.Collection getUserDomainMappingsInternal(java.lang.String user, java.lang.String domain)
          Return Collection of all mappings for the given username and domain
 void initialize()
           
 java.lang.String mapAddressInternal(java.lang.String user, java.lang.String domain)
          Override to map virtual recipients to real recipients, both local and non-local.
 boolean removeMappingInternal(java.lang.String user, java.lang.String domain, java.lang.String mapping)
          Remove mapping
 void service(org.apache.avalon.framework.service.ServiceManager arg0)
           
 void setDataSourceComponent(org.apache.avalon.excalibur.datasource.DataSourceComponent dataSourceComponent)
           
 void setFileSystem(FileSystem fileSystem)
           
 
Methods inherited from class org.apache.james.impl.vut.AbstractVirtualUserTable
addAddressMapping, addAliasDomainMapping, addErrorMapping, addMapping, addRegexMapping, getAllMappings, getDomains, getMappings, getMappings, getUserDomainMappings, removeAddressMapping, removeAliasDomainMapping, removeErrorMapping, removeMapping, removeRegexMapping, setAutoDetect, setAutoDetectIP, setMappingLimit, setRecursiveMapping
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sqlQueries

protected SqlResources sqlQueries
Contains all of the sql strings for this component.


datasourceName

protected java.lang.String datasourceName
Constructor Detail

JDBCVirtualUserTable

public JDBCVirtualUserTable()
Method Detail

service

public void service(org.apache.avalon.framework.service.ServiceManager arg0)
             throws org.apache.avalon.framework.service.ServiceException
Specified by:
service in interface org.apache.avalon.framework.service.Serviceable
Overrides:
service in class AbstractVirtualUserTable
Throws:
org.apache.avalon.framework.service.ServiceException
See Also:
Serviceable.service(org.apache.avalon.framework.service.ServiceManager)

configure

public void configure(org.apache.avalon.framework.configuration.Configuration arg0)
               throws org.apache.avalon.framework.configuration.ConfigurationException
Specified by:
configure in interface org.apache.avalon.framework.configuration.Configurable
Overrides:
configure in class AbstractVirtualUserTable
Throws:
org.apache.avalon.framework.configuration.ConfigurationException
See Also:
Configurable.configure(org.apache.avalon.framework.configuration.Configuration)

initialize

public void initialize()
                throws java.lang.Exception
Specified by:
initialize in interface org.apache.avalon.framework.activity.Initializable
Throws:
java.lang.Exception
See Also:
Initializable.initialize()

setDataSourceComponent

public void setDataSourceComponent(org.apache.avalon.excalibur.datasource.DataSourceComponent dataSourceComponent)

setFileSystem

public void setFileSystem(FileSystem fileSystem)

mapAddressInternal

public java.lang.String mapAddressInternal(java.lang.String user,
                                           java.lang.String domain)
Description copied from class: AbstractVirtualUserTable
Override to map virtual recipients to real recipients, both local and non-local. Each key in the provided map corresponds to a potential virtual recipient, stored as a 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.

Specified by:
mapAddressInternal in class AbstractVirtualUserTable
Parameters:
user - the mapping of virtual to real recipients, as MailAddresses to Strings.
See Also:
AbstractVirtualUserTable.mapAddressInternal(java.lang.String, java.lang.String)

removeMappingInternal

public boolean removeMappingInternal(java.lang.String user,
                                     java.lang.String domain,
                                     java.lang.String mapping)
                              throws InvalidMappingException
Description copied from class: AbstractVirtualUserTable
Remove mapping

Specified by:
removeMappingInternal in class AbstractVirtualUserTable
Parameters:
user - the user
domain - the domain
mapping - the mapping
Returns:
true if successfully
Throws:
InvalidMappingException
See Also:
AbstractVirtualUserTable.removeMappingInternal(String, String, String)

addMappingInternal

public boolean addMappingInternal(java.lang.String user,
                                  java.lang.String domain,
                                  java.lang.String regex)
                           throws InvalidMappingException
Description copied from class: AbstractVirtualUserTable
Add new mapping

Specified by:
addMappingInternal in class AbstractVirtualUserTable
Parameters:
user - the user
domain - the domain
regex - the mapping
Returns:
true if successfully
Throws:
InvalidMappingException
See Also:
AbstractVirtualUserTable.addMappingInternal(String, String, String)

getUserDomainMappingsInternal

protected java.util.Collection getUserDomainMappingsInternal(java.lang.String user,
                                                             java.lang.String domain)
Description copied from class: AbstractVirtualUserTable
Return Collection of all mappings for the given username and domain

Specified by:
getUserDomainMappingsInternal in class AbstractVirtualUserTable
Parameters:
user - the user
domain - the domain
Returns:
Collection which hold the mappings
See Also:
AbstractVirtualUserTable.mapAddress(java.lang.String, java.lang.String)

getDomainsInternal

protected java.util.List getDomainsInternal()
Description copied from class: AbstractVirtualUserTable
Return List of all domains for which email should accepted

Specified by:
getDomainsInternal in class AbstractVirtualUserTable
Returns:
domains the domains
See Also:
AbstractVirtualUserTable.getDomainsInternal()

containsDomain

public boolean containsDomain(java.lang.String domain)
Description copied from interface: DomainList
Return true if the domain exists in the service

Specified by:
containsDomain in interface DomainList
Parameters:
domain - the domain
Returns:
true if the given domain exists in the service
See Also:
DomainList.containsDomain(java.lang.String)

getAllMappingsInternal

public java.util.Map getAllMappingsInternal()
Description copied from class: AbstractVirtualUserTable
Return a Map which holds all Mappings

Specified by:
getAllMappingsInternal in class AbstractVirtualUserTable
Returns:
Map
See Also:
AbstractVirtualUserTable.getAllMappingsInternal()


Copyright ? 2002-2009 The Apache Software Foundation. All Rights Reserved.