directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: r501531 - in /directory/apacheds/trunk/protocol-dns/src: main/java/org/apache/directory/server/dns/io/decoder/ main/java/org/apache/directory/server/dns/io/encoder/ main/java/org/apache/directory/server/dns/protocol/ main/java/org/apache/di...
Date Tue, 30 Jan 2007 19:51:20 GMT
Author: erodriguez
Date: Tue Jan 30 11:51:18 2007
New Revision: 501531

URL: http://svn.apache.org/viewvc?view=rev&rev=501531
Log:
Applying second patch attached to DIRSERVER-831 (Proposed protocol-dns changes).
o  ByteBufferUtil replaced with MINA ByteBuffer.
o  Numerous javadocs.

Removed:
    directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/util/ByteBufferUtil.java
Modified:
    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/AddressRecordEncoder.java
    directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/CanonicalNameRecordEncoder.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/io/encoder/MailExchangeRecordEncoder.java
    directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/NameServerRecordEncoder.java
    directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/PointerRecordEncoder.java
    directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/QuestionRecordEncoder.java
    directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/RecordEncoder.java
    directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/ResourceRecordEncoder.java
    directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/ServerSelectionRecordEncoder.java
    directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/StartOfAuthorityRecordEncoder.java
    directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/TextRecordEncoder.java
    directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/protocol/DnsDecoder.java
    directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/protocol/DnsEncoder.java
    directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/util/EnumConverter.java
    directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/AbstractDnsTestCase.java
    directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/protocol/DnsMessageEncoderTest.java

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=501531&r1=501530&r2=501531
==============================================================================
--- 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 Jan 30 11:51:18 2007
@@ -23,14 +23,29 @@
 
 import java.io.IOException;
 import java.net.InetAddress;
-import java.nio.ByteBuffer;
 import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.directory.server.dns.store.DnsAttribute;
+import org.apache.mina.common.ByteBuffer;
 
 
 /**
+ * A decoder for A records. As per RFC 1035
+ * 
+ * <pre>
+ *   3.4.1. A RDATA format
+ *
+ *     +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+ *     |                    ADDRESS                    |
+ *     +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+ *
+ *   where:
+ *
+ *   ADDRESS
+ *       A 32 bit Internet address. 
+ * </pre>
+ * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */

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=501531&r1=501530&r2=501531
==============================================================================
--- 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 Jan 30 11:51:18 2007
@@ -22,7 +22,6 @@
 
 
 import java.io.IOException;
-import java.nio.ByteBuffer;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
@@ -39,12 +38,17 @@
 import org.apache.directory.server.dns.messages.ResourceRecord;
 import org.apache.directory.server.dns.messages.ResourceRecordImpl;
 import org.apache.directory.server.dns.messages.ResponseCode;
-import org.apache.directory.server.dns.util.ByteBufferUtil;
+import org.apache.mina.common.ByteBuffer;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 
 /**
+ * A decoder for DNS messages.  The primary usage of the DnsMessageDecoder is by
+ * calling the <code>decode(ByteBuffer)</code> method which will read the 
+ * message from the incoming ByteBuffer and build a <code>DnsMessage</code>
+ * from it according to the DnsMessage encoding in RFC-1035.
+ * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
@@ -75,7 +79,7 @@
     {
         DnsMessageModifier modifier = new DnsMessageModifier();
 
-        modifier.setTransactionId( ByteBufferUtil.getUnsignedShort( in ) );
+        modifier.setTransactionId( in.getUnsignedShort() );
 
         byte header = in.get();
         modifier.setMessageType( decodeMessageType( header ) );
@@ -172,11 +176,11 @@
 
     static void recurseDomainName( ByteBuffer byteBuffer, StringBuffer domainName )
     {
-        int length = ByteBufferUtil.getUnsignedByte( byteBuffer );
+        int length = byteBuffer.getUnsigned();
 
         if ( isOffset( length ) )
         {
-            int position = ByteBufferUtil.getUnsignedByte( byteBuffer );
+            int position = byteBuffer.getUnsigned();
             int offset = length & ~( 0xc0 ) << 8;
             int originalPosition = byteBuffer.position();
             byteBuffer.position( position + offset );

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=501531&r1=501530&r2=501531
==============================================================================
--- 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 Jan 30 11:51:18 2007
@@ -23,14 +23,23 @@
 
 import java.io.IOException;
 import java.net.InetAddress;
-import java.nio.ByteBuffer;
 import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.directory.server.dns.store.DnsAttribute;
+import org.apache.mina.common.ByteBuffer;
 
 
 /**
+ * A decoder for AAAA records.  AAAA records are encoded as per RFC-3596:
+ * 
+ * <pre>
+ *   2.2. AAAA data format
+ *
+ *     A 128 bit IPv6 address is encoded in the data portion of an AAAA
+ *     resource record in network byte order (high-order byte first).
+ * </pre>
+ * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */

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=501531&r1=501530&r2=501531
==============================================================================
--- 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 Jan 30 11:51:18 2007
@@ -22,14 +22,37 @@
 
 
 import java.io.IOException;
-import java.nio.ByteBuffer;
 import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.directory.server.dns.store.DnsAttribute;
+import org.apache.mina.common.ByteBuffer;
 
 
 /**
+ * A decoder for MX records.  MX records are encoded as per RFC-1035:
+ * 
+ * <pre>
+ *   3.3.9. MX RDATA format
+ *
+ *     +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+ *     |                  PREFERENCE                   |
+ *     +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+ *     /                   EXCHANGE                    /
+ *     /                                               /
+ *     +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+ *
+ *   where:
+ *
+ *   PREFERENCE
+ *     A 16 bit integer which specifies the preference given to this RR among 
+ *     others at the same owner. Lower values are preferred. 
+ *     
+ *   EXCHANGE
+ *     A <domain-name> which specifies a host willing to act as a mail exchange
+ *     for the owner name.
+ * </pre>
+ * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */

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=501531&r1=501530&r2=501531
==============================================================================
--- 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 Jan 30 11:51:18 2007
@@ -22,14 +22,31 @@
 
 
 import java.io.IOException;
-import java.nio.ByteBuffer;
 import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.directory.server.dns.store.DnsAttribute;
+import org.apache.mina.common.ByteBuffer;
 
 
 /**
+ * A decoder for NS records.  NS records are encoded as per RFC-1035:
+ * 
+ * <pre>
+ *   3.3.11. NS RDATA format
+ *
+ *     +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+ *     /                   NSDNAME                     /
+ *     /                                               /
+ *     +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+ *
+ *   where:
+ *
+ *   NSDNAME
+ *     A <domain-name> which specifies a host which should be authoritative for
+ *     the specified class and domain. 
+ * </pre>
+ * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */

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=501531&r1=501530&r2=501531
==============================================================================
--- 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 Jan 30 11:51:18 2007
@@ -22,8 +22,9 @@
 
 
 import java.io.IOException;
-import java.nio.ByteBuffer;
 import java.util.Map;
+
+import org.apache.mina.common.ByteBuffer;
 
 
 /**

Modified: directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/AddressRecordEncoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/AddressRecordEncoder.java?view=diff&rev=501531&r1=501530&r2=501531
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/AddressRecordEncoder.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/AddressRecordEncoder.java
Tue Jan 30 11:51:18 2007
@@ -23,10 +23,10 @@
 
 import java.net.InetAddress;
 import java.net.UnknownHostException;
-import java.nio.ByteBuffer;
 
 import org.apache.directory.server.dns.messages.ResourceRecord;
 import org.apache.directory.server.dns.store.DnsAttribute;
+import org.apache.mina.common.ByteBuffer;
 
 
 /**

Modified: directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/CanonicalNameRecordEncoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/CanonicalNameRecordEncoder.java?view=diff&rev=501531&r1=501530&r2=501531
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/CanonicalNameRecordEncoder.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/CanonicalNameRecordEncoder.java
Tue Jan 30 11:51:18 2007
@@ -21,10 +21,9 @@
 package org.apache.directory.server.dns.io.encoder;
 
 
-import java.nio.ByteBuffer;
-
 import org.apache.directory.server.dns.messages.ResourceRecord;
 import org.apache.directory.server.dns.store.DnsAttribute;
+import org.apache.mina.common.ByteBuffer;
 
 
 /**

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=501531&r1=501530&r2=501531
==============================================================================
--- 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 Jan 30 11:51:18 2007
@@ -22,7 +22,6 @@
 
 
 import java.io.IOException;
-import java.nio.ByteBuffer;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -37,12 +36,17 @@
 import org.apache.directory.server.dns.messages.ResourceRecord;
 import org.apache.directory.server.dns.messages.ResponseCode;
 import org.apache.directory.server.dns.protocol.DnsEncoder;
-import org.apache.directory.server.dns.util.ByteBufferUtil;
+import org.apache.mina.common.ByteBuffer;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 
 /**
+ * An encoder for DNS messages.  The primary usage of the DnsMessageEncoder is 
+ * to call the <code>encode(ByteBuffer, DnsMessage)</code> method which will

+ * write the message to the outgoing ByteBuffer according to the DnsMessage 
+ * encoding in RFC-1035.
+ * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
@@ -76,7 +80,7 @@
 
     public void encode( ByteBuffer byteBuffer, DnsMessage message )
     {
-        ByteBufferUtil.putUnsignedShort( byteBuffer, message.getTransactionId() );
+        byteBuffer.putShort( ( short ) message.getTransactionId() );
 
         byte header = ( byte ) 0x00;
         header |= encodeMessageType( message.getMessageType() );

Modified: directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/MailExchangeRecordEncoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/MailExchangeRecordEncoder.java?view=diff&rev=501531&r1=501530&r2=501531
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/MailExchangeRecordEncoder.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/MailExchangeRecordEncoder.java
Tue Jan 30 11:51:18 2007
@@ -21,10 +21,9 @@
 package org.apache.directory.server.dns.io.encoder;
 
 
-import java.nio.ByteBuffer;
-
 import org.apache.directory.server.dns.messages.ResourceRecord;
 import org.apache.directory.server.dns.store.DnsAttribute;
+import org.apache.mina.common.ByteBuffer;
 
 
 /**

Modified: directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/NameServerRecordEncoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/NameServerRecordEncoder.java?view=diff&rev=501531&r1=501530&r2=501531
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/NameServerRecordEncoder.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/NameServerRecordEncoder.java
Tue Jan 30 11:51:18 2007
@@ -21,10 +21,9 @@
 package org.apache.directory.server.dns.io.encoder;
 
 
-import java.nio.ByteBuffer;
-
 import org.apache.directory.server.dns.messages.ResourceRecord;
 import org.apache.directory.server.dns.store.DnsAttribute;
+import org.apache.mina.common.ByteBuffer;
 
 
 /**

Modified: directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/PointerRecordEncoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/PointerRecordEncoder.java?view=diff&rev=501531&r1=501530&r2=501531
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/PointerRecordEncoder.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/PointerRecordEncoder.java
Tue Jan 30 11:51:18 2007
@@ -21,10 +21,9 @@
 package org.apache.directory.server.dns.io.encoder;
 
 
-import java.nio.ByteBuffer;
-
 import org.apache.directory.server.dns.messages.ResourceRecord;
 import org.apache.directory.server.dns.store.DnsAttribute;
+import org.apache.mina.common.ByteBuffer;
 
 
 /**

Modified: directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/QuestionRecordEncoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/QuestionRecordEncoder.java?view=diff&rev=501531&r1=501530&r2=501531
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/QuestionRecordEncoder.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/QuestionRecordEncoder.java
Tue Jan 30 11:51:18 2007
@@ -21,11 +21,10 @@
 package org.apache.directory.server.dns.io.encoder;
 
 
-import java.nio.ByteBuffer;
-
 import org.apache.directory.server.dns.messages.QuestionRecord;
 import org.apache.directory.server.dns.messages.RecordClass;
 import org.apache.directory.server.dns.messages.RecordType;
+import org.apache.mina.common.ByteBuffer;
 
 
 /**

Modified: directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/RecordEncoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/RecordEncoder.java?view=diff&rev=501531&r1=501530&r2=501531
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/RecordEncoder.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/RecordEncoder.java
Tue Jan 30 11:51:18 2007
@@ -22,9 +22,9 @@
 
 
 import java.io.IOException;
-import java.nio.ByteBuffer;
 
 import org.apache.directory.server.dns.messages.ResourceRecord;
+import org.apache.mina.common.ByteBuffer;
 
 
 /**

Modified: directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/ResourceRecordEncoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/ResourceRecordEncoder.java?view=diff&rev=501531&r1=501530&r2=501531
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/ResourceRecordEncoder.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/ResourceRecordEncoder.java
Tue Jan 30 11:51:18 2007
@@ -22,11 +22,11 @@
 
 
 import java.io.IOException;
-import java.nio.ByteBuffer;
 
 import org.apache.directory.server.dns.messages.RecordClass;
 import org.apache.directory.server.dns.messages.RecordType;
 import org.apache.directory.server.dns.messages.ResourceRecord;
+import org.apache.mina.common.ByteBuffer;
 
 
 /**

Modified: directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/ServerSelectionRecordEncoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/ServerSelectionRecordEncoder.java?view=diff&rev=501531&r1=501530&r2=501531
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/ServerSelectionRecordEncoder.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/ServerSelectionRecordEncoder.java
Tue Jan 30 11:51:18 2007
@@ -21,10 +21,9 @@
 package org.apache.directory.server.dns.io.encoder;
 
 
-import java.nio.ByteBuffer;
-
 import org.apache.directory.server.dns.messages.ResourceRecord;
 import org.apache.directory.server.dns.store.DnsAttribute;
+import org.apache.mina.common.ByteBuffer;
 
 
 /**

Modified: directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/StartOfAuthorityRecordEncoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/StartOfAuthorityRecordEncoder.java?view=diff&rev=501531&r1=501530&r2=501531
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/StartOfAuthorityRecordEncoder.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/StartOfAuthorityRecordEncoder.java
Tue Jan 30 11:51:18 2007
@@ -21,12 +21,10 @@
 package org.apache.directory.server.dns.io.encoder;
 
 
-import java.nio.ByteBuffer;
-
 import org.apache.directory.server.dns.messages.ResourceRecord;
 import org.apache.directory.server.dns.store.DnsAttribute;
-import org.apache.directory.server.dns.util.ByteBufferUtil;
-
+import org.apache.mina.common.ByteBuffer;
+import org.apache.mina.util.ByteBufferUtil;
 
 /**
  * 3.3.13. SOA RDATA format
@@ -114,13 +112,13 @@
         putDomainName( byteBuffer, mName );
         putDomainName( byteBuffer, rName );
 
-        ByteBufferUtil.putUnsignedInt( byteBuffer, serial );
+        byteBuffer.putInt( ( int ) serial );
 
         byteBuffer.putInt( refresh );
         byteBuffer.putInt( retry );
         byteBuffer.putInt( expire );
 
-        ByteBufferUtil.putUnsignedInt( byteBuffer, minimum );
+        byteBuffer.putInt( ( int ) minimum );
 
         putDataSize( byteBuffer, startPosition );
     }

Modified: directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/TextRecordEncoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/TextRecordEncoder.java?view=diff&rev=501531&r1=501530&r2=501531
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/TextRecordEncoder.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/TextRecordEncoder.java
Tue Jan 30 11:51:18 2007
@@ -21,10 +21,9 @@
 package org.apache.directory.server.dns.io.encoder;
 
 
-import java.nio.ByteBuffer;
-
 import org.apache.directory.server.dns.messages.ResourceRecord;
 import org.apache.directory.server.dns.store.DnsAttribute;
+import org.apache.mina.common.ByteBuffer;
 
 
 /**

Modified: directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/protocol/DnsDecoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/protocol/DnsDecoder.java?view=diff&rev=501531&r1=501530&r2=501531
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/protocol/DnsDecoder.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/protocol/DnsDecoder.java
Tue Jan 30 11:51:18 2007
@@ -31,6 +31,9 @@
 
 
 /**
+ * A ProtocolDecoder for use in the MINA framework that uses the 
+ * DnsMessageDecoder to decode DnsMessages.
+ * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
@@ -41,7 +44,7 @@
 
     public void decode( IoSession session, ByteBuffer in, ProtocolDecoderOutput out ) throws
IOException
     {
-        out.write( decoder.decode( in.buf() ) );
+        out.write( decoder.decode( in ) );
     }
 
 

Modified: directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/protocol/DnsEncoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/protocol/DnsEncoder.java?view=diff&rev=501531&r1=501530&r2=501531
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/protocol/DnsEncoder.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/protocol/DnsEncoder.java
Tue Jan 30 11:51:18 2007
@@ -30,6 +30,9 @@
 
 
 /**
+ * A ProtocolEncoder for use in the MINA framework that uses the 
+ * DnsMessageEncoder to encode DnsMessages.
+ * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
@@ -41,7 +44,7 @@
     public void encode( IoSession session, Object message, ProtocolEncoderOutput out )
     {
         ByteBuffer buf = ByteBuffer.allocate( 1024 );
-        encoder.encode( buf.buf(), ( DnsMessage ) message );
+        encoder.encode( buf, ( DnsMessage ) message );
 
         buf.flip();
 

Modified: directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/util/EnumConverter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/util/EnumConverter.java?view=diff&rev=501531&r1=501530&r2=501531
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/util/EnumConverter.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/util/EnumConverter.java
Tue Jan 30 11:51:18 2007
@@ -22,6 +22,17 @@
 
 
 /**
+ * An interface that allows an Enum to be converted to another type, such as an
+ * integer or long.  Useful in cases where the Java assigned ordinal just isn't
+ * reliable enough or is unable to represent the values we need.<p>
+ * 
+ * Implementers should also implement (though there is no way of requiring it)
+ * a static method for taking the conversion the other way:
+ * 
+ * <code>
+ *   public static Enum convert (K value);
+ * </code>
+ * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */

Modified: directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/AbstractDnsTestCase.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/AbstractDnsTestCase.java?view=diff&rev=501531&r1=501530&r2=501531
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/AbstractDnsTestCase.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/AbstractDnsTestCase.java
Tue Jan 30 11:51:18 2007
@@ -24,7 +24,6 @@
 import java.io.InputStream;
 import java.net.InetAddress;
 import java.net.UnknownHostException;
-import java.nio.ByteBuffer;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
@@ -42,6 +41,7 @@
 import org.apache.directory.server.dns.messages.ResourceRecordModifier;
 import org.apache.directory.server.dns.messages.ResponseCode;
 import org.apache.directory.server.dns.store.DnsAttribute;
+import org.apache.mina.common.ByteBuffer;
 
 
 /**

Modified: directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/protocol/DnsMessageEncoderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/protocol/DnsMessageEncoderTest.java?view=diff&rev=501531&r1=501530&r2=501531
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/protocol/DnsMessageEncoderTest.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/protocol/DnsMessageEncoderTest.java
Tue Jan 30 11:51:18 2007
@@ -21,10 +21,10 @@
 package org.apache.directory.server.dns.protocol;
 
 import java.io.IOException;
-import java.nio.ByteBuffer;
 
 import org.apache.directory.server.dns.AbstractDnsTestCase;
 import org.apache.directory.server.dns.io.encoder.DnsMessageEncoder;
+import org.apache.mina.common.ByteBuffer;
 
 
 /**



Mime
View raw message