james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b...@apache.org
Subject svn commit: r531080 - in /james/jspf/branches/asynch-jspf/src: main/java/org/apache/james/jspf/ main/java/org/apache/james/jspf/core/ main/java/org/apache/james/jspf/macro/ main/java/org/apache/james/jspf/policies/ main/java/org/apache/james/jspf/polic...
Date Sat, 21 Apr 2007 18:46:27 GMT
Author: bago
Date: Sat Apr 21 11:46:26 2007
New Revision: 531080

URL: http://svn.apache.org/viewvc?view=rev&rev=531080
Log:
Renamed SPF1Data to SPFSession. Added basic attributes support to SPFSession

Added:
    james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/core/SPFSession.java
  (contents, props changed)
      - copied, changed from r531076, james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/core/SPF1Data.java
    james/jspf/branches/asynch-jspf/src/test/java/org/apache/james/jspf/core/SPFSessionTest.java
  (contents, props changed)
      - copied, changed from r531076, james/jspf/branches/asynch-jspf/src/test/java/org/apache/james/jspf/core/SPF1DataTest.java
Removed:
    james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/core/SPF1Data.java
    james/jspf/branches/asynch-jspf/src/test/java/org/apache/james/jspf/core/SPF1DataTest.java
Modified:
    james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/SPF.java
    james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/SPFResult.java
    james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/core/Directive.java
    james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/core/Mechanism.java
    james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/core/SPFChecker.java
    james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/macro/MacroExpand.java
    james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/policies/NeutralIfNotMatchPolicy.java
    james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/policies/local/DefaultExplanationPolicy.java
    james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/AMechanism.java
    james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/AllMechanism.java
    james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/ExistsMechanism.java
    james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/ExpModifier.java
    james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/GenericMechanism.java
    james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/GenericModifier.java
    james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/IP4Mechanism.java
    james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/IncludeMechanism.java
    james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/MXMechanism.java
    james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/PTRMechanism.java
    james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/RedirectModifier.java
    james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/UnknownModifier.java

Modified: james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/SPF.java
URL: http://svn.apache.org/viewvc/james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/SPF.java?view=diff&rev=531080&r1=531079&r2=531080
==============================================================================
--- james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/SPF.java (original)
+++ james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/SPF.java Sat Apr 21
11:46:26 2007
@@ -23,7 +23,7 @@
 import org.apache.james.jspf.core.DNSService;
 import org.apache.james.jspf.core.Logger;
 import org.apache.james.jspf.core.SPF1Constants;
-import org.apache.james.jspf.core.SPF1Data;
+import org.apache.james.jspf.core.SPFSession;
 import org.apache.james.jspf.core.SPF1Record;
 import org.apache.james.jspf.core.SPFChecker;
 import org.apache.james.jspf.core.SPFRecordParser;
@@ -130,13 +130,13 @@
      * @return result The SPFResult
      */
     public SPFResult checkSPF(String ipAddress, String mailFrom, String hostName) {
-        SPF1Data spfData = null;
+        SPFSession spfData = null;
         String result = null;
         String explanation = null;
 
         try {
             // Setup the data
-            spfData = new SPF1Data(mailFrom, hostName, ipAddress);
+            spfData = new SPFSession(mailFrom, hostName, ipAddress);
             checkSPF(spfData);
             String resultChar = spfData.getCurrentResult() != null ? spfData.getCurrentResult()
: "";
             result = SPF1Utils.resultToName(resultChar);
@@ -163,9 +163,9 @@
     }
     
     /**
-     * @see org.apache.james.jspf.SPFChecker#checkSPF(org.apache.james.jspf.core.SPF1Data)
+     * @see org.apache.james.jspf.SPFChecker#checkSPF(org.apache.james.jspf.core.SPFSession)
      */
-    public void checkSPF(SPF1Data spfData) throws PermErrorException,
+    public void checkSPF(SPFSession spfData) throws PermErrorException,
             NoneException, TempErrorException, NeutralException {
 
         SPF1Record spfRecord = getPolicy().getSPFRecord(spfData.getCurrentDomain());
@@ -182,7 +182,7 @@
      * @throws TempErrorException exception
      * @throws NeutralException exception
      */
-    public void checkSPF(SPF1Data spfData, SPF1Record spfRecord) throws PermErrorException,
NoneException, TempErrorException, NeutralException {
+    public void checkSPF(SPFSession spfData, SPF1Record spfRecord) throws PermErrorException,
NoneException, TempErrorException, NeutralException {
         Iterator i = spfRecord.iterator();
         while (i.hasNext()) {
             SPFChecker m = (SPFChecker) i.next();

Modified: james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/SPFResult.java
URL: http://svn.apache.org/viewvc/james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/SPFResult.java?view=diff&rev=531080&r1=531079&r2=531080
==============================================================================
--- james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/SPFResult.java (original)
+++ james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/SPFResult.java Sat
Apr 21 11:46:26 2007
@@ -20,7 +20,7 @@
 
 package org.apache.james.jspf;
 
-import org.apache.james.jspf.core.SPF1Data;
+import org.apache.james.jspf.core.SPFSession;
 
 /**
  * This class is used to return the result of an SPF lookup.
@@ -43,7 +43,7 @@
      * @param explanation the explanation
      * @param spf1data the SPF1Data
      */
-    public SPFResult(String result, String explanation, SPF1Data spf1data) {
+    public SPFResult(String result, String explanation, SPFSession spf1data) {
         this.explanation = explanation;
         this.result = result;
         this.headerTextAsString = generateHeader(result, spf1data);
@@ -81,7 +81,7 @@
      * 
      * @param result The result we should use to generate the header
      */
-    private String generateHeader(String result, SPF1Data spfData) {
+    private String generateHeader(String result, SPFSession spfData) {
 
         StringBuffer headerText = new StringBuffer();
 

Modified: james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/core/Directive.java
URL: http://svn.apache.org/viewvc/james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/core/Directive.java?view=diff&rev=531080&r1=531079&r2=531080
==============================================================================
--- james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/core/Directive.java
(original)
+++ james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/core/Directive.java
Sat Apr 21 11:46:26 2007
@@ -64,7 +64,7 @@
      * @throws TempErrorException get thrown if a TempError should returned
      * @throws NoneException get thrown if a NoneException should returned;
      */
-    public void checkSPF(SPF1Data spfData) throws PermErrorException,
+    public void checkSPF(SPFSession spfData) throws PermErrorException,
             TempErrorException, NoneException {
         // if already have a current result we don't run this
         if (spfData.getCurrentResult() == null) {

Modified: james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/core/Mechanism.java
URL: http://svn.apache.org/viewvc/james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/core/Mechanism.java?view=diff&rev=531080&r1=531079&r2=531080
==============================================================================
--- james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/core/Mechanism.java
(original)
+++ james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/core/Mechanism.java
Sat Apr 21 11:46:26 2007
@@ -43,7 +43,7 @@
      * @throws NoneException
      *             Get thrown if no valid records was found
      */
-    public boolean run(SPF1Data spfData) throws PermErrorException,
+    public boolean run(SPFSession spfData) throws PermErrorException,
             TempErrorException, NoneException;
 
 }

Modified: james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/core/SPFChecker.java
URL: http://svn.apache.org/viewvc/james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/core/SPFChecker.java?view=diff&rev=531080&r1=531079&r2=531080
==============================================================================
--- james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/core/SPFChecker.java
(original)
+++ james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/core/SPFChecker.java
Sat Apr 21 11:46:26 2007
@@ -43,7 +43,7 @@
      * @throws NeutralException  
      *             Get thrown if the result should be neutral
      */
-    public void checkSPF(SPF1Data spfData)
+    public void checkSPF(SPFSession spfData)
             throws PermErrorException, NoneException, TempErrorException,
             NeutralException;
 

Copied: james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/core/SPFSession.java
(from r531076, james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/core/SPF1Data.java)
URL: http://svn.apache.org/viewvc/james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/core/SPFSession.java?view=diff&rev=531080&p1=james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/core/SPF1Data.java&r1=531076&p2=james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/core/SPFSession.java&r2=531080
==============================================================================
--- james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/core/SPF1Data.java
(original)
+++ james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/core/SPFSession.java
Sat Apr 21 11:46:26 2007
@@ -24,6 +24,9 @@
 import org.apache.james.jspf.exceptions.PermErrorException;
 import org.apache.james.jspf.macro.MacroData;
 
+import java.util.HashMap;
+import java.util.Map;
+
 /**
  * 
  * This Class is used as a container between the other classes. All necessary
@@ -31,7 +34,7 @@
  * 
  */
 
-public class SPF1Data implements MacroData {
+public class SPFSession implements MacroData {
 
     private String ipAddress = ""; // also used for (i)<sending-host>
 
@@ -65,6 +68,8 @@
     private String currentResult = null;
 
     private boolean ignoreExplanation = false;
+    
+    private Map attributes = new HashMap();
 
     /**
      * Build the SPF1Data from the given parameters
@@ -82,7 +87,7 @@
      * @throws NoneException
      *             Get thrown if no valid emailaddress get passed
      */
-    public SPF1Data(String mailFrom, String heloDomain, String clientIP) throws PermErrorException,
NoneException {
+    public SPFSession(String mailFrom, String heloDomain, String clientIP) throws PermErrorException,
NoneException {
         super();
         this.mailFrom = mailFrom.trim();
         this.hostName = heloDomain.trim();
@@ -326,6 +331,26 @@
      */
     public boolean ignoreExplanation() {
         return ignoreExplanation;
+    }
+    
+    /**
+     * Retrieve a stored attribute
+     * 
+     * @param key the attribute key
+     * @return the stored attribute
+     */
+    public Object getAttribute(String key) {
+        return attributes.get(key);
+    }
+    
+    /**
+     * Sets a new attribute in the session
+     * 
+     * @param key attribute key
+     * @param value the value for this attribute
+     */
+    public void setAttribute(String key, Object value) {
+        this.attributes.put(key, value);
     }
     
 }

Propchange: james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/core/SPFSession.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/macro/MacroExpand.java
URL: http://svn.apache.org/viewvc/james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/macro/MacroExpand.java?view=diff&rev=531080&r1=531079&r2=531080
==============================================================================
--- james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/macro/MacroExpand.java
(original)
+++ james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/macro/MacroExpand.java
Sat Apr 21 11:46:26 2007
@@ -30,7 +30,7 @@
 import org.apache.james.jspf.core.DNSService;
 import org.apache.james.jspf.core.IPAddr;
 import org.apache.james.jspf.core.Logger;
-import org.apache.james.jspf.core.SPF1Data;
+import org.apache.james.jspf.core.SPFSession;
 import org.apache.james.jspf.core.DNSService.TimeoutException;
 import org.apache.james.jspf.exceptions.PermErrorException;
 import org.apache.james.jspf.util.SPFTermsRegexps;
@@ -318,8 +318,8 @@
             rValue = macroData.getClientDomain();
             if (rValue == null) {
                 rValue = "unknown";
-                if (macroData instanceof SPF1Data) {
-                    SPF1Data spf1data = (SPF1Data) macroData;
+                if (macroData instanceof SPFSession) {
+                    SPFSession spf1data = (SPFSession) macroData;
                     try {
                         boolean ip6 = IPAddr.isIPV6(spf1data.getIpAddress());
                         List records = dnsProbe.getRecords(IPAddr.getAddress(spf1data.getIpAddress()).getReverseIP(),
DNSService.PTR);
@@ -358,8 +358,8 @@
                     // check if the domainname is a FQDN
                     if (SPF1Utils.checkFQDN(dNames.get(i).toString())) {
                         rValue = dNames.get(i).toString();
-                        if (macroData instanceof SPF1Data) {
-                            ((SPF1Data) macroData).setReceivingDomain(rValue);
+                        if (macroData instanceof SPFSession) {
+                            ((SPFSession) macroData).setReceivingDomain(rValue);
                         }
                         break;
                     }

Modified: james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/policies/NeutralIfNotMatchPolicy.java
URL: http://svn.apache.org/viewvc/james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/policies/NeutralIfNotMatchPolicy.java?view=diff&rev=531080&r1=531079&r2=531080
==============================================================================
--- james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/policies/NeutralIfNotMatchPolicy.java
(original)
+++ james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/policies/NeutralIfNotMatchPolicy.java
Sat Apr 21 11:46:26 2007
@@ -20,7 +20,7 @@
 package org.apache.james.jspf.policies;
 
 import org.apache.james.jspf.core.SPF1Constants;
-import org.apache.james.jspf.core.SPF1Data;
+import org.apache.james.jspf.core.SPFSession;
 import org.apache.james.jspf.core.SPF1Record;
 import org.apache.james.jspf.core.SPFChecker;
 import org.apache.james.jspf.exceptions.NeutralException;
@@ -42,7 +42,7 @@
         // Maybe we should simply append a "?all" at the end, as modifier
         if (spfRecord.getDirectives().size() > 0) {
             spfRecord.getModifiers().add(new SPFChecker() {
-                public void checkSPF(SPF1Data spfData) throws PermErrorException, NoneException,
TempErrorException, NeutralException {
+                public void checkSPF(SPFSession spfData) throws PermErrorException, NoneException,
TempErrorException, NeutralException {
                     // If no match was found set the result to neutral
                     if (spfData.getCurrentResult() == null) {
                         spfData.setCurrentResult(SPF1Constants.NEUTRAL);

Modified: james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/policies/local/DefaultExplanationPolicy.java
URL: http://svn.apache.org/viewvc/james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/policies/local/DefaultExplanationPolicy.java?view=diff&rev=531080&r1=531079&r2=531080
==============================================================================
--- james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/policies/local/DefaultExplanationPolicy.java
(original)
+++ james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/policies/local/DefaultExplanationPolicy.java
Sat Apr 21 11:46:26 2007
@@ -22,7 +22,7 @@
 import org.apache.james.jspf.SPF1Utils;
 import org.apache.james.jspf.core.Logger;
 import org.apache.james.jspf.core.SPF1Constants;
-import org.apache.james.jspf.core.SPF1Data;
+import org.apache.james.jspf.core.SPFSession;
 import org.apache.james.jspf.core.SPF1Record;
 import org.apache.james.jspf.core.SPFChecker;
 import org.apache.james.jspf.exceptions.NeutralException;
@@ -64,7 +64,7 @@
         if (spfRecord == null) return null;
         // Default explanation policy.
         spfRecord.getModifiers().add(new SPFChecker() {
-            public void checkSPF(SPF1Data spfData) throws PermErrorException, NoneException,
TempErrorException, NeutralException {
+            public void checkSPF(SPFSession spfData) throws PermErrorException, NoneException,
TempErrorException, NeutralException {
                 
                 if (SPF1Constants.FAIL.equals(spfData.getCurrentResult())) {  
                     if (spfData.getExplanation()==null || spfData.getExplanation().equals(""))
{

Modified: james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/AMechanism.java
URL: http://svn.apache.org/viewvc/james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/AMechanism.java?view=diff&rev=531080&r1=531079&r2=531080
==============================================================================
--- james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/AMechanism.java
(original)
+++ james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/AMechanism.java
Sat Apr 21 11:46:26 2007
@@ -23,7 +23,7 @@
 import org.apache.james.jspf.core.Configuration;
 import org.apache.james.jspf.core.DNSService;
 import org.apache.james.jspf.core.IPAddr;
-import org.apache.james.jspf.core.SPF1Data;
+import org.apache.james.jspf.core.SPFSession;
 import org.apache.james.jspf.exceptions.PermErrorException;
 import org.apache.james.jspf.exceptions.TempErrorException;
 import org.apache.james.jspf.util.Inet6Util;
@@ -54,9 +54,9 @@
 
     /**
      * 
-     * @see org.apache.james.jspf.core.GenericMechanism#run(org.apache.james.jspf.core.SPF1Data)
+     * @see org.apache.james.jspf.core.GenericMechanism#run(org.apache.james.jspf.core.SPFSession)
      */
-    public boolean run(SPF1Data spfData) throws PermErrorException,
+    public boolean run(SPFSession spfData) throws PermErrorException,
             TempErrorException {
         // update currentDepth
         spfData.increaseCurrentDepth();

Modified: james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/AllMechanism.java
URL: http://svn.apache.org/viewvc/james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/AllMechanism.java?view=diff&rev=531080&r1=531079&r2=531080
==============================================================================
--- james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/AllMechanism.java
(original)
+++ james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/AllMechanism.java
Sat Apr 21 11:46:26 2007
@@ -23,7 +23,7 @@
 import org.apache.james.jspf.core.Configurable;
 import org.apache.james.jspf.core.Configuration;
 import org.apache.james.jspf.core.Mechanism;
-import org.apache.james.jspf.core.SPF1Data;
+import org.apache.james.jspf.core.SPFSession;
 import org.apache.james.jspf.exceptions.PermErrorException;
 
 /**
@@ -35,9 +35,9 @@
     public static final String REGEX = "[aA][lL][lL]";
 
     /**
-     * @see org.apache.james.jspf.core.Mechanism#run(SPF1Data)
+     * @see org.apache.james.jspf.core.Mechanism#run(SPFSession)
      */
-    public boolean run(SPF1Data spfData) throws PermErrorException {
+    public boolean run(SPFSession spfData) throws PermErrorException {
         return true;
     }
 

Modified: james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/ExistsMechanism.java
URL: http://svn.apache.org/viewvc/james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/ExistsMechanism.java?view=diff&rev=531080&r1=531079&r2=531080
==============================================================================
--- james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/ExistsMechanism.java
(original)
+++ james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/ExistsMechanism.java
Sat Apr 21 11:46:26 2007
@@ -21,7 +21,7 @@
 package org.apache.james.jspf.terms;
 
 import org.apache.james.jspf.core.DNSService;
-import org.apache.james.jspf.core.SPF1Data;
+import org.apache.james.jspf.core.SPFSession;
 import org.apache.james.jspf.exceptions.PermErrorException;
 import org.apache.james.jspf.exceptions.TempErrorException;
 import org.apache.james.jspf.util.SPFTermsRegexps;
@@ -45,9 +45,9 @@
 
     /**
      * 
-     * @see org.apache.james.jspf.core.GenericMechanism#run(org.apache.james.jspf.core.SPF1Data)
+     * @see org.apache.james.jspf.core.GenericMechanism#run(org.apache.james.jspf.core.SPFSession)
      */
-    public boolean run(SPF1Data spfData) throws PermErrorException,
+    public boolean run(SPFSession spfData) throws PermErrorException,
             TempErrorException {
         List aRecords;
 

Modified: james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/ExpModifier.java
URL: http://svn.apache.org/viewvc/james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/ExpModifier.java?view=diff&rev=531080&r1=531079&r2=531080
==============================================================================
--- james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/ExpModifier.java
(original)
+++ james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/ExpModifier.java
Sat Apr 21 11:46:26 2007
@@ -22,7 +22,7 @@
 
 import org.apache.james.jspf.core.DNSService;
 import org.apache.james.jspf.core.SPF1Constants;
-import org.apache.james.jspf.core.SPF1Data;
+import org.apache.james.jspf.core.SPFSession;
 import org.apache.james.jspf.exceptions.PermErrorException;
 import org.apache.james.jspf.exceptions.TempErrorException;
 import org.apache.james.jspf.macro.MacroExpand;
@@ -60,7 +60,7 @@
      *            The SPF1Data which should used
      * @throws PermErrorException 
      */
-    protected void checkSPFLogged(SPF1Data spfData) throws PermErrorException {
+    protected void checkSPFLogged(SPFSession spfData) throws PermErrorException {
         String exp = null;
         String host = getHost();
         

Modified: james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/GenericMechanism.java
URL: http://svn.apache.org/viewvc/james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/GenericMechanism.java?view=diff&rev=531080&r1=531079&r2=531080
==============================================================================
--- james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/GenericMechanism.java
(original)
+++ james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/GenericMechanism.java
Sat Apr 21 11:46:26 2007
@@ -24,7 +24,7 @@
 import org.apache.james.jspf.core.Configuration;
 import org.apache.james.jspf.core.Logger;
 import org.apache.james.jspf.core.Mechanism;
-import org.apache.james.jspf.core.SPF1Data;
+import org.apache.james.jspf.core.SPFSession;
 import org.apache.james.jspf.exceptions.PermErrorException;
 import org.apache.james.jspf.macro.MacroExpand;
 import org.apache.james.jspf.wiring.LogEnabled;
@@ -65,7 +65,7 @@
      * @param spfData The SPF1Data to use
      * @throws PermErrorException get Thrown if invalid macros are used
      */
-    protected String expandHost(SPF1Data spfData) throws PermErrorException {
+    protected String expandHost(SPFSession spfData) throws PermErrorException {
         String host = getDomain();
         if (host == null) {
             host = spfData.getCurrentDomain();

Modified: james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/GenericModifier.java
URL: http://svn.apache.org/viewvc/james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/GenericModifier.java?view=diff&rev=531080&r1=531079&r2=531080
==============================================================================
--- james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/GenericModifier.java
(original)
+++ james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/GenericModifier.java
Sat Apr 21 11:46:26 2007
@@ -24,7 +24,7 @@
 import org.apache.james.jspf.core.Configuration;
 import org.apache.james.jspf.core.Logger;
 import org.apache.james.jspf.core.Modifier;
-import org.apache.james.jspf.core.SPF1Data;
+import org.apache.james.jspf.core.SPFSession;
 import org.apache.james.jspf.exceptions.PermErrorException;
 import org.apache.james.jspf.exceptions.TempErrorException;
 import org.apache.james.jspf.wiring.LogEnabled;
@@ -40,10 +40,10 @@
     protected Logger log;
 
     /**
-     * @see org.apache.james.jspf.core.Modifier#run(SPF1Data)
+     * @see org.apache.james.jspf.core.Modifier#run(SPFSession)
      * 
      */
-    public void checkSPF(SPF1Data spfData) throws PermErrorException,
+    public void checkSPF(SPFSession spfData) throws PermErrorException,
             TempErrorException {
         log.debug("Processing modifier: " + this);
         checkSPFLogged(spfData);
@@ -51,7 +51,7 @@
                 + spfData.getCurrentResult());
     }
     
-    protected abstract void checkSPFLogged(SPF1Data spfData) throws PermErrorException,
+    protected abstract void checkSPFLogged(SPFSession spfData) throws PermErrorException,
         TempErrorException;
 
 

Modified: james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/IP4Mechanism.java
URL: http://svn.apache.org/viewvc/james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/IP4Mechanism.java?view=diff&rev=531080&r1=531079&r2=531080
==============================================================================
--- james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/IP4Mechanism.java
(original)
+++ james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/IP4Mechanism.java
Sat Apr 21 11:46:26 2007
@@ -22,7 +22,7 @@
 
 import org.apache.james.jspf.core.Configuration;
 import org.apache.james.jspf.core.IPAddr;
-import org.apache.james.jspf.core.SPF1Data;
+import org.apache.james.jspf.core.SPFSession;
 import org.apache.james.jspf.exceptions.PermErrorException;
 import org.apache.james.jspf.util.Inet6Util;
 
@@ -42,9 +42,9 @@
 
     /**
      * 
-     * @see org.apache.james.jspf.core.GenericMechanism#run(org.apache.james.jspf.core.SPF1Data)
+     * @see org.apache.james.jspf.core.GenericMechanism#run(org.apache.james.jspf.core.SPFSession)
      */
-    public boolean run(SPF1Data spfData) throws PermErrorException {
+    public boolean run(SPFSession spfData) throws PermErrorException {
         IPAddr originalIP;
 
         originalIP = IPAddr.getAddress(spfData.getIpAddress(), getIp()

Modified: james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/IncludeMechanism.java
URL: http://svn.apache.org/viewvc/james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/IncludeMechanism.java?view=diff&rev=531080&r1=531079&r2=531080
==============================================================================
--- james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/IncludeMechanism.java
(original)
+++ james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/IncludeMechanism.java
Sat Apr 21 11:46:26 2007
@@ -25,7 +25,7 @@
 import org.apache.james.jspf.core.Logger;
 import org.apache.james.jspf.core.Mechanism;
 import org.apache.james.jspf.core.SPF1Constants;
-import org.apache.james.jspf.core.SPF1Data;
+import org.apache.james.jspf.core.SPFSession;
 import org.apache.james.jspf.core.SPFChecker;
 import org.apache.james.jspf.exceptions.NeutralException;
 import org.apache.james.jspf.exceptions.NoneException;
@@ -68,7 +68,7 @@
      * @throws TempErrorException 
      *             if the dns return a temp error
      */
-    public boolean run(SPF1Data spfData) throws PermErrorException, TempErrorException {
+    public boolean run(SPFSession spfData) throws PermErrorException, TempErrorException
{
         String host = getHost();
 
         // update currentDepth

Modified: james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/MXMechanism.java
URL: http://svn.apache.org/viewvc/james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/MXMechanism.java?view=diff&rev=531080&r1=531079&r2=531080
==============================================================================
--- james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/MXMechanism.java
(original)
+++ james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/MXMechanism.java
Sat Apr 21 11:46:26 2007
@@ -22,7 +22,7 @@
 
 import org.apache.james.jspf.core.DNSService;
 import org.apache.james.jspf.core.IPAddr;
-import org.apache.james.jspf.core.SPF1Data;
+import org.apache.james.jspf.core.SPFSession;
 import org.apache.james.jspf.exceptions.NoneException;
 import org.apache.james.jspf.exceptions.PermErrorException;
 import org.apache.james.jspf.exceptions.TempErrorException;
@@ -47,9 +47,9 @@
     /**
      * 
      * @throws NoneException 
-     * @see org.apache.james.jspf.core.GenericMechanism#run(org.apache.james.jspf.core.SPF1Data)
+     * @see org.apache.james.jspf.core.GenericMechanism#run(org.apache.james.jspf.core.SPFSession)
      */
-    public boolean run(SPF1Data spfData) throws PermErrorException,
+    public boolean run(SPFSession spfData) throws PermErrorException,
             TempErrorException{
         IPAddr checkAddress;
 

Modified: james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/PTRMechanism.java
URL: http://svn.apache.org/viewvc/james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/PTRMechanism.java?view=diff&rev=531080&r1=531079&r2=531080
==============================================================================
--- james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/PTRMechanism.java
(original)
+++ james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/PTRMechanism.java
Sat Apr 21 11:46:26 2007
@@ -22,7 +22,7 @@
 
 import org.apache.james.jspf.core.DNSService;
 import org.apache.james.jspf.core.IPAddr;
-import org.apache.james.jspf.core.SPF1Data;
+import org.apache.james.jspf.core.SPFSession;
 import org.apache.james.jspf.exceptions.PermErrorException;
 import org.apache.james.jspf.exceptions.TempErrorException;
 import org.apache.james.jspf.util.SPFTermsRegexps;
@@ -46,9 +46,9 @@
     private DNSService dnsService;
 
     /**
-     * @see org.apache.james.jspf.core.Mechanism#run(org.apache.james.jspf.core.SPF1Data)
+     * @see org.apache.james.jspf.core.Mechanism#run(org.apache.james.jspf.core.SPFSession)
      */
-    public boolean run(SPF1Data spfData) throws PermErrorException,
+    public boolean run(SPFSession spfData) throws PermErrorException,
             TempErrorException {
         String compareDomain;
         ArrayList validatedHosts = new ArrayList();

Modified: james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/RedirectModifier.java
URL: http://svn.apache.org/viewvc/james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/RedirectModifier.java?view=diff&rev=531080&r1=531079&r2=531080
==============================================================================
--- james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/RedirectModifier.java
(original)
+++ james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/RedirectModifier.java
Sat Apr 21 11:46:26 2007
@@ -20,7 +20,7 @@
 
 package org.apache.james.jspf.terms;
 
-import org.apache.james.jspf.core.SPF1Data;
+import org.apache.james.jspf.core.SPFSession;
 import org.apache.james.jspf.core.SPFChecker;
 import org.apache.james.jspf.exceptions.NeutralException;
 import org.apache.james.jspf.exceptions.NoneException;
@@ -59,7 +59,7 @@
      * @throws TempErrorException
      *             if an DNS problem accurred
      */
-    protected void checkSPFLogged(SPF1Data spfData) throws PermErrorException,
+    protected void checkSPFLogged(SPFSession spfData) throws PermErrorException,
             TempErrorException {
         // the redirect modifier is used only when we had no previous matches
         if (spfData.getCurrentResult() == null) {

Modified: james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/UnknownModifier.java
URL: http://svn.apache.org/viewvc/james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/UnknownModifier.java?view=diff&rev=531080&r1=531079&r2=531080
==============================================================================
--- james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/UnknownModifier.java
(original)
+++ james/jspf/branches/asynch-jspf/src/main/java/org/apache/james/jspf/terms/UnknownModifier.java
Sat Apr 21 11:46:26 2007
@@ -23,7 +23,7 @@
 import org.apache.james.jspf.core.Configurable;
 import org.apache.james.jspf.core.Configuration;
 import org.apache.james.jspf.core.Modifier;
-import org.apache.james.jspf.core.SPF1Data;
+import org.apache.james.jspf.core.SPFSession;
 import org.apache.james.jspf.exceptions.PermErrorException;
 import org.apache.james.jspf.util.SPFTermsRegexps;
 
@@ -42,9 +42,9 @@
             + SPFTermsRegexps.MACRO_STRING_REGEX + ")";
 
     /**
-     * @see org.apache.james.jspf.core.Modifier#run(org.apache.james.jspf.core.SPF1Data)
+     * @see org.apache.james.jspf.core.Modifier#run(org.apache.james.jspf.core.SPFSession)
      */
-    public void checkSPF(SPF1Data spfData) throws PermErrorException {
+    public void checkSPF(SPFSession spfData) throws PermErrorException {
         return;
     }
 

Copied: james/jspf/branches/asynch-jspf/src/test/java/org/apache/james/jspf/core/SPFSessionTest.java
(from r531076, james/jspf/branches/asynch-jspf/src/test/java/org/apache/james/jspf/core/SPF1DataTest.java)
URL: http://svn.apache.org/viewvc/james/jspf/branches/asynch-jspf/src/test/java/org/apache/james/jspf/core/SPFSessionTest.java?view=diff&rev=531080&p1=james/jspf/branches/asynch-jspf/src/test/java/org/apache/james/jspf/core/SPF1DataTest.java&r1=531076&p2=james/jspf/branches/asynch-jspf/src/test/java/org/apache/james/jspf/core/SPFSessionTest.java&r2=531080
==============================================================================
--- james/jspf/branches/asynch-jspf/src/test/java/org/apache/james/jspf/core/SPF1DataTest.java
(original)
+++ james/jspf/branches/asynch-jspf/src/test/java/org/apache/james/jspf/core/SPFSessionTest.java
Sat Apr 21 11:46:26 2007
@@ -24,13 +24,13 @@
 
 import junit.framework.TestCase;
 
-public class SPF1DataTest extends TestCase {
+public class SPFSessionTest extends TestCase {
 
     /*
      * Test method for 'org.apache.james.jspf.core.SPF1Data.getMacroIpAddress()'
      */
     public void testGetMacroIpAddress() throws PermErrorException, NoneException {
-        SPF1Data d = new SPF1Data("mailfrom@fromdomain.com","helodomain.com","2001:DB8::CB01");
+        SPFSession d = new SPFSession("mailfrom@fromdomain.com","helodomain.com","2001:DB8::CB01");
         assertEquals("2.0.0.1.0.D.B.8.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.C.B.0.1",d.getMacroIpAddress());
     }
 

Propchange: james/jspf/branches/asynch-jspf/src/test/java/org/apache/james/jspf/core/SPFSessionTest.java
------------------------------------------------------------------------------
    svn:eol-style = native



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message