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 "Norman Maurer (JIRA)" <se...@james.apache.org> on 2008/07/16 09:13:31 UTC

[jira] Created: (JSPF-61) Allow use of costum Resolver

Allow use of costum Resolver
----------------------------

                 Key: JSPF-61
                 URL: https://issues.apache.org/jira/browse/JSPF-61
             Project: jSPF
          Issue Type: New Feature
          Components: Core
    Affects Versions: 0.9.6, 0.9.5, 0.9b4, 0.9b3, 0.9b2, 0.9b1
            Reporter: Norman Maurer
            Assignee: Norman Maurer




-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (JSPF-61) Allow use of costum Resolver

Posted by "Norman Maurer (JIRA)" <se...@james.apache.org>.
    [ https://issues.apache.org/jira/browse/JSPF-61?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12613890#action_12613890 ] 

Norman Maurer commented on JSPF-61:
-----------------------------------

I mainly use the static setDefaultResolver() because we did the same on the DNSJnioAsynchService ;-)... Btw I'm happy to remove the static stuff

> Allow use of costum Resolver
> ----------------------------
>
>                 Key: JSPF-61
>                 URL: https://issues.apache.org/jira/browse/JSPF-61
>             Project: jSPF
>          Issue Type: New Feature
>          Components: Core
>    Affects Versions: 0.9b1, 0.9b2, 0.9b3, 0.9b4, 0.9.5, 0.9.6
>            Reporter: Norman Maurer
>            Assignee: Norman Maurer
>


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (JSPF-61) Allow use of costum Resolver

Posted by "Stefano Bagnara (JIRA)" <se...@james.apache.org>.
    [ https://issues.apache.org/jira/browse/JSPF-61?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12613867#action_12613867 ] 

Stefano Bagnara commented on JSPF-61:
-------------------------------------

Can you explain?
What Resolver are you referring to?

Do you mean dnsjava Resolver?


In this case do you propose to create a new constructor (and setter/getter) for DNSServiceXBillImpl so people can specify a different Resolver?

> Allow use of costum Resolver
> ----------------------------
>
>                 Key: JSPF-61
>                 URL: https://issues.apache.org/jira/browse/JSPF-61
>             Project: jSPF
>          Issue Type: New Feature
>          Components: Core
>    Affects Versions: 0.9b1, 0.9b2, 0.9b3, 0.9b4, 0.9.5, 0.9.6
>            Reporter: Norman Maurer
>            Assignee: Norman Maurer
>


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (JSPF-61) Allow use of costum Resolver

Posted by "Stefano Bagnara (JIRA)" <se...@james.apache.org>.
    [ https://issues.apache.org/jira/browse/JSPF-61?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12613889#action_12613889 ] 

Stefano Bagnara commented on JSPF-61:
-------------------------------------

I don't like the patch you propose... in that case we can leave the code as is and tell the user to run a Lookup.setDefaultResolver(resolver) in its own code and jspf will use that static resolver.

Otherwise if we want to avoid static/singleton stuff then we have to avoid the static usage of Lookup object similarly to  what we do in james server DNSServer, e.g:

Lookup l = new Lookup(namestr, type);
l.setResolver(resolver);


> Allow use of costum Resolver
> ----------------------------
>
>                 Key: JSPF-61
>                 URL: https://issues.apache.org/jira/browse/JSPF-61
>             Project: jSPF
>          Issue Type: New Feature
>          Components: Core
>    Affects Versions: 0.9b1, 0.9b2, 0.9b3, 0.9b4, 0.9.5, 0.9.6
>            Reporter: Norman Maurer
>            Assignee: Norman Maurer
>


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (JSPF-61) Allow use of costum Resolver

Posted by "Norman Maurer (JIRA)" <se...@james.apache.org>.
    [ https://issues.apache.org/jira/browse/JSPF-61?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12613885#action_12613885 ] 

Norman Maurer commented on JSPF-61:
-----------------------------------

Yeah something like:


Index: /home/norman/workspace/jspf/src/main/java/org/apache/james/jspf/impl/DNSServiceXBillImpl.java
===================================================================
--- /home/norman/workspace/jspf/src/main/java/org/apache/james/jspf/impl/DNSServiceXBillImpl.java	(revision 655147)
+++ /home/norman/workspace/jspf/src/main/java/org/apache/james/jspf/impl/DNSServiceXBillImpl.java	(working copy)
@@ -30,6 +30,7 @@
 import org.xbill.DNS.MXRecord;
 import org.xbill.DNS.PTRRecord;
 import org.xbill.DNS.Record;
+import org.xbill.DNS.Resolver;
 import org.xbill.DNS.SPFRecord;
 import org.xbill.DNS.TXTRecord;
 import org.xbill.DNS.TextParseException;
@@ -61,7 +62,12 @@
     public DNSServiceXBillImpl(Logger logger) {
         this.log = logger;
         // Default record limit is 10
-        this.recordLimit = 10;
+        this.recordLimit = 10;  
+    }
+    
+    public DNSServiceXBillImpl(Logger logger, Resolver resolver) {
+        this(logger);
+        Lookup.setDefaultResolver(resolver);
     }
 
     /**
@@ -68,7 +74,7 @@
      * @see org.apache.james.jspf.core.DNSService#setTimeOut(int)
      */
     public synchronized void setTimeOut(int timeOut) {
-        this.timeOut = timeOut;
+    	Lookup.getDefaultResolver().setTimeout(timeOut);
     }
 
     /**
@@ -131,9 +137,9 @@
 
             log.debug("Start "+recordTypeDescription+"-Record lookup for : " + request.getHostname());
 
-            Lookup.getDefaultResolver().setTimeout(timeOut);
+
             Lookup query = new Lookup(request.getHostname(), dnsJavaType);
-
+            
             Record[] rr = query.run();
             int queryResult = query.getResult();
             


> Allow use of costum Resolver
> ----------------------------
>
>                 Key: JSPF-61
>                 URL: https://issues.apache.org/jira/browse/JSPF-61
>             Project: jSPF
>          Issue Type: New Feature
>          Components: Core
>    Affects Versions: 0.9b1, 0.9b2, 0.9b3, 0.9b4, 0.9.5, 0.9.6
>            Reporter: Norman Maurer
>            Assignee: Norman Maurer
>


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (JSPF-61) Allow use of costum Resolver

Posted by "Stefano Bagnara (JIRA)" <se...@james.apache.org>.
    [ https://issues.apache.org/jira/browse/JSPF-61?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12617287#action_12617287 ] 

Stefano Bagnara commented on JSPF-61:
-------------------------------------

@Norman: the setDefaultResolver we call in DNSJnioAsynchService  is from the LookupAsync class.
Unfortunately dnsjnio is very "static oriented" so there is no way (AFAIK) to use a different resolver without altering the default static resolver. Instead dnsjava has this feature, so I prefer to not change the default static resolver when possible.
Please review the patch I committed and tell me if you're fine with it.

> Allow use of costum Resolver
> ----------------------------
>
>                 Key: JSPF-61
>                 URL: https://issues.apache.org/jira/browse/JSPF-61
>             Project: jSPF
>          Issue Type: New Feature
>          Components: Core
>    Affects Versions: 0.9b1, 0.9b2, 0.9b3, 0.9b4, 0.9.5, 0.9.6
>            Reporter: Norman Maurer
>            Assignee: Stefano Bagnara
>             Fix For: 0.9.7
>
>


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Resolved: (JSPF-61) Allow use of costum Resolver

Posted by "Stefano Bagnara (JIRA)" <se...@james.apache.org>.
     [ https://issues.apache.org/jira/browse/JSPF-61?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stefano Bagnara resolved JSPF-61.
---------------------------------

       Resolution: Fixed
    Fix Version/s: 0.9.7
         Assignee: Stefano Bagnara  (was: Norman Maurer)

I fixed this by setting the resolver in the Lookup object created instead of changing the default resolver.
Not sure if this is enough for the user that requested this change or if we have also to expose the Cache and the SearchPaths property in our object.

jSPF is really modular, so in the worst case an user should be able to implement it's own extension to DNSServiceXBillImpl and use it, but if we can accomodate flexibility without adding complexity I'm in favor of doing this.

Let's wait the user feedback, now.

> Allow use of costum Resolver
> ----------------------------
>
>                 Key: JSPF-61
>                 URL: https://issues.apache.org/jira/browse/JSPF-61
>             Project: jSPF
>          Issue Type: New Feature
>          Components: Core
>    Affects Versions: 0.9b1, 0.9b2, 0.9b3, 0.9b4, 0.9.5, 0.9.6
>            Reporter: Norman Maurer
>            Assignee: Stefano Bagnara
>             Fix For: 0.9.7
>
>


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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