org.apache.james.smtpserver.core.filter.fastfail
Class GreylistHandler

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.james.smtpserver.core.filter.fastfail.GreylistHandler
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, CommandHandler

public class GreylistHandler
extends org.apache.avalon.framework.logger.AbstractLogEnabled
implements CommandHandler, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.service.Serviceable, org.apache.avalon.framework.activity.Initializable

GreylistHandler which can be used to activate Greylisting


Constructor Summary
GreylistHandler()
           
 
Method Summary
 void configure(org.apache.avalon.framework.configuration.Configuration handlerConfiguration)
           
 java.util.Collection getImplCommands()
          Return a Collection of implemented commands
 void initialize()
           
 void initSqlQueries(java.sql.Connection conn, java.lang.String sqlFileUrl)
          Initializes the sql query environment from the SqlResources file.
 void onCommand(SMTPSession session)
          Handle the command
 void service(org.apache.avalon.framework.service.ServiceManager serviceMan)
           
 void setAutoWhiteListLifeTime(java.lang.String autoWhiteListLifeTime)
          Setup the autowhitelist lifetime for which we should whitelist a triplet.
 void setDataSource(org.apache.avalon.excalibur.datasource.DataSourceComponent datasource)
          Set the datasource
 void setDataSources(org.apache.avalon.cornerstone.services.datasources.DataSourceSelector datasources)
          Set the datasources
 void setDnsServer(DNSService dnsServer)
          Set the DNSService
 void setRepositoryPath(java.lang.String repositoryPath)
          Set the repositoryPath to use
 void setSqlFileUrl(java.lang.String sqlFileUrl)
          Set the sqlFileUrl to use for getting the sqlRessource.xml file
 void setTempBlockTime(java.lang.String tempBlockTime)
          Setup the temporary blocking time
 void setUnseenLifeTime(java.lang.String unseenLifeTime)
          Set up the liftime of only once seen triplet.
 
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
 

Constructor Detail

GreylistHandler

public GreylistHandler()
Method Detail

configure

public void configure(org.apache.avalon.framework.configuration.Configuration handlerConfiguration)
               throws org.apache.avalon.framework.configuration.ConfigurationException
Specified by:
configure in interface org.apache.avalon.framework.configuration.Configurable
Throws:
org.apache.avalon.framework.configuration.ConfigurationException
See Also:
Configurable.configure(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()

service

public void service(org.apache.avalon.framework.service.ServiceManager serviceMan)
             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)

setDnsServer

public void setDnsServer(DNSService dnsServer)
Set the DNSService

Parameters:
dnsServer - The DNSService

setSqlFileUrl

public void setSqlFileUrl(java.lang.String sqlFileUrl)
Set the sqlFileUrl to use for getting the sqlRessource.xml file

Parameters:
sqlFileUrl - The fileUrl

setRepositoryPath

public void setRepositoryPath(java.lang.String repositoryPath)
Set the repositoryPath to use

Parameters:
repositoryPath - The repositoryPath

setDataSources

public void setDataSources(org.apache.avalon.cornerstone.services.datasources.DataSourceSelector datasources)
Set the datasources

Parameters:
datasources - The datasources

setDataSource

public void setDataSource(org.apache.avalon.excalibur.datasource.DataSourceComponent datasource)
Set the datasource

Parameters:
datasource - the datasource

setTempBlockTime

public void setTempBlockTime(java.lang.String tempBlockTime)
Setup the temporary blocking time

Parameters:
tempBlockTime - The temporary blocking time

setAutoWhiteListLifeTime

public void setAutoWhiteListLifeTime(java.lang.String autoWhiteListLifeTime)
Setup the autowhitelist lifetime for which we should whitelist a triplet. After this lifetime the record will be deleted

Parameters:
autoWhiteListLifeTime - The lifeTime

setUnseenLifeTime

public void setUnseenLifeTime(java.lang.String unseenLifeTime)
Set up the liftime of only once seen triplet. After this liftime the record will be deleted

Parameters:
unseenLifeTime - The lifetime

onCommand

public void onCommand(SMTPSession session)
Description copied from interface: CommandHandler
Handle the command

Specified by:
onCommand in interface CommandHandler
See Also:
CommandHandler.onCommand(SMTPSession)

initSqlQueries

public void initSqlQueries(java.sql.Connection conn,
                           java.lang.String sqlFileUrl)
                    throws java.lang.Exception
Initializes the sql query environment from the SqlResources file. Will look for conf/sqlResources.xml.

Parameters:
conn - The connection for accessing the database
sqlFileUrl - The url which we use to get the sql file
Throws:
java.lang.Exception - If any error occurs

getImplCommands

public java.util.Collection getImplCommands()
Description copied from interface: CommandHandler
Return a Collection of implemented commands

Specified by:
getImplCommands in interface CommandHandler
Returns:
Collection which contains implemented commands


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