You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by ba...@apache.org on 2006/09/25 10:45:05 UTC

svn commit: r449609 - /james/jspf/trunk/src/main/java/org/apache/james/jspf/DNSServiceXBillImpl.java

Author: bago
Date: Mon Sep 25 01:45:03 2006
New Revision: 449609

URL: http://svn.apache.org/viewvc?view=rev&rev=449609
Log:
Further simplifications for the previous DNSService refactoring: removed internal getTXTRecords (JSPF-29)

Modified:
    james/jspf/trunk/src/main/java/org/apache/james/jspf/DNSServiceXBillImpl.java

Modified: james/jspf/trunk/src/main/java/org/apache/james/jspf/DNSServiceXBillImpl.java
URL: http://svn.apache.org/viewvc/james/jspf/trunk/src/main/java/org/apache/james/jspf/DNSServiceXBillImpl.java?view=diff&rev=449609&r1=449608&r2=449609
==============================================================================
--- james/jspf/trunk/src/main/java/org/apache/james/jspf/DNSServiceXBillImpl.java (original)
+++ james/jspf/trunk/src/main/java/org/apache/james/jspf/DNSServiceXBillImpl.java Mon Sep 25 01:45:03 2006
@@ -73,13 +73,11 @@
             throws PermErrorException, TempErrorException {
 
         String returnValue = null;
-        ArrayList txtR = new ArrayList();
-
         // do DNS lookup for TXT
-        txtR = getTXTRecords(hostname);
+        List txtR = getRecords(hostname, TXT);
 
         // process returned records
-        if (!txtR.isEmpty()) {
+        if (txtR != null && !txtR.isEmpty()) {
 
             Iterator all = txtR.iterator();
 
@@ -104,33 +102,6 @@
     }
 
     /**
-     * Get an ArrayList of all TXT Records for a partical domain.
-     * 
-     * @param hostname
-     *            The hostname for which the TXT-Records should be retrieved
-     * @return TXT Records-which were found.
-     * @throws NoneException
-     *             if none TXT-Records were found.
-     * @throws TempErrorException
-     *             if the lookup result was "TRY_AGAIN"
-     * @throws PermErrorException
-     *             if an PermError should be returned
-     */
-    private ArrayList getTXTRecords(String hostname)
-            throws TempErrorException {
-        ArrayList txtR = new ArrayList();
-        List records = getRecords(hostname, TXT);
-        for (int i = 0; i < records.size(); i++) {
-            String txt = (String) records.get(i);
-
-            log.debug("Add txt " + txt + " to list");
-
-            txtR.add(txt);
-        }
-        return txtR;
-    }
-
-    /**
      * @see org.apache.james.jspf.core.DNSService#getARecords(java.lang.String,
      *      int)
      */
@@ -195,7 +166,7 @@
     public String getTxtCatType(String strServer) throws TempErrorException {
 
         StringBuffer txtData = new StringBuffer();
-        ArrayList records = getTXTRecords(strServer);
+        List records = getRecords(strServer, TXT);
 
         log.debug("Convert " + records.size() + " TXT-Records to one String");
 



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