james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nor...@apache.org
Subject svn commit: r572765 - in /james/jspf/trunk: ./ src/main/java/org/apache/james/jspf/core/ src/main/java/org/apache/james/jspf/parser/ src/main/java/org/apache/james/jspf/policies/ src/main/java/org/apache/james/jspf/policies/local/ src/main/java/org/apa...
Date Tue, 04 Sep 2007 18:14:47 GMT
Author: norman
Date: Tue Sep  4 11:14:45 2007
New Revision: 572765

URL: http://svn.apache.org/viewvc?rev=572765&view=rev
Log:
Fix some javadocs
Code cleanup
Add license headers

Modified:
    james/jspf/trunk/build.xml
    james/jspf/trunk/src/main/java/org/apache/james/jspf/core/DNSLookupContinuation.java
    james/jspf/trunk/src/main/java/org/apache/james/jspf/core/DNSRequest.java
    james/jspf/trunk/src/main/java/org/apache/james/jspf/core/DNSService.java
    james/jspf/trunk/src/main/java/org/apache/james/jspf/core/SPF1Constants.java
    james/jspf/trunk/src/main/java/org/apache/james/jspf/parser/DefaultSPF1Parser.java
    james/jspf/trunk/src/main/java/org/apache/james/jspf/parser/DefaultTermDefinition.java
    james/jspf/trunk/src/main/java/org/apache/james/jspf/policies/SPFRetriever.java
    james/jspf/trunk/src/main/java/org/apache/james/jspf/policies/local/BestGuessPolicy.java
    james/jspf/trunk/src/main/java/org/apache/james/jspf/policies/local/TrustedForwarderPolicy.java
    james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/AMechanism.java
    james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/ExistsMechanism.java
    james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/IncludeMechanism.java
    james/jspf/trunk/src/main/java/org/apache/james/jspf/wiring/WiringServiceTable.java
    james/jspf/trunk/src/main/resources/org/apache/james/jspf/parser/jspf.default.terms
    james/jspf/trunk/src/test/resources/log4j.properties

Modified: james/jspf/trunk/build.xml
URL: http://svn.apache.org/viewvc/james/jspf/trunk/build.xml?rev=572765&r1=572764&r2=572765&view=diff
==============================================================================
--- james/jspf/trunk/build.xml (original)
+++ james/jspf/trunk/build.xml Tue Sep  4 11:14:45 2007
@@ -1,3 +1,22 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.    
+-->
+
 <project name="jspf" default="jar" basedir=".">
   <property file="${user.home}/.m2/maven.properties"/>
   <property name="maven.build.output" value="target/classes"/>

Modified: james/jspf/trunk/src/main/java/org/apache/james/jspf/core/DNSLookupContinuation.java
URL: http://svn.apache.org/viewvc/james/jspf/trunk/src/main/java/org/apache/james/jspf/core/DNSLookupContinuation.java?rev=572765&r1=572764&r2=572765&view=diff
==============================================================================
--- james/jspf/trunk/src/main/java/org/apache/james/jspf/core/DNSLookupContinuation.java (original)
+++ james/jspf/trunk/src/main/java/org/apache/james/jspf/core/DNSLookupContinuation.java Tue
Sep  4 11:14:45 2007
@@ -19,6 +19,10 @@
 
 package org.apache.james.jspf.core;
 
+/**
+ * 
+ *
+ */
 public class DNSLookupContinuation {
     
     private DNSRequest request;

Modified: james/jspf/trunk/src/main/java/org/apache/james/jspf/core/DNSRequest.java
URL: http://svn.apache.org/viewvc/james/jspf/trunk/src/main/java/org/apache/james/jspf/core/DNSRequest.java?rev=572765&r1=572764&r2=572765&view=diff
==============================================================================
--- james/jspf/trunk/src/main/java/org/apache/james/jspf/core/DNSRequest.java (original)
+++ james/jspf/trunk/src/main/java/org/apache/james/jspf/core/DNSRequest.java Tue Sep  4 11:14:45
2007
@@ -23,6 +23,9 @@
 import org.xbill.DNS.Name;
 import org.xbill.DNS.TextParseException;
 
+/**
+ * Represent a DNSRequest
+ */
 public final class DNSRequest {
 
     /** The record types for the lookups */

Modified: james/jspf/trunk/src/main/java/org/apache/james/jspf/core/DNSService.java
URL: http://svn.apache.org/viewvc/james/jspf/trunk/src/main/java/org/apache/james/jspf/core/DNSService.java?rev=572765&r1=572764&r2=572765&view=diff
==============================================================================
--- james/jspf/trunk/src/main/java/org/apache/james/jspf/core/DNSService.java (original)
+++ james/jspf/trunk/src/main/java/org/apache/james/jspf/core/DNSService.java Tue Sep  4 11:14:45
2007
@@ -39,8 +39,7 @@
      * 
      * @param request the dns request
      * @return an array of Strings representing the records
-     * @throws NoneException when no record is found or a textparse exception happen
-     * @throws TempErrorException on timeout.
+     * @throws TimeoutException
      */
     public List getRecords(DNSRequest request) throws TimeoutException;
 
@@ -54,8 +53,7 @@
     /**
      * Set the timeout for DNS-Requests
      * 
-     * @param timeOut
-     *            The timeout in seconds
+     * @param timeOut The timeout in seconds
      */
     public void setTimeOut(int timeOut);
     
@@ -66,6 +64,7 @@
 
     /**
      * Sets a new limit for the number of records for MX and PTR lookups.
+     * 
      * @param recordLimit the new limit (0 => unlimited)
      */
     public void setRecordLimit(int recordLimit);

Modified: james/jspf/trunk/src/main/java/org/apache/james/jspf/core/SPF1Constants.java
URL: http://svn.apache.org/viewvc/james/jspf/trunk/src/main/java/org/apache/james/jspf/core/SPF1Constants.java?rev=572765&r1=572764&r2=572765&view=diff
==============================================================================
--- james/jspf/trunk/src/main/java/org/apache/james/jspf/core/SPF1Constants.java (original)
+++ james/jspf/trunk/src/main/java/org/apache/james/jspf/core/SPF1Constants.java Tue Sep 
4 11:14:45 2007
@@ -48,6 +48,6 @@
     /**
      * The valid SPF_VERSION identifier
      */
-    public static final String SPF_VERSION = "v=spf1";
+    public static final String SPF_VERSION1 = "v=spf1";
 
 }

Modified: james/jspf/trunk/src/main/java/org/apache/james/jspf/parser/DefaultSPF1Parser.java
URL: http://svn.apache.org/viewvc/james/jspf/trunk/src/main/java/org/apache/james/jspf/parser/DefaultSPF1Parser.java?rev=572765&r1=572764&r2=572765&view=diff
==============================================================================
--- james/jspf/trunk/src/main/java/org/apache/james/jspf/parser/DefaultSPF1Parser.java (original)
+++ james/jspf/trunk/src/main/java/org/apache/james/jspf/parser/DefaultSPF1Parser.java Tue
Sep  4 11:14:45 2007
@@ -258,15 +258,15 @@
         SPF1Record result = new SPF1Record();
 
         // check the version "header"
-        if (spfRecord.toLowerCase().startsWith(SPF1Constants.SPF_VERSION + " ") || spfRecord.equalsIgnoreCase(SPF1Constants.SPF_VERSION))
{
-            if (!spfRecord.toLowerCase().startsWith(SPF1Constants.SPF_VERSION + " ")) throw
new NeutralException("Empty SPF Record");
+        if (spfRecord.toLowerCase().startsWith(SPF1Constants.SPF_VERSION1 + " ") || spfRecord.equalsIgnoreCase(SPF1Constants.SPF_VERSION1))
{
+            if (!spfRecord.toLowerCase().startsWith(SPF1Constants.SPF_VERSION1 + " ")) throw
new NeutralException("Empty SPF Record");
         } else {
             throw new NoneException("No valid SPF Record: " + spfRecord);
         }
 
         // extract terms
         String[] terms = termsSeparatorPattern.split(spfRecord.replaceFirst(
-                SPF1Constants.SPF_VERSION, ""));
+                SPF1Constants.SPF_VERSION1, ""));
 
         // cycle terms
         for (int i = 0; i < terms.length; i++) {

Modified: james/jspf/trunk/src/main/java/org/apache/james/jspf/parser/DefaultTermDefinition.java
URL: http://svn.apache.org/viewvc/james/jspf/trunk/src/main/java/org/apache/james/jspf/parser/DefaultTermDefinition.java?rev=572765&r1=572764&r2=572765&view=diff
==============================================================================
--- james/jspf/trunk/src/main/java/org/apache/james/jspf/parser/DefaultTermDefinition.java
(original)
+++ james/jspf/trunk/src/main/java/org/apache/james/jspf/parser/DefaultTermDefinition.java
Tue Sep  4 11:14:45 2007
@@ -27,7 +27,7 @@
  * This implementation try to retrieve the definition looking up a
  * static REGEX field in the term class.
  */
-class DefaultTermDefinition implements TermDefinition {
+public class DefaultTermDefinition implements TermDefinition {
 
     private Pattern pattern;
 

Modified: james/jspf/trunk/src/main/java/org/apache/james/jspf/policies/SPFRetriever.java
URL: http://svn.apache.org/viewvc/james/jspf/trunk/src/main/java/org/apache/james/jspf/policies/SPFRetriever.java?rev=572765&r1=572764&r2=572765&view=diff
==============================================================================
--- james/jspf/trunk/src/main/java/org/apache/james/jspf/policies/SPFRetriever.java (original)
+++ james/jspf/trunk/src/main/java/org/apache/james/jspf/policies/SPFRetriever.java Tue Sep
 4 11:14:45 2007
@@ -119,7 +119,7 @@
             }
 
             // We trim the compare value only for the comparison
-            if (compare.toLowerCase().trim().startsWith(SPF1Constants.SPF_VERSION + " ")
|| compare.trim().equalsIgnoreCase(SPF1Constants.SPF_VERSION)) {
+            if (compare.toLowerCase().trim().startsWith(SPF1Constants.SPF_VERSION1 + " ")
|| compare.trim().equalsIgnoreCase(SPF1Constants.SPF_VERSION1)) {
                 if (returnValue == null) {
                     returnValue = compare;
                 } else {

Modified: james/jspf/trunk/src/main/java/org/apache/james/jspf/policies/local/BestGuessPolicy.java
URL: http://svn.apache.org/viewvc/james/jspf/trunk/src/main/java/org/apache/james/jspf/policies/local/BestGuessPolicy.java?rev=572765&r1=572764&r2=572765&view=diff
==============================================================================
--- james/jspf/trunk/src/main/java/org/apache/james/jspf/policies/local/BestGuessPolicy.java
(original)
+++ james/jspf/trunk/src/main/java/org/apache/james/jspf/policies/local/BestGuessPolicy.java
Tue Sep  4 11:14:45 2007
@@ -27,6 +27,12 @@
 import org.apache.james.jspf.policies.PolicyPostFilter;
 import org.apache.james.jspf.util.SPF1Utils;
 
+/**
+ * PolicyPostFilter which handles best guess. 
+ * See http://www.openspf.org/FAQ/Best_guess_record for more informations 
+ * 
+ *
+ */
 public class BestGuessPolicy implements PolicyPostFilter {
 
     /**

Modified: james/jspf/trunk/src/main/java/org/apache/james/jspf/policies/local/TrustedForwarderPolicy.java
URL: http://svn.apache.org/viewvc/james/jspf/trunk/src/main/java/org/apache/james/jspf/policies/local/TrustedForwarderPolicy.java?rev=572765&r1=572764&r2=572765&view=diff
==============================================================================
--- james/jspf/trunk/src/main/java/org/apache/james/jspf/policies/local/TrustedForwarderPolicy.java
(original)
+++ james/jspf/trunk/src/main/java/org/apache/james/jspf/policies/local/TrustedForwarderPolicy.java
Tue Sep  4 11:14:45 2007
@@ -29,6 +29,11 @@
 import org.apache.james.jspf.policies.PolicyPostFilter;
 import org.apache.james.jspf.terms.IncludeMechanism;
 
+/**
+ * PolicyPostFilter which implements trusted forwared. 
+ * See http://www.trusted-forwarder.org for more informations
+ *
+ */
 public class TrustedForwarderPolicy implements PolicyPostFilter {
 
     /**

Modified: james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/AMechanism.java
URL: http://svn.apache.org/viewvc/james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/AMechanism.java?rev=572765&r1=572764&r2=572765&view=diff
==============================================================================
--- james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/AMechanism.java (original)
+++ james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/AMechanism.java Tue Sep  4
11:14:45 2007
@@ -63,7 +63,11 @@
     private SPFChecker expandedChecker = new ExpandedChecker();
 
     private final class ExpandedChecker implements SPFChecker {
-        public DNSLookupContinuation checkSPF(SPFSession spfData) throws PermErrorException,
+       /*
+        * (non-Javadoc)
+        * @see org.apache.james.jspf.core.SPFChecker#checkSPF(org.apache.james.jspf.core.SPFSession)
+        */
+    	public DNSLookupContinuation checkSPF(SPFSession spfData) throws PermErrorException,
                 TempErrorException, NeutralException, NoneException {
             // Get the right host.
             String host = expandHost(spfData);

Modified: james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/ExistsMechanism.java
URL: http://svn.apache.org/viewvc/james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/ExistsMechanism.java?rev=572765&r1=572764&r2=572765&view=diff
==============================================================================
--- james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/ExistsMechanism.java (original)
+++ james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/ExistsMechanism.java Tue Sep
 4 11:14:45 2007
@@ -43,7 +43,12 @@
 public class ExistsMechanism extends GenericMechanism implements SPFCheckerDNSResponseListener
{
 
     private final class ExpandedChecker implements SPFChecker {
-        public DNSLookupContinuation checkSPF(SPFSession spfData) throws PermErrorException,
+       
+    	/*
+    	 * (non-Javadoc)
+    	 * @see org.apache.james.jspf.core.SPFChecker#checkSPF(org.apache.james.jspf.core.SPFSession)
+    	 */
+    	public DNSLookupContinuation checkSPF(SPFSession spfData) throws PermErrorException,
                 TempErrorException, NeutralException, NoneException {
             String host = expandHost(spfData);
             return new DNSLookupContinuation(new DNSRequest(host,DNSRequest.A), ExistsMechanism.this);

Modified: james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/IncludeMechanism.java
URL: http://svn.apache.org/viewvc/james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/IncludeMechanism.java?rev=572765&r1=572764&r2=572765&view=diff
==============================================================================
--- james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/IncludeMechanism.java (original)
+++ james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/IncludeMechanism.java Tue Sep
 4 11:14:45 2007
@@ -255,13 +255,4 @@
     public void enableMacroExpand(MacroExpand macroExpand) {
         this.macroExpand = macroExpand;
     }
-
-    /**
-     * @see org.apache.james.jspf.core.Mechanism#onDNSResponse(org.apache.james.jspf.core.DNSResponse,
org.apache.james.jspf.core.SPFSession)
-     */
-    public boolean onDNSResponse(DNSResponse response, SPFSession spfSession)
-            throws PermErrorException, TempErrorException, NoneException {
-        // not called yet.
-        return false;
-    }
 }

Modified: james/jspf/trunk/src/main/java/org/apache/james/jspf/wiring/WiringServiceTable.java
URL: http://svn.apache.org/viewvc/james/jspf/trunk/src/main/java/org/apache/james/jspf/wiring/WiringServiceTable.java?rev=572765&r1=572764&r2=572765&view=diff
==============================================================================
--- james/jspf/trunk/src/main/java/org/apache/james/jspf/wiring/WiringServiceTable.java (original)
+++ james/jspf/trunk/src/main/java/org/apache/james/jspf/wiring/WiringServiceTable.java Tue
Sep  4 11:14:45 2007
@@ -27,6 +27,10 @@
 
 public class WiringServiceTable extends Hashtable implements WiringService {
 
+    /*
+     * (non-Javadoc)
+     * @see org.apache.james.jspf.wiring.WiringService#wire(java.lang.Object)
+     */
     public void wire(Object component) throws WiringServiceException {
         Iterator i = keySet().iterator();
         while (i.hasNext()) {

Modified: james/jspf/trunk/src/main/resources/org/apache/james/jspf/parser/jspf.default.terms
URL: http://svn.apache.org/viewvc/james/jspf/trunk/src/main/resources/org/apache/james/jspf/parser/jspf.default.terms?rev=572765&r1=572764&r2=572765&view=diff
==============================================================================
--- james/jspf/trunk/src/main/resources/org/apache/james/jspf/parser/jspf.default.terms (original)
+++ james/jspf/trunk/src/main/resources/org/apache/james/jspf/parser/jspf.default.terms Tue
Sep  4 11:14:45 2007
@@ -1,2 +1,21 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.    
+-->
+
 mechanisms=org.apache.james.jspf.terms.AllMechanism,org.apache.james.jspf.terms.AMechanism,org.apache.james.jspf.terms.ExistsMechanism,org.apache.james.jspf.terms.IncludeMechanism,org.apache.james.jspf.terms.IP4Mechanism,org.apache.james.jspf.terms.IP6Mechanism,org.apache.james.jspf.terms.MXMechanism,org.apache.james.jspf.terms.PTRMechanism
 modifiers=org.apache.james.jspf.terms.ExpModifier,org.apache.james.jspf.terms.RedirectModifier,org.apache.james.jspf.terms.UnknownModifier

Modified: james/jspf/trunk/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/james/jspf/trunk/src/test/resources/log4j.properties?rev=572765&r1=572764&r2=572765&view=diff
==============================================================================
--- james/jspf/trunk/src/test/resources/log4j.properties (original)
+++ james/jspf/trunk/src/test/resources/log4j.properties Tue Sep  4 11:14:45 2007
@@ -1,3 +1,22 @@
+#################################################################
+#  Licensed to the Apache Software Foundation (ASF) under one   #
+#  or more contributor license agreements.  See the NOTICE file #
+#  distributed with this work for additional information        #
+#  regarding copyright ownership.  The ASF licenses this file   #
+#  to you under the Apache License, Version 2.0 (the            #
+#  "License"); you may not use this file except in compliance   #
+#  with the License.  You may obtain a copy of the License at   #
+#                                                               #
+#    http://www.apache.org/licenses/LICENSE-2.0                 #
+#                                                               #
+#  Unless required by applicable law or agreed to in writing,   #
+#  software distributed under the License is distributed on an  #
+#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       #
+#  KIND, either express or implied.  See the License for the    #
+#  specific language governing permissions and limitations      #
+#  under the License.                                           #
+#################################################################
+
 #
 # The logging properties
 #



---------------------------------------------------------------------
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