org.apache.james.jspf.policies.local
Class FallbackPolicy

java.lang.Object
  extended by org.apache.james.jspf.policies.local.FallbackPolicy
All Implemented Interfaces:
PolicyPostFilter
Direct Known Subclasses:
OverridePolicy

public class FallbackPolicy
extends java.lang.Object
implements PolicyPostFilter

Class to support Fallback feature


Constructor Summary
FallbackPolicy(Logger log, SPFRecordParser parser)
           
 
Method Summary
 void addEntry(java.lang.String rawHost, java.lang.String rawSpfRecord)
          Add a entry.
 void clearEntrys()
          Clear all entries
protected  SPF1Record getMySPFRecord(java.lang.String host)
          Return the SPF1Record for the given host
 SPF1Record getSPFRecord(java.lang.String currentDomain, SPF1Record res)
          Filter or replace a record for the given domain
 void removeEntry(java.lang.String host)
          Remove entry
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FallbackPolicy

public FallbackPolicy(Logger log,
                      SPFRecordParser parser)
Method Detail

addEntry

public void addEntry(java.lang.String rawHost,
                     java.lang.String rawSpfRecord)
              throws java.lang.IllegalArgumentException
Add a entry.

Parameters:
rawHost - the host or ipaddress for which the entry should be added.
rawSpfRecord - the spfRecord to add
Throws:
java.lang.IllegalArgumentException - get thrown on invalid spfRecord

clearEntrys

public void clearEntrys()
Clear all entries


removeEntry

public void removeEntry(java.lang.String host)
Remove entry

Parameters:
host - The host

getSPFRecord

public SPF1Record getSPFRecord(java.lang.String currentDomain,
                               SPF1Record res)
                        throws PermErrorException,
                               TempErrorException,
                               NoneException,
                               NeutralException
Description copied from interface: PolicyPostFilter
Filter or replace a record for the given domain

Specified by:
getSPFRecord in interface PolicyPostFilter
Parameters:
currentDomain - the domain to retrieve the SPFRecord for
res - the previous record
Returns:
the SPFRecord found
Throws:
PermErrorException - exception
TempErrorException - exception
NoneException - exception
NeutralException - exception
See Also:
PolicyPostFilter.getSPFRecord(java.lang.String, org.apache.james.jspf.core.SPF1Record)

getMySPFRecord

protected SPF1Record getMySPFRecord(java.lang.String host)
Return the SPF1Record for the given host

Parameters:
host - the hostname or ipaddress
Returns:
the SPF1Record of null if no SPF1Record was found in fallback for the given host


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