org.apache.james.jspf.terms
Class GenericMechanism

java.lang.Object
  extended by org.apache.james.jspf.terms.GenericMechanism
All Implemented Interfaces:
LogEnabled, MacroExpandEnabled, SPFChecker, ConfigurationEnabled, Mechanism
Direct Known Subclasses:
AMechanism, ExistsMechanism, IP4Mechanism, PTRMechanism

public abstract class GenericMechanism
extends java.lang.Object
implements Mechanism, ConfigurationEnabled, LogEnabled, MacroExpandEnabled

This abstract class represent a gerneric mechanism


Field Summary
protected static java.lang.String DUAL_CIDR_LENGTH_REGEX
          ABNF: dual-cidr-length = [ ip4-cidr-length ] [ "/" ip6-cidr-length ]
protected static java.lang.String IP4_CIDR_LENGTH_REGEX
          ABNF: ip4-cidr-length = "/" 1*DIGIT
protected static java.lang.String IP6_CIDR_LENGTH_REGEX
          ABNF: ip6-cidr-length = "/" 1*DIGIT
protected  Logger log
           
protected  MacroExpand macroExpand
           
 
Constructor Summary
GenericMechanism()
           
 
Method Summary
 void config(Configuration params)
          Configuration
 void enableLogging(Logger logger)
          Provide component with a logger.
 void enableMacroExpand(MacroExpand macroExpand)
          Provide component with a DNSService.
protected  java.lang.String expandHost(SPFSession spfData)
          Expand the hostname
protected  java.lang.String getDomain()
           
 
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.jspf.core.SPFChecker
checkSPF
 

Field Detail

IP4_CIDR_LENGTH_REGEX

protected static final java.lang.String IP4_CIDR_LENGTH_REGEX
ABNF: ip4-cidr-length = "/" 1*DIGIT

See Also:
Constant Field Values

IP6_CIDR_LENGTH_REGEX

protected static final java.lang.String IP6_CIDR_LENGTH_REGEX
ABNF: ip6-cidr-length = "/" 1*DIGIT

See Also:
Constant Field Values

DUAL_CIDR_LENGTH_REGEX

protected static final java.lang.String DUAL_CIDR_LENGTH_REGEX
ABNF: dual-cidr-length = [ ip4-cidr-length ] [ "/" ip6-cidr-length ]

See Also:
Constant Field Values

log

protected Logger log

macroExpand

protected MacroExpand macroExpand
Constructor Detail

GenericMechanism

public GenericMechanism()
Method Detail

expandHost

protected java.lang.String expandHost(SPFSession spfData)
                               throws PermErrorException
Expand the hostname

Parameters:
spfData - The SPF1Data to use
Throws:
PermErrorException - get Thrown if invalid macros are used

config

public void config(Configuration params)
            throws PermErrorException
Description copied from interface: ConfigurationEnabled
Configuration

Specified by:
config in interface ConfigurationEnabled
Parameters:
params - the ConfigurationMatch which should used
Throws:
PermErrorException - get thrown if a PermError should returned
See Also:
ConfigurationEnabled.config(Configuration)

getDomain

protected java.lang.String getDomain()
Returns:
Returns the domain.

enableLogging

public void enableLogging(Logger logger)
Description copied from interface: LogEnabled
Provide component with a logger.

Specified by:
enableLogging in interface LogEnabled
Parameters:
logger - the logger. Must not be null.
See Also:
LogEnabled.enableLogging(org.apache.james.jspf.core.Logger)

enableMacroExpand

public void enableMacroExpand(MacroExpand macroExpand)
Description copied from interface: MacroExpandEnabled
Provide component with a DNSService.

Specified by:
enableMacroExpand in interface MacroExpandEnabled
Parameters:
macroExpand - the macroExpand service. Must not be null.
See Also:
MacroExpandEnabled.enableMacroExpand(org.apache.james.jspf.core.MacroExpand)


Copyright © 2006-2009 The Apache Software Foundation. All Rights Reserved.