org.apache.james.jspf.terms
Class IP4Mechanism

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

public class IP4Mechanism
extends GenericMechanism

This class represent the ip4 mechanism


Field Summary
static java.lang.String REGEX
          ABNF: IP4 = "ip4" ":" ip4-network [ ip4-cidr-length ]
 
Fields inherited from class org.apache.james.jspf.terms.GenericMechanism
DUAL_CIDR_LENGTH_REGEX, IP4_CIDR_LENGTH_REGEX, IP6_CIDR_LENGTH_REGEX, log, macroExpand
 
Constructor Summary
IP4Mechanism()
           
 
Method Summary
 DNSLookupContinuation checkSPF(SPFSession spfData)
          Run check for SPF with the given values.
 void config(Configuration params)
          Configuration
protected  IPAddr getIp()
           
protected  int getMaxCidr()
          Returns the max cidr for ip4
protected  boolean isValidAddress(java.lang.String ipString)
           
 java.lang.String toString()
           
 
Methods inherited from class org.apache.james.jspf.terms.GenericMechanism
enableLogging, enableMacroExpand, expandHost, getDomain
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

REGEX

public static final java.lang.String REGEX
ABNF: IP4 = "ip4" ":" ip4-network [ ip4-cidr-length ]

See Also:
Constant Field Values
Constructor Detail

IP4Mechanism

public IP4Mechanism()
Method Detail

checkSPF

public DNSLookupContinuation checkSPF(SPFSession spfData)
                               throws PermErrorException
Description copied from interface: SPFChecker
Run check for SPF with the given values.

Parameters:
spfData - The SPF1Data which should be used to run the check
Throws:
PermErrorException - Get thrown if an error was detected
See Also:
SPFChecker.checkSPF(org.apache.james.jspf.core.SPFSession)

config

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

Specified by:
config in interface ConfigurationEnabled
Overrides:
config in class GenericMechanism
Parameters:
params - the ConfigurationMatch which should used
Throws:
PermErrorException - get thrown if a PermError should returned
See Also:
GenericMechanism.config(org.apache.james.jspf.terms.Configuration)

isValidAddress

protected boolean isValidAddress(java.lang.String ipString)
See Also:
Inet6Util.isValidIPV4Address(String)

getMaxCidr

protected int getMaxCidr()
Returns the max cidr for ip4

Returns:
maxCidr The max cidr

getIp

protected IPAddr getIp()
Returns:
Returns the ip.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()


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