directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r704006 [3/4] - in /directory/apacheds/trunk: ./ kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/keytab/ kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/keytab/ mitosis/src/main/java/org/a...
Date Mon, 13 Oct 2008 10:16:12 GMT
Modified: directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/AbstractResourceRecordEncoderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/AbstractResourceRecordEncoderTest.java?rev=704006&r1=704005&r2=704006&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/AbstractResourceRecordEncoderTest.java (original)
+++ directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/AbstractResourceRecordEncoderTest.java Mon Oct 13 03:16:07 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.core.buffer.IoBuffer;
+import org.apache.mina.common.ByteBuffer;
 
 
 /**
@@ -43,7 +43,7 @@
  */
 public abstract class AbstractResourceRecordEncoderTest extends TestCase
 {
-    IoBuffer expectedData;
+    ByteBuffer 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 = IoBuffer.allocate( 128 );
+        expectedData = ByteBuffer.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
     {
-        IoBuffer outBuffer = IoBuffer.allocate( 128 );
+        ByteBuffer outBuffer = ByteBuffer.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( IoBuffer expectedData );
+    protected abstract void putExpectedResourceData( ByteBuffer expectedData );
 }

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

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

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

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

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

Modified: directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/QuestionRecordEncoderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/QuestionRecordEncoderTest.java?rev=704006&r1=704005&r2=704006&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/QuestionRecordEncoderTest.java (original)
+++ directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/QuestionRecordEncoderTest.java Mon Oct 13 03:16:07 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.core.buffer.IoBuffer;
+import org.apache.mina.common.ByteBuffer;
 
 
 /**
@@ -37,7 +37,7 @@
  */
 public class QuestionRecordEncoderTest extends TestCase
 {
-    IoBuffer expectedData;
+    ByteBuffer expectedData;
 
     QuestionRecordEncoder encoder;
 
@@ -53,7 +53,7 @@
     {
         encoder = new QuestionRecordEncoder();
 
-        expectedData = IoBuffer.allocate( 128 );
+        expectedData = ByteBuffer.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()
     {
-        IoBuffer out = IoBuffer.allocate( 128 );
+        ByteBuffer out = ByteBuffer.allocate( 128 );
         encoder.put( out, record );
         assertEquals( expectedData, out );
     }

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

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

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

Modified: directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/KdcServer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/KdcServer.java?rev=704006&r1=704005&r2=704006&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/KdcServer.java (original)
+++ directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/KdcServer.java Mon Oct 13 03:16:07 2008
@@ -33,6 +33,8 @@
 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;
 
@@ -433,18 +435,29 @@
         store = new DirectoryPrincipalStore( getDirectoryService() );
 
         
+//        if ( isCatelogBased() )
+//        {
+//            store = new JndiPrincipalStoreImpl( getSearchBaseDn(), null, getDirectoryService() );
+//        }
+//        else
+//        {
+//            store = new JndiPrincipalStoreImpl( null, getSearchBaseDn(), getDirectoryService() );
+//        }
+        
+        
+
         if ( getDatagramAcceptor() != null )
         {
-            getDatagramAcceptor().setHandler( new KerberosProtocolHandler( this, store ) );
-            getDatagramAcceptor().bind( new InetSocketAddress( getIpPort() ) );
+            DatagramAcceptorConfig udpConfig = new DatagramAcceptorConfig();
+            getDatagramAcceptor().bind( new InetSocketAddress( getIpPort() ), new KerberosProtocolHandler( this, store ), udpConfig );
         }
 
         if ( getSocketAcceptor() != null )
         {
-            getSocketAcceptor().setCloseOnDeactivation( false );
-            getSocketAcceptor().setReuseAddress( true );
-            getSocketAcceptor().setHandler( new KerberosProtocolHandler( this, store ) );
-            getSocketAcceptor().bind( new InetSocketAddress( getIpPort() ) );
+            SocketAcceptorConfig tcpConfig = new SocketAcceptorConfig();
+            tcpConfig.setDisconnectOnUnbind( false );
+            tcpConfig.setReuseAddress( true );
+            getSocketAcceptor().bind( new InetSocketAddress( getIpPort() ), new KerberosProtocolHandler( this, store ), tcpConfig );
         }
         
         LOG.info( "Kerberos service started." );

Modified: directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosProtocolHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosProtocolHandler.java?rev=704006&r1=704005&r2=704006&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosProtocolHandler.java (original)
+++ directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosProtocolHandler.java Mon Oct 13 03:16:07 2008
@@ -38,9 +38,10 @@
 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.core.service.IoHandler;
-import org.apache.mina.core.session.IdleStatus;
-import org.apache.mina.core.session.IoSession;
+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.filter.codec.ProtocolCodecFilter;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -80,10 +81,10 @@
     {
         if ( log.isDebugEnabled() )
         {
-            log.debug( "{} CREATED:  {}", session.getRemoteAddress(), session.getTransportMetadata() );
+            log.debug( "{} CREATED:  {}", session.getRemoteAddress(), session.getTransportType() );
         }
 
-        if ( session.getTransportMetadata().isConnectionless() )
+        if ( session.getTransportType() == TransportType.DATAGRAM )
         {
             session.getFilterChain().addFirst( "codec",
                 new ProtocolCodecFilter( KerberosUdpProtocolCodecFactory.getInstance() ) );

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

Modified: directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosTcpEncoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosTcpEncoder.java?rev=704006&r1=704005&r2=704006&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosTcpEncoder.java (original)
+++ directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosTcpEncoder.java Mon Oct 13 03:16:07 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.core.buffer.IoBuffer;
-import org.apache.mina.core.session.IoSession;
+import org.apache.mina.common.ByteBuffer;
+import org.apache.mina.common.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
     {
-        IoBuffer buf = IoBuffer.allocate( 1024 );
+        ByteBuffer buf = ByteBuffer.allocate( 1024 );
 
         // make space for int length
         buf.putInt( 0 );

Modified: directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosTcpProtocolCodecFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosTcpProtocolCodecFactory.java?rev=704006&r1=704005&r2=704006&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosTcpProtocolCodecFactory.java (original)
+++ directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosTcpProtocolCodecFactory.java Mon Oct 13 03:16:07 2008
@@ -20,7 +20,6 @@
 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;
@@ -52,14 +51,14 @@
     }
 
 
-    public ProtocolEncoder getEncoder( IoSession session )
+    public ProtocolEncoder getEncoder()
     {
         // Create a new encoder.
         return new KerberosTcpEncoder();
     }
 
 
-    public ProtocolDecoder getDecoder( IoSession session )
+    public ProtocolDecoder getDecoder()
     {
         // Create a new decoder.
         return new KerberosTcpDecoder();

Modified: directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosUdpDecoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosUdpDecoder.java?rev=704006&r1=704005&r2=704006&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosUdpDecoder.java (original)
+++ directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosUdpDecoder.java Mon Oct 13 03:16:07 2008
@@ -23,8 +23,8 @@
 import java.io.IOException;
 
 import org.apache.directory.server.kerberos.shared.io.decoder.KdcRequestDecoder;
-import org.apache.mina.core.buffer.IoBuffer;
-import org.apache.mina.core.session.IoSession;
+import org.apache.mina.common.ByteBuffer;
+import org.apache.mina.common.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, IoBuffer in, ProtocolDecoderOutput out ) throws IOException
+    public void decode( IoSession session, ByteBuffer in, ProtocolDecoderOutput out ) throws IOException
     {
         out.write( decoder.decode( in.buf() ) );
     }

Modified: directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosUdpEncoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosUdpEncoder.java?rev=704006&r1=704005&r2=704006&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosUdpEncoder.java (original)
+++ directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosUdpEncoder.java Mon Oct 13 03:16:07 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.core.buffer.IoBuffer;
-import org.apache.mina.core.session.IoSession;
+import org.apache.mina.common.ByteBuffer;
+import org.apache.mina.common.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
     {
-        IoBuffer buf = IoBuffer.allocate( 1024 );
+        ByteBuffer buf = ByteBuffer.allocate( 1024 );
 
         if ( message instanceof KdcReply )
         {

Modified: directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosUdpProtocolCodecFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosUdpProtocolCodecFactory.java?rev=704006&r1=704005&r2=704006&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosUdpProtocolCodecFactory.java (original)
+++ directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosUdpProtocolCodecFactory.java Mon Oct 13 03:16:07 2008
@@ -20,7 +20,6 @@
 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;
@@ -52,14 +51,14 @@
     }
 
 
-    public ProtocolEncoder getEncoder( IoSession session )
+    public ProtocolEncoder getEncoder()
     {
         // Create a new encoder.
         return new KerberosUdpEncoder();
     }
 
 
-    public ProtocolDecoder getDecoder( IoSession session )
+    public ProtocolDecoder getDecoder()
     {
         // Create a new decoder.
         return new KerberosUdpDecoder();

Modified: directory/apacheds/trunk/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/AbstractAuthenticationServiceTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/AbstractAuthenticationServiceTest.java?rev=704006&r1=704005&r2=704006&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/AbstractAuthenticationServiceTest.java (original)
+++ directory/apacheds/trunk/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/AbstractAuthenticationServiceTest.java Mon Oct 13 03:16:07 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.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;
+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;
 
 
 /**
@@ -122,14 +122,17 @@
         return key;
     }
 
-    protected static class DummySession extends AbstractIoSession
+    protected static class DummySession extends BaseIoSession
     {
         Object message;
 
 
-        public IoProcessor<IoSession> getProcessor()
+        @Override
+        public WriteFuture write( Object message )
         {
-            return null;
+            this.message = message;
+
+            return super.write( message );
         }
 
 
@@ -163,7 +166,7 @@
         }
 
 
-        public TransportMetadata getTransportMetadata()
+        public TransportType getTransportType()
         {
             return null;
         }
@@ -197,5 +200,17 @@
         {
             return null;
         }
+
+
+        public IoServiceConfig getServiceConfig()
+        {
+            return null;
+        }
+
+
+        public int getScheduledWriteBytes()
+        {
+            return 0;
+        }
     }
 }

Modified: directory/apacheds/trunk/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/AbstractTicketGrantingServiceTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/AbstractTicketGrantingServiceTest.java?rev=704006&r1=704005&r2=704006&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/AbstractTicketGrantingServiceTest.java (original)
+++ directory/apacheds/trunk/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/AbstractTicketGrantingServiceTest.java Mon Oct 13 03:16:07 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.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;
+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;
 
 
 /**
@@ -324,14 +324,17 @@
         return principalName;
     }
 
-    protected static class DummySession extends AbstractIoSession
+    protected static class DummySession extends BaseIoSession
     {
         Object message;
 
 
-        public IoProcessor<IoSession> getProcessor()
+        @Override
+        public WriteFuture write( Object message )
         {
-            return null;
+            this.message = message;
+
+            return super.write( message );
         }
 
 
@@ -365,7 +368,7 @@
         }
 
 
-        public TransportMetadata getTransportMetadata()
+        public TransportType getTransportType()
         {
             return null;
         }
@@ -399,5 +402,17 @@
         {
             return null;
         }
+
+
+        public IoServiceConfig getServiceConfig()
+        {
+            return null;
+        }
+
+
+        public int getScheduledWriteBytes()
+        {
+            return 0;
+        }
     }
 }

Modified: directory/apacheds/trunk/protocol-ldap/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/pom.xml?rev=704006&r1=704005&r2=704006&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/pom.xml (original)
+++ directory/apacheds/trunk/protocol-ldap/pom.xml Mon Oct 13 03:16:07 2008
@@ -47,6 +47,11 @@
     </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/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapProtocolCodecFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapProtocolCodecFactory.java?rev=704006&r1=704005&r2=704006&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapProtocolCodecFactory.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapProtocolCodecFactory.java Mon Oct 13 03:16:07 2008
@@ -28,7 +28,6 @@
 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;
@@ -62,7 +61,7 @@
      * (non-Javadoc)
      * @see org.apache.mina.filter.codec.ProtocolCodecFactory#getEncoder()
      */
-    public ProtocolEncoder getEncoder( IoSession session )
+    public ProtocolEncoder getEncoder()
     {
         return new Asn1CodecEncoder( new MessageEncoder() );
     }
@@ -72,7 +71,7 @@
      * (non-Javadoc)
      * @see org.apache.mina.filter.codec.ProtocolCodecFactory#getDecoder()
      */
-    public ProtocolDecoder getDecoder( IoSession session )
+    public ProtocolDecoder getDecoder()
     {
         return new Asn1CodecDecoder( new MessageDecoder( new BinaryAttributeDetector()
         {

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapProtocolHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapProtocolHandler.java?rev=704006&r1=704005&r2=704006&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapProtocolHandler.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapProtocolHandler.java Mon Oct 13 03:16:07 2008
@@ -31,11 +31,13 @@
 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.core.filterchain.IoFilterChain;
-import org.apache.mina.core.session.IoSession;
+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.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;
 
@@ -144,14 +146,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" );
@@ -197,7 +199,8 @@
             }                
         }
         
-        LOG.warn( "Unexpected exception forcing session to close: sending disconnect notice to client.", cause );
+        SessionLog.warn( session,
+            "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/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapService.java?rev=704006&r1=704005&r2=704006&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapService.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapService.java Mon Oct 13 03:16:07 2008
@@ -64,13 +64,15 @@
 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.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.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.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;
 
@@ -352,7 +354,7 @@
             try
             {
                 sessions = new ArrayList<IoSession>(
-                        getSocketAcceptor().getManagedSessions().values() );
+                        getSocketAcceptor().getManagedSessions( new InetSocketAddress( getIpPort() ) ) );
             }
             catch ( IllegalArgumentException e )
             {
@@ -382,7 +384,7 @@
 
             for ( WriteFuture future:writeFutures )
             {
-                future.await( 1000L );
+                future.join( 1000 );
                 sessionIt.next().close();
             }
         }
@@ -420,12 +422,17 @@
 
         try
         {
+            SocketAcceptorConfig acceptorCfg = new SocketAcceptorConfig();
+
             // Disable the disconnection of the clients on unbind
-            getSocketAcceptor().setCloseOnDeactivation( false );
-            getSocketAcceptor().getSessionConfig().setTcpNoDelay( true );
-            getSocketAcceptor().setFilterChainBuilder( chainBuilder );
-            getSocketAcceptor().setHandler( getHandler() );
-            getSocketAcceptor().bind( new InetSocketAddress( port ) );
+            acceptorCfg.setDisconnectOnUnbind( false );
+            acceptorCfg.setReuseAddress( true );
+            acceptorCfg.setFilterChainBuilder( chainBuilder );
+            acceptorCfg.setThreadModel( ThreadModel.MANUAL );
+
+            acceptorCfg.getSessionConfig().setTcpNoDelay( true );
+
+            getSocketAcceptor().bind( new InetSocketAddress( port ), getHandler(), acceptorCfg );
             started = true;
 
             if ( LOG.isInfoEnabled() )
@@ -869,10 +876,10 @@
 
     public void setAbandonHandler( LdapRequestHandler<AbandonRequest> abandonHandler )
     {
-        this.handler.removeReceivedMessageHandler( AbandonRequest.class );
+        this.handler.removeMessageHandler( AbandonRequest.class );
         this.abandonHandler = abandonHandler;
         this.abandonHandler.setLdapServer( this );
-        this.handler.addReceivedMessageHandler( AbandonRequest.class, this.abandonHandler );
+        this.handler.addMessageHandler( AbandonRequest.class, this.abandonHandler );
     }
 
 
@@ -884,10 +891,10 @@
 
     public void setAddHandler( LdapRequestHandler<AddRequest> addHandler )
     {
-        this.handler.removeReceivedMessageHandler( AddRequest.class );
+        this.handler.removeMessageHandler( AddRequest.class );
         this.addHandler = addHandler;
         this.addHandler.setLdapServer( this );
-        this.handler.addReceivedMessageHandler( AddRequest.class, this.addHandler );
+        this.handler.addMessageHandler( AddRequest.class, this.addHandler );
     }
 
 
@@ -899,10 +906,10 @@
 
     public void setBindHandler( LdapRequestHandler<BindRequest> bindHandler )
     {
-        this.handler.removeReceivedMessageHandler( BindRequest.class );
+        this.handler.removeMessageHandler( BindRequest.class );
         this.bindHandler = bindHandler;
         this.bindHandler.setLdapServer( this );
-        this.handler.addReceivedMessageHandler( BindRequest.class, this.bindHandler );
+        this.handler.addMessageHandler( BindRequest.class, this.bindHandler );
     }
 
 
@@ -914,10 +921,10 @@
 
     public void setCompareHandler( LdapRequestHandler<CompareRequest> compareHandler )
     {
-        this.handler.removeReceivedMessageHandler( CompareRequest.class );
+        this.handler.removeMessageHandler( CompareRequest.class );
         this.compareHandler = compareHandler;
         this.compareHandler.setLdapServer( this );
-        this.handler.addReceivedMessageHandler( CompareRequest.class, this.compareHandler );
+        this.handler.addMessageHandler( CompareRequest.class, this.compareHandler );
     }
 
 
@@ -929,10 +936,10 @@
 
     public void setDeleteHandler( LdapRequestHandler<DeleteRequest> deleteHandler )
     {
-        this.handler.removeReceivedMessageHandler( DeleteRequest.class );
+        this.handler.removeMessageHandler( DeleteRequest.class );
         this.deleteHandler = deleteHandler;
         this.deleteHandler.setLdapServer( this );
-        this.handler.addReceivedMessageHandler( DeleteRequest.class, this.deleteHandler );
+        this.handler.addMessageHandler( DeleteRequest.class, this.deleteHandler );
     }
 
 
@@ -944,10 +951,10 @@
 
     public void setExtendedHandler( LdapRequestHandler<ExtendedRequest> extendedHandler )
     {
-        this.handler.removeReceivedMessageHandler( ExtendedRequest.class );
+        this.handler.removeMessageHandler( ExtendedRequest.class );
         this.extendedHandler = extendedHandler;
         this.extendedHandler.setLdapServer( this );
-        this.handler.addReceivedMessageHandler( ExtendedRequest.class, this.extendedHandler );
+        this.handler.addMessageHandler( ExtendedRequest.class, this.extendedHandler );
     }
 
 
@@ -959,10 +966,10 @@
 
     public void setModifyHandler( LdapRequestHandler<ModifyRequest> modifyHandler )
     {
-        this.handler.removeReceivedMessageHandler( ModifyRequest.class );
+        this.handler.removeMessageHandler( ModifyRequest.class );
         this.modifyHandler = modifyHandler;
         this.modifyHandler.setLdapServer( this );
-        this.handler.addReceivedMessageHandler( ModifyRequest.class, this.modifyHandler );
+        this.handler.addMessageHandler( ModifyRequest.class, this.modifyHandler );
     }
 
 
@@ -974,10 +981,10 @@
 
     public void setModifyDnHandler( LdapRequestHandler<ModifyDnRequest> modifyDnHandler )
     {
-        this.handler.removeReceivedMessageHandler( ModifyDnRequest.class );
+        this.handler.removeMessageHandler( ModifyDnRequest.class );
         this.modifyDnHandler = modifyDnHandler;
         this.modifyDnHandler.setLdapServer( this );
-        this.handler.addReceivedMessageHandler( ModifyDnRequest.class, this.modifyDnHandler );
+        this.handler.addMessageHandler( ModifyDnRequest.class, this.modifyDnHandler );
     }
 
 
@@ -989,10 +996,10 @@
 
     public void setSearchHandler( LdapRequestHandler<SearchRequest> searchHandler )
     {
-        this.handler.removeReceivedMessageHandler( SearchRequest.class );
+        this.handler.removeMessageHandler( SearchRequest.class );
         this.searchHandler = searchHandler;
         this.searchHandler.setLdapServer( this );
-        this.handler.addReceivedMessageHandler( SearchRequest.class, this.searchHandler );
+        this.handler.addMessageHandler( SearchRequest.class, this.searchHandler );
     }
 
 
@@ -1004,10 +1011,10 @@
 
     public void setUnbindHandler( LdapRequestHandler<UnbindRequest> unbindHandler )
     {
-        this.handler.removeReceivedMessageHandler( UnbindRequest.class );
+        this.handler.removeMessageHandler( UnbindRequest.class );
         this.unbindHandler = unbindHandler;
         this.unbindHandler.setLdapServer( this );
-        this.handler.addReceivedMessageHandler( UnbindRequest.class, this.unbindHandler );
+        this.handler.addMessageHandler( UnbindRequest.class, this.unbindHandler );
     }
 
 

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapSession.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapSession.java?rev=704006&r1=704005&r2=704006&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapSession.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapSession.java Mon Oct 13 03:16:07 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.core.session.IoSession;
+import org.apache.mina.common.IoSession;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

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

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/gui/SessionsFrame.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/gui/SessionsFrame.java?rev=704006&r1=704005&r2=704006&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/gui/SessionsFrame.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/gui/SessionsFrame.java Mon Oct 13 03:16:07 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.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.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.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -481,9 +481,9 @@
                     WriteFuture future = selected.getIoSession().write( NoticeOfDisconnect.STRONGAUTHREQUIRED );
                     try
                     {
-                        future.awaitUninterruptibly( 1000L );
+                        future.join( 1000 );
                         CloseFuture cfuture = selected.getIoSession().close();
-                        cfuture.awaitUninterruptibly( 1000L );
+                        cfuture.join( 1000 );
                     }
                     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().values() );
+                            acceptor.getManagedSessions( requestor.getServiceAddress() ) );
 
                     if ( input == JOptionPane.CANCEL_OPTION )
                     {
@@ -826,8 +826,7 @@
                 {
                     try
                     {
-                        ( ( IoAcceptor ) requestor.getService() ).setHandler( getLdapProvider() );
-                        ( ( IoAcceptor ) requestor.getService() ).bind( requestor.getServiceAddress() );
+                        ( ( IoAcceptor ) requestor.getService() ).bind( requestor.getServiceAddress(), getLdapProvider() );
                         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/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/LdapRequestHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/LdapRequestHandler.java?rev=704006&r1=704005&r2=704006&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/LdapRequestHandler.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/LdapRequestHandler.java Mon Oct 13 03:16:07 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.core.filterchain.IoFilterChain;
-import org.apache.mina.core.session.IoSession;
+import org.apache.mina.common.IoFilterChain;
+import org.apache.mina.common.IoSession;
 import org.apache.mina.handler.demux.MessageHandler;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -199,18 +199,6 @@
     }
 
     
-    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/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/AbstractMechanismHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/AbstractMechanismHandler.java?rev=704006&r1=704005&r2=704006&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/AbstractMechanismHandler.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/AbstractMechanismHandler.java Mon Oct 13 03:16:07 2008
@@ -22,8 +22,8 @@
 import javax.security.sasl.SaslServer;
 
 import org.apache.directory.server.ldap.LdapSession;
-import org.apache.mina.core.filterchain.IoFilterChain;
-import org.apache.mina.core.session.IoSession;
+import org.apache.mina.common.IoFilterChain;
+import org.apache.mina.common.IoSession;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/AbstractSaslCallbackHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/AbstractSaslCallbackHandler.java?rev=704006&r1=704005&r2=704006&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/AbstractSaslCallbackHandler.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/AbstractSaslCallbackHandler.java Mon Oct 13 03:16:07 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.core.session.IoSession;
+import org.apache.mina.common.IoSession;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/SaslFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/SaslFilter.java?rev=704006&r1=704005&r2=704006&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/SaslFilter.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/SaslFilter.java Mon Oct 13 03:16:07 2008
@@ -25,11 +25,9 @@
 import javax.security.sasl.SaslServer;
 
 import org.apache.directory.shared.ldap.constants.SaslQoP;
-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.apache.mina.common.ByteBuffer;
+import org.apache.mina.common.IoFilterAdapter;
+import org.apache.mina.common.IoSession;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -97,14 +95,14 @@
             /*
              * Get the buffer as bytes.  First 4 bytes are length as int.
              */
-            IoBuffer buf = ( IoBuffer ) message;
+            ByteBuffer buf = ( ByteBuffer ) 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, IoBuffer.wrap( token ) );
+            nextFilter.messageReceived( session, ByteBuffer.wrap( token ) );
         }
         else
         {
@@ -136,14 +134,14 @@
         String qop = ( String ) saslServer.getNegotiatedProperty( Sasl.QOP );
         boolean hasSecurityLayer = ( qop != null && ( qop.equals( SaslQoP.QOP_AUTH_INT ) || qop.equals( SaslQoP.QOP_AUTH_CONF ) ) );
 
-        IoBuffer saslLayerBuffer = null;
+        ByteBuffer saslLayerBuffer = null;
 
         if ( hasSecurityLayer )
         {
             /*
              * Get the buffer as bytes.
              */
-            IoBuffer buf = ( IoBuffer ) writeRequest.getMessage();
+            ByteBuffer buf = ( ByteBuffer ) writeRequest.getMessage();
             int bufferLength = buf.remaining();
             byte[] bufferBytes = new byte[bufferLength];
             buf.get( bufferBytes );
@@ -155,14 +153,14 @@
             /*
              * Prepend 4 byte length.
              */
-            saslLayerBuffer = IoBuffer.allocate( 4 + saslLayer.length );
+            saslLayerBuffer = ByteBuffer.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 DefaultWriteRequest( saslLayerBuffer, writeRequest.getFuture() ) );
+            nextFilter.filterWrite( session, new WriteRequest( saslLayerBuffer, writeRequest.getFuture() ) );
         }
         else
         {

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

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/GracefulShutdownHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/GracefulShutdownHandler.java?rev=704006&r1=704005&r2=704006&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/GracefulShutdownHandler.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/GracefulShutdownHandler.java Mon Oct 13 03:16:07 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.core.future.WriteFuture;
-import org.apache.mina.core.service.IoAcceptor;
-import org.apache.mina.core.session.IoSession;
+import org.apache.mina.common.IoAcceptor;
+import org.apache.mina.common.IoSession;
+import org.apache.mina.common.WriteFuture;
 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().values() );
+                acceptor.getManagedSessions( requestor.getIoSession().getServiceAddress() ) );
         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.awaitUninterruptibly();
+        future.join();
         if ( future.isWritten() )
         {
             if ( LOG.isInfoEnabled() )

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/StartTlsHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/StartTlsHandler.java?rev=704006&r1=704005&r2=704006&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/StartTlsHandler.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/StartTlsHandler.java Mon Oct 13 03:16:07 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.core.filterchain.IoFilterChain;
-import org.apache.mina.filter.ssl.SslFilter;
+import org.apache.mina.common.IoFilterChain;
+import org.apache.mina.filter.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/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/ssl/LdapsInitializer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/ssl/LdapsInitializer.java?rev=704006&r1=704005&r2=704006&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/ssl/LdapsInitializer.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/ssl/LdapsInitializer.java Mon Oct 13 03:16:07 2008
@@ -29,9 +29,9 @@
 import javax.net.ssl.SSLContext;
 import javax.net.ssl.TrustManager;
 
-import org.apache.mina.core.filterchain.DefaultIoFilterChainBuilder;
-import org.apache.mina.core.filterchain.IoFilterChainBuilder;
-import org.apache.mina.filter.ssl.SslFilter;
+import org.apache.mina.common.DefaultIoFilterChainBuilder;
+import org.apache.mina.common.IoFilterChainBuilder;
+import org.apache.mina.filter.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/trunk/protocol-ldap/src/test/java/org/apache/directory/server/ldap/SettingAlternativeHandlersTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/test/java/org/apache/directory/server/ldap/SettingAlternativeHandlersTest.java?rev=704006&r1=704005&r2=704006&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/test/java/org/apache/directory/server/ldap/SettingAlternativeHandlersTest.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/test/java/org/apache/directory/server/ldap/SettingAlternativeHandlersTest.java Mon Oct 13 03:16:07 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.core.session.IoSession;
+import org.apache.mina.common.IoSession;
 
 
 /**

Modified: directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/NtpServer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/NtpServer.java?rev=704006&r1=704005&r2=704006&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/NtpServer.java (original)
+++ directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/NtpServer.java Mon Oct 13 03:16:07 2008
@@ -22,6 +22,8 @@
 
 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;
@@ -71,16 +73,16 @@
         //If appropriate, the udp and tcp servers could be enabled with boolean flags.
         if ( getDatagramAcceptor() != null )
         {
-            getDatagramAcceptor().setHandler( new NtpProtocolHandler() );
-            getDatagramAcceptor().bind( new InetSocketAddress( getIpPort() ) );
+            DatagramAcceptorConfig udpConfig = new DatagramAcceptorConfig();
+            getDatagramAcceptor().bind( new InetSocketAddress( getIpPort() ), new NtpProtocolHandler(), udpConfig );
         }
 
         if ( getSocketAcceptor() != null )
         {
-            getSocketAcceptor().setReuseAddress( true );
-            getSocketAcceptor().setCloseOnDeactivation( false );
-            getSocketAcceptor().setHandler( new NtpProtocolHandler() );
-            getSocketAcceptor().bind( new InetSocketAddress( getIpPort() ) );
+            SocketAcceptorConfig tcpConfig = new SocketAcceptorConfig();
+            tcpConfig.setDisconnectOnUnbind( false );
+            tcpConfig.setReuseAddress( true );
+            getSocketAcceptor().bind( new InetSocketAddress( getIpPort() ), new NtpProtocolHandler(), tcpConfig );
         }
     }
 

Modified: directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/protocol/NtpDecoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/protocol/NtpDecoder.java?rev=704006&r1=704005&r2=704006&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/protocol/NtpDecoder.java (original)
+++ directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/protocol/NtpDecoder.java Mon Oct 13 03:16:07 2008
@@ -22,8 +22,8 @@
 
 
 import org.apache.directory.server.ntp.io.NtpMessageDecoder;
-import org.apache.mina.core.buffer.IoBuffer;
-import org.apache.mina.core.session.IoSession;
+import org.apache.mina.common.ByteBuffer;
+import org.apache.mina.common.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, IoBuffer in, ProtocolDecoderOutput out )
+    public void decode( IoSession session, ByteBuffer in, ProtocolDecoderOutput out )
     {
         NtpMessageDecoder decoder = new NtpMessageDecoder();
         out.write( decoder.decode( in.buf() ) );

Modified: directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/protocol/NtpEncoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/protocol/NtpEncoder.java?rev=704006&r1=704005&r2=704006&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/protocol/NtpEncoder.java (original)
+++ directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/protocol/NtpEncoder.java Mon Oct 13 03:16:07 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.core.buffer.IoBuffer;
-import org.apache.mina.core.session.IoSession;
+import org.apache.mina.common.ByteBuffer;
+import org.apache.mina.common.IoSession;
 import org.apache.mina.filter.codec.ProtocolEncoderAdapter;
 import org.apache.mina.filter.codec.ProtocolEncoderOutput;
 
@@ -39,7 +39,7 @@
     {
         NtpMessageEncoder encoder = new NtpMessageEncoder();
 
-        IoBuffer buf = IoBuffer.allocate( 1024 );
+        ByteBuffer buf = ByteBuffer.allocate( 1024 );
         encoder.encode( buf.buf(), ( NtpMessage ) message );
 
         buf.flip();

Modified: directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/protocol/NtpProtocolCodecFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/protocol/NtpProtocolCodecFactory.java?rev=704006&r1=704005&r2=704006&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/protocol/NtpProtocolCodecFactory.java (original)
+++ directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/protocol/NtpProtocolCodecFactory.java Mon Oct 13 03:16:07 2008
@@ -21,7 +21,6 @@
 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;
@@ -53,14 +52,14 @@
     }
 
 
-    public ProtocolEncoder getEncoder( IoSession session )
+    public ProtocolEncoder getEncoder()
     {
         // Create a new encoder.
         return new NtpEncoder();
     }
 
 
-    public ProtocolDecoder getDecoder( IoSession session )
+    public ProtocolDecoder getDecoder()
     {
         // Create a new decoder.
         return new NtpDecoder();

Modified: directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/protocol/NtpProtocolHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/protocol/NtpProtocolHandler.java?rev=704006&r1=704005&r2=704006&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/protocol/NtpProtocolHandler.java (original)
+++ directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/protocol/NtpProtocolHandler.java Mon Oct 13 03:16:07 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.core.service.IoHandler;
-import org.apache.mina.core.session.IdleStatus;
-import org.apache.mina.core.session.IoSession;
+import org.apache.mina.common.IdleStatus;
+import org.apache.mina.common.IoHandler;
+import org.apache.mina.common.IoSession;
 import org.apache.mina.filter.codec.ProtocolCodecFilter;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;

Modified: directory/apacheds/trunk/protocol-ntp/src/test/java/org/apache/directory/server/ntp/NtpITest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ntp/src/test/java/org/apache/directory/server/ntp/NtpITest.java?rev=704006&r1=704005&r2=704006&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ntp/src/test/java/org/apache/directory/server/ntp/NtpITest.java (original)
+++ directory/apacheds/trunk/protocol-ntp/src/test/java/org/apache/directory/server/ntp/NtpITest.java Mon Oct 13 03:16:07 2008
@@ -21,15 +21,13 @@
 
 
 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;
 
 
@@ -50,9 +48,7 @@
      */
     public void setUp() throws Exception
     {
-        NioDatagramAcceptor datagramAcceptor = new NioDatagramAcceptor( null );
-        datagramAcceptor.getFilterChain().addLast( "executor", new ExecutorFilter( Executors.newCachedThreadPool() ) );
-        //datagramAcceptor.getFilterChain().addlast( "decoder", )
+        DatagramAcceptor datagramAcceptor = new DatagramAcceptor( null );
         ntpConfig = new NtpServer();
         ntpConfig.setDatagramAcceptor( datagramAcceptor );
         ntpConfig.setEnabled( true );
@@ -74,7 +70,7 @@
         InetAddress host = InetAddress.getByName( null );
 
         NTPUDPClient ntp = new NTPUDPClient();
-        ntp.setDefaultTimeout( 500000 );
+        ntp.setDefaultTimeout( 5000 );
 
         TimeInfo timeInfo = ntp.getTime( host, port );
         long returnTime = timeInfo.getReturnTime();

Modified: directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/AbstractProtocolService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/AbstractProtocolService.java?rev=704006&r1=704005&r2=704006&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/AbstractProtocolService.java (original)
+++ directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/AbstractProtocolService.java Mon Oct 13 03:16:07 2008
@@ -20,8 +20,6 @@
 
 
 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;
@@ -44,8 +42,8 @@
     private String ipAddress;
     private int ipPort = -1;
     private Set<TransportProtocol> transportProtocols;
-    private NioDatagramAcceptor datagramAcceptor;
-    private NioSocketAcceptor socketAcceptor;
+    private DatagramAcceptor datagramAcceptor;
+    private SocketAcceptor socketAcceptor;
     /** directory service core where protocol data is backed */
     private DirectoryService directoryService;
 
@@ -153,25 +151,25 @@
     }
 
 
-    public NioDatagramAcceptor getDatagramAcceptor()
+    public DatagramAcceptor getDatagramAcceptor()
     {
         return datagramAcceptor;
     }
 
 
-    public void setDatagramAcceptor( NioDatagramAcceptor datagramAcceptor )
+    public void setDatagramAcceptor( DatagramAcceptor datagramAcceptor )
     {
         this.datagramAcceptor = datagramAcceptor;
     }
 
 
-    public NioSocketAcceptor getSocketAcceptor()
+    public SocketAcceptor getSocketAcceptor()
     {
         return socketAcceptor;
     }
 
 
-    public void setSocketAcceptor( NioSocketAcceptor socketAcceptor )
+    public void setSocketAcceptor( SocketAcceptor socketAcceptor )
     {
         this.socketAcceptor = socketAcceptor;
     }

Modified: directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/ProtocolService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/ProtocolService.java?rev=704006&r1=704005&r2=704006&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/ProtocolService.java (original)
+++ directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/ProtocolService.java Mon Oct 13 03:16:07 2008
@@ -20,8 +20,6 @@
 
 
 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;
 
@@ -64,7 +62,7 @@
      *
      * @return the MINA DatagramAcceptor used for UDP transports
      */
-    NioDatagramAcceptor getDatagramAcceptor();
+    DatagramAcceptor getDatagramAcceptor();
 
 
     /**
@@ -73,7 +71,7 @@
      *
      * @param datagramAcceptor the MINA DatagramAcceptor used for UDP transport
      */
-    void setDatagramAcceptor( NioDatagramAcceptor datagramAcceptor );
+    void setDatagramAcceptor( DatagramAcceptor datagramAcceptor );
 
 
     /**
@@ -82,7 +80,7 @@
      *
      * @return the MINA SocketAcceptor used for TCP transport
      */
-    NioSocketAcceptor getSocketAcceptor();
+    SocketAcceptor getSocketAcceptor();
 
 
     /**
@@ -91,7 +89,7 @@
      *
      * @param socketAcceptor the MINA SocketAcceptor used for TCP transport
      */
-    void setSocketAcceptor( NioSocketAcceptor socketAcceptor );
+    void setSocketAcceptor( SocketAcceptor socketAcceptor );
 
 
     /**

Modified: directory/apacheds/trunk/server-integ/src/main/java/org/apache/directory/server/integ/LdapServerFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/main/java/org/apache/directory/server/integ/LdapServerFactory.java?rev=704006&r1=704005&r2=704006&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/main/java/org/apache/directory/server/integ/LdapServerFactory.java (original)
+++ directory/apacheds/trunk/server-integ/src/main/java/org/apache/directory/server/integ/LdapServerFactory.java Mon Oct 13 03:16:07 2008
@@ -21,7 +21,6 @@
 
 import java.util.HashMap;
 import java.util.Map;
-import java.util.concurrent.Executors;
 
 import org.apache.directory.server.core.DefaultDirectoryService;
 import org.apache.directory.server.core.DirectoryService;
@@ -35,9 +34,8 @@
 import org.apache.directory.server.ldap.handlers.bind.ntlm.NtlmMechanismHandler;
 import org.apache.directory.server.ldap.handlers.extended.StartTlsHandler;
 import org.apache.directory.server.ldap.handlers.extended.StoredProcedureExtendedOperationHandler;
+import org.apache.directory.server.protocol.shared.SocketAcceptor;
 import org.apache.directory.shared.ldap.constants.SupportedSaslMechanisms;
-import org.apache.mina.transport.socket.nio.NioProcessor;
-import org.apache.mina.transport.socket.nio.NioSocketAcceptor;
 import org.apache.mina.util.AvailablePortFinder;
 
 
@@ -71,7 +69,7 @@
 
             LdapService ldapService = new LdapService();
             ldapService.setDirectoryService( service );
-            ldapService.setSocketAcceptor( new NioSocketAcceptor( new NioProcessor( Executors.newCachedThreadPool() ) ) );
+            ldapService.setSocketAcceptor( new SocketAcceptor( null ) );
             ldapService.setIpPort( AvailablePortFinder.getNextAvailable( 1024 ) );
             ldapService.addExtendedOperationHandler( new StartTlsHandler() );
             ldapService.addExtendedOperationHandler( new StoredProcedureExtendedOperationHandler() );

Modified: directory/apacheds/trunk/server-integ/src/main/java/org/apache/directory/server/integ/state/NonExistentState.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/main/java/org/apache/directory/server/integ/state/NonExistentState.java?rev=704006&r1=704005&r2=704006&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/main/java/org/apache/directory/server/integ/state/NonExistentState.java (original)
+++ directory/apacheds/trunk/server-integ/src/main/java/org/apache/directory/server/integ/state/NonExistentState.java Mon Oct 13 03:16:07 2008
@@ -83,7 +83,6 @@
         }
         catch ( Exception e )
         {
-            e.printStackTrace();
             throw new NamingException( e.getMessage() );
         }
     }

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/kerberos/KeyDerivationServiceIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/kerberos/KeyDerivationServiceIT.java?rev=704006&r1=704005&r2=704006&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/kerberos/KeyDerivationServiceIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/kerberos/KeyDerivationServiceIT.java Mon Oct 13 03:16:07 2008
@@ -49,8 +49,8 @@
 import org.apache.directory.server.ldap.handlers.bind.ntlm.NtlmMechanismHandler;
 import org.apache.directory.server.ldap.handlers.bind.plain.PlainMechanismHandler;
 import org.apache.directory.server.ldap.handlers.extended.StoredProcedureExtendedOperationHandler;
+import org.apache.directory.server.protocol.shared.SocketAcceptor;
 import org.apache.directory.shared.ldap.constants.SupportedSaslMechanisms;
-import org.apache.mina.transport.socket.nio.NioSocketAcceptor;
 import org.apache.mina.util.AvailablePortFinder;
 import org.junit.Before;
 import org.junit.Test;
@@ -142,7 +142,7 @@
 
              LdapService ldapService = new LdapService();
              ldapService.setDirectoryService( service );
-             ldapService.setSocketAcceptor( new NioSocketAcceptor( null ) );
+             ldapService.setSocketAcceptor( new SocketAcceptor( null ) );
              ldapService.setIpPort( AvailablePortFinder.getNextAvailable( 1024 ) );
              ldapService.setAllowAnonymousAccess( false );
              ldapService.addExtendedOperationHandler( new StoredProcedureExtendedOperationHandler() );

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/kerberos/PasswordPolicyServiceIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/kerberos/PasswordPolicyServiceIT.java?rev=704006&r1=704005&r2=704006&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/kerberos/PasswordPolicyServiceIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/kerberos/PasswordPolicyServiceIT.java Mon Oct 13 03:16:07 2008
@@ -44,8 +44,8 @@
 import org.apache.directory.server.ldap.handlers.bind.ntlm.NtlmMechanismHandler;
 import org.apache.directory.server.ldap.handlers.bind.plain.PlainMechanismHandler;
 import org.apache.directory.server.ldap.handlers.extended.StoredProcedureExtendedOperationHandler;
+import org.apache.directory.server.protocol.shared.SocketAcceptor;
 import org.apache.directory.shared.ldap.constants.SupportedSaslMechanisms;
-import org.apache.mina.transport.socket.nio.NioSocketAcceptor;
 import org.apache.mina.util.AvailablePortFinder;
 import org.junit.After;
 import org.junit.Before;
@@ -131,7 +131,7 @@
 
             LdapService ldapService = new LdapService();
             ldapService.setDirectoryService( service );
-            ldapService.setSocketAcceptor( new NioSocketAcceptor( null ) );
+            ldapService.setSocketAcceptor( new SocketAcceptor( null ) );
             ldapService.setIpPort( AvailablePortFinder.getNextAvailable( 1024 ) );
             ldapService.setAllowAnonymousAccess( false );
             ldapService.addExtendedOperationHandler( new StoredProcedureExtendedOperationHandler() );

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/MiscBindIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/MiscBindIT.java?rev=704006&r1=704005&r2=704006&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/MiscBindIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/MiscBindIT.java Mon Oct 13 03:16:07 2008
@@ -56,12 +56,12 @@
 import org.apache.directory.server.ldap.handlers.bind.gssapi.GssapiMechanismHandler;
 import org.apache.directory.server.ldap.handlers.bind.ntlm.NtlmMechanismHandler;
 import org.apache.directory.server.ldap.handlers.extended.StoredProcedureExtendedOperationHandler;
+import org.apache.directory.server.protocol.shared.SocketAcceptor;
 import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition;
 import org.apache.directory.shared.asn1.util.Asn1StringUtils;
 import org.apache.directory.shared.ldap.constants.SupportedSaslMechanisms;
 import org.apache.directory.shared.ldap.message.MutableControl;
 import org.apache.directory.shared.ldap.util.ArrayUtils;
-import org.apache.mina.transport.socket.nio.NioSocketAcceptor;
 import org.apache.mina.util.AvailablePortFinder;
 import org.junit.After;
 import org.junit.Before;
@@ -122,7 +122,7 @@
 
             LdapService ldapService = new LdapService();
             ldapService.setDirectoryService( service );
-            ldapService.setSocketAcceptor( new NioSocketAcceptor( null ) );
+            ldapService.setSocketAcceptor( new SocketAcceptor( null ) );
             ldapService.setIpPort( AvailablePortFinder.getNextAvailable( 1024 ) );
             ldapService.setAllowAnonymousAccess( true );
             ldapService.addExtendedOperationHandler( new StoredProcedureExtendedOperationHandler() );



Mime
View raw message