org.apache.james.domain
Class AbstractDomainList

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.james.domain.AbstractDomainList
All Implemented Interfaces:
org.apache.avalon.framework.logger.LogEnabled, org.apache.avalon.framework.service.Serviceable, DomainList, ManageableDomainList
Direct Known Subclasses:
JDBCDomainList, XMLDomainList

public abstract class AbstractDomainList
extends org.apache.avalon.framework.logger.AbstractLogEnabled
implements org.apache.avalon.framework.service.Serviceable, ManageableDomainList

All implementations of the DomainList interface should extends this abstract class


Field Summary
 
Fields inherited from interface org.apache.james.api.domainlist.ManageableDomainList
ROLE
 
Constructor Summary
AbstractDomainList()
           
 
Method Summary
 boolean addDomain(java.lang.String domain)
          Add domain to the service
protected abstract  boolean addDomainInternal(java.lang.String domain)
          Add domain
protected  DNSService getDNSServer()
          Return dnsServer
protected abstract  java.util.List getDomainListInternal()
          Return domainList
 java.util.List getDomains()
          Return List of domains which should be used as localdomains.
 boolean removeDomain(java.lang.String domain)
          Remove domain from the service
protected abstract  boolean removeDomainInternal(java.lang.String domain)
          Remove domain
 void service(org.apache.avalon.framework.service.ServiceManager arg0)
           
 void setAutoDetect(boolean autoDetect)
          Set to true to autodetect the hostname of the host on which james is runnin, and add this to the domain service Default is true
 void setAutoDetectIP(boolean autoDetectIP)
          Set to true to lookup the ipaddresses for each given domain and add these to the domain service Default is true
 
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
 
Methods inherited from interface org.apache.james.api.domainlist.DomainList
containsDomain
 

Constructor Detail

AbstractDomainList

public AbstractDomainList()
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
Throws:
org.apache.avalon.framework.service.ServiceException
See Also:
Serviceable.service(org.apache.avalon.framework.service.ServiceManager)

getDomains

public java.util.List getDomains()
Description copied from interface: DomainList
Return List of domains which should be used as localdomains. Return null if no domains were found

Specified by:
getDomains in interface DomainList
Returns:
domains
See Also:
DomainList.getDomains()

addDomain

public boolean addDomain(java.lang.String domain)
Description copied from interface: ManageableDomainList
Add domain to the service

Specified by:
addDomain in interface ManageableDomainList
Parameters:
domain - domain to add
Returns:
true if successfully
See Also:
ManageableDomainList.addDomain(java.lang.String)

removeDomain

public boolean removeDomain(java.lang.String domain)
Description copied from interface: ManageableDomainList
Remove domain from the service

Specified by:
removeDomain in interface ManageableDomainList
Parameters:
domain - domain to remove
Returns:
true if succesfully
See Also:
ManageableDomainList.removeDomain(java.lang.String)

setAutoDetect

public void setAutoDetect(boolean autoDetect)
Description copied from interface: DomainList
Set to true to autodetect the hostname of the host on which james is runnin, and add this to the domain service Default is true

Specified by:
setAutoDetect in interface DomainList
Parameters:
autoDetect - set to false for disable
See Also:
DomainList.setAutoDetect(boolean)

setAutoDetectIP

public void setAutoDetectIP(boolean autoDetectIP)
Description copied from interface: DomainList
Set to true to lookup the ipaddresses for each given domain and add these to the domain service Default is true

Specified by:
setAutoDetectIP in interface DomainList
Parameters:
autoDetectIP - set to false for disable
See Also:
DomainList.setAutoDetectIP(boolean)

getDNSServer

protected DNSService getDNSServer()
Return dnsServer

Returns:
dns

getDomainListInternal

protected abstract java.util.List getDomainListInternal()
Return domainList

Returns:
List

addDomainInternal

protected abstract boolean addDomainInternal(java.lang.String domain)
Add domain

Parameters:
domain - domain to add
Returns:
true if successfully

removeDomainInternal

protected abstract boolean removeDomainInternal(java.lang.String domain)
Remove domain

Parameters:
domain - domain to remove
Returns:
true if successfully


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