directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r725712 [3/9] - in /directory: apacheds/trunk/ apacheds/trunk/all/ apacheds/trunk/bootstrap-plugin/src/main/java/org/apache/directory/server/core/bootstrap/plugin/ apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltr...
Date Thu, 11 Dec 2008 15:32:12 GMT
Modified: directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/keytab/KeytabDecoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/keytab/KeytabDecoder.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/keytab/KeytabDecoder.java (original)
+++ directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/keytab/KeytabDecoder.java Thu Dec 11 07:32:04 2008
@@ -27,11 +27,11 @@
 import org.apache.directory.server.kerberos.shared.crypto.encryption.EncryptionType;
 import org.apache.directory.server.kerberos.shared.messages.value.EncryptionKey;
 import org.apache.directory.server.kerberos.shared.messages.value.KerberosTime;
-import org.apache.mina.common.ByteBuffer;
+import org.apache.mina.core.buffer.IoBuffer;
 
 
 /**
- * Decode a {@link ByteBuffer} into keytab fields.
+ * Decode a {@link IoBuffer} into keytab fields.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
@@ -42,7 +42,7 @@
      * Read the keytab 16-bit file format version.  This
      * keytab reader currently only supports version 5.2.
      */
-    byte[] getKeytabVersion( ByteBuffer buffer )
+    byte[] getKeytabVersion( IoBuffer buffer )
     {
         byte[] version = new byte[2];
         buffer.get( version );
@@ -58,7 +58,7 @@
      * @param buffer
      * @return The keytab entries.
      */
-    List<KeytabEntry> getKeytabEntries( ByteBuffer buffer )
+    List<KeytabEntry> getKeytabEntries( IoBuffer buffer )
     {
         List<KeytabEntry> entries = new ArrayList<KeytabEntry>();
 
@@ -68,7 +68,7 @@
             byte[] entry = new byte[size];
 
             buffer.get( entry );
-            entries.add( getKeytabEntry( ByteBuffer.wrap( entry ) ) );
+            entries.add( getKeytabEntry( IoBuffer.wrap( entry ) ) );
         }
 
         return entries;
@@ -79,7 +79,7 @@
      * Reads off a "keytab entry," which consists of a principal name,
      * principal type, key version number, and key material.
      */
-    private KeytabEntry getKeytabEntry( ByteBuffer buffer )
+    private KeytabEntry getKeytabEntry( IoBuffer buffer )
     {
         String principalName = getPrincipalName( buffer );
 
@@ -102,7 +102,7 @@
      * @param buffer
      * @return The principal name.
      */
-    private String getPrincipalName( ByteBuffer buffer )
+    private String getPrincipalName( IoBuffer buffer )
     {
         int count = buffer.getUnsignedShort();
 
@@ -132,7 +132,7 @@
     /**
      * Read off a 16-bit encryption type and symmetric key material.
      */
-    private EncryptionKey getKeyBlock( ByteBuffer buffer, int keyVersion )
+    private EncryptionKey getKeyBlock( IoBuffer buffer, int keyVersion )
     {
         int type = buffer.getUnsignedShort();
         byte[] keyblock = getCountedBytes( buffer );
@@ -148,7 +148,7 @@
      * Use a prefixed 16-bit length to read off a String.  Realm and name
      * components are ASCII encoded text with no zero terminator.
      */
-    private String getCountedString( ByteBuffer buffer )
+    private String getCountedString( IoBuffer buffer )
     {
         int length = buffer.getUnsignedShort();
         byte[] data = new byte[length];
@@ -169,7 +169,7 @@
     /**
      * Use a prefixed 16-bit length to read off raw bytes.
      */
-    private byte[] getCountedBytes( ByteBuffer buffer )
+    private byte[] getCountedBytes( IoBuffer buffer )
     {
         int length = buffer.getUnsignedShort();
         byte[] data = new byte[length];

Modified: directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/keytab/KeytabEncoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/keytab/KeytabEncoder.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/keytab/KeytabEncoder.java (original)
+++ directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/keytab/KeytabEncoder.java Thu Dec 11 07:32:04 2008
@@ -24,11 +24,11 @@
 import java.util.List;
 
 import org.apache.directory.server.kerberos.shared.messages.value.EncryptionKey;
-import org.apache.mina.common.ByteBuffer;
+import org.apache.mina.core.buffer.IoBuffer;
 
 
 /**
- * Encode keytab fields into a {@link ByteBuffer}.
+ * Encode keytab fields into a {@link IoBuffer}.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
@@ -36,15 +36,15 @@
 class KeytabEncoder
 {
     /**
-     * Write the keytab version and entries into a {@link ByteBuffer}.
+     * Write the keytab version and entries into a {@link IoBuffer}.
      *
      * @param keytabVersion
      * @param entries
-     * @return The ByteBuffer.
+     * @return The IoBuffer.
      */
-    ByteBuffer write( byte[] keytabVersion, List<KeytabEntry> entries )
+    IoBuffer write( byte[] keytabVersion, List<KeytabEntry> entries )
     {
-        ByteBuffer buffer = ByteBuffer.allocate( 512 );
+        IoBuffer buffer = IoBuffer.allocate( 512 );
         putKeytabVersion( buffer, keytabVersion );
         putKeytabEntries( buffer, entries );
         buffer.flip();
@@ -57,7 +57,7 @@
      * Encode the 16-bit file format version.  This
      * keytab reader currently only support verision 5.2.
      */
-    private void putKeytabVersion( ByteBuffer buffer, byte[] version )
+    private void putKeytabVersion( IoBuffer buffer, byte[] version )
     {
         buffer.put( version );
     }
@@ -69,13 +69,13 @@
      * @param buffer
      * @param entries
      */
-    private void putKeytabEntries( ByteBuffer buffer, List<KeytabEntry> entries )
+    private void putKeytabEntries( IoBuffer buffer, List<KeytabEntry> entries )
     {
         Iterator<KeytabEntry> iterator = entries.iterator();
 
         while ( iterator.hasNext() )
         {
-            ByteBuffer entryBuffer = putKeytabEntry( iterator.next() );
+            IoBuffer entryBuffer = putKeytabEntry( iterator.next() );
             int size = entryBuffer.position();
 
             entryBuffer.flip();
@@ -90,9 +90,9 @@
      * Encode a "keytab entry," which consists of a principal name,
      * principal type, key version number, and key material.
      */
-    private ByteBuffer putKeytabEntry( KeytabEntry entry )
+    private IoBuffer putKeytabEntry( KeytabEntry entry )
     {
-        ByteBuffer buffer = ByteBuffer.allocate( 100 );
+        IoBuffer buffer = IoBuffer.allocate( 100 );
 
         putPrincipalName( buffer, entry.getPrincipalName() );
 
@@ -114,7 +114,7 @@
      * @param buffer
      * @param principalName
      */
-    private void putPrincipalName( ByteBuffer buffer, String principalName )
+    private void putPrincipalName( IoBuffer buffer, String principalName )
     {
         String[] split = principalName.split( "@" );
         String nameComponent = split[0];
@@ -138,7 +138,7 @@
     /**
      * Encode a 16-bit encryption type and symmetric key material.
      */
-    private void putKeyBlock( ByteBuffer buffer, EncryptionKey key )
+    private void putKeyBlock( IoBuffer buffer, EncryptionKey key )
     {
         buffer.putShort( ( short ) key.getKeyType().getOrdinal() );
         putCountedBytes( buffer, key.getKeyValue() );
@@ -149,7 +149,7 @@
      * Use a prefixed 16-bit length to encode a String.  Realm and name
      * components are ASCII encoded text with no zero terminator.
      */
-    private void putCountedString( ByteBuffer buffer, String string )
+    private void putCountedString( IoBuffer buffer, String string )
     {
         byte[] data = string.getBytes();
         buffer.putShort( ( short ) data.length );
@@ -160,7 +160,7 @@
     /**
      * Use a prefixed 16-bit length to encode raw bytes.
      */
-    private void putCountedBytes( ByteBuffer buffer, byte[] data )
+    private void putCountedBytes( IoBuffer buffer, byte[] data )
     {
         buffer.putShort( ( short ) data.length );
         buffer.put( data );

Modified: directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/keytab/KeytabTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/keytab/KeytabTest.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/keytab/KeytabTest.java (original)
+++ directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/keytab/KeytabTest.java Thu Dec 11 07:32:04 2008
@@ -38,7 +38,7 @@
 import org.apache.directory.server.kerberos.shared.crypto.encryption.KerberosKeyFactory;
 import org.apache.directory.server.kerberos.shared.messages.value.EncryptionKey;
 import org.apache.directory.server.kerberos.shared.messages.value.KerberosTime;
-import org.apache.mina.common.ByteBuffer;
+import org.apache.mina.core.buffer.IoBuffer;
 
 
 /**
@@ -151,7 +151,7 @@
 
         Keytab writer = Keytab.getInstance();
         writer.setEntries( entries );
-        ByteBuffer buffer = writer.write();
+        IoBuffer buffer = writer.write();
         assertEquals( "Expected file size.", 130, buffer.limit() );
     }
 

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/ClientConnectionManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/ClientConnectionManager.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/ClientConnectionManager.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/ClientConnectionManager.java Thu Dec 11 07:32:04 2008
@@ -23,7 +23,6 @@
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
-import java.util.concurrent.ExecutorService;
 import java.util.concurrent.LinkedBlockingQueue;
 import java.util.concurrent.ThreadPoolExecutor;
 import java.util.concurrent.TimeUnit;
@@ -34,16 +33,14 @@
 import org.apache.directory.mitosis.service.protocol.handler.ReplicationClientContextHandler;
 import org.apache.directory.mitosis.service.protocol.handler.ReplicationClientProtocolHandler;
 import org.apache.directory.mitosis.service.protocol.handler.ReplicationProtocolHandler;
-import org.apache.mina.common.ConnectFuture;
-import org.apache.mina.common.ExecutorThreadModel;
-import org.apache.mina.common.IoConnector;
-import org.apache.mina.common.IoConnectorConfig;
-import org.apache.mina.common.IoSession;
-import org.apache.mina.common.RuntimeIOException;
-import org.apache.mina.filter.LoggingFilter;
+import org.apache.mina.core.RuntimeIoException;
+import org.apache.mina.core.future.ConnectFuture;
+import org.apache.mina.core.service.IoConnector;
+import org.apache.mina.core.session.IoSession;
+import org.apache.mina.filter.logging.LoggingFilter;
 import org.apache.mina.filter.codec.ProtocolCodecFilter;
-import org.apache.mina.transport.socket.nio.SocketConnector;
-import org.apache.mina.transport.socket.nio.SocketConnectorConfig;
+import org.apache.mina.filter.executor.ExecutorFilter;
+import org.apache.mina.transport.socket.nio.NioSocketConnector;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -70,8 +67,7 @@
     private static final Logger LOG = LoggerFactory.getLogger( ClientConnectionManager.class );
 
     private final ReplicationInterceptor interceptor;
-    private final IoConnector connector = new SocketConnector();
-    private final IoConnectorConfig connectorConfig = new SocketConnectorConfig();
+    private final IoConnector connector = new NioSocketConnector();
     private final Map<String,Connection> sessions = new HashMap<String,Connection>();
     private ReplicationConfiguration configuration;
     private ConnectionMonitor monitor;
@@ -81,16 +77,17 @@
     {
         this.interceptor = interceptor;
 
-        ExecutorThreadModel threadModel = ExecutorThreadModel.getInstance( "mitosis" );
-        threadModel.setExecutor( new ThreadPoolExecutor( 16, 16, 60, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>() ) );
-        connectorConfig.setThreadModel( threadModel );
-
-        //// add codec
-        connectorConfig.getFilterChain().addLast( "protocol",
+        ExecutorFilter executor = new ExecutorFilter( new ThreadPoolExecutor( 16, 16, 60, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>() ) );
+        
+        // Add executor filter
+        connector.getFilterChain().addLast( "executor", executor );
+        
+        // add codec
+        connector.getFilterChain().addLast( "protocol",
             new ProtocolCodecFilter( new ReplicationClientProtocolCodecFactory() ) );
 
-        //// add logger
-        connectorConfig.getFilterChain().addLast( "logger", new LoggingFilter() );
+        // add logger
+        connector.getFilterChain().addLast( "logger", new LoggingFilter() );
     }
 
 
@@ -110,7 +107,8 @@
         // remove all filters
         connector.getFilterChain().clear();
 
-        ( ( ExecutorService ) ( ( ExecutorThreadModel ) connectorConfig.getThreadModel() ).getExecutor() ).shutdown();
+        // Shutdown the executor
+        ((ThreadPoolExecutor)(((ExecutorFilter)(connector.getFilterChain().get( "executor" )))).getExecutor()).shutdown();
         
         // Remove all status values.
         sessions.clear();
@@ -308,7 +306,7 @@
                         {
                             LOG.info( "[Replica-{}] Closed connection to Replica-{}", configuration.getReplicaId(),
                                     con.replicaId );
-                            con.session.close();
+                            con.session.close( true );
                         }
                     }
                 }
@@ -370,11 +368,11 @@
             IoSession session;
             try
             {
-                connectorConfig.setConnectTimeout( configuration.getResponseTimeout() );
-                ConnectFuture future = connector.connect( replica.getAddress(), new ReplicationClientProtocolHandler(
-                        interceptor ), connectorConfig );
+                connector.setConnectTimeoutMillis( configuration.getResponseTimeout() );
+                connector.setHandler( new ReplicationClientProtocolHandler( interceptor )  );
+                ConnectFuture future = connector.connect( replica.getAddress() );
 
-                future.join();
+                future.awaitUninterruptibly();
                 session = future.getSession();
 
                 synchronized ( con )
@@ -385,7 +383,7 @@
                     con.replicaId = replica.getId();
                 }
             }
-            catch ( RuntimeIOException e )
+            catch ( RuntimeIoException e )
             {
                 LOG.warn( "[Replica-" + ClientConnectionManager.this.configuration.getReplicaId()
                         + "] Failed to connect to replica-" + replica.getId(), e );

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/DefaultReplicationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/DefaultReplicationContext.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/DefaultReplicationContext.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/DefaultReplicationContext.java Thu Dec 11 07:32:04 2008
@@ -33,8 +33,9 @@
 import org.apache.directory.mitosis.service.protocol.handler.ReplicationProtocolHandler;
 import org.apache.directory.mitosis.service.protocol.message.BaseMessage;
 import org.apache.directory.server.core.DirectoryService;
-import org.apache.mina.common.IoSession;
-import org.apache.mina.util.SessionLog;
+import org.apache.mina.core.session.IoSession;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * The default implementation of {@link ReplicationContext}
@@ -43,6 +44,9 @@
  */
 public class DefaultReplicationContext implements ReplicationContext
 {
+    /** A logger for this class */
+    private final Logger logger = LoggerFactory.getLogger(getClass());
+
     private static final Timer EXPIRATION_TIMER = new Timer( "ReplicationMessageExpirer" );
 
     private final ReplicationInterceptor interceptor;
@@ -208,9 +212,9 @@
         {
             if ( removeTask( message.getSequence() ) == this )
             {
-                SessionLog.warn( getSession(), "No response within " + configuration.getResponseTimeout()
+                logger.warn( "No response within " + configuration.getResponseTimeout()
                     + " second(s) for message #" + message.getSequence() );
-                getSession().close();
+                getSession().close( true );
             }
         }
     }

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationContext.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationContext.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationContext.java Thu Dec 11 07:32:04 2008
@@ -26,7 +26,7 @@
 import org.apache.directory.mitosis.service.protocol.handler.ReplicationContextHandler;
 import org.apache.directory.mitosis.service.protocol.handler.ReplicationServerContextHandler;
 import org.apache.directory.server.core.DirectoryService;
-import org.apache.mina.common.IoSession;
+import org.apache.mina.core.session.IoSession;
 
 
 /**

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationInterceptor.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationInterceptor.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationInterceptor.java Thu Dec 11 07:32:04 2008
@@ -66,11 +66,9 @@
 import org.apache.directory.shared.ldap.filter.PresenceNode;
 import org.apache.directory.shared.ldap.message.AliasDerefMode;
 import org.apache.directory.shared.ldap.name.LdapDN;
-import org.apache.mina.common.IoAcceptor;
-import org.apache.mina.filter.LoggingFilter;
+import org.apache.mina.filter.logging.LoggingFilter;
 import org.apache.mina.filter.codec.ProtocolCodecFilter;
-import org.apache.mina.transport.socket.nio.SocketAcceptor;
-import org.apache.mina.transport.socket.nio.SocketAcceptorConfig;
+import org.apache.mina.transport.socket.nio.NioSocketAcceptor;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -164,7 +162,7 @@
     private PartitionNexus nexus;
     private OperationFactory operationFactory;
     private ReplicationStore store;
-    private IoAcceptor registry;
+    private NioSocketAcceptor registry;
     private final ClientConnectionManager clientConnectionManager = new ClientConnectionManager( this );
     private Registries registries;
 
@@ -254,18 +252,16 @@
 
     private void startNetworking() throws Exception
     {
-        registry = new SocketAcceptor();
-        SocketAcceptorConfig config = new SocketAcceptorConfig();
-        config.setReuseAddress( true );
-
-        config.getFilterChain().addLast( "protocol",
+        registry = new NioSocketAcceptor();
+        registry.setReuseAddress( true );
+        registry.getFilterChain().addLast( "protocol",
             new ProtocolCodecFilter( new ReplicationServerProtocolCodecFactory() ) );
 
-        config.getFilterChain().addLast( "logger", new LoggingFilter() );
-
+        registry.getFilterChain().addLast( "logger", new LoggingFilter() );
+        registry.setHandler( new ReplicationServerProtocolHandler( this  ) );
+        
         // bind server protocol provider
-        registry.bind( new InetSocketAddress( configuration.getServerPort() ), new ReplicationServerProtocolHandler(
-            this ), config );
+        registry.bind( new InetSocketAddress( configuration.getServerPort() ) );
 
         clientConnectionManager.start( configuration );
     }
@@ -290,7 +286,7 @@
             LOG.error( "[Replica-{}] Failed to stop the client connection manager.", configuration.getReplicaId() );
             LOG.error( "Stop failure exception: ", e );
         }
-        registry.unbindAll();
+        registry.unbind();
     }
 
 
@@ -386,7 +382,7 @@
         {
             while ( cursor.next() )
             {
-            	ServerEntry entry = cursor.get();
+                ServerEntry entry = cursor.get();
                 LdapDN name = entry.getDn();
                 
                 if ( name.size() > contextName.size() )
@@ -528,14 +524,14 @@
     @Override
     public EntryFilteringCursor list( NextInterceptor nextInterceptor, ListOperationContext opContext ) throws Exception
     {
-    	EntryFilteringCursor cursor = nextInterceptor.search(
-	            new SearchOperationContext(
-	                opContext.getSession(), opContext.getDn(), opContext.getAliasDerefMode(),
-	                new PresenceNode( SchemaConstants.OBJECT_CLASS_AT_OID ),
-	                new SearchControls() ) );
+        EntryFilteringCursor cursor = nextInterceptor.search(
+                new SearchOperationContext(
+                    opContext.getSession(), opContext.getDn(), opContext.getAliasDerefMode(),
+                    new PresenceNode( SchemaConstants.OBJECT_CLASS_AT_OID ),
+                    new SearchControls() ) );
 
-    	cursor.addEntryFilter( Constants.DELETED_ENTRIES_FILTER );
-    	return cursor;
+        cursor.addEntryFilter( Constants.DELETED_ENTRIES_FILTER );
+        return cursor;
     }
 
 
@@ -554,10 +550,10 @@
             searchControls.setReturningAttributes( newAttrIds );
         }
 
-    	EntryFilteringCursor cursor = nextInterceptor.search( new SearchOperationContext( opContext.getSession(), 
-    	    opContext.getDn(), opContext.getAliasDerefMode(), opContext.getFilter(), searchControls ) );
-    	cursor.addEntryFilter( Constants.DELETED_ENTRIES_FILTER );
-    	return cursor;
+        EntryFilteringCursor cursor = nextInterceptor.search( new SearchOperationContext( opContext.getSession(), 
+            opContext.getDn(), opContext.getAliasDerefMode(), opContext.getFilter(), searchControls ) );
+        cursor.addEntryFilter( Constants.DELETED_ENTRIES_FILTER );
+        return cursor;
     }
 
 

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/BaseMessageDecoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/BaseMessageDecoder.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/BaseMessageDecoder.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/BaseMessageDecoder.java Thu Dec 11 07:32:04 2008
@@ -22,8 +22,8 @@
 
 import org.apache.directory.mitosis.service.protocol.message.BaseMessage;
 import org.apache.directory.server.schema.registries.Registries;
-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.ProtocolDecoderException;
 import org.apache.mina.filter.codec.ProtocolDecoderOutput;
 import org.apache.mina.filter.codec.demux.MessageDecoder;
@@ -48,13 +48,13 @@
     }
 
 
-    public final MessageDecoderResult decodable( IoSession session, ByteBuffer buf )
+    public final MessageDecoderResult decodable( IoSession session, IoBuffer buf )
     {
         return type == buf.get() ? OK : NOT_OK;
     }
 
 
-    public final MessageDecoderResult decode( IoSession session, ByteBuffer in, ProtocolDecoderOutput out )
+    public final MessageDecoderResult decode( IoSession session, IoBuffer in, ProtocolDecoderOutput out )
         throws Exception
     {
         if ( !readHeader )
@@ -104,5 +104,5 @@
     }
 
 
-    protected abstract BaseMessage decodeBody( Registries registries, int sequence, int bodyLength, ByteBuffer in ) throws Exception;
+    protected abstract BaseMessage decodeBody( Registries registries, int sequence, int bodyLength, IoBuffer in ) throws Exception;
 }

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/BaseMessageEncoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/BaseMessageEncoder.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/BaseMessageEncoder.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/BaseMessageEncoder.java Thu Dec 11 07:32:04 2008
@@ -21,8 +21,8 @@
 
 
 import org.apache.directory.mitosis.service.protocol.message.BaseMessage;
-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.ProtocolEncoderOutput;
 import org.apache.mina.filter.codec.demux.MessageEncoder;
 
@@ -37,7 +37,7 @@
     public final void encode( IoSession session, Object in, ProtocolEncoderOutput out ) throws Exception
     {
         BaseMessage m = ( BaseMessage ) in;
-        ByteBuffer buf = ByteBuffer.allocate( 16 );
+        IoBuffer buf = IoBuffer.allocate( 16 );
         buf.setAutoExpand( true );
         buf.put( ( byte ) m.getType() );
         buf.putInt( m.getSequence() );
@@ -58,5 +58,5 @@
     }
 
 
-    protected abstract void encodeBody( BaseMessage in, ByteBuffer out ) throws Exception;
+    protected abstract void encodeBody( BaseMessage in, IoBuffer out ) throws Exception;
 }

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesAckMessageDecoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesAckMessageDecoder.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesAckMessageDecoder.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesAckMessageDecoder.java Thu Dec 11 07:32:04 2008
@@ -30,8 +30,8 @@
 import org.apache.directory.mitosis.service.protocol.message.BaseMessage;
 import org.apache.directory.mitosis.service.protocol.message.BeginLogEntriesAckMessage;
 import org.apache.directory.server.schema.registries.Registries;
-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.ProtocolDecoderException;
 import org.apache.mina.filter.codec.ProtocolDecoderOutput;
 
@@ -48,7 +48,7 @@
     }
 
 
-    protected BaseMessage decodeBody( Registries registries, int sequence, int bodyLength, int responseCode, ByteBuffer in ) throws Exception
+    protected BaseMessage decodeBody( Registries registries, int sequence, int bodyLength, int responseCode, IoBuffer in ) throws Exception
     {
         if ( responseCode != Constants.OK )
         {
@@ -65,7 +65,7 @@
     }
 
 
-    private void readCSNVector( ByteBuffer in, CSNVector updateVector ) throws Exception
+    private void readCSNVector( IoBuffer in, CSNVector updateVector ) throws Exception
     {
         int nReplicas = in.getInt();
         

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesAckMessageEncoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesAckMessageEncoder.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesAckMessageEncoder.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesAckMessageEncoder.java Thu Dec 11 07:32:04 2008
@@ -26,12 +26,12 @@
 import java.util.HashSet;
 import java.util.Set;
 
-import org.apache.mina.common.ByteBuffer;
 import org.apache.directory.mitosis.common.CSN;
 import org.apache.directory.mitosis.common.CSNVector;
 import org.apache.directory.mitosis.service.protocol.Constants;
 import org.apache.directory.mitosis.service.protocol.message.BaseMessage;
 import org.apache.directory.mitosis.service.protocol.message.BeginLogEntriesAckMessage;
+import org.apache.mina.core.buffer.IoBuffer;
 
 
 public class BeginLogEntriesAckMessageEncoder extends ResponseMessageEncoder
@@ -45,7 +45,7 @@
     }
 
 
-    protected void encodeBody( BaseMessage in, ByteBuffer out ) throws Exception
+    protected void encodeBody( BaseMessage in, IoBuffer out ) throws Exception
     {
         // write out response code
         super.encodeBody( in, out );
@@ -61,7 +61,7 @@
     }
 
 
-    private void writeCSNVector( ByteBuffer out, CSNVector csns )
+    private void writeCSNVector( IoBuffer out, CSNVector csns )
     {
         Set<String> replicaIds = csns.getReplicaIds();
 

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesMessageDecoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesMessageDecoder.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesMessageDecoder.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesMessageDecoder.java Thu Dec 11 07:32:04 2008
@@ -24,8 +24,8 @@
 import org.apache.directory.mitosis.service.protocol.message.BaseMessage;
 import org.apache.directory.mitosis.service.protocol.message.BeginLogEntriesMessage;
 import org.apache.directory.server.schema.registries.Registries;
-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.ProtocolDecoderOutput;
 
 
@@ -38,7 +38,7 @@
     }
 
 
-    protected BaseMessage decodeBody( Registries registries, int sequence, int bodyLength, ByteBuffer in ) throws Exception
+    protected BaseMessage decodeBody( Registries registries, int sequence, int bodyLength, IoBuffer in ) throws Exception
     {
         return new BeginLogEntriesMessage( sequence );
     }

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesMessageEncoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesMessageEncoder.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesMessageEncoder.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesMessageEncoder.java Thu Dec 11 07:32:04 2008
@@ -25,7 +25,7 @@
 
 import org.apache.directory.mitosis.service.protocol.message.BaseMessage;
 import org.apache.directory.mitosis.service.protocol.message.BeginLogEntriesMessage;
-import org.apache.mina.common.ByteBuffer;
+import org.apache.mina.core.buffer.IoBuffer;
 
 
 public class BeginLogEntriesMessageEncoder extends BaseMessageEncoder
@@ -35,7 +35,7 @@
     }
 
 
-    protected void encodeBody( BaseMessage in, ByteBuffer out )
+    protected void encodeBody( BaseMessage in, IoBuffer out )
     {
     }
 

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/EndLogEntriesAckMessageDecoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/EndLogEntriesAckMessageDecoder.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/EndLogEntriesAckMessageDecoder.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/EndLogEntriesAckMessageDecoder.java Thu Dec 11 07:32:04 2008
@@ -24,8 +24,8 @@
 import org.apache.directory.mitosis.service.protocol.message.BaseMessage;
 import org.apache.directory.mitosis.service.protocol.message.EndLogEntriesAckMessage;
 import org.apache.directory.server.schema.registries.Registries;
-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.ProtocolDecoderOutput;
 
 
@@ -37,7 +37,7 @@
     }
 
 
-    protected BaseMessage decodeBody( Registries registries, int sequence, int bodyLength, int responseCode, ByteBuffer in ) throws Exception
+    protected BaseMessage decodeBody( Registries registries, int sequence, int bodyLength, int responseCode, IoBuffer in ) throws Exception
     {
         return new EndLogEntriesAckMessage( sequence, responseCode );
     }

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/EndLogEntriesMessageDecoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/EndLogEntriesMessageDecoder.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/EndLogEntriesMessageDecoder.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/EndLogEntriesMessageDecoder.java Thu Dec 11 07:32:04 2008
@@ -24,8 +24,8 @@
 import org.apache.directory.mitosis.service.protocol.message.BaseMessage;
 import org.apache.directory.mitosis.service.protocol.message.EndLogEntriesMessage;
 import org.apache.directory.server.schema.registries.Registries;
-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.ProtocolDecoderOutput;
 
 
@@ -38,7 +38,7 @@
     }
 
 
-    protected BaseMessage decodeBody( Registries registries, int sequence, int bodyLength, ByteBuffer in ) throws Exception
+    protected BaseMessage decodeBody( Registries registries, int sequence, int bodyLength, IoBuffer in ) throws Exception
     {
         return new EndLogEntriesMessage( sequence );
     }

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/EndLogEntriesMessageEncoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/EndLogEntriesMessageEncoder.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/EndLogEntriesMessageEncoder.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/EndLogEntriesMessageEncoder.java Thu Dec 11 07:32:04 2008
@@ -25,7 +25,7 @@
 
 import org.apache.directory.mitosis.service.protocol.message.BaseMessage;
 import org.apache.directory.mitosis.service.protocol.message.EndLogEntriesMessage;
-import org.apache.mina.common.ByteBuffer;
+import org.apache.mina.core.buffer.IoBuffer;
 
 
 public class EndLogEntriesMessageEncoder extends BaseMessageEncoder
@@ -35,7 +35,7 @@
     }
 
 
-    protected void encodeBody( BaseMessage in, ByteBuffer out )
+    protected void encodeBody( BaseMessage in, IoBuffer out )
     {
     }
 

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LogEntryAckMessageDecoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LogEntryAckMessageDecoder.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LogEntryAckMessageDecoder.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LogEntryAckMessageDecoder.java Thu Dec 11 07:32:04 2008
@@ -24,8 +24,8 @@
 import org.apache.directory.mitosis.service.protocol.message.BaseMessage;
 import org.apache.directory.mitosis.service.protocol.message.LogEntryAckMessage;
 import org.apache.directory.server.schema.registries.Registries;
-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.ProtocolDecoderOutput;
 
 
@@ -37,7 +37,7 @@
     }
 
 
-    protected BaseMessage decodeBody( Registries registries, int sequence, int bodyLength, int responseCode, ByteBuffer in ) throws Exception
+    protected BaseMessage decodeBody( Registries registries, int sequence, int bodyLength, int responseCode, IoBuffer in ) throws Exception
     {
         return new LogEntryAckMessage( sequence, responseCode );
     }

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LogEntryMessageDecoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LogEntryMessageDecoder.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LogEntryMessageDecoder.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LogEntryMessageDecoder.java Thu Dec 11 07:32:04 2008
@@ -25,8 +25,8 @@
 import org.apache.directory.mitosis.service.protocol.message.BaseMessage;
 import org.apache.directory.mitosis.service.protocol.message.LogEntryMessage;
 import org.apache.directory.server.schema.registries.Registries;
-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.ProtocolDecoderOutput;
 
 
@@ -41,7 +41,7 @@
     }
 
 
-    protected BaseMessage decodeBody( Registries registries, int sequence, int bodyLength, ByteBuffer in ) throws Exception
+    protected BaseMessage decodeBody( Registries registries, int sequence, int bodyLength, IoBuffer in ) throws Exception
     {
         byte[] src = new byte[in.remaining()];
         in.get( src );

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LogEntryMessageEncoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LogEntryMessageEncoder.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LogEntryMessageEncoder.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LogEntryMessageEncoder.java Thu Dec 11 07:32:04 2008
@@ -26,7 +26,7 @@
 import org.apache.directory.mitosis.operation.OperationCodec;
 import org.apache.directory.mitosis.service.protocol.message.BaseMessage;
 import org.apache.directory.mitosis.service.protocol.message.LogEntryMessage;
-import org.apache.mina.common.ByteBuffer;
+import org.apache.mina.core.buffer.IoBuffer;
 
 
 public class LogEntryMessageEncoder extends BaseMessageEncoder
@@ -39,7 +39,7 @@
     }
 
 
-    protected void encodeBody( BaseMessage in, ByteBuffer out )
+    protected void encodeBody( BaseMessage in, IoBuffer out )
     {
         LogEntryMessage m = ( LogEntryMessage ) in;
         out.put( operationCodec.encode( m.getOperation() ) );

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LoginAckMessageDecoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LoginAckMessageDecoder.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LoginAckMessageDecoder.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LoginAckMessageDecoder.java Thu Dec 11 07:32:04 2008
@@ -23,8 +23,8 @@
 import java.nio.charset.Charset;
 import java.nio.charset.CharsetDecoder;
 
-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.ProtocolDecoderOutput;
 import org.apache.directory.mitosis.service.protocol.Constants;
 import org.apache.directory.mitosis.service.protocol.message.BaseMessage;
@@ -43,7 +43,7 @@
     }
 
 
-    protected BaseMessage decodeBody( Registries registries, int sequence, int bodyLength, int responseCode, ByteBuffer in ) throws Exception
+    protected BaseMessage decodeBody( Registries registries, int sequence, int bodyLength, int responseCode, IoBuffer in ) throws Exception
     {
         return new LoginAckMessage( sequence, responseCode, in.getString( utf8decoder ) );
     }

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LoginAckMessageEncoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LoginAckMessageEncoder.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LoginAckMessageEncoder.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LoginAckMessageEncoder.java Thu Dec 11 07:32:04 2008
@@ -27,7 +27,7 @@
 
 import org.apache.directory.mitosis.service.protocol.message.BaseMessage;
 import org.apache.directory.mitosis.service.protocol.message.LoginAckMessage;
-import org.apache.mina.common.ByteBuffer;
+import org.apache.mina.core.buffer.IoBuffer;
 
 
 public class LoginAckMessageEncoder extends ResponseMessageEncoder
@@ -48,7 +48,7 @@
     }
 
 
-    protected void encodeBody( BaseMessage in, ByteBuffer out ) throws Exception
+    protected void encodeBody( BaseMessage in, IoBuffer out ) throws Exception
     {
         LoginAckMessage m = ( LoginAckMessage ) in;
         super.encodeBody( in, out );

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LoginMessageDecoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LoginMessageDecoder.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LoginMessageDecoder.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LoginMessageDecoder.java Thu Dec 11 07:32:04 2008
@@ -23,8 +23,8 @@
 import java.nio.charset.Charset;
 import java.nio.charset.CharsetDecoder;
 
-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.ProtocolDecoderOutput;
 import org.apache.directory.mitosis.service.protocol.Constants;
 import org.apache.directory.mitosis.service.protocol.message.BaseMessage;
@@ -44,7 +44,7 @@
     }
 
 
-    protected BaseMessage decodeBody( Registries registries, int sequence, int bodyLength, ByteBuffer in ) throws Exception
+    protected BaseMessage decodeBody( Registries registries, int sequence, int bodyLength, IoBuffer in ) throws Exception
     {
         return new LoginMessage( sequence, in.getString( utf8decoder ) );
     }

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LoginMessageEncoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LoginMessageEncoder.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LoginMessageEncoder.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LoginMessageEncoder.java Thu Dec 11 07:32:04 2008
@@ -28,7 +28,7 @@
 
 import org.apache.directory.mitosis.service.protocol.message.BaseMessage;
 import org.apache.directory.mitosis.service.protocol.message.LoginMessage;
-import org.apache.mina.common.ByteBuffer;
+import org.apache.mina.core.buffer.IoBuffer;
 
 
 public class LoginMessageEncoder extends BaseMessageEncoder
@@ -42,7 +42,7 @@
     }
 
 
-    protected void encodeBody( BaseMessage in, ByteBuffer out )
+    protected void encodeBody( BaseMessage in, IoBuffer out )
     {
         LoginMessage m = ( LoginMessage ) in;
 

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/ReplicationClientProtocolCodecFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/ReplicationClientProtocolCodecFactory.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/ReplicationClientProtocolCodecFactory.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/ReplicationClientProtocolCodecFactory.java Thu Dec 11 07:32:04 2008
@@ -20,6 +20,10 @@
 package org.apache.directory.mitosis.service.protocol.codec;
 
 
+import org.apache.directory.mitosis.service.protocol.message.BeginLogEntriesMessage;
+import org.apache.directory.mitosis.service.protocol.message.EndLogEntriesMessage;
+import org.apache.directory.mitosis.service.protocol.message.LogEntryMessage;
+import org.apache.directory.mitosis.service.protocol.message.LoginMessage;
 import org.apache.mina.filter.codec.demux.DemuxingProtocolCodecFactory;
 
 
@@ -28,14 +32,14 @@
 
     public ReplicationClientProtocolCodecFactory()
     {
-        register( LogEntryMessageEncoder.class );
-        register( LoginMessageEncoder.class );
-        register( BeginLogEntriesMessageEncoder.class );
-        register( EndLogEntriesMessageEncoder.class );
-
-        register( LogEntryAckMessageDecoder.class );
-        register( LoginAckMessageDecoder.class );
-        register( BeginLogEntriesAckMessageDecoder.class );
-        register( EndLogEntriesAckMessageDecoder.class );
+        addMessageEncoder( LogEntryMessage.class, LogEntryMessageEncoder.class );
+        addMessageEncoder( LoginMessage.class, LoginMessageEncoder.class );
+        addMessageEncoder( BeginLogEntriesMessage.class, BeginLogEntriesMessageEncoder.class );
+        addMessageEncoder( EndLogEntriesMessage.class, EndLogEntriesMessageEncoder.class );
+
+        addMessageDecoder( LogEntryAckMessageDecoder.class );
+        addMessageDecoder( LoginAckMessageDecoder.class );
+        addMessageDecoder( BeginLogEntriesAckMessageDecoder.class );
+        addMessageDecoder( EndLogEntriesAckMessageDecoder.class );
     }
 }

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/ReplicationServerProtocolCodecFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/ReplicationServerProtocolCodecFactory.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/ReplicationServerProtocolCodecFactory.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/ReplicationServerProtocolCodecFactory.java Thu Dec 11 07:32:04 2008
@@ -20,6 +20,10 @@
 package org.apache.directory.mitosis.service.protocol.codec;
 
 
+import org.apache.directory.mitosis.service.protocol.message.BeginLogEntriesAckMessage;
+import org.apache.directory.mitosis.service.protocol.message.EndLogEntriesAckMessage;
+import org.apache.directory.mitosis.service.protocol.message.LogEntryAckMessage;
+import org.apache.directory.mitosis.service.protocol.message.LoginAckMessage;
 import org.apache.mina.filter.codec.demux.DemuxingProtocolCodecFactory;
 
 
@@ -28,14 +32,14 @@
 
     public ReplicationServerProtocolCodecFactory()
     {
-        register( LogEntryAckMessageEncoder.class );
-        register( LoginAckMessageEncoder.class );
-        register( BeginLogEntriesAckMessageEncoder.class );
-        register( EndLogEntriesAckMessageEncoder.class );
-
-        register( LogEntryMessageDecoder.class );
-        register( LoginMessageDecoder.class );
-        register( BeginLogEntriesMessageDecoder.class );
-        register( EndLogEntriesMessageDecoder.class );
+        addMessageEncoder( LogEntryAckMessage.class, LogEntryAckMessageEncoder.class );
+        addMessageEncoder( LoginAckMessage.class, LoginAckMessageEncoder.class );
+        addMessageEncoder( BeginLogEntriesAckMessage.class, BeginLogEntriesAckMessageEncoder.class );
+        addMessageEncoder( EndLogEntriesAckMessage.class, EndLogEntriesAckMessageEncoder.class );
+
+        addMessageDecoder( LogEntryMessageDecoder.class );
+        addMessageDecoder( LoginMessageDecoder.class );
+        addMessageDecoder( BeginLogEntriesMessageDecoder.class );
+        addMessageDecoder( EndLogEntriesMessageDecoder.class );
     }
 }

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/ResponseMessageDecoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/ResponseMessageDecoder.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/ResponseMessageDecoder.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/ResponseMessageDecoder.java Thu Dec 11 07:32:04 2008
@@ -22,7 +22,7 @@
 
 import org.apache.directory.mitosis.service.protocol.message.BaseMessage;
 import org.apache.directory.server.schema.registries.Registries;
-import org.apache.mina.common.ByteBuffer;
+import org.apache.mina.core.buffer.IoBuffer;
 
 
 public abstract class ResponseMessageDecoder extends BaseMessageDecoder
@@ -34,13 +34,13 @@
     }
 
 
-    protected final BaseMessage decodeBody( Registries registries, int sequence, int bodyLength, ByteBuffer in ) throws Exception
+    protected final BaseMessage decodeBody( Registries registries, int sequence, int bodyLength, IoBuffer in ) throws Exception
     {
         return decodeBody( registries, sequence, bodyLength, in.getInt(), in );
     }
 
 
-    protected abstract BaseMessage decodeBody( Registries registries, int sequence, int bodyLength, int responseCode, ByteBuffer in )
+    protected abstract BaseMessage decodeBody( Registries registries, int sequence, int bodyLength, int responseCode, IoBuffer in )
         throws Exception;
 
 }

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/ResponseMessageEncoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/ResponseMessageEncoder.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/ResponseMessageEncoder.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/ResponseMessageEncoder.java Thu Dec 11 07:32:04 2008
@@ -22,7 +22,7 @@
 
 import org.apache.directory.mitosis.service.protocol.message.BaseMessage;
 import org.apache.directory.mitosis.service.protocol.message.ResponseMessage;
-import org.apache.mina.common.ByteBuffer;
+import org.apache.mina.core.buffer.IoBuffer;
 
 
 public abstract class ResponseMessageEncoder extends BaseMessageEncoder
@@ -32,7 +32,7 @@
     }
 
 
-    protected void encodeBody( BaseMessage in, ByteBuffer out ) throws Exception
+    protected void encodeBody( BaseMessage in, IoBuffer out ) throws Exception
     {
         ResponseMessage m = ( ResponseMessage ) in;
         out.putInt( m.getResponseCode() );

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationClientContextHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationClientContextHandler.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationClientContextHandler.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationClientContextHandler.java Thu Dec 11 07:32:04 2008
@@ -58,9 +58,10 @@
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.OidNormalizer;
 import org.apache.directory.shared.ldap.util.StringTools;
-import org.apache.mina.common.IdleStatus;
-import org.apache.mina.common.WriteFuture;
-import org.apache.mina.util.SessionLog;
+import org.apache.mina.core.future.WriteFuture;
+import org.apache.mina.core.session.IdleStatus;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import javax.naming.directory.SearchControls;
 import java.net.InetSocketAddress;
@@ -124,6 +125,9 @@
  */
 public class ReplicationClientContextHandler implements ReplicationContextHandler
 {
+    /** A logger for this class */
+    private final Logger logger = LoggerFactory.getLogger(getClass());
+    
     public void contextBegin( ReplicationContext ctx ) throws Exception
     {
         // Send a login message.
@@ -131,10 +135,10 @@
         writeTimeLimitedMessage( ctx, m );
 
         // Set write timeout
-        ctx.getSession().setWriteTimeout( ctx.getConfiguration().getResponseTimeout() );
+        ctx.getSession().getConfig().setWriteTimeout( ctx.getConfiguration().getResponseTimeout() );
 
         // Check update vector of the remote peer periodically.
-        ctx.getSession().setIdleTime( IdleStatus.BOTH_IDLE, ctx.getConfiguration().getReplicationInterval() );
+        ctx.getSession().getConfig().setIdleTime( IdleStatus.BOTH_IDLE, ctx.getConfiguration().getReplicationInterval() );
     }
 
 
@@ -201,12 +205,12 @@
 
     public void exceptionCaught( ReplicationContext ctx, Throwable cause ) throws Exception
     {
-        if ( SessionLog.isWarnEnabled( ctx.getSession() ) )
+        if ( logger.isWarnEnabled() )
         {
-            SessionLog.warn( ctx.getSession(), "[Replica-" + ctx.getConfiguration().getReplicaId()
+            logger.warn( "[Replica-" + ctx.getConfiguration().getReplicaId()
                 + "] Unexpected exception.", cause );
         }
-        ctx.getSession().close();
+        ctx.getSession().close( true );
     }
 
 
@@ -220,9 +224,9 @@
     {
         if ( message.getResponseCode() != Constants.OK )
         {
-            SessionLog.warn( ctx.getSession(), "[Replica-" + ctx.getConfiguration().getReplicaId()
+            logger.warn( "[Replica-" + ctx.getConfiguration().getReplicaId()
                 + "] Login attempt failed: " + message.getResponseCode() );
-            ctx.getSession().close();
+            ctx.getSession().close( true );
             return;
         }
 
@@ -239,18 +243,18 @@
                 }
                 else
                 {
-                    SessionLog.warn( ctx.getSession(), "[Replica-" + ctx.getConfiguration().getReplicaId()
+                    logger.warn( "[Replica-" + ctx.getConfiguration().getReplicaId()
                         + "] Peer address mismatches: " + ctx.getSession().getRemoteAddress() + " (expected: "
                         + replica.getAddress() );
-                    ctx.getSession().close();
+                    ctx.getSession().close( true );
                     return;
                 }
             }
         }
 
-        SessionLog.warn( ctx.getSession(), "[Replica-" + ctx.getConfiguration().getReplicaId()
+        logger.warn( "[Replica-" + ctx.getConfiguration().getReplicaId()
             + "] Unknown peer replica ID: " + message.getReplicaId() );
-        ctx.getSession().close();
+        ctx.getSession().close( true );
     }
 
 
@@ -261,12 +265,12 @@
         // it means previous replication process ended or this is the
         // first replication attempt.
         if ( ctx.getState() == State.READY && ctx.getScheduledExpirations() <= 0
-            && ctx.getSession().getScheduledWriteRequests() <= 0 )
+            && ctx.getSession().getScheduledWriteMessages() <= 0 )
         {
             // Initiate replication process asking update vector.
-            if ( SessionLog.isDebugEnabled( ctx.getSession() ) )
+            if ( logger.isDebugEnabled() )
             {
-                SessionLog.debug( ctx.getSession(), "(" + ctx.getConfiguration().getReplicaId() + "->"
+                logger.debug( "(" + ctx.getConfiguration().getReplicaId() + "->"
                     + ( ctx.getPeer() != null ? ctx.getPeer().getId() : "null" ) + ") Beginning replication. " );
             }
             ctx.getSession().write( new BeginLogEntriesMessage( ctx.getNextSequence() ) );
@@ -274,13 +278,13 @@
         }
         else
         {
-            if ( SessionLog.isDebugEnabled( ctx.getSession() ) )
+            if ( logger.isDebugEnabled() )
             {
-                SessionLog.debug( ctx.getSession(), "(" + ctx.getConfiguration().getReplicaId() + "->"
+                logger.debug( "(" + ctx.getConfiguration().getReplicaId() + "->"
                     + ( ctx.getPeer() != null ? ctx.getPeer().getId() : "null" )
                     + ") Couldn't begin replication.  State:" + ctx.getState() + ", scheduledExpirations:"
-                    + ctx.getScheduledExpirations() + ", scheduledWriteRequests:"
-                    + ctx.getSession().getScheduledWriteRequests() );
+                    + ctx.getScheduledExpirations() + ", scheduledWriteMessages:"
+                    + ctx.getSession().getScheduledWriteMessages() );
             }
             return false;
         }
@@ -291,9 +295,9 @@
     {
         if ( message.getResponseCode() != Constants.OK )
         {
-            SessionLog.warn( ctx.getSession(), "[Replica-" + ctx.getConfiguration().getReplicaId()
+            logger.warn( "[Replica-" + ctx.getConfiguration().getReplicaId()
                 + "] Remote peer failed to execute a log entry." );
-            ctx.getSession().close();
+            ctx.getSession().close( true );
         }
     }
 
@@ -316,9 +320,9 @@
         }
         catch ( Exception e )
         {
-            SessionLog.warn( ctx.getSession(), "[Replica-" + ctx.getConfiguration().getReplicaId()
+            logger.warn( "[Replica-" + ctx.getConfiguration().getReplicaId()
                 + "] Failed to get update vector.", e );
-            ctx.getSession().close();
+            ctx.getSession().close( true );
             return;
         }
 
@@ -327,13 +331,13 @@
         {
             if ( myPV.size() > 0 && yourUV.size() == 0 )
             {
-                SessionLog.warn( ctx.getSession(), "[Replica-" + ctx.getConfiguration().getReplicaId()
+                logger.warn( "[Replica-" + ctx.getConfiguration().getReplicaId()
                     + "] Starting a whole DIT transfer." );
                 sendAllEntries( ctx );
             }
             else
             {
-                SessionLog.warn( ctx.getSession(), "[Replica-" + ctx.getConfiguration().getReplicaId()
+                logger.warn( "[Replica-" + ctx.getConfiguration().getReplicaId()
                     + "] Starting a partial replication log transfer." );
                 sendReplicationLogs( registries, ctx, myPV, yourUV );
             }
@@ -354,7 +358,7 @@
 
         if ( namingContextsAttr == null || namingContextsAttr.size() == 0 )
         {
-            SessionLog.warn( ctx.getSession(), "[Replica-" + ctx.getConfiguration().getReplicaId()
+            logger.warn( "[Replica-" + ctx.getConfiguration().getReplicaId()
                 + "] No namingContexts attributes in rootDSE." );
             return;
         }
@@ -367,7 +371,7 @@
 
             contextName = new LdapDN( ( String ) namingContext.get() );
 
-            SessionLog.info( ctx.getSession(), "[Replica-" + ctx.getConfiguration().getReplicaId()
+            logger.info( "[Replica-" + ctx.getConfiguration().getReplicaId()
                 + "] Sending entries under '" + contextName + '\'' );
 
             Map<String, OidNormalizer> mapping = ctx.getDirectoryService().getRegistries().getAttributeTypeRegistry()
@@ -426,7 +430,7 @@
                 }
                 catch ( IllegalArgumentException ex )
                 {
-                    SessionLog.warn( ctx.getSession(), "An entry with improper entryCSN: " + entry.getDn() );
+                    logger.warn( "An entry with improper entryCSN: " + entry.getDn() );
                     continue;
                 }
 
@@ -457,9 +461,9 @@
             
             if ( yourCSN != null && ( myCSN == null || yourCSN.compareTo( myCSN ) < 0 ) )
             {
-                SessionLog.warn( ctx.getSession(), "Remote update vector (" + yourUV
+                logger.warn( "Remote update vector (" + yourUV
                     + ") is out-of-date.  Full replication is required." );
-                ctx.getSession().close();
+                ctx.getSession().close( true );
                 return;
             }
         }
@@ -482,7 +486,7 @@
 
     private void onUnexpectedMessage( ReplicationContext ctx, Object message )
     {
-        SessionLog.warn( ctx.getSession(), "Unexpected message: " + message );
-        ctx.getSession().close();
+        logger.warn( "Unexpected message: " + message );
+        ctx.getSession().close( true );
     }
 }

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationContextHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationContextHandler.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationContextHandler.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationContextHandler.java Thu Dec 11 07:32:04 2008
@@ -21,8 +21,7 @@
 
 
 import org.apache.directory.mitosis.service.ReplicationContext;
-import org.apache.mina.common.IdleStatus;
-import org.apache.mina.common.IoHandler;
+import org.apache.mina.core.session.IdleStatus;
 
 /**
  * An interface that provides handler methods for events which occurs

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationProtocolHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationProtocolHandler.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationProtocolHandler.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationProtocolHandler.java Thu Dec 11 07:32:04 2008
@@ -25,9 +25,9 @@
 import org.apache.directory.mitosis.service.ReplicationContext;
 import org.apache.directory.mitosis.service.ReplicationInterceptor;
 import org.apache.directory.server.core.DirectoryService;
-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;
 
 /**
  * A MINA {@link IoHandler} that wraps a {@link ReplicationContextHandler}

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationServerContextHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationServerContextHandler.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationServerContextHandler.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationServerContextHandler.java Thu Dec 11 07:32:04 2008
@@ -35,8 +35,9 @@
 import org.apache.directory.mitosis.service.protocol.message.LoginAckMessage;
 import org.apache.directory.mitosis.service.protocol.message.LoginMessage;
 import org.apache.directory.mitosis.store.ReplicationStore;
-import org.apache.mina.common.IdleStatus;
-import org.apache.mina.util.SessionLog;
+import org.apache.mina.core.session.IdleStatus;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import java.net.InetSocketAddress;
 
@@ -52,16 +53,19 @@
  */
 public class ReplicationServerContextHandler implements ReplicationContextHandler
 {
+    /** A logger for this class */
+    private final Logger logger = LoggerFactory.getLogger(getClass());
+
     private Replica replicaInTransaction;
 
 
     public void contextBegin( ReplicationContext ctx ) throws Exception
     {
         // Set login timeout
-        ctx.getSession().setIdleTime( IdleStatus.BOTH_IDLE, ctx.getConfiguration().getResponseTimeout() );
+        ctx.getSession().getConfig().setIdleTime( IdleStatus.BOTH_IDLE, ctx.getConfiguration().getResponseTimeout() );
 
         // Set write timeout
-        ctx.getSession().setWriteTimeout( ctx.getConfiguration().getResponseTimeout() );
+        ctx.getSession().getConfig().setWriteTimeout( ctx.getConfiguration().getResponseTimeout() );
     }
 
 
@@ -117,9 +121,9 @@
 
     public void exceptionCaught( ReplicationContext ctx, Throwable cause ) throws Exception
     {
-        SessionLog.warn( ctx.getSession(), "[Replica-" + ctx.getConfiguration().getReplicaId()
+        logger.warn( "[Replica-" + ctx.getConfiguration().getReplicaId()
                 + "] Unexpected exception.", cause );
-        ctx.getSession().close();
+        ctx.getSession().close( true );
     }
 
 
@@ -127,10 +131,10 @@
     {
         if ( ctx.getState() == State.INIT )
         {
-            SessionLog.warn( ctx.getSession(), "[Replica-" + ctx.getConfiguration().getReplicaId()
+            logger.warn( "[Replica-" + ctx.getConfiguration().getReplicaId()
                 + "] No login attempt in " + ctx.getConfiguration().getResponseTimeout()
                 + " second(s)." );
-            ctx.getSession().close();
+            ctx.getSession().close( true );
         }
     }
 
@@ -152,28 +156,28 @@
                     ctx.setState( State.READY );
 
                     // Clear login timeout.
-                    ctx.getSession().setIdleTime( IdleStatus.BOTH_IDLE, 0 );
+                    ctx.getSession().getConfig().setIdleTime( IdleStatus.BOTH_IDLE, 0 );
                     return;
                 }
                 else
                 {
-                    SessionLog.warn( ctx.getSession(), "[Replica-" + ctx.getConfiguration().getReplicaId()
+                    logger.warn( "[Replica-" + ctx.getConfiguration().getReplicaId()
                             + "] Peer address mismatches: "
                             + ctx.getSession().getRemoteAddress() + " (expected: " + replica.getAddress() );
                     ctx.getSession().write(
                             new LoginAckMessage( message.getSequence(), Constants.NOT_OK, ctx.getConfiguration()
                                     .getReplicaId() ) );
-                    ctx.getSession().close();
+                    ctx.getSession().close( true );
                     return;
                 }
             }
         }
 
-        SessionLog.warn( ctx.getSession(), "[Replica-" + ctx.getConfiguration().getReplicaId()
+        logger.warn( "[Replica-" + ctx.getConfiguration().getReplicaId()
                 + "] Unknown peer replica ID: " + message.getReplicaId() );
         ctx.getSession().write(
             new LoginAckMessage( message.getSequence(), Constants.NOT_OK, ctx.getConfiguration().getReplicaId() ) );
-        ctx.getSession().close();
+        ctx.getSession().close( true );
     }
 
     
@@ -192,7 +196,7 @@
         try
         {
             op.execute( ctx.getDirectoryService().getPartitionNexus(), ctx.getConfiguration().getStore(),
-            		ctx.getDirectoryService().getSession() );
+                        ctx.getDirectoryService().getSession() );
             
             ack = new LogEntryAckMessage( message.getSequence(), Constants.OK );
         }
@@ -228,7 +232,7 @@
         }
         catch ( Exception e )
         {
-            SessionLog.warn( ctx.getSession(), "Failed to get update vector.", e );
+            logger.warn( "Failed to get update vector.", e );
             ctx.getSession()
                 .write( new BeginLogEntriesAckMessage( message.getSequence(), Constants.NOT_OK, null, null ) );
         }
@@ -252,8 +256,8 @@
 
     private void onUnexpectedMessage( ReplicationContext ctx, Object message )
     {
-        SessionLog.warn( ctx.getSession(), "[Replica-" + ctx.getConfiguration().getReplicaId()
+        logger.warn( "[Replica-" + ctx.getConfiguration().getReplicaId()
                 + "] Unexpected message: " + message );
-        ctx.getSession().close();
+        ctx.getSession().close( true );
     }
 }

Modified: directory/apacheds/trunk/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/AbstractMessageCodecTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/AbstractMessageCodecTest.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/AbstractMessageCodecTest.java (original)
+++ directory/apacheds/trunk/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/AbstractMessageCodecTest.java Thu Dec 11 07:32:04 2008
@@ -29,20 +29,15 @@
 
 import org.apache.directory.mitosis.service.protocol.message.BaseMessage;
 import org.apache.directory.server.core.DefaultDirectoryService;
-import org.apache.mina.common.ByteBuffer;
-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.IoSession;
-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.buffer.IoBuffer;
+import org.apache.mina.core.filterchain.IoFilter.NextFilter;
+import org.apache.mina.core.future.WriteFuture;
+import org.apache.mina.core.session.DummySession;
+import org.apache.mina.core.session.IoSession;
+import org.apache.mina.filter.codec.AbstractProtocolEncoderOutput;
 import org.apache.mina.filter.codec.ProtocolDecoderOutput;
 import org.apache.mina.filter.codec.demux.MessageDecoder;
 import org.apache.mina.filter.codec.demux.MessageEncoder;
-import org.apache.mina.filter.codec.support.SimpleProtocolEncoderOutput;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
@@ -87,20 +82,20 @@
     @Test 
     public void testMessageCodec() throws Exception
     {
-        SimpleProtocolEncoderOutput encoderOut = new SimpleProtocolEncoderOutput()
+        AbstractProtocolEncoderOutput encoderOut = new AbstractProtocolEncoderOutput()
         {
-            protected WriteFuture doFlush( ByteBuffer buf )
+            public WriteFuture flush()
             {
                 return null;
             }
 
         };
         
-        IoSession session = new  DummySession();
+        IoSession session = new MitosisDummySession();
         
         session.setAttribute( "registries", service.getRegistries() );
         encoder.encode( session, message, encoderOut );
-        ByteBuffer buf = encoderOut.getBufferQueue().poll();
+        IoBuffer buf = (IoBuffer)encoderOut.getMessageQueue().poll();
 
         buf.mark();
         Assert.assertTrue( decoder.decodable( null, buf ) == MessageDecoder.OK );
@@ -126,6 +121,9 @@
         public void flush()
         {
         }
+        
+        public void flush(NextFilter nextFilter, IoSession session) {
+        }
 
 
         public void write( Object message )
@@ -135,74 +133,23 @@
     }
 
 
-    protected static class DummySession extends BaseIoSession
+    protected static class MitosisDummySession extends DummySession
     {
         Object message;
 
 
-        @Override
-        public WriteFuture write( Object message )
-        {
-            this.message = message;
-
-            return super.write( message );
-        }
-
-
         protected Object getMessage()
         {
             return message;
         }
 
 
-        protected void updateTrafficMask()
-        {
-            // Do nothing.
-        }
-
-
-        public IoService getService()
-        {
-            return null;
-        }
-
-
-        public IoHandler getHandler()
-        {
-            return null;
-        }
-
-
-        public IoFilterChain getFilterChain()
-        {
-            return null;
-        }
-
-
-        public TransportType getTransportType()
-        {
-            return null;
-        }
-
-
         public SocketAddress getRemoteAddress()
         {
             return new InetSocketAddress( 10088 );
         }
 
-
-        public SocketAddress getLocalAddress()
-        {
-            return null;
-        }
-
-
-        public IoSessionConfig getConfig()
-        {
-            return null;
-        }
-
-
+        
         public int getScheduledWriteRequests()
         {
             return 0;
@@ -213,17 +160,12 @@
         {
             return null;
         }
-
-
-        public IoServiceConfig getServiceConfig()
+        
+        
+        public WriteFuture write(Object message) 
         {
+            this.message = message;
             return null;
         }
-
-
-        public int getScheduledWriteBytes()
-        {
-            return 0;
-        }
     }
 }

Modified: directory/apacheds/trunk/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/pom.xml?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
--- directory/apacheds/trunk/pom.xml (original)
+++ directory/apacheds/trunk/pom.xml Thu Dec 11 07:32:04 2008
@@ -74,13 +74,7 @@
       <dependency>
         <groupId>org.apache.mina</groupId>
         <artifactId>mina-core</artifactId>
-        <version>1.1.7</version>
-      </dependency>
-
-      <dependency>
-        <groupId>org.apache.mina</groupId>
-        <artifactId>mina-filter-ssl</artifactId>
-        <version>1.1.7</version>
+        <version>2.0.0-M4-SNAPSHOT</version>
       </dependency>
 
       <dependency>
@@ -272,7 +266,7 @@
       <dependency>
         <groupId>bouncycastle</groupId>
         <artifactId>bcprov-jdk15</artifactId>
-        <version>136</version>
+        <version>140</version>
       </dependency>
     </dependencies>
   </dependencyManagement>

Modified: directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/ChangePasswordServer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/ChangePasswordServer.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/ChangePasswordServer.java (original)
+++ directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/ChangePasswordServer.java Thu Dec 11 07:32:04 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;
 
@@ -269,18 +267,16 @@
         
         if ( getDatagramAcceptor() != null )
         {
-            DatagramAcceptorConfig udpConfig = new DatagramAcceptorConfig();
-            getDatagramAcceptor().bind( new InetSocketAddress( getIpPort() ),
-                    new ChangePasswordProtocolHandler( this, store ), udpConfig );
+            getDatagramAcceptor().setHandler( new ChangePasswordProtocolHandler( 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 ChangePasswordProtocolHandler( this, store ), tcpConfig );
+            getSocketAcceptor().setCloseOnDeactivation( false );
+            getSocketAcceptor().setReuseAddress( true );
+            getSocketAcceptor().setHandler( new ChangePasswordProtocolHandler( this, store ) );
+            getSocketAcceptor().bind( new InetSocketAddress( getIpPort() ) );
         }
         
         LOG.info( "ChangePassword service started." );

Modified: directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/protocol/ChangePasswordProtocolHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/protocol/ChangePasswordProtocolHandler.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/protocol/ChangePasswordProtocolHandler.java (original)
+++ directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/protocol/ChangePasswordProtocolHandler.java Thu Dec 11 07:32:04 2008
@@ -40,10 +40,9 @@
 import org.apache.directory.server.kerberos.shared.messages.ErrorMessageModifier;
 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;
@@ -79,10 +78,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( ChangePasswordUdpProtocolCodecFactory.getInstance() ) );
@@ -116,7 +115,7 @@
     public void exceptionCaught( IoSession session, Throwable cause )
     {
         log.debug( session.getRemoteAddress() + " EXCEPTION", cause );
-        session.close();
+        session.close( true );
     }
 
 

Modified: directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/protocol/ChangePasswordTcpDecoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/protocol/ChangePasswordTcpDecoder.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/protocol/ChangePasswordTcpDecoder.java (original)
+++ directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/protocol/ChangePasswordTcpDecoder.java Thu Dec 11 07:32:04 2008
@@ -22,9 +22,8 @@
 
 
 import org.apache.directory.server.changepw.io.ChangePasswordRequestDecoder;
-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;
 
@@ -74,7 +73,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/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/protocol/ChangePasswordTcpEncoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/protocol/ChangePasswordTcpEncoder.java?rev=725712&r1=725711&r2=725712&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/protocol/ChangePasswordTcpEncoder.java (original)
+++ directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/protocol/ChangePasswordTcpEncoder.java Thu Dec 11 07:32:04 2008
@@ -27,8 +27,8 @@
 import org.apache.directory.server.changepw.io.ChangePasswordReplyEncoder;
 import org.apache.directory.server.changepw.messages.ChangePasswordError;
 import org.apache.directory.server.changepw.messages.ChangePasswordReply;
-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;
 
@@ -45,7 +45,7 @@
 
     public void encode( IoSession session, Object message, ProtocolEncoderOutput out ) throws IOException
     {
-        ByteBuffer buf = ByteBuffer.allocate( 512 );
+        IoBuffer buf = IoBuffer.allocate( 512 );
 
         // make space for int length
         buf.putInt( 0 );



Mime
View raw message