directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: r406147 - in /directory/trunks/apacheds/protocol-dns/src/main/java/org/apache/directory/server/dns: messages/ResourceRecordImpl.java messages/ResourceRecordModifier.java service/GetResourceRecords.java
Date Sat, 13 May 2006 19:53:55 GMT
Author: erodriguez
Date: Sat May 13 12:53:54 2006
New Revision: 406147

URL: http://svn.apache.org/viewcvs?rev=406147&view=rev
Log:
Changes to DNS protocol-provider:
o  Addition of logging to resource record retrieval.
o  Changes to make resource record attribute retrieval case-insensitive.

Modified:
    directory/trunks/apacheds/protocol-dns/src/main/java/org/apache/directory/server/dns/messages/ResourceRecordImpl.java
    directory/trunks/apacheds/protocol-dns/src/main/java/org/apache/directory/server/dns/messages/ResourceRecordModifier.java
    directory/trunks/apacheds/protocol-dns/src/main/java/org/apache/directory/server/dns/service/GetResourceRecords.java

Modified: directory/trunks/apacheds/protocol-dns/src/main/java/org/apache/directory/server/dns/messages/ResourceRecordImpl.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/protocol-dns/src/main/java/org/apache/directory/server/dns/messages/ResourceRecordImpl.java?rev=406147&r1=406146&r2=406147&view=diff
==============================================================================
--- directory/trunks/apacheds/protocol-dns/src/main/java/org/apache/directory/server/dns/messages/ResourceRecordImpl.java
(original)
+++ directory/trunks/apacheds/protocol-dns/src/main/java/org/apache/directory/server/dns/messages/ResourceRecordImpl.java
Sat May 13 12:53:54 2006
@@ -86,8 +86,8 @@
     private Map attributes;
 
 
-    public ResourceRecordImpl(String domainName, RecordType recordType, RecordClass recordClass,
int timeToLive,
-        Map attributes)
+    public ResourceRecordImpl( String domainName, RecordType recordType, RecordClass recordClass,
int timeToLive,
+        Map attributes )
     {
         this.domainName = domainName;
         this.recordType = recordType;
@@ -138,7 +138,7 @@
      */
     public String get( String id )
     {
-        return ( String ) attributes.get( id );
+        return ( String ) attributes.get( id.toLowerCase() );
     }
 
 

Modified: directory/trunks/apacheds/protocol-dns/src/main/java/org/apache/directory/server/dns/messages/ResourceRecordModifier.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/protocol-dns/src/main/java/org/apache/directory/server/dns/messages/ResourceRecordModifier.java?rev=406147&r1=406146&r2=406147&view=diff
==============================================================================
--- directory/trunks/apacheds/protocol-dns/src/main/java/org/apache/directory/server/dns/messages/ResourceRecordModifier.java
(original)
+++ directory/trunks/apacheds/protocol-dns/src/main/java/org/apache/directory/server/dns/messages/ResourceRecordModifier.java
Sat May 13 12:53:54 2006
@@ -83,6 +83,6 @@
      */
     public void put( String id, String value )
     {
-        attributes.put( id, value );
+        attributes.put( id.toLowerCase(), value );
     }
 }

Modified: directory/trunks/apacheds/protocol-dns/src/main/java/org/apache/directory/server/dns/service/GetResourceRecords.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/protocol-dns/src/main/java/org/apache/directory/server/dns/service/GetResourceRecords.java?rev=406147&r1=406146&r2=406147&view=diff
==============================================================================
--- directory/trunks/apacheds/protocol-dns/src/main/java/org/apache/directory/server/dns/service/GetResourceRecords.java
(original)
+++ directory/trunks/apacheds/protocol-dns/src/main/java/org/apache/directory/server/dns/service/GetResourceRecords.java
Sat May 13 12:53:54 2006
@@ -29,10 +29,15 @@
 import org.apache.directory.shared.ldap.exception.LdapNameNotFoundException;
 import org.apache.mina.common.IoSession;
 import org.apache.mina.handler.chain.IoHandlerCommand;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 public class GetResourceRecords implements IoHandlerCommand
 {
+    /** the log for this class */
+    private static final Logger log = LoggerFactory.getLogger( GetResourceRecords.class );
+
     private String contextKey = "context";
 
     public void execute( NextCommand next, IoSession session, Object message ) throws Exception
@@ -64,15 +69,21 @@
         }
         catch ( LdapNameNotFoundException lnnfe )
         {
+            log.debug( "Name for DNS record search does not exist.", lnnfe );
+
             throw new DnsException( ResponseCode.NAME_ERROR );
         }
         catch ( Exception e )
         {
+            log.debug( "Unexpected error retrieving DNS records.", e );
+
             throw new DnsException( ResponseCode.SERVER_FAILURE );
         }
 
         if ( records == null || records.isEmpty() )
         {
+            log.debug( "The domain name referenced in the query does not exist." );
+
             throw new DnsException( ResponseCode.NAME_ERROR );
         }
 



Mime
View raw message