directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r704263 [3/4] - in /directory: apacheds/branches/apacheds-mina2/ apacheds/branches/apacheds-mina2/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/keytab/ apacheds/branches/apacheds-mina2/kerberos-shared/src/test/ja...
Date Mon, 13 Oct 2008 21:34:38 GMT
Modified: directory/apacheds/branches/apacheds-mina2/protocol-dns/src/test/java/org/apache/directory/server/dns/io/decoder/IPv6RecordDecoderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mina2/protocol-dns/src/test/java/org/apache/directory/server/dns/io/decoder/IPv6RecordDecoderTest.java?rev=704263&r1=704262&r2=704263&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mina2/protocol-dns/src/test/java/org/apache/directory/server/dns/io/decoder/IPv6RecordDecoderTest.java (original)
+++ directory/apacheds/branches/apacheds-mina2/protocol-dns/src/test/java/org/apache/directory/server/dns/io/decoder/IPv6RecordDecoderTest.java Mon Oct 13 14:34:35 2008
@@ -27,7 +27,7 @@
 import junit.framework.TestCase;
 
 import org.apache.directory.server.dns.store.DnsAttribute;
-import org.apache.mina.common.ByteBuffer;
+import org.apache.mina.core.buffer.IoBuffer;
 
 
 /**
@@ -39,7 +39,7 @@
 public class IPv6RecordDecoderTest extends TestCase
 {
     InetAddress address;
-    ByteBuffer inputBuffer;
+    IoBuffer inputBuffer;
 
     IPv6RecordDecoder decoder;
 
@@ -47,7 +47,7 @@
     public void setUp() throws Exception
     {
         address = InetAddress.getByName( "0:0:0:0:0:0:0:1" );
-        inputBuffer = ByteBuffer.allocate( address.getAddress().length );
+        inputBuffer = IoBuffer.allocate( address.getAddress().length );
         inputBuffer.put( address.getAddress() );
         inputBuffer.flip();
 

Modified: directory/apacheds/branches/apacheds-mina2/protocol-dns/src/test/java/org/apache/directory/server/dns/io/decoder/MailExchangeRecordDecoderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mina2/protocol-dns/src/test/java/org/apache/directory/server/dns/io/decoder/MailExchangeRecordDecoderTest.java?rev=704263&r1=704262&r2=704263&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mina2/protocol-dns/src/test/java/org/apache/directory/server/dns/io/decoder/MailExchangeRecordDecoderTest.java (original)
+++ directory/apacheds/branches/apacheds-mina2/protocol-dns/src/test/java/org/apache/directory/server/dns/io/decoder/MailExchangeRecordDecoderTest.java Mon Oct 13 14:34:35 2008
@@ -26,7 +26,7 @@
 import junit.framework.TestCase;
 
 import org.apache.directory.server.dns.store.DnsAttribute;
-import org.apache.mina.common.ByteBuffer;
+import org.apache.mina.core.buffer.IoBuffer;
 
 
 /**
@@ -37,7 +37,7 @@
  */
 public class MailExchangeRecordDecoderTest extends TestCase
 {
-    ByteBuffer inputBuffer;
+    IoBuffer inputBuffer;
 
     short preference = 10;
     String domainName = "herse.apache.org";
@@ -49,7 +49,7 @@
 
     public void setUp()
     {
-        inputBuffer = ByteBuffer.allocate( 128 );
+        inputBuffer = IoBuffer.allocate( 128 );
         inputBuffer.putShort( preference );
         inputBuffer.put( ( byte ) domainNameParts[0].length() );
         inputBuffer.put( domainNameParts[0].getBytes() );

Modified: directory/apacheds/branches/apacheds-mina2/protocol-dns/src/test/java/org/apache/directory/server/dns/io/decoder/NameServerRecordDecoderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mina2/protocol-dns/src/test/java/org/apache/directory/server/dns/io/decoder/NameServerRecordDecoderTest.java?rev=704263&r1=704262&r2=704263&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mina2/protocol-dns/src/test/java/org/apache/directory/server/dns/io/decoder/NameServerRecordDecoderTest.java (original)
+++ directory/apacheds/branches/apacheds-mina2/protocol-dns/src/test/java/org/apache/directory/server/dns/io/decoder/NameServerRecordDecoderTest.java Mon Oct 13 14:34:35 2008
@@ -26,7 +26,7 @@
 import junit.framework.TestCase;
 
 import org.apache.directory.server.dns.store.DnsAttribute;
-import org.apache.mina.common.ByteBuffer;
+import org.apache.mina.core.buffer.IoBuffer;
 
 
 /**
@@ -37,7 +37,7 @@
  */
 public class NameServerRecordDecoderTest extends TestCase
 {
-    ByteBuffer inputBuffer;
+    IoBuffer inputBuffer;
 
     String domainName = "ns.hyperreal.org";
     String[] domainNameParts = new String[]
@@ -48,7 +48,7 @@
 
     public void setUp()
     {
-        inputBuffer = ByteBuffer.allocate( 128 );
+        inputBuffer = IoBuffer.allocate( 128 );
         inputBuffer.put( ( byte ) domainNameParts[0].length() );
         inputBuffer.put( domainNameParts[0].getBytes() );
         inputBuffer.put( ( byte ) domainNameParts[1].length() );

Modified: directory/apacheds/branches/apacheds-mina2/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/AbstractResourceRecordEncoderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mina2/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/AbstractResourceRecordEncoderTest.java?rev=704263&r1=704262&r2=704263&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mina2/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/AbstractResourceRecordEncoderTest.java (original)
+++ directory/apacheds/branches/apacheds-mina2/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/AbstractResourceRecordEncoderTest.java Mon Oct 13 14:34:35 2008
@@ -30,7 +30,7 @@
 import org.apache.directory.server.dns.messages.RecordType;
 import org.apache.directory.server.dns.messages.ResourceRecord;
 import org.apache.directory.server.dns.messages.ResourceRecordImpl;
-import org.apache.mina.common.ByteBuffer;
+import org.apache.mina.core.buffer.IoBuffer;
 
 
 /**
@@ -43,7 +43,7 @@
  */
 public abstract class AbstractResourceRecordEncoderTest extends TestCase
 {
-    ByteBuffer expectedData;
+    IoBuffer expectedData;
     String domainName = "herse.apache.org";
     String[] domainNameParts = domainName.split( "\\." );
     int timeToLive = 3400;
@@ -55,7 +55,7 @@
         setUpResourceData();
         record = new ResourceRecordImpl( domainName, RecordType.A, RecordClass.IN, timeToLive, getAttributes() );
 
-        expectedData = ByteBuffer.allocate( 128 );
+        expectedData = IoBuffer.allocate( 128 );
         expectedData.put( ( byte ) 18 );
         expectedData.put( ( byte ) domainNameParts[0].length() ); // 1
         expectedData.put( domainNameParts[0].getBytes() ); // + 5
@@ -73,7 +73,7 @@
 
     public void testEncode() throws IOException
     {
-        ByteBuffer outBuffer = ByteBuffer.allocate( 128 );
+        IoBuffer outBuffer = IoBuffer.allocate( 128 );
         getEncoder().put( outBuffer, record );
         assertEquals( expectedData, outBuffer );
     }
@@ -108,5 +108,5 @@
      * 
      * @param expectedData buffer where the expected resource data should be put
      */
-    protected abstract void putExpectedResourceData( ByteBuffer expectedData );
+    protected abstract void putExpectedResourceData( IoBuffer expectedData );
 }

Modified: directory/apacheds/branches/apacheds-mina2/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/AddressRecordEncoderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mina2/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/AddressRecordEncoderTest.java?rev=704263&r1=704262&r2=704263&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mina2/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/AddressRecordEncoderTest.java (original)
+++ directory/apacheds/branches/apacheds-mina2/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/AddressRecordEncoderTest.java Mon Oct 13 14:34:35 2008
@@ -27,7 +27,7 @@
 import java.util.Map;
 
 import org.apache.directory.server.dns.store.DnsAttribute;
-import org.apache.mina.common.ByteBuffer;
+import org.apache.mina.core.buffer.IoBuffer;
 
 
 /**
@@ -68,7 +68,7 @@
     }
 
 
-    protected void putExpectedResourceData( ByteBuffer expectedData )
+    protected void putExpectedResourceData( IoBuffer expectedData )
     {
         expectedData.put( ( byte ) address.getAddress().length );
         expectedData.put( address.getAddress() );

Modified: directory/apacheds/branches/apacheds-mina2/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/CanonicalNameRecordEncoderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mina2/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/CanonicalNameRecordEncoderTest.java?rev=704263&r1=704262&r2=704263&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mina2/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/CanonicalNameRecordEncoderTest.java (original)
+++ directory/apacheds/branches/apacheds-mina2/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/CanonicalNameRecordEncoderTest.java Mon Oct 13 14:34:35 2008
@@ -45,7 +45,7 @@
 import java.util.Map;
 
 import org.apache.directory.server.dns.store.DnsAttribute;
-import org.apache.mina.common.ByteBuffer;
+import org.apache.mina.core.buffer.IoBuffer;
 
 
 /**
@@ -74,7 +74,7 @@
     }
 
 
-    protected void putExpectedResourceData( ByteBuffer expectedData )
+    protected void putExpectedResourceData( IoBuffer expectedData )
     {
         expectedData.put( ( byte ) 18 );
         expectedData.put( ( byte ) cnameParts[0].length() ); // 1

Modified: directory/apacheds/branches/apacheds-mina2/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/MailExchangeRecordEncoderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mina2/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/MailExchangeRecordEncoderTest.java?rev=704263&r1=704262&r2=704263&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mina2/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/MailExchangeRecordEncoderTest.java (original)
+++ directory/apacheds/branches/apacheds-mina2/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/MailExchangeRecordEncoderTest.java Mon Oct 13 14:34:35 2008
@@ -25,7 +25,7 @@
 import java.util.Map;
 
 import org.apache.directory.server.dns.store.DnsAttribute;
-import org.apache.mina.common.ByteBuffer;
+import org.apache.mina.core.buffer.IoBuffer;
 
 
 /**
@@ -56,7 +56,7 @@
     }
 
 
-    protected void putExpectedResourceData( ByteBuffer expectedData )
+    protected void putExpectedResourceData( IoBuffer expectedData )
     {
         expectedData.put( ( byte ) 20 );
         expectedData.putShort( Short.parseShort( mxPreference ) );

Modified: directory/apacheds/branches/apacheds-mina2/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/NameServerRecordEncoderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mina2/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/NameServerRecordEncoderTest.java?rev=704263&r1=704262&r2=704263&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mina2/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/NameServerRecordEncoderTest.java (original)
+++ directory/apacheds/branches/apacheds-mina2/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/NameServerRecordEncoderTest.java Mon Oct 13 14:34:35 2008
@@ -25,7 +25,7 @@
 import java.util.Map;
 
 import org.apache.directory.server.dns.store.DnsAttribute;
-import org.apache.mina.common.ByteBuffer;
+import org.apache.mina.core.buffer.IoBuffer;
 
 
 /**
@@ -54,7 +54,7 @@
     }
 
 
-    protected void putExpectedResourceData( ByteBuffer expectedData )
+    protected void putExpectedResourceData( IoBuffer expectedData )
     {
         expectedData.put( ( byte ) 19 );
         expectedData.put( ( byte ) nsParts[0].length() ); // 1

Modified: directory/apacheds/branches/apacheds-mina2/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/PointerRecordEncoderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mina2/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/PointerRecordEncoderTest.java?rev=704263&r1=704262&r2=704263&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mina2/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/PointerRecordEncoderTest.java (original)
+++ directory/apacheds/branches/apacheds-mina2/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/PointerRecordEncoderTest.java Mon Oct 13 14:34:35 2008
@@ -25,7 +25,7 @@
 import java.util.Map;
 
 import org.apache.directory.server.dns.store.DnsAttribute;
-import org.apache.mina.common.ByteBuffer;
+import org.apache.mina.core.buffer.IoBuffer;
 
 
 /**
@@ -54,7 +54,7 @@
     }
 
 
-    protected void putExpectedResourceData( ByteBuffer expectedData )
+    protected void putExpectedResourceData( IoBuffer expectedData )
     {
         expectedData.put( ( byte ) 15 );
         expectedData.put( ( byte ) ptrParts[0].length() ); // 1

Modified: directory/apacheds/branches/apacheds-mina2/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/QuestionRecordEncoderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mina2/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/QuestionRecordEncoderTest.java?rev=704263&r1=704262&r2=704263&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mina2/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/QuestionRecordEncoderTest.java (original)
+++ directory/apacheds/branches/apacheds-mina2/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/QuestionRecordEncoderTest.java Mon Oct 13 14:34:35 2008
@@ -26,7 +26,7 @@
 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;
+import org.apache.mina.core.buffer.IoBuffer;
 
 
 /**
@@ -37,7 +37,7 @@
  */
 public class QuestionRecordEncoderTest extends TestCase
 {
-    ByteBuffer expectedData;
+    IoBuffer expectedData;
 
     QuestionRecordEncoder encoder;
 
@@ -53,7 +53,7 @@
     {
         encoder = new QuestionRecordEncoder();
 
-        expectedData = ByteBuffer.allocate( 128 );
+        expectedData = IoBuffer.allocate( 128 );
         expectedData.put( ( byte ) nameParts[0].length() ); // 1
         expectedData.put( nameParts[0].getBytes() ); // + 3
         expectedData.put( ( byte ) nameParts[1].length() ); // + 1
@@ -68,7 +68,7 @@
 
     public void testEncode()
     {
-        ByteBuffer out = ByteBuffer.allocate( 128 );
+        IoBuffer out = IoBuffer.allocate( 128 );
         encoder.put( out, record );
         assertEquals( expectedData, out );
     }

Modified: directory/apacheds/branches/apacheds-mina2/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/ServerSelectionRecordEncoderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mina2/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/ServerSelectionRecordEncoderTest.java?rev=704263&r1=704262&r2=704263&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mina2/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/ServerSelectionRecordEncoderTest.java (original)
+++ directory/apacheds/branches/apacheds-mina2/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/ServerSelectionRecordEncoderTest.java Mon Oct 13 14:34:35 2008
@@ -25,7 +25,7 @@
 import java.util.Map;
 
 import org.apache.directory.server.dns.store.DnsAttribute;
-import org.apache.mina.common.ByteBuffer;
+import org.apache.mina.core.buffer.IoBuffer;
 
 
 /**
@@ -63,7 +63,7 @@
 
 
     @Override
-    protected void putExpectedResourceData( ByteBuffer expectedData )
+    protected void putExpectedResourceData( IoBuffer expectedData )
     {
         expectedData.put( ( byte ) 22 );
         expectedData.putShort( Short.parseShort( priority ) );

Modified: directory/apacheds/branches/apacheds-mina2/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/StartOfAuthorityRecordEncoderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mina2/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/StartOfAuthorityRecordEncoderTest.java?rev=704263&r1=704262&r2=704263&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mina2/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/StartOfAuthorityRecordEncoderTest.java (original)
+++ directory/apacheds/branches/apacheds-mina2/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/StartOfAuthorityRecordEncoderTest.java Mon Oct 13 14:34:35 2008
@@ -25,7 +25,7 @@
 import java.util.Map;
 
 import org.apache.directory.server.dns.store.DnsAttribute;
-import org.apache.mina.common.ByteBuffer;
+import org.apache.mina.core.buffer.IoBuffer;
 
 
 /**
@@ -67,7 +67,7 @@
     }
 
 
-    protected void putExpectedResourceData( ByteBuffer expectedData )
+    protected void putExpectedResourceData( IoBuffer expectedData )
     {
         expectedData.put( ( byte ) 60 ); // 1 + 18 + 1 + 20 + 4 + 4 + 4 + 4 + 4
         expectedData.put( ( byte ) mNameParts[0].length() ); // 1

Modified: directory/apacheds/branches/apacheds-mina2/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/TextRecordEncoderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mina2/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/TextRecordEncoderTest.java?rev=704263&r1=704262&r2=704263&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mina2/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/TextRecordEncoderTest.java (original)
+++ directory/apacheds/branches/apacheds-mina2/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/TextRecordEncoderTest.java Mon Oct 13 14:34:35 2008
@@ -25,7 +25,7 @@
 import java.util.Map;
 
 import org.apache.directory.server.dns.store.DnsAttribute;
-import org.apache.mina.common.ByteBuffer;
+import org.apache.mina.core.buffer.IoBuffer;
 
 
 /**
@@ -53,7 +53,7 @@
     }
 
 
-    protected void putExpectedResourceData( ByteBuffer expectedData )
+    protected void putExpectedResourceData( IoBuffer expectedData )
     {
         expectedData.put( ( byte ) ( characterString.length() + 1 ) );
         expectedData.put( ( byte ) characterString.length() );

Modified: directory/apacheds/branches/apacheds-mina2/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/KdcServer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mina2/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/KdcServer.java?rev=704263&r1=704262&r2=704263&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mina2/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/KdcServer.java (original)
+++ directory/apacheds/branches/apacheds-mina2/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/KdcServer.java Mon Oct 13 14:34:35 2008
@@ -33,8 +33,6 @@
 import org.apache.directory.server.kerberos.shared.store.DirectoryPrincipalStore;
 import org.apache.directory.server.kerberos.shared.store.PrincipalStore;
 import org.apache.directory.server.protocol.shared.DirectoryBackedService;
-import org.apache.mina.transport.socket.nio.DatagramAcceptorConfig;
-import org.apache.mina.transport.socket.nio.SocketAcceptorConfig;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -435,29 +433,18 @@
         store = new DirectoryPrincipalStore( getDirectoryService() );
 
         
-//        if ( isCatelogBased() )
-//        {
-//            store = new JndiPrincipalStoreImpl( getSearchBaseDn(), null, getDirectoryService() );
-//        }
-//        else
-//        {
-//            store = new JndiPrincipalStoreImpl( null, getSearchBaseDn(), getDirectoryService() );
-//        }
-        
-        
-
         if ( getDatagramAcceptor() != null )
         {
-            DatagramAcceptorConfig udpConfig = new DatagramAcceptorConfig();
-            getDatagramAcceptor().bind( new InetSocketAddress( getIpPort() ), new KerberosProtocolHandler( this, store ), udpConfig );
+            getDatagramAcceptor().setHandler( new KerberosProtocolHandler( this, store ) );
+            getDatagramAcceptor().bind( new InetSocketAddress( getIpPort() ) );
         }
 
         if ( getSocketAcceptor() != null )
         {
-            SocketAcceptorConfig tcpConfig = new SocketAcceptorConfig();
-            tcpConfig.setDisconnectOnUnbind( false );
-            tcpConfig.setReuseAddress( true );
-            getSocketAcceptor().bind( new InetSocketAddress( getIpPort() ), new KerberosProtocolHandler( this, store ), tcpConfig );
+            getSocketAcceptor().setCloseOnDeactivation( false );
+            getSocketAcceptor().setReuseAddress( true );
+            getSocketAcceptor().setHandler( new KerberosProtocolHandler( this, store ) );
+            getSocketAcceptor().bind( new InetSocketAddress( getIpPort() ) );
         }
         
         LOG.info( "Kerberos service started." );

Modified: directory/apacheds/branches/apacheds-mina2/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosProtocolHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mina2/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosProtocolHandler.java?rev=704263&r1=704262&r2=704263&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mina2/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosProtocolHandler.java (original)
+++ directory/apacheds/branches/apacheds-mina2/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosProtocolHandler.java Mon Oct 13 14:34:35 2008
@@ -38,10 +38,9 @@
 import org.apache.directory.server.kerberos.shared.messages.KdcRequest;
 import org.apache.directory.server.kerberos.shared.messages.value.KerberosTime;
 import org.apache.directory.server.kerberos.shared.store.PrincipalStore;
-import org.apache.mina.common.IdleStatus;
-import org.apache.mina.common.IoHandler;
-import org.apache.mina.common.IoSession;
-import org.apache.mina.common.TransportType;
+import org.apache.mina.core.service.IoHandler;
+import org.apache.mina.core.session.IdleStatus;
+import org.apache.mina.core.session.IoSession;
 import org.apache.mina.filter.codec.ProtocolCodecFilter;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -81,10 +80,10 @@
     {
         if ( log.isDebugEnabled() )
         {
-            log.debug( "{} CREATED:  {}", session.getRemoteAddress(), session.getTransportType() );
+            log.debug( "{} CREATED:  {}", session.getRemoteAddress(), session.getTransportMetadata() );
         }
 
-        if ( session.getTransportType() == TransportType.DATAGRAM )
+        if ( session.getTransportMetadata().isConnectionless() )
         {
             session.getFilterChain().addFirst( "codec",
                 new ProtocolCodecFilter( KerberosUdpProtocolCodecFactory.getInstance() ) );

Modified: directory/apacheds/branches/apacheds-mina2/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosTcpDecoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mina2/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosTcpDecoder.java?rev=704263&r1=704262&r2=704263&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mina2/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosTcpDecoder.java (original)
+++ directory/apacheds/branches/apacheds-mina2/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosTcpDecoder.java Mon Oct 13 14:34:35 2008
@@ -21,9 +21,8 @@
 
 
 import org.apache.directory.server.kerberos.shared.io.decoder.KdcRequestDecoder;
-import org.apache.mina.common.BufferDataException;
-import org.apache.mina.common.ByteBuffer;
-import org.apache.mina.common.IoSession;
+import org.apache.mina.core.buffer.IoBuffer;
+import org.apache.mina.core.session.IoSession;
 import org.apache.mina.filter.codec.CumulativeProtocolDecoder;
 import org.apache.mina.filter.codec.ProtocolDecoderOutput;
 
@@ -76,7 +75,7 @@
 
 
     @Override
-    protected boolean doDecode( IoSession session, ByteBuffer in, ProtocolDecoderOutput out ) throws Exception
+    protected boolean doDecode( IoSession session, IoBuffer in, ProtocolDecoderOutput out ) throws Exception
     {
         if ( !in.prefixedDataAvailable( 4, maxObjectSize ) )
         {

Modified: directory/apacheds/branches/apacheds-mina2/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosTcpEncoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mina2/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosTcpEncoder.java?rev=704263&r1=704262&r2=704263&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mina2/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosTcpEncoder.java (original)
+++ directory/apacheds/branches/apacheds-mina2/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosTcpEncoder.java Mon Oct 13 14:34:35 2008
@@ -26,8 +26,8 @@
 import org.apache.directory.server.kerberos.shared.io.encoder.KdcReplyEncoder;
 import org.apache.directory.server.kerberos.shared.messages.ErrorMessage;
 import org.apache.directory.server.kerberos.shared.messages.KdcReply;
-import org.apache.mina.common.ByteBuffer;
-import org.apache.mina.common.IoSession;
+import org.apache.mina.core.buffer.IoBuffer;
+import org.apache.mina.core.session.IoSession;
 import org.apache.mina.filter.codec.ProtocolEncoderAdapter;
 import org.apache.mina.filter.codec.ProtocolEncoderOutput;
 
@@ -44,7 +44,7 @@
 
     public void encode( IoSession session, Object message, ProtocolEncoderOutput out ) throws IOException
     {
-        ByteBuffer buf = ByteBuffer.allocate( 1024 );
+        IoBuffer buf = IoBuffer.allocate( 1024 );
 
         // make space for int length
         buf.putInt( 0 );

Modified: directory/apacheds/branches/apacheds-mina2/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosTcpProtocolCodecFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mina2/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosTcpProtocolCodecFactory.java?rev=704263&r1=704262&r2=704263&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mina2/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosTcpProtocolCodecFactory.java (original)
+++ directory/apacheds/branches/apacheds-mina2/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosTcpProtocolCodecFactory.java Mon Oct 13 14:34:35 2008
@@ -20,6 +20,7 @@
 package org.apache.directory.server.kerberos.protocol;
 
 
+import org.apache.mina.core.session.IoSession;
 import org.apache.mina.filter.codec.ProtocolCodecFactory;
 import org.apache.mina.filter.codec.ProtocolDecoder;
 import org.apache.mina.filter.codec.ProtocolEncoder;
@@ -51,14 +52,14 @@
     }
 
 
-    public ProtocolEncoder getEncoder()
+    public ProtocolEncoder getEncoder( IoSession session )
     {
         // Create a new encoder.
         return new KerberosTcpEncoder();
     }
 
 
-    public ProtocolDecoder getDecoder()
+    public ProtocolDecoder getDecoder( IoSession session )
     {
         // Create a new decoder.
         return new KerberosTcpDecoder();

Modified: directory/apacheds/branches/apacheds-mina2/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosUdpDecoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mina2/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosUdpDecoder.java?rev=704263&r1=704262&r2=704263&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mina2/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosUdpDecoder.java (original)
+++ directory/apacheds/branches/apacheds-mina2/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosUdpDecoder.java Mon Oct 13 14:34:35 2008
@@ -23,8 +23,8 @@
 import java.io.IOException;
 
 import org.apache.directory.server.kerberos.shared.io.decoder.KdcRequestDecoder;
-import org.apache.mina.common.ByteBuffer;
-import org.apache.mina.common.IoSession;
+import org.apache.mina.core.buffer.IoBuffer;
+import org.apache.mina.core.session.IoSession;
 import org.apache.mina.filter.codec.ProtocolDecoderAdapter;
 import org.apache.mina.filter.codec.ProtocolDecoderOutput;
 
@@ -38,7 +38,7 @@
     private KdcRequestDecoder decoder = new KdcRequestDecoder();
 
 
-    public void decode( IoSession session, ByteBuffer in, ProtocolDecoderOutput out ) throws IOException
+    public void decode( IoSession session, IoBuffer in, ProtocolDecoderOutput out ) throws IOException
     {
         out.write( decoder.decode( in.buf() ) );
     }

Modified: directory/apacheds/branches/apacheds-mina2/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosUdpEncoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mina2/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosUdpEncoder.java?rev=704263&r1=704262&r2=704263&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mina2/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosUdpEncoder.java (original)
+++ directory/apacheds/branches/apacheds-mina2/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosUdpEncoder.java Mon Oct 13 14:34:35 2008
@@ -26,8 +26,8 @@
 import org.apache.directory.server.kerberos.shared.io.encoder.KdcReplyEncoder;
 import org.apache.directory.server.kerberos.shared.messages.ErrorMessage;
 import org.apache.directory.server.kerberos.shared.messages.KdcReply;
-import org.apache.mina.common.ByteBuffer;
-import org.apache.mina.common.IoSession;
+import org.apache.mina.core.buffer.IoBuffer;
+import org.apache.mina.core.session.IoSession;
 import org.apache.mina.filter.codec.ProtocolEncoderAdapter;
 import org.apache.mina.filter.codec.ProtocolEncoderOutput;
 
@@ -44,7 +44,7 @@
 
     public void encode( IoSession session, Object message, ProtocolEncoderOutput out ) throws IOException
     {
-        ByteBuffer buf = ByteBuffer.allocate( 1024 );
+        IoBuffer buf = IoBuffer.allocate( 1024 );
 
         if ( message instanceof KdcReply )
         {

Modified: directory/apacheds/branches/apacheds-mina2/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosUdpProtocolCodecFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mina2/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosUdpProtocolCodecFactory.java?rev=704263&r1=704262&r2=704263&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mina2/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosUdpProtocolCodecFactory.java (original)
+++ directory/apacheds/branches/apacheds-mina2/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosUdpProtocolCodecFactory.java Mon Oct 13 14:34:35 2008
@@ -20,6 +20,7 @@
 package org.apache.directory.server.kerberos.protocol;
 
 
+import org.apache.mina.core.session.IoSession;
 import org.apache.mina.filter.codec.ProtocolCodecFactory;
 import org.apache.mina.filter.codec.ProtocolDecoder;
 import org.apache.mina.filter.codec.ProtocolEncoder;
@@ -51,14 +52,14 @@
     }
 
 
-    public ProtocolEncoder getEncoder()
+    public ProtocolEncoder getEncoder( IoSession session )
     {
         // Create a new encoder.
         return new KerberosUdpEncoder();
     }
 
 
-    public ProtocolDecoder getDecoder()
+    public ProtocolDecoder getDecoder( IoSession session )
     {
         // Create a new decoder.
         return new KerberosUdpDecoder();

Modified: directory/apacheds/branches/apacheds-mina2/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/AbstractAuthenticationServiceTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mina2/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/AbstractAuthenticationServiceTest.java?rev=704263&r1=704262&r2=704263&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mina2/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/AbstractAuthenticationServiceTest.java (original)
+++ directory/apacheds/branches/apacheds-mina2/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/AbstractAuthenticationServiceTest.java Mon Oct 13 14:34:35 2008
@@ -41,14 +41,14 @@
 import org.apache.directory.server.kerberos.shared.messages.value.PrincipalName;
 import org.apache.directory.server.kerberos.shared.messages.value.types.PaDataType;
 import org.apache.directory.server.kerberos.shared.messages.value.types.PrincipalNameType;
-import org.apache.mina.common.IoFilterChain;
-import org.apache.mina.common.IoHandler;
-import org.apache.mina.common.IoService;
-import org.apache.mina.common.IoServiceConfig;
-import org.apache.mina.common.IoSessionConfig;
-import org.apache.mina.common.TransportType;
-import org.apache.mina.common.WriteFuture;
-import org.apache.mina.common.support.BaseIoSession;
+import org.apache.mina.core.filterchain.IoFilterChain;
+import org.apache.mina.core.service.IoHandler;
+import org.apache.mina.core.service.IoProcessor;
+import org.apache.mina.core.service.IoService;
+import org.apache.mina.core.service.TransportMetadata;
+import org.apache.mina.core.session.AbstractIoSession;
+import org.apache.mina.core.session.IoSession;
+import org.apache.mina.core.session.IoSessionConfig;
 
 
 /**
@@ -122,17 +122,14 @@
         return key;
     }
 
-    protected static class DummySession extends BaseIoSession
+    protected static class DummySession extends AbstractIoSession
     {
         Object message;
 
 
-        @Override
-        public WriteFuture write( Object message )
+        public IoProcessor<IoSession> getProcessor()
         {
-            this.message = message;
-
-            return super.write( message );
+            return null;
         }
 
 
@@ -166,7 +163,7 @@
         }
 
 
-        public TransportType getTransportType()
+        public TransportMetadata getTransportMetadata()
         {
             return null;
         }
@@ -200,17 +197,5 @@
         {
             return null;
         }
-
-
-        public IoServiceConfig getServiceConfig()
-        {
-            return null;
-        }
-
-
-        public int getScheduledWriteBytes()
-        {
-            return 0;
-        }
     }
 }

Modified: directory/apacheds/branches/apacheds-mina2/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/AbstractTicketGrantingServiceTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mina2/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/AbstractTicketGrantingServiceTest.java?rev=704263&r1=704262&r2=704263&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mina2/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/AbstractTicketGrantingServiceTest.java (original)
+++ directory/apacheds/branches/apacheds-mina2/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/AbstractTicketGrantingServiceTest.java Mon Oct 13 14:34:35 2008
@@ -61,14 +61,14 @@
 import org.apache.directory.server.kerberos.shared.messages.value.flags.TicketFlags;
 import org.apache.directory.server.kerberos.shared.messages.value.types.PaDataType;
 import org.apache.directory.server.kerberos.shared.messages.value.types.PrincipalNameType;
-import org.apache.mina.common.IoFilterChain;
-import org.apache.mina.common.IoHandler;
-import org.apache.mina.common.IoService;
-import org.apache.mina.common.IoServiceConfig;
-import org.apache.mina.common.IoSessionConfig;
-import org.apache.mina.common.TransportType;
-import org.apache.mina.common.WriteFuture;
-import org.apache.mina.common.support.BaseIoSession;
+import org.apache.mina.core.filterchain.IoFilterChain;
+import org.apache.mina.core.service.IoHandler;
+import org.apache.mina.core.service.IoProcessor;
+import org.apache.mina.core.service.IoService;
+import org.apache.mina.core.service.TransportMetadata;
+import org.apache.mina.core.session.AbstractIoSession;
+import org.apache.mina.core.session.IoSession;
+import org.apache.mina.core.session.IoSessionConfig;
 
 
 /**
@@ -324,17 +324,14 @@
         return principalName;
     }
 
-    protected static class DummySession extends BaseIoSession
+    protected static class DummySession extends AbstractIoSession
     {
         Object message;
 
 
-        @Override
-        public WriteFuture write( Object message )
+        public IoProcessor<IoSession> getProcessor()
         {
-            this.message = message;
-
-            return super.write( message );
+            return null;
         }
 
 
@@ -368,7 +365,7 @@
         }
 
 
-        public TransportType getTransportType()
+        public TransportMetadata getTransportMetadata()
         {
             return null;
         }
@@ -402,17 +399,5 @@
         {
             return null;
         }
-
-
-        public IoServiceConfig getServiceConfig()
-        {
-            return null;
-        }
-
-
-        public int getScheduledWriteBytes()
-        {
-            return 0;
-        }
     }
 }

Modified: directory/apacheds/branches/apacheds-mina2/protocol-ldap/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mina2/protocol-ldap/pom.xml?rev=704263&r1=704262&r2=704263&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mina2/protocol-ldap/pom.xml (original)
+++ directory/apacheds/branches/apacheds-mina2/protocol-ldap/pom.xml Mon Oct 13 14:34:35 2008
@@ -47,11 +47,6 @@
     </dependency>
 
     <dependency>
-      <groupId>org.apache.mina</groupId>
-      <artifactId>mina-filter-ssl</artifactId>
-    </dependency>
-
-    <dependency>
       <groupId>org.apache.directory.server</groupId>
       <artifactId>apacheds-kerberos-shared</artifactId>
       <version>${pom.version}</version>

Modified: directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapProtocolCodecFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapProtocolCodecFactory.java?rev=704263&r1=704262&r2=704263&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapProtocolCodecFactory.java (original)
+++ directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapProtocolCodecFactory.java Mon Oct 13 14:34:35 2008
@@ -28,6 +28,7 @@
 import org.apache.directory.shared.ldap.message.MessageEncoder;
 import org.apache.directory.shared.ldap.message.spi.BinaryAttributeDetector;
 import org.apache.directory.shared.ldap.schema.AttributeType;
+import org.apache.mina.core.session.IoSession;
 import org.apache.mina.filter.codec.ProtocolCodecFactory;
 import org.apache.mina.filter.codec.ProtocolDecoder;
 import org.apache.mina.filter.codec.ProtocolEncoder;
@@ -61,7 +62,7 @@
      * (non-Javadoc)
      * @see org.apache.mina.filter.codec.ProtocolCodecFactory#getEncoder()
      */
-    public ProtocolEncoder getEncoder()
+    public ProtocolEncoder getEncoder( IoSession session )
     {
         return new Asn1CodecEncoder( new MessageEncoder() );
     }
@@ -71,7 +72,7 @@
      * (non-Javadoc)
      * @see org.apache.mina.filter.codec.ProtocolCodecFactory#getDecoder()
      */
-    public ProtocolDecoder getDecoder()
+    public ProtocolDecoder getDecoder( IoSession session )
     {
         return new Asn1CodecDecoder( new MessageDecoder( new BinaryAttributeDetector()
         {

Modified: directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapProtocolHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapProtocolHandler.java?rev=704263&r1=704262&r2=704263&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapProtocolHandler.java (original)
+++ directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapProtocolHandler.java Mon Oct 13 14:34:35 2008
@@ -31,13 +31,11 @@
 import org.apache.directory.shared.ldap.message.ResultResponse;
 import org.apache.directory.shared.ldap.message.ResultResponseRequest;
 import org.apache.directory.shared.ldap.message.extended.NoticeOfDisconnect;
-import org.apache.mina.common.IoFilterChain;
-import org.apache.mina.common.IoHandler;
-import org.apache.mina.common.IoSession;
-import org.apache.mina.filter.SSLFilter;
+import org.apache.mina.core.filterchain.IoFilterChain;
+import org.apache.mina.core.session.IoSession;
 import org.apache.mina.filter.codec.ProtocolCodecFilter;
+import org.apache.mina.filter.ssl.SslFilter;
 import org.apache.mina.handler.demux.DemuxingIoHandler;
-import org.apache.mina.util.SessionLog;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -146,14 +144,14 @@
         // and degrade authentication level to 'anonymous' as specified
         // in the RFC, and this is no threat.
 
-        if ( message == SSLFilter.SESSION_SECURED )
+        if ( message == SslFilter.SESSION_SECURED )
         {
             ExtendedRequest req = new ExtendedRequestImpl( 0 );
             req.setOid( "1.3.6.1.4.1.1466.20037" );
             req.setPayload( "SECURED".getBytes( "ISO-8859-1" ) );
             message = req;
         }
-        else if ( message == SSLFilter.SESSION_UNSECURED )
+        else if ( message == SslFilter.SESSION_UNSECURED )
         {
             ExtendedRequest req = new ExtendedRequestImpl( 0 );
             req.setOid( "1.3.6.1.4.1.1466.20037" );
@@ -199,8 +197,7 @@
             }                
         }
         
-        SessionLog.warn( session,
-            "Unexpected exception forcing session to close: sending disconnect notice to client.", cause );
+        LOG.warn( "Unexpected exception forcing session to close: sending disconnect notice to client.", cause );
 
         session.write( NoticeOfDisconnect.PROTOCOLERROR );
         LdapSession ldapSession = this.ldapService.getLdapSessionManager().removeLdapSession( session );

Modified: directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapService.java?rev=704263&r1=704262&r2=704263&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapService.java (original)
+++ directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapService.java Mon Oct 13 14:34:35 2008
@@ -64,15 +64,13 @@
 import org.apache.directory.shared.ldap.message.control.PersistentSearchControl;
 import org.apache.directory.shared.ldap.message.control.SubentriesControl;
 import org.apache.directory.shared.ldap.message.extended.NoticeOfDisconnect;
-import org.apache.mina.common.DefaultIoFilterChainBuilder;
-import org.apache.mina.common.IoFilterChainBuilder;
-import org.apache.mina.common.IoHandler;
-import org.apache.mina.common.IoSession;
-import org.apache.mina.common.ThreadModel;
-import org.apache.mina.common.WriteFuture;
+import org.apache.mina.core.filterchain.DefaultIoFilterChainBuilder;
+import org.apache.mina.core.filterchain.IoFilterChainBuilder;
+import org.apache.mina.core.future.WriteFuture;
+import org.apache.mina.core.service.IoHandler;
+import org.apache.mina.core.session.IoSession;
 import org.apache.mina.filter.codec.ProtocolCodecFactory;
 import org.apache.mina.handler.demux.MessageHandler;
-import org.apache.mina.transport.socket.nio.SocketAcceptorConfig;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -354,7 +352,7 @@
             try
             {
                 sessions = new ArrayList<IoSession>(
-                        getSocketAcceptor().getManagedSessions( new InetSocketAddress( getIpPort() ) ) );
+                        getSocketAcceptor().getManagedSessions().values() );
             }
             catch ( IllegalArgumentException e )
             {
@@ -384,7 +382,7 @@
 
             for ( WriteFuture future:writeFutures )
             {
-                future.join( 1000 );
+                future.await( 1000L );
                 sessionIt.next().close();
             }
         }
@@ -422,17 +420,12 @@
 
         try
         {
-            SocketAcceptorConfig acceptorCfg = new SocketAcceptorConfig();
-
             // Disable the disconnection of the clients on unbind
-            acceptorCfg.setDisconnectOnUnbind( false );
-            acceptorCfg.setReuseAddress( true );
-            acceptorCfg.setFilterChainBuilder( chainBuilder );
-            acceptorCfg.setThreadModel( ThreadModel.MANUAL );
-
-            acceptorCfg.getSessionConfig().setTcpNoDelay( true );
-
-            getSocketAcceptor().bind( new InetSocketAddress( port ), getHandler(), acceptorCfg );
+            getSocketAcceptor().setCloseOnDeactivation( false );
+            getSocketAcceptor().getSessionConfig().setTcpNoDelay( true );
+            getSocketAcceptor().setFilterChainBuilder( chainBuilder );
+            getSocketAcceptor().setHandler( getHandler() );
+            getSocketAcceptor().bind( new InetSocketAddress( port ) );
             started = true;
 
             if ( LOG.isInfoEnabled() )
@@ -876,10 +869,10 @@
 
     public void setAbandonHandler( LdapRequestHandler<AbandonRequest> abandonHandler )
     {
-        this.handler.removeMessageHandler( AbandonRequest.class );
+        this.handler.removeReceivedMessageHandler( AbandonRequest.class );
         this.abandonHandler = abandonHandler;
         this.abandonHandler.setLdapServer( this );
-        this.handler.addMessageHandler( AbandonRequest.class, this.abandonHandler );
+        this.handler.addReceivedMessageHandler( AbandonRequest.class, this.abandonHandler );
     }
 
 
@@ -891,10 +884,10 @@
 
     public void setAddHandler( LdapRequestHandler<AddRequest> addHandler )
     {
-        this.handler.removeMessageHandler( AddRequest.class );
+        this.handler.removeReceivedMessageHandler( AddRequest.class );
         this.addHandler = addHandler;
         this.addHandler.setLdapServer( this );
-        this.handler.addMessageHandler( AddRequest.class, this.addHandler );
+        this.handler.addReceivedMessageHandler( AddRequest.class, this.addHandler );
     }
 
 
@@ -906,10 +899,10 @@
 
     public void setBindHandler( LdapRequestHandler<BindRequest> bindHandler )
     {
-        this.handler.removeMessageHandler( BindRequest.class );
+        this.handler.removeReceivedMessageHandler( BindRequest.class );
         this.bindHandler = bindHandler;
         this.bindHandler.setLdapServer( this );
-        this.handler.addMessageHandler( BindRequest.class, this.bindHandler );
+        this.handler.addReceivedMessageHandler( BindRequest.class, this.bindHandler );
     }
 
 
@@ -921,10 +914,10 @@
 
     public void setCompareHandler( LdapRequestHandler<CompareRequest> compareHandler )
     {
-        this.handler.removeMessageHandler( CompareRequest.class );
+        this.handler.removeReceivedMessageHandler( CompareRequest.class );
         this.compareHandler = compareHandler;
         this.compareHandler.setLdapServer( this );
-        this.handler.addMessageHandler( CompareRequest.class, this.compareHandler );
+        this.handler.addReceivedMessageHandler( CompareRequest.class, this.compareHandler );
     }
 
 
@@ -936,10 +929,10 @@
 
     public void setDeleteHandler( LdapRequestHandler<DeleteRequest> deleteHandler )
     {
-        this.handler.removeMessageHandler( DeleteRequest.class );
+        this.handler.removeReceivedMessageHandler( DeleteRequest.class );
         this.deleteHandler = deleteHandler;
         this.deleteHandler.setLdapServer( this );
-        this.handler.addMessageHandler( DeleteRequest.class, this.deleteHandler );
+        this.handler.addReceivedMessageHandler( DeleteRequest.class, this.deleteHandler );
     }
 
 
@@ -951,10 +944,10 @@
 
     public void setExtendedHandler( LdapRequestHandler<ExtendedRequest> extendedHandler )
     {
-        this.handler.removeMessageHandler( ExtendedRequest.class );
+        this.handler.removeReceivedMessageHandler( ExtendedRequest.class );
         this.extendedHandler = extendedHandler;
         this.extendedHandler.setLdapServer( this );
-        this.handler.addMessageHandler( ExtendedRequest.class, this.extendedHandler );
+        this.handler.addReceivedMessageHandler( ExtendedRequest.class, this.extendedHandler );
     }
 
 
@@ -966,10 +959,10 @@
 
     public void setModifyHandler( LdapRequestHandler<ModifyRequest> modifyHandler )
     {
-        this.handler.removeMessageHandler( ModifyRequest.class );
+        this.handler.removeReceivedMessageHandler( ModifyRequest.class );
         this.modifyHandler = modifyHandler;
         this.modifyHandler.setLdapServer( this );
-        this.handler.addMessageHandler( ModifyRequest.class, this.modifyHandler );
+        this.handler.addReceivedMessageHandler( ModifyRequest.class, this.modifyHandler );
     }
 
 
@@ -981,10 +974,10 @@
 
     public void setModifyDnHandler( LdapRequestHandler<ModifyDnRequest> modifyDnHandler )
     {
-        this.handler.removeMessageHandler( ModifyDnRequest.class );
+        this.handler.removeReceivedMessageHandler( ModifyDnRequest.class );
         this.modifyDnHandler = modifyDnHandler;
         this.modifyDnHandler.setLdapServer( this );
-        this.handler.addMessageHandler( ModifyDnRequest.class, this.modifyDnHandler );
+        this.handler.addReceivedMessageHandler( ModifyDnRequest.class, this.modifyDnHandler );
     }
 
 
@@ -996,10 +989,10 @@
 
     public void setSearchHandler( LdapRequestHandler<SearchRequest> searchHandler )
     {
-        this.handler.removeMessageHandler( SearchRequest.class );
+        this.handler.removeReceivedMessageHandler( SearchRequest.class );
         this.searchHandler = searchHandler;
         this.searchHandler.setLdapServer( this );
-        this.handler.addMessageHandler( SearchRequest.class, this.searchHandler );
+        this.handler.addReceivedMessageHandler( SearchRequest.class, this.searchHandler );
     }
 
 
@@ -1011,10 +1004,10 @@
 
     public void setUnbindHandler( LdapRequestHandler<UnbindRequest> unbindHandler )
     {
-        this.handler.removeMessageHandler( UnbindRequest.class );
+        this.handler.removeReceivedMessageHandler( UnbindRequest.class );
         this.unbindHandler = unbindHandler;
         this.unbindHandler.setLdapServer( this );
-        this.handler.addMessageHandler( UnbindRequest.class, this.unbindHandler );
+        this.handler.addReceivedMessageHandler( UnbindRequest.class, this.unbindHandler );
     }
 
 

Modified: directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapSession.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapSession.java?rev=704263&r1=704262&r2=704263&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapSession.java (original)
+++ directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapSession.java Mon Oct 13 14:34:35 2008
@@ -28,7 +28,7 @@
 import org.apache.directory.server.core.CoreSession;
 import org.apache.directory.shared.ldap.message.AbandonableRequest;
 import org.apache.directory.shared.ldap.message.BindStatus;
-import org.apache.mina.common.IoSession;
+import org.apache.mina.core.session.IoSession;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

Modified: directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapSessionManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapSessionManager.java?rev=704263&r1=704262&r2=704263&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapSessionManager.java (original)
+++ directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapSessionManager.java Mon Oct 13 14:34:35 2008
@@ -23,7 +23,7 @@
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 
-import org.apache.mina.common.IoSession;
+import org.apache.mina.core.session.IoSession;
 
 
 /**

Modified: directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/gui/SessionsFrame.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/gui/SessionsFrame.java?rev=704263&r1=704262&r2=704263&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/gui/SessionsFrame.java (original)
+++ directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/gui/SessionsFrame.java Mon Oct 13 14:34:35 2008
@@ -50,11 +50,11 @@
 import org.apache.directory.server.ldap.handlers.extended.GracefulShutdownHandler;
 import org.apache.directory.shared.ldap.message.extended.GracefulDisconnect;
 import org.apache.directory.shared.ldap.message.extended.NoticeOfDisconnect;
-import org.apache.mina.common.CloseFuture;
-import org.apache.mina.common.IoAcceptor;
-import org.apache.mina.common.IoHandler;
-import org.apache.mina.common.IoSession;
-import org.apache.mina.common.WriteFuture;
+import org.apache.mina.core.future.CloseFuture;
+import org.apache.mina.core.future.WriteFuture;
+import org.apache.mina.core.service.IoAcceptor;
+import org.apache.mina.core.service.IoHandler;
+import org.apache.mina.core.session.IoSession;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -481,9 +481,9 @@
                     WriteFuture future = selected.getIoSession().write( NoticeOfDisconnect.STRONGAUTHREQUIRED );
                     try
                     {
-                        future.join( 1000 );
+                        future.awaitUninterruptibly( 1000L );
                         CloseFuture cfuture = selected.getIoSession().close();
-                        cfuture.join( 1000 );
+                        cfuture.awaitUninterruptibly( 1000L );
                     }
                     catch ( Exception e1 )
                     {
@@ -726,7 +726,7 @@
                         "Send graceful disconnect before disconnect notice?", JOptionPane.YES_NO_CANCEL_OPTION );
                     IoAcceptor acceptor = ( IoAcceptor ) requestor.getService();
                     List<IoSession> sessions = new ArrayList<IoSession>(
-                            acceptor.getManagedSessions( requestor.getServiceAddress() ) );
+                            acceptor.getManagedSessions().values() );
 
                     if ( input == JOptionPane.CANCEL_OPTION )
                     {
@@ -826,7 +826,8 @@
                 {
                     try
                     {
-                        ( ( IoAcceptor ) requestor.getService() ).bind( requestor.getServiceAddress(), getLdapProvider() );
+                        ( ( IoAcceptor ) requestor.getService() ).setHandler( getLdapProvider() );
+                        ( ( IoAcceptor ) requestor.getService() ).bind( requestor.getServiceAddress() );
                         JOptionPane.showMessageDialog( SessionsFrame.this, "Ldap service " + requestor.getServiceAddress()
                             + " has been successfully bound.\n" + " Clients may now connect to the server once again.",
                             "Success!", JOptionPane.INFORMATION_MESSAGE );

Modified: directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/LdapRequestHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/LdapRequestHandler.java?rev=704263&r1=704262&r2=704263&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/LdapRequestHandler.java (original)
+++ directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/LdapRequestHandler.java Mon Oct 13 14:34:35 2008
@@ -40,8 +40,8 @@
 import org.apache.directory.shared.ldap.message.ResultResponseRequest;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.util.ExceptionUtils;
-import org.apache.mina.common.IoFilterChain;
-import org.apache.mina.common.IoSession;
+import org.apache.mina.core.filterchain.IoFilterChain;
+import org.apache.mina.core.session.IoSession;
 import org.apache.mina.handler.demux.MessageHandler;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -199,6 +199,18 @@
     }
 
     
+    public final void handleMessage( IoSession session, T message ) throws Exception
+    {
+        LdapSession ldapSession = ldapService.getLdapSessionManager().getLdapSession( session );
+        
+        // TODO - session you get from LdapService should have the ldapService 
+        // member already set no?  Should remove these lines where ever they
+        // may be if that's the case.
+        ldapSession.setLdapServer( ldapService );
+        
+        handle( ldapSession, message );
+    }
+    
     /**
      * Handle a Ldap message associated with a session
      * 

Modified: directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/AbstractMechanismHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/AbstractMechanismHandler.java?rev=704263&r1=704262&r2=704263&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/AbstractMechanismHandler.java (original)
+++ directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/AbstractMechanismHandler.java Mon Oct 13 14:34:35 2008
@@ -22,8 +22,8 @@
 import javax.security.sasl.SaslServer;
 
 import org.apache.directory.server.ldap.LdapSession;
-import org.apache.mina.common.IoFilterChain;
-import org.apache.mina.common.IoSession;
+import org.apache.mina.core.filterchain.IoFilterChain;
+import org.apache.mina.core.session.IoSession;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

Modified: directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/AbstractSaslCallbackHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/AbstractSaslCallbackHandler.java?rev=704263&r1=704262&r2=704263&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/AbstractSaslCallbackHandler.java (original)
+++ directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/AbstractSaslCallbackHandler.java Mon Oct 13 14:34:35 2008
@@ -34,7 +34,7 @@
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.util.ExceptionUtils;
 import org.apache.directory.shared.ldap.util.StringTools;
-import org.apache.mina.common.IoSession;
+import org.apache.mina.core.session.IoSession;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

Modified: directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/SaslFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/SaslFilter.java?rev=704263&r1=704262&r2=704263&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/SaslFilter.java (original)
+++ directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/SaslFilter.java Mon Oct 13 14:34:35 2008
@@ -25,9 +25,11 @@
 import javax.security.sasl.SaslServer;
 
 import org.apache.directory.shared.ldap.constants.SaslQoP;
-import org.apache.mina.common.ByteBuffer;
-import org.apache.mina.common.IoFilterAdapter;
-import org.apache.mina.common.IoSession;
+import org.apache.mina.core.buffer.IoBuffer;
+import org.apache.mina.core.filterchain.IoFilterAdapter;
+import org.apache.mina.core.session.IoSession;
+import org.apache.mina.core.write.DefaultWriteRequest;
+import org.apache.mina.core.write.WriteRequest;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -95,14 +97,14 @@
             /*
              * Get the buffer as bytes.  First 4 bytes are length as int.
              */
-            ByteBuffer buf = ( ByteBuffer ) message;
+            IoBuffer buf = ( IoBuffer ) message;
             int bufferLength = buf.getInt();
             byte[] bufferBytes = new byte[bufferLength];
             buf.get( bufferBytes );
 
             log.debug( "Will use SASL to unwrap received message of length:  {}", bufferLength );
             byte[] token = saslServer.unwrap( bufferBytes, 0, bufferBytes.length );
-            nextFilter.messageReceived( session, ByteBuffer.wrap( token ) );
+            nextFilter.messageReceived( session, IoBuffer.wrap( token ) );
         }
         else
         {
@@ -134,14 +136,14 @@
         String qop = ( String ) saslServer.getNegotiatedProperty( Sasl.QOP );
         boolean hasSecurityLayer = ( qop != null && ( qop.equals( SaslQoP.QOP_AUTH_INT ) || qop.equals( SaslQoP.QOP_AUTH_CONF ) ) );
 
-        ByteBuffer saslLayerBuffer = null;
+        IoBuffer saslLayerBuffer = null;
 
         if ( hasSecurityLayer )
         {
             /*
              * Get the buffer as bytes.
              */
-            ByteBuffer buf = ( ByteBuffer ) writeRequest.getMessage();
+            IoBuffer buf = ( IoBuffer ) writeRequest.getMessage();
             int bufferLength = buf.remaining();
             byte[] bufferBytes = new byte[bufferLength];
             buf.get( bufferBytes );
@@ -153,14 +155,14 @@
             /*
              * Prepend 4 byte length.
              */
-            saslLayerBuffer = ByteBuffer.allocate( 4 + saslLayer.length );
+            saslLayerBuffer = IoBuffer.allocate( 4 + saslLayer.length );
             saslLayerBuffer.putInt( saslLayer.length );
             saslLayerBuffer.put( saslLayer );
             saslLayerBuffer.position( 0 );
             saslLayerBuffer.limit( 4 + saslLayer.length );
 
             log.debug( "Sending encrypted token of length {}.", saslLayerBuffer.limit() );
-            nextFilter.filterWrite( session, new WriteRequest( saslLayerBuffer, writeRequest.getFuture() ) );
+            nextFilter.filterWrite( session, new DefaultWriteRequest( saslLayerBuffer, writeRequest.getFuture() ) );
         }
         else
         {

Modified: directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/ntlm/NtlmProvider.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/ntlm/NtlmProvider.java?rev=704263&r1=704262&r2=704263&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/ntlm/NtlmProvider.java (original)
+++ directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/ntlm/NtlmProvider.java Mon Oct 13 14:34:35 2008
@@ -19,8 +19,7 @@
  */
 package org.apache.directory.server.ldap.handlers.bind.ntlm;
 
-
-import org.apache.mina.common.IoSession;
+import org.apache.mina.core.session.IoSession;
 
 
 /**

Modified: directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/GracefulShutdownHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/GracefulShutdownHandler.java?rev=704263&r1=704262&r2=704263&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/GracefulShutdownHandler.java (original)
+++ directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/GracefulShutdownHandler.java Mon Oct 13 14:34:35 2008
@@ -36,9 +36,9 @@
 import org.apache.directory.shared.ldap.message.extended.GracefulShutdownRequest;
 import org.apache.directory.shared.ldap.message.extended.GracefulShutdownResponse;
 import org.apache.directory.shared.ldap.message.extended.NoticeOfDisconnect;
-import org.apache.mina.common.IoAcceptor;
-import org.apache.mina.common.IoSession;
-import org.apache.mina.common.WriteFuture;
+import org.apache.mina.core.future.WriteFuture;
+import org.apache.mina.core.service.IoAcceptor;
+import org.apache.mina.core.session.IoSession;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -91,7 +91,7 @@
 
         IoAcceptor acceptor = ( IoAcceptor ) requestor.getIoSession().getService();
         List<IoSession> sessions = new ArrayList<IoSession>(
-                acceptor.getManagedSessions( requestor.getIoSession().getServiceAddress() ) );
+                acceptor.getManagedSessions().values() );
         GracefulShutdownRequest gsreq = ( GracefulShutdownRequest ) req;
 
         // build the graceful disconnect message with replicationContexts
@@ -142,7 +142,7 @@
     {
         GracefulShutdownResponse msg = new GracefulShutdownResponse( messageId, ResultCodeEnum.SUCCESS );
         WriteFuture future = requestor.write( msg );
-        future.join();
+        future.awaitUninterruptibly();
         if ( future.isWritten() )
         {
             if ( LOG.isInfoEnabled() )

Modified: directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/StartTlsHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/StartTlsHandler.java?rev=704263&r1=704262&r2=704263&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/StartTlsHandler.java (original)
+++ directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/StartTlsHandler.java Mon Oct 13 14:34:35 2008
@@ -44,8 +44,8 @@
 import org.apache.directory.shared.ldap.message.ExtendedResponseImpl;
 import org.apache.directory.shared.ldap.message.LdapResult;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
-import org.apache.mina.common.IoFilterChain;
-import org.apache.mina.filter.SSLFilter;
+import org.apache.mina.core.filterchain.IoFilterChain;
+import org.apache.mina.filter.ssl.SslFilter;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -82,15 +82,15 @@
         LOG.info( "Handling StartTLS request." );
         
         IoFilterChain chain = session.getIoSession().getFilterChain();
-        SSLFilter sslFilter = ( SSLFilter ) chain.get( "sslFilter" );
+        SslFilter sslFilter = ( SslFilter ) chain.get( "sslFilter" );
         if( sslFilter == null )
         {
-            sslFilter = new SSLFilter( sslContext );
+            sslFilter = new SslFilter( sslContext );
             chain.addFirst( "sslFilter", sslFilter );
         }
         else
         {
-            sslFilter.startSSL( session.getIoSession() );
+            sslFilter.startSsl( session.getIoSession() );
         }
         
         ExtendedResponse res = new ExtendedResponseImpl( req.getMessageId() );
@@ -100,7 +100,7 @@
         res.setResponse( new byte[ 0 ] );
 
         // Send a response.
-        session.getIoSession().setAttribute( SSLFilter.DISABLE_ENCRYPTION_ONCE );
+        session.getIoSession().setAttribute( SslFilter.DISABLE_ENCRYPTION_ONCE );
         session.getIoSession().write( res );
     }
     

Modified: directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/ssl/LdapsInitializer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/ssl/LdapsInitializer.java?rev=704263&r1=704262&r2=704263&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/ssl/LdapsInitializer.java (original)
+++ directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/ssl/LdapsInitializer.java Mon Oct 13 14:34:35 2008
@@ -29,9 +29,9 @@
 import javax.net.ssl.SSLContext;
 import javax.net.ssl.TrustManager;
 
-import org.apache.mina.common.DefaultIoFilterChainBuilder;
-import org.apache.mina.common.IoFilterChainBuilder;
-import org.apache.mina.filter.SSLFilter;
+import org.apache.mina.core.filterchain.DefaultIoFilterChainBuilder;
+import org.apache.mina.core.filterchain.IoFilterChainBuilder;
+import org.apache.mina.filter.ssl.SslFilter;
 
 
 /**
@@ -69,7 +69,7 @@
         }
 
         DefaultIoFilterChainBuilder chain = new DefaultIoFilterChainBuilder();
-        chain.addLast( "sslFilter", new SSLFilter( sslCtx ) );
+        chain.addLast( "sslFilter", new SslFilter( sslCtx ) );
         return chain;
     }
 }

Modified: directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/test/java/org/apache/directory/server/ldap/SettingAlternativeHandlersTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/test/java/org/apache/directory/server/ldap/SettingAlternativeHandlersTest.java?rev=704263&r1=704262&r2=704263&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/test/java/org/apache/directory/server/ldap/SettingAlternativeHandlersTest.java (original)
+++ directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/test/java/org/apache/directory/server/ldap/SettingAlternativeHandlersTest.java Mon Oct 13 14:34:35 2008
@@ -43,7 +43,7 @@
 import org.apache.directory.shared.ldap.message.ModifyRequest;
 import org.apache.directory.shared.ldap.message.SearchRequest;
 import org.apache.directory.shared.ldap.message.UnbindRequest;
-import org.apache.mina.common.IoSession;
+import org.apache.mina.core.session.IoSession;
 
 
 /**

Modified: directory/apacheds/branches/apacheds-mina2/protocol-ntp/src/main/java/org/apache/directory/server/ntp/NtpServer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mina2/protocol-ntp/src/main/java/org/apache/directory/server/ntp/NtpServer.java?rev=704263&r1=704262&r2=704263&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mina2/protocol-ntp/src/main/java/org/apache/directory/server/ntp/NtpServer.java (original)
+++ directory/apacheds/branches/apacheds-mina2/protocol-ntp/src/main/java/org/apache/directory/server/ntp/NtpServer.java Mon Oct 13 14:34:35 2008
@@ -22,8 +22,6 @@
 
 import org.apache.directory.server.ntp.protocol.NtpProtocolHandler;
 import org.apache.directory.server.protocol.shared.AbstractProtocolService;
-import org.apache.mina.transport.socket.nio.DatagramAcceptorConfig;
-import org.apache.mina.transport.socket.nio.SocketAcceptorConfig;
 
 import java.io.IOException;
 import java.net.InetSocketAddress;
@@ -73,16 +71,16 @@
         //If appropriate, the udp and tcp servers could be enabled with boolean flags.
         if ( getDatagramAcceptor() != null )
         {
-            DatagramAcceptorConfig udpConfig = new DatagramAcceptorConfig();
-            getDatagramAcceptor().bind( new InetSocketAddress( getIpPort() ), new NtpProtocolHandler(), udpConfig );
+            getDatagramAcceptor().setHandler( new NtpProtocolHandler() );
+            getDatagramAcceptor().bind( new InetSocketAddress( getIpPort() ) );
         }
 
         if ( getSocketAcceptor() != null )
         {
-            SocketAcceptorConfig tcpConfig = new SocketAcceptorConfig();
-            tcpConfig.setDisconnectOnUnbind( false );
-            tcpConfig.setReuseAddress( true );
-            getSocketAcceptor().bind( new InetSocketAddress( getIpPort() ), new NtpProtocolHandler(), tcpConfig );
+            getSocketAcceptor().setReuseAddress( true );
+            getSocketAcceptor().setCloseOnDeactivation( false );
+            getSocketAcceptor().setHandler( new NtpProtocolHandler() );
+            getSocketAcceptor().bind( new InetSocketAddress( getIpPort() ) );
         }
     }
 

Modified: directory/apacheds/branches/apacheds-mina2/protocol-ntp/src/main/java/org/apache/directory/server/ntp/protocol/NtpDecoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mina2/protocol-ntp/src/main/java/org/apache/directory/server/ntp/protocol/NtpDecoder.java?rev=704263&r1=704262&r2=704263&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mina2/protocol-ntp/src/main/java/org/apache/directory/server/ntp/protocol/NtpDecoder.java (original)
+++ directory/apacheds/branches/apacheds-mina2/protocol-ntp/src/main/java/org/apache/directory/server/ntp/protocol/NtpDecoder.java Mon Oct 13 14:34:35 2008
@@ -22,8 +22,8 @@
 
 
 import org.apache.directory.server.ntp.io.NtpMessageDecoder;
-import org.apache.mina.common.ByteBuffer;
-import org.apache.mina.common.IoSession;
+import org.apache.mina.core.buffer.IoBuffer;
+import org.apache.mina.core.session.IoSession;
 import org.apache.mina.filter.codec.ProtocolDecoderAdapter;
 import org.apache.mina.filter.codec.ProtocolDecoderOutput;
 
@@ -34,7 +34,7 @@
  */
 public class NtpDecoder extends ProtocolDecoderAdapter
 {
-    public void decode( IoSession session, ByteBuffer in, ProtocolDecoderOutput out )
+    public void decode( IoSession session, IoBuffer in, ProtocolDecoderOutput out )
     {
         NtpMessageDecoder decoder = new NtpMessageDecoder();
         out.write( decoder.decode( in.buf() ) );

Modified: directory/apacheds/branches/apacheds-mina2/protocol-ntp/src/main/java/org/apache/directory/server/ntp/protocol/NtpEncoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mina2/protocol-ntp/src/main/java/org/apache/directory/server/ntp/protocol/NtpEncoder.java?rev=704263&r1=704262&r2=704263&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mina2/protocol-ntp/src/main/java/org/apache/directory/server/ntp/protocol/NtpEncoder.java (original)
+++ directory/apacheds/branches/apacheds-mina2/protocol-ntp/src/main/java/org/apache/directory/server/ntp/protocol/NtpEncoder.java Mon Oct 13 14:34:35 2008
@@ -23,8 +23,8 @@
 
 import org.apache.directory.server.ntp.io.NtpMessageEncoder;
 import org.apache.directory.server.ntp.messages.NtpMessage;
-import org.apache.mina.common.ByteBuffer;
-import org.apache.mina.common.IoSession;
+import org.apache.mina.core.buffer.IoBuffer;
+import org.apache.mina.core.session.IoSession;
 import org.apache.mina.filter.codec.ProtocolEncoderAdapter;
 import org.apache.mina.filter.codec.ProtocolEncoderOutput;
 
@@ -39,7 +39,7 @@
     {
         NtpMessageEncoder encoder = new NtpMessageEncoder();
 
-        ByteBuffer buf = ByteBuffer.allocate( 1024 );
+        IoBuffer buf = IoBuffer.allocate( 1024 );
         encoder.encode( buf.buf(), ( NtpMessage ) message );
 
         buf.flip();

Modified: directory/apacheds/branches/apacheds-mina2/protocol-ntp/src/main/java/org/apache/directory/server/ntp/protocol/NtpProtocolCodecFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mina2/protocol-ntp/src/main/java/org/apache/directory/server/ntp/protocol/NtpProtocolCodecFactory.java?rev=704263&r1=704262&r2=704263&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mina2/protocol-ntp/src/main/java/org/apache/directory/server/ntp/protocol/NtpProtocolCodecFactory.java (original)
+++ directory/apacheds/branches/apacheds-mina2/protocol-ntp/src/main/java/org/apache/directory/server/ntp/protocol/NtpProtocolCodecFactory.java Mon Oct 13 14:34:35 2008
@@ -21,6 +21,7 @@
 package org.apache.directory.server.ntp.protocol;
 
 
+import org.apache.mina.core.session.IoSession;
 import org.apache.mina.filter.codec.ProtocolCodecFactory;
 import org.apache.mina.filter.codec.ProtocolDecoder;
 import org.apache.mina.filter.codec.ProtocolEncoder;
@@ -52,14 +53,14 @@
     }
 
 
-    public ProtocolEncoder getEncoder()
+    public ProtocolEncoder getEncoder( IoSession session )
     {
         // Create a new encoder.
         return new NtpEncoder();
     }
 
 
-    public ProtocolDecoder getDecoder()
+    public ProtocolDecoder getDecoder( IoSession session )
     {
         // Create a new decoder.
         return new NtpDecoder();

Modified: directory/apacheds/branches/apacheds-mina2/protocol-ntp/src/main/java/org/apache/directory/server/ntp/protocol/NtpProtocolHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mina2/protocol-ntp/src/main/java/org/apache/directory/server/ntp/protocol/NtpProtocolHandler.java?rev=704263&r1=704262&r2=704263&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mina2/protocol-ntp/src/main/java/org/apache/directory/server/ntp/protocol/NtpProtocolHandler.java (original)
+++ directory/apacheds/branches/apacheds-mina2/protocol-ntp/src/main/java/org/apache/directory/server/ntp/protocol/NtpProtocolHandler.java Mon Oct 13 14:34:35 2008
@@ -24,9 +24,9 @@
 import org.apache.directory.server.ntp.NtpService;
 import org.apache.directory.server.ntp.messages.NtpMessage;
 import org.apache.directory.server.ntp.service.NtpServiceImpl;
-import org.apache.mina.common.IdleStatus;
-import org.apache.mina.common.IoHandler;
-import org.apache.mina.common.IoSession;
+import org.apache.mina.core.service.IoHandler;
+import org.apache.mina.core.session.IdleStatus;
+import org.apache.mina.core.session.IoSession;
 import org.apache.mina.filter.codec.ProtocolCodecFilter;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;

Modified: directory/apacheds/branches/apacheds-mina2/protocol-ntp/src/test/java/org/apache/directory/server/ntp/NtpITest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mina2/protocol-ntp/src/test/java/org/apache/directory/server/ntp/NtpITest.java?rev=704263&r1=704262&r2=704263&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mina2/protocol-ntp/src/test/java/org/apache/directory/server/ntp/NtpITest.java (original)
+++ directory/apacheds/branches/apacheds-mina2/protocol-ntp/src/test/java/org/apache/directory/server/ntp/NtpITest.java Mon Oct 13 14:34:35 2008
@@ -21,13 +21,15 @@
 
 
 import java.net.InetAddress;
+import java.util.concurrent.Executors;
 
 import junit.framework.Assert;
 import junit.framework.TestCase;
 import org.apache.commons.net.ntp.NTPUDPClient;
 import org.apache.commons.net.ntp.TimeInfo;
-import org.apache.directory.server.protocol.shared.DatagramAcceptor;
 import org.apache.directory.server.unit.AbstractServerTest;
+import org.apache.mina.filter.executor.ExecutorFilter;
+import org.apache.mina.transport.socket.nio.NioDatagramAcceptor;
 import org.apache.mina.util.AvailablePortFinder;
 
 
@@ -48,7 +50,9 @@
      */
     public void setUp() throws Exception
     {
-        DatagramAcceptor datagramAcceptor = new DatagramAcceptor( null );
+        NioDatagramAcceptor datagramAcceptor = new NioDatagramAcceptor( null );
+        datagramAcceptor.getFilterChain().addLast( "executor", new ExecutorFilter( Executors.newCachedThreadPool() ) );
+        //datagramAcceptor.getFilterChain().addlast( "decoder", )
         ntpConfig = new NtpServer();
         ntpConfig.setDatagramAcceptor( datagramAcceptor );
         ntpConfig.setEnabled( true );
@@ -70,7 +74,7 @@
         InetAddress host = InetAddress.getByName( null );
 
         NTPUDPClient ntp = new NTPUDPClient();
-        ntp.setDefaultTimeout( 5000 );
+        ntp.setDefaultTimeout( 500000 );
 
         TimeInfo timeInfo = ntp.getTime( host, port );
         long returnTime = timeInfo.getReturnTime();

Modified: directory/apacheds/branches/apacheds-mina2/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/AbstractProtocolService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mina2/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/AbstractProtocolService.java?rev=704263&r1=704262&r2=704263&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mina2/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/AbstractProtocolService.java (original)
+++ directory/apacheds/branches/apacheds-mina2/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/AbstractProtocolService.java Mon Oct 13 14:34:35 2008
@@ -20,6 +20,8 @@
 
 
 import org.apache.directory.server.core.DirectoryService;
+import org.apache.mina.transport.socket.nio.NioDatagramAcceptor;
+import org.apache.mina.transport.socket.nio.NioSocketAcceptor;
 
 import java.util.Collections;
 import java.util.HashSet;
@@ -42,8 +44,8 @@
     private String ipAddress;
     private int ipPort = -1;
     private Set<TransportProtocol> transportProtocols;
-    private DatagramAcceptor datagramAcceptor;
-    private SocketAcceptor socketAcceptor;
+    private NioDatagramAcceptor datagramAcceptor;
+    private NioSocketAcceptor socketAcceptor;
     /** directory service core where protocol data is backed */
     private DirectoryService directoryService;
 
@@ -151,25 +153,25 @@
     }
 
 
-    public DatagramAcceptor getDatagramAcceptor()
+    public NioDatagramAcceptor getDatagramAcceptor()
     {
         return datagramAcceptor;
     }
 
 
-    public void setDatagramAcceptor( DatagramAcceptor datagramAcceptor )
+    public void setDatagramAcceptor( NioDatagramAcceptor datagramAcceptor )
     {
         this.datagramAcceptor = datagramAcceptor;
     }
 
 
-    public SocketAcceptor getSocketAcceptor()
+    public NioSocketAcceptor getSocketAcceptor()
     {
         return socketAcceptor;
     }
 
 
-    public void setSocketAcceptor( SocketAcceptor socketAcceptor )
+    public void setSocketAcceptor( NioSocketAcceptor socketAcceptor )
     {
         this.socketAcceptor = socketAcceptor;
     }

Modified: directory/apacheds/branches/apacheds-mina2/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/ProtocolService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mina2/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/ProtocolService.java?rev=704263&r1=704262&r2=704263&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mina2/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/ProtocolService.java (original)
+++ directory/apacheds/branches/apacheds-mina2/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/ProtocolService.java Mon Oct 13 14:34:35 2008
@@ -20,6 +20,8 @@
 
 
 import org.apache.directory.server.core.DirectoryService;
+import org.apache.mina.transport.socket.nio.NioDatagramAcceptor;
+import org.apache.mina.transport.socket.nio.NioSocketAcceptor;
 
 import java.util.Set;
 
@@ -62,7 +64,7 @@
      *
      * @return the MINA DatagramAcceptor used for UDP transports
      */
-    DatagramAcceptor getDatagramAcceptor();
+    NioDatagramAcceptor getDatagramAcceptor();
 
 
     /**
@@ -71,7 +73,7 @@
      *
      * @param datagramAcceptor the MINA DatagramAcceptor used for UDP transport
      */
-    void setDatagramAcceptor( DatagramAcceptor datagramAcceptor );
+    void setDatagramAcceptor( NioDatagramAcceptor datagramAcceptor );
 
 
     /**
@@ -80,7 +82,7 @@
      *
      * @return the MINA SocketAcceptor used for TCP transport
      */
-    SocketAcceptor getSocketAcceptor();
+    NioSocketAcceptor getSocketAcceptor();
 
 
     /**
@@ -89,7 +91,7 @@
      *
      * @param socketAcceptor the MINA SocketAcceptor used for TCP transport
      */
-    void setSocketAcceptor( SocketAcceptor socketAcceptor );
+    void setSocketAcceptor( NioSocketAcceptor socketAcceptor );
 
 
     /**



Mime
View raw message