directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: r552764 - in /directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns: ./ io/decoder/ io/encoder/ messages/ service/ store/jndi/ store/jndi/operations/
Date Tue, 03 Jul 2007 09:38:22 GMT
Author: erodriguez
Date: Tue Jul  3 02:38:20 2007
New Revision: 552764

URL: http://svn.apache.org/viewvc?view=rev&rev=552764
Log:
Warnings clean-up in protocol-dns.

Added:
    directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/store/jndi/DnsOperation.java
  (with props)
Modified:
    directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/DnsServer.java
    directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/decoder/AddressRecordDecoder.java
    directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/decoder/DnsMessageDecoder.java
    directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/decoder/IPv6RecordDecoder.java
    directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/decoder/MailExchangeRecordDecoder.java
    directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/decoder/NameServerRecordDecoder.java
    directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/decoder/RecordDecoder.java
    directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/DnsMessageEncoder.java
    directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/messages/ResourceRecordImpl.java
    directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/messages/ResourceRecordModifier.java
    directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/service/GetResourceRecords.java
    directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/store/jndi/DnsCatalog.java
    directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/store/jndi/MultiBaseSearch.java
    directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/store/jndi/SingleBaseSearch.java
    directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/store/jndi/operations/GetFlatRecord.java
    directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/store/jndi/operations/GetRecords.java

Modified: directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/DnsServer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/DnsServer.java?view=diff&rev=552764&r1=552763&r2=552764
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/DnsServer.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/DnsServer.java
Tue Jul  3 02:38:20 2007
@@ -91,7 +91,7 @@
      * @param newConfig
      * @return Whether configuration being proposed as new is really different.
      */
-    public boolean isDifferent( Dictionary newConfig )
+    public boolean isDifferent( Dictionary<String, Object> newConfig )
     {
         return config.isDifferent( newConfig );
     }

Modified: directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/decoder/AddressRecordDecoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/decoder/AddressRecordDecoder.java?view=diff&rev=552764&r1=552763&r2=552764
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/decoder/AddressRecordDecoder.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/decoder/AddressRecordDecoder.java
Tue Jul  3 02:38:20 2007
@@ -51,7 +51,7 @@
  */
 public class AddressRecordDecoder implements RecordDecoder
 {
-    public Map decode( ByteBuffer byteBuffer, short length ) throws IOException
+    public Map<String, Object> decode( ByteBuffer byteBuffer, short length ) throws
IOException
     {
         Map<String, Object> attributes = new HashMap<String, Object>();
         byte[] addressBytes = new byte[length];

Modified: directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/decoder/DnsMessageDecoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/decoder/DnsMessageDecoder.java?view=diff&rev=552764&r1=552763&r2=552764
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/decoder/DnsMessageDecoder.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/decoder/DnsMessageDecoder.java
Tue Jul  3 02:38:20 2007
@@ -60,7 +60,7 @@
     /**
      * A Hashed Adapter mapping record types to their encoders.
      */
-    private static final Map DEFAULT_DECODERS;
+    private static final Map<RecordType, RecordDecoder> DEFAULT_DECODERS;
 
     static
     {
@@ -133,7 +133,7 @@
             int timeToLive = byteBuffer.getInt();
             short dataLength = byteBuffer.getShort();
 
-            Map attributes = decode( byteBuffer, recordType, dataLength );
+            Map<String, Object> attributes = decode( byteBuffer, recordType, dataLength
);
             records.add( new ResourceRecordImpl( domainName, recordType, recordClass, timeToLive,
attributes ) );
         }
 
@@ -141,7 +141,7 @@
     }
 
 
-    private Map decode( ByteBuffer byteBuffer, RecordType type, short length ) throws IOException
+    private Map<String, Object> decode( ByteBuffer byteBuffer, RecordType type, short
length ) throws IOException
     {
         RecordDecoder recordDecoder = ( RecordDecoder ) DEFAULT_DECODERS.get( type );
 

Modified: directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/decoder/IPv6RecordDecoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/decoder/IPv6RecordDecoder.java?view=diff&rev=552764&r1=552763&r2=552764
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/decoder/IPv6RecordDecoder.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/decoder/IPv6RecordDecoder.java
Tue Jul  3 02:38:20 2007
@@ -46,7 +46,7 @@
 public class IPv6RecordDecoder implements RecordDecoder
 {
 
-    public Map decode( ByteBuffer byteBuffer, short length ) throws IOException
+    public Map<String, Object> decode( ByteBuffer byteBuffer, short length ) throws
IOException
     {
         Map<String, Object> attributes = new HashMap<String, Object>();
         byte[] addressBytes = new byte[length];

Modified: directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/decoder/MailExchangeRecordDecoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/decoder/MailExchangeRecordDecoder.java?view=diff&rev=552764&r1=552763&r2=552764
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/decoder/MailExchangeRecordDecoder.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/decoder/MailExchangeRecordDecoder.java
Tue Jul  3 02:38:20 2007
@@ -58,7 +58,7 @@
  */
 public class MailExchangeRecordDecoder implements RecordDecoder
 {
-    public Map decode( ByteBuffer byteBuffer, short length ) throws IOException
+    public Map<String, Object> decode( ByteBuffer byteBuffer, short length ) throws
IOException
     {
         Map<String, Object> attributes = new HashMap<String, Object>();
         attributes.put( DnsAttribute.MX_PREFERENCE, byteBuffer.getShort() );

Modified: directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/decoder/NameServerRecordDecoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/decoder/NameServerRecordDecoder.java?view=diff&rev=552764&r1=552763&r2=552764
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/decoder/NameServerRecordDecoder.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/decoder/NameServerRecordDecoder.java
Tue Jul  3 02:38:20 2007
@@ -52,10 +52,9 @@
  */
 public class NameServerRecordDecoder implements RecordDecoder
 {
-
-    public Map decode( ByteBuffer byteBuffer, short length ) throws IOException
+    public Map<String, Object> decode( ByteBuffer byteBuffer, short length ) throws
IOException
     {
-        Map<String, String> map = new HashMap<String, String>();
+        Map<String, Object> map = new HashMap<String, Object>();
         map.put( DnsAttribute.DOMAIN_NAME, DnsMessageDecoder.getDomainName( byteBuffer )
);
         return map;
     }

Modified: directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/decoder/RecordDecoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/decoder/RecordDecoder.java?view=diff&rev=552764&r1=552763&r2=552764
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/decoder/RecordDecoder.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/decoder/RecordDecoder.java
Tue Jul  3 02:38:20 2007
@@ -42,5 +42,5 @@
      * @return The map of attributes.
      * @throws IOException
      */
-    public Map decode( ByteBuffer byteBuffer, short length ) throws IOException;
+    public Map<String, Object> decode( ByteBuffer byteBuffer, short length ) throws
IOException;
 }

Modified: directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/DnsMessageEncoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/DnsMessageEncoder.java?view=diff&rev=552764&r1=552763&r2=552764
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/DnsMessageEncoder.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/DnsMessageEncoder.java
Tue Jul  3 02:38:20 2007
@@ -57,7 +57,7 @@
     /**
      * A Hashed Adapter mapping record types to their encoders.
      */
-    private static final Map DEFAULT_ENCODERS;
+    private static final Map<RecordType, RecordEncoder> DEFAULT_ENCODERS;
 
     static
     {
@@ -123,11 +123,11 @@
 
         QuestionRecordEncoder encoder = new QuestionRecordEncoder();
 
-        Iterator it = questions.iterator();
+        Iterator<QuestionRecord> it = questions.iterator();
 
         while ( it.hasNext() )
         {
-            QuestionRecord question = ( QuestionRecord ) it.next();
+            QuestionRecord question = it.next();
             encoder.put( byteBuffer, question );
         }
     }
@@ -140,11 +140,11 @@
             return;
         }
 
-        Iterator it = records.iterator();
+        Iterator<ResourceRecord> it = records.iterator();
 
         while ( it.hasNext() )
         {
-            ResourceRecord record = ( ResourceRecord ) it.next();
+            ResourceRecord record = it.next();
 
             try
             {

Modified: directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/messages/ResourceRecordImpl.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/messages/ResourceRecordImpl.java?view=diff&rev=552764&r1=552763&r2=552764
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/messages/ResourceRecordImpl.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/messages/ResourceRecordImpl.java
Tue Jul  3 02:38:20 2007
@@ -89,7 +89,7 @@
      * resource.  The format of this information varies
      * according to the TYPE and CLASS of the resource record.
      */
-    private Map attributes;
+    private Map<String, Object> attributes;
 
 
     /**
@@ -102,7 +102,7 @@
      * @param attributes
      */
     public ResourceRecordImpl( String domainName, RecordType recordType, RecordClass recordClass,
int timeToLive,
-        Map attributes )
+        Map<String, Object> attributes )
     {
         this.domainName = domainName;
         this.recordType = recordType;

Modified: directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/messages/ResourceRecordModifier.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/messages/ResourceRecordModifier.java?view=diff&rev=552764&r1=552763&r2=552764
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/messages/ResourceRecordModifier.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/messages/ResourceRecordModifier.java
Tue Jul  3 02:38:20 2007
@@ -35,7 +35,7 @@
     private RecordClass dnsClass;
     private int dnsTtl;
 
-    private Map<String, String> attributes = new HashMap<String, String>();
+    private Map<String, Object> attributes = new HashMap<String, Object>();
 
 
     /**

Modified: directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/service/GetResourceRecords.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/service/GetResourceRecords.java?view=diff&rev=552764&r1=552763&r2=552764
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/service/GetResourceRecords.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/service/GetResourceRecords.java
Tue Jul  3 02:38:20 2007
@@ -56,11 +56,11 @@
         DnsMessage request = ( DnsMessage ) message;
         List<QuestionRecord> questions = request.getQuestionRecords();
 
-        Iterator it = questions.iterator();
+        Iterator<QuestionRecord> it = questions.iterator();
 
         while ( it.hasNext() )
         {
-            dnsContext.addResourceRecords( getEntry( store, ( QuestionRecord ) it.next()
) );
+            dnsContext.addResourceRecords( getEntry( store, it.next() ) );
         }
 
         next.execute( session, message );

Modified: directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/store/jndi/DnsCatalog.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/store/jndi/DnsCatalog.java?view=diff&rev=552764&r1=552763&r2=552764
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/store/jndi/DnsCatalog.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/store/jndi/DnsCatalog.java
Tue Jul  3 02:38:20 2007
@@ -34,7 +34,7 @@
  */
 class DnsCatalog implements Catalog
 {
-    private Map map;
+    private Map<String, Object> map;
 
 
     /**
@@ -42,7 +42,7 @@
      *
      * @param map
      */
-    public DnsCatalog( Map map )
+    public DnsCatalog( Map<String, Object> map )
     {
         this.map = map;
     }

Added: directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/store/jndi/DnsOperation.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/store/jndi/DnsOperation.java?view=auto&rev=552764
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/store/jndi/DnsOperation.java
(added)
+++ directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/store/jndi/DnsOperation.java
Tue Jul  3 02:38:20 2007
@@ -0,0 +1,49 @@
+/*
+ *  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. 
+ *  
+ */
+package org.apache.directory.server.dns.store.jndi;
+
+
+import java.io.Serializable;
+import java.util.Set;
+
+import javax.naming.Name;
+import javax.naming.directory.DirContext;
+
+import org.apache.directory.server.dns.messages.ResourceRecord;
+
+
+/**
+ * Interface to support the command pattern with JNDI contexts.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev: 437023 $, $Date: 2006-08-25 16:50:47 -0700 (Fri, 25 Aug 2006) $
+ */
+public interface DnsOperation extends Serializable
+{
+    /**
+     * The command pattern execute method.
+     * 
+     * @param ctx The context to execute the command with
+     * @param baseDn The base DN for working with the context
+     * @return Set<ResourceRecord> The result returned by the command
+     * @throws Exception The exception thrown by the command
+     */
+    public Set<ResourceRecord> execute( DirContext ctx, Name baseDn ) throws Exception;
+}

Propchange: directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/store/jndi/DnsOperation.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/store/jndi/MultiBaseSearch.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/store/jndi/MultiBaseSearch.java?view=diff&rev=552764&r1=552763&r2=552764
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/store/jndi/MultiBaseSearch.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/store/jndi/MultiBaseSearch.java
Tue Jul  3 02:38:20 2007
@@ -74,7 +74,7 @@
         try
         {
             DirContext ctx = ( DirContext ) factory.getInitialContext( env );
-            catalog = new DnsCatalog( ( Map ) execute( ctx, new GetCatalog() ) );
+            catalog = new DnsCatalog( ( Map<String, Object> ) execute( ctx, new GetCatalog()
) );
         }
         catch ( Exception e )
         {
@@ -92,30 +92,36 @@
         try
         {
             DirContext ctx = ( DirContext ) factory.getInitialContext( env );
-            return ( Set ) execute( ctx, new GetRecords( question ) );
+            return ( Set<ResourceRecord> ) execute( ctx, new GetRecords( question )
);
         }
         catch ( LdapNameNotFoundException lnnfe )
-	    {
-	        log.debug( "Name for DNS record search does not exist.", lnnfe );
-	
-	        throw new DnsException( ResponseCode.NAME_ERROR );
-	    }
+        {
+            log.debug( "Name for DNS record search does not exist.", lnnfe );
+
+            throw new DnsException( ResponseCode.NAME_ERROR );
+        }
         catch ( NamingException ne )
         {
             log.error( ne.getMessage(), ne );
             String message = "Failed to get initial context " + ( String ) env.get( Context.PROVIDER_URL
);
             throw new ServiceConfigurationException( message, ne );
         }
-	    catch ( Exception e )
-	    {
-	        log.debug( "Unexpected error retrieving DNS records.", e );
-	        throw new DnsException( ResponseCode.SERVER_FAILURE );
-	    }
+        catch ( Exception e )
+        {
+            log.debug( "Unexpected error retrieving DNS records.", e );
+            throw new DnsException( ResponseCode.SERVER_FAILURE );
+        }
 
     }
 
 
     private Object execute( DirContext ctx, ContextOperation operation ) throws Exception
+    {
+        return operation.execute( ctx, null );
+    }
+
+
+    private Set<ResourceRecord> execute( DirContext ctx, DnsOperation operation ) throws
Exception
     {
         return operation.execute( ctx, null );
     }

Modified: directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/store/jndi/SingleBaseSearch.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/store/jndi/SingleBaseSearch.java?view=diff&rev=552764&r1=552763&r2=552764
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/store/jndi/SingleBaseSearch.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/store/jndi/SingleBaseSearch.java
Tue Jul  3 02:38:20 2007
@@ -36,7 +36,6 @@
 import org.apache.directory.server.dns.messages.ResponseCode;
 import org.apache.directory.server.dns.store.jndi.operations.GetRecords;
 import org.apache.directory.server.protocol.shared.ServiceConfigurationException;
-import org.apache.directory.server.protocol.shared.store.ContextOperation;
 import org.apache.directory.shared.ldap.exception.LdapNameNotFoundException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -73,11 +72,11 @@
 
     public Set<ResourceRecord> getRecords( QuestionRecord question ) throws DnsException
     {
-        return ( Set ) execute( new GetRecords( question ) );
+        return execute( new GetRecords( question ) );
     }
 
 
-    private Object execute( ContextOperation operation ) throws DnsException
+    private Set<ResourceRecord> execute( DnsOperation operation ) throws DnsException
     {
     	try {
     		
@@ -108,8 +107,5 @@
 	        log.debug( "Unexpected error retrieving DNS records.", e );
 	        throw new DnsException( ResponseCode.SERVER_FAILURE );
 	    }
-
-
-
     }
 }

Modified: directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/store/jndi/operations/GetFlatRecord.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/store/jndi/operations/GetFlatRecord.java?view=diff&rev=552764&r1=552763&r2=552764
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/store/jndi/operations/GetFlatRecord.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/store/jndi/operations/GetFlatRecord.java
Tue Jul  3 02:38:20 2007
@@ -20,6 +20,9 @@
 package org.apache.directory.server.dns.store.jndi.operations;
 
 
+import java.util.HashSet;
+import java.util.Set;
+
 import javax.naming.Name;
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
@@ -34,7 +37,7 @@
 import org.apache.directory.server.dns.messages.ResourceRecord;
 import org.apache.directory.server.dns.messages.ResourceRecordModifier;
 import org.apache.directory.server.dns.store.DnsAttribute;
-import org.apache.directory.server.protocol.shared.store.ContextOperation;
+import org.apache.directory.server.dns.store.jndi.DnsOperation;
 import org.apache.directory.shared.ldap.message.AttributeImpl;
 import org.apache.directory.shared.ldap.message.AttributesImpl;
 
@@ -45,7 +48,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class GetFlatRecord implements ContextOperation
+public class GetFlatRecord implements DnsOperation
 {
     private static final long serialVersionUID = 4931303293468915435L;
 
@@ -68,7 +71,7 @@
      * Note that the base is a relative path from the exiting context.
      * It is not a DN.
      */
-    public Object execute( DirContext ctx, Name base ) throws Exception
+    public Set<ResourceRecord> execute( DirContext ctx, Name base ) throws Exception
     {
         if ( question == null )
         {
@@ -81,13 +84,13 @@
         matchAttrs.put( new AttributeImpl( DnsAttribute.TYPE, question.getRecordType().name()
) );
         matchAttrs.put( new AttributeImpl( DnsAttribute.CLASS, question.getRecordClass().name()
) );
 
-        ResourceRecord record = null;
+        Set<ResourceRecord> record = new HashSet<ResourceRecord>();
 
-        NamingEnumeration answer = ctx.search( base, matchAttrs );
+        NamingEnumeration<SearchResult> answer = ctx.search( base, matchAttrs );
 
         if ( answer.hasMore() )
         {
-            SearchResult result = ( SearchResult ) answer.next();
+            SearchResult result = answer.next();
 
             Attributes attrs = result.getAttributes();
 
@@ -96,7 +99,7 @@
                 return null;
             }
 
-            record = getRecord( attrs );
+            record.add( getRecord( attrs ) );
         }
 
         return record;
@@ -126,11 +129,11 @@
         modifier.setDnsClass( RecordClass.valueOf( dnsClass ) );
         modifier.setDnsTtl( Integer.parseInt( dnsTtl ) );
 
-        NamingEnumeration ids = attrs.getIDs();
+        NamingEnumeration<String> ids = attrs.getIDs();
 
         while ( ids.hasMore() )
         {
-            String id = ( String ) ids.next();
+            String id = ids.next();
             modifier.put( id, ( String ) attrs.get( id ).get() );
         }
 

Modified: directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/store/jndi/operations/GetRecords.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/store/jndi/operations/GetRecords.java?view=diff&rev=552764&r1=552763&r2=552764
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/store/jndi/operations/GetRecords.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/store/jndi/operations/GetRecords.java
Tue Jul  3 02:38:20 2007
@@ -44,7 +44,7 @@
 import org.apache.directory.server.dns.messages.ResourceRecord;
 import org.apache.directory.server.dns.messages.ResourceRecordModifier;
 import org.apache.directory.server.dns.store.DnsAttribute;
-import org.apache.directory.server.protocol.shared.store.ContextOperation;
+import org.apache.directory.server.dns.store.jndi.DnsOperation;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 
 
@@ -54,7 +54,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class GetRecords implements ContextOperation
+public class GetRecords implements DnsOperation
 {
     private static final long serialVersionUID = 1077580995617778894L;
 
@@ -119,7 +119,7 @@
      * Note that the base is a relative path from the exiting context.
      * It is not a DN.
      */
-    public Object execute( DirContext ctx, Name base ) throws Exception
+    public Set<ResourceRecord> execute( DirContext ctx, Name base ) throws Exception
     {
         if ( question == null )
         {
@@ -134,13 +134,13 @@
 
         String filter = "(objectClass=" + TYPE_TO_OBJECTCLASS.get( type ) + ")";
 
-        NamingEnumeration list = ctx.search( transformDomainName( name ), filter, controls
);
+        NamingEnumeration<SearchResult> list = ctx.search( transformDomainName( name
), filter, controls );
 
         Set<ResourceRecord> set = new HashSet<ResourceRecord>();
 
         while ( list.hasMore() )
         {
-            SearchResult result = ( SearchResult ) list.next();
+            SearchResult result = list.next();
             Name relative = getRelativeName( ctx.getNameInNamespace(), result.getName() );
 
             set.add( getRecord( result.getAttributes(), relative ) );
@@ -202,7 +202,7 @@
         String dnsTtl = ( attr = attrs.get( DnsAttribute.TTL ) ) != null ? ( String ) attr.get()
: SOA_MINIMUM;
         modifier.setDnsTtl( Integer.parseInt( dnsTtl ) );
 
-        NamingEnumeration ids = attrs.getIDs();
+        NamingEnumeration<String> ids = attrs.getIDs();
 
         while ( ids.hasMore() )
         {
@@ -260,7 +260,7 @@
 
     private RecordType getType( Attribute objectClass ) throws NamingException
     {
-        NamingEnumeration list = objectClass.getAll();
+        NamingEnumeration<?> list = objectClass.getAll();
 
         while ( list.hasMore() )
         {



Mime
View raw message