directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r726234 - in /directory/clients/trunk/kerberos: client/src/main/java/org/apache/directory/client/kerberos/ client/src/main/java/org/apache/directory/client/kerberos/protocol/ password/src/main/java/org/apache/directory/client/password/ pass...
Date Sat, 13 Dec 2008 17:02:20 GMT
Author: elecharny
Date: Sat Dec 13 09:02:20 2008
New Revision: 726234

URL: http://svn.apache.org/viewvc?rev=726234&view=rev
Log:
Switched to MINA 2.0. Some error are still there, and need to be fixed.

Modified:
    directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/GetServiceTicket.java
    directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/GetTicketGrantingTicket.java
    directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/protocol/KerberosClientHandler.java
    directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/protocol/KerberosClientTcpCodecFactory.java
    directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/protocol/KerberosClientTcpDecoder.java
    directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/protocol/KerberosClientTcpEncoder.java
    directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/protocol/KerberosClientUdpCodecFactory.java
    directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/protocol/KerberosClientUdpDecoder.java
    directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/protocol/KerberosClientUdpEncoder.java
    directory/clients/trunk/kerberos/password/src/main/java/org/apache/directory/client/password/ChangePassword.java
    directory/clients/trunk/kerberos/password/src/main/java/org/apache/directory/client/password/ExportKey.java
    directory/clients/trunk/kerberos/password/src/main/java/org/apache/directory/client/password/protocol/PasswordClientHandler.java
    directory/clients/trunk/kerberos/password/src/main/java/org/apache/directory/client/password/protocol/PasswordClientTcpCodecFactory.java
    directory/clients/trunk/kerberos/password/src/main/java/org/apache/directory/client/password/protocol/PasswordClientTcpDecoder.java
    directory/clients/trunk/kerberos/password/src/main/java/org/apache/directory/client/password/protocol/PasswordClientTcpEncoder.java
    directory/clients/trunk/kerberos/password/src/main/java/org/apache/directory/client/password/protocol/PasswordClientUdpCodecFactory.java
    directory/clients/trunk/kerberos/password/src/main/java/org/apache/directory/client/password/protocol/PasswordClientUdpDecoder.java
    directory/clients/trunk/kerberos/password/src/main/java/org/apache/directory/client/password/protocol/PasswordClientUdpEncoder.java

Modified: directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/GetServiceTicket.java
URL: http://svn.apache.org/viewvc/directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/GetServiceTicket.java?rev=726234&r1=726233&r2=726234&view=diff
==============================================================================
--- directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/GetServiceTicket.java
(original)
+++ directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/GetServiceTicket.java
Sat Dec 13 09:02:20 2008
@@ -61,11 +61,13 @@
 import org.apache.directory.server.kerberos.shared.messages.value.RequestBodyModifier;
 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.mina.common.ConnectFuture;
-import org.apache.mina.common.IoConnector;
-import org.apache.mina.common.IoSession;
-import org.apache.mina.transport.socket.nio.DatagramConnector;
-import org.apache.mina.transport.socket.nio.SocketConnector;
+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.transport.socket.DatagramConnector;
+import org.apache.mina.transport.socket.SocketConnector;
+import org.apache.mina.transport.socket.nio.NioDatagramConnector;
+import org.apache.mina.transport.socket.nio.NioSocketConnector;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -131,7 +133,7 @@
 
         ConnectFuture future = connector.connect( new InetSocketAddress( hostname, port ),
new KerberosClientHandler() );
 
-        future.join();
+        future.awaitUninterruptibly();
 
         IoSession session = future.getSession();
 
@@ -145,7 +147,7 @@
             log.debug( "Unexpected exception.", e );
         }
 
-        session.getCloseFuture().join();
+        session.getCloseFuture().awaitUninterruptibly();
 
         Object message = session.getAttribute( "reply" );
 
@@ -405,11 +407,11 @@
 
         if ( transport.equals( "UDP" ) )
         {
-            connector = new DatagramConnector();
+            connector = new NioDatagramConnector();
         }
         else
         {
-            connector = new SocketConnector();
+            connector = new NioSocketConnector();
         }
 
         return connector;

Modified: directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/GetTicketGrantingTicket.java
URL: http://svn.apache.org/viewvc/directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/GetTicketGrantingTicket.java?rev=726234&r1=726233&r2=726234&view=diff
==============================================================================
--- directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/GetTicketGrantingTicket.java
(original)
+++ directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/GetTicketGrantingTicket.java
Sat Dec 13 09:02:20 2008
@@ -58,11 +58,11 @@
 import org.apache.directory.server.kerberos.shared.messages.value.RequestBodyModifier;
 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.mina.common.ConnectFuture;
-import org.apache.mina.common.IoConnector;
-import org.apache.mina.common.IoSession;
-import org.apache.mina.transport.socket.nio.DatagramConnector;
-import org.apache.mina.transport.socket.nio.SocketConnector;
+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.transport.socket.nio.NioDatagramConnector;
+import org.apache.mina.transport.socket.nio.NioSocketConnector;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -125,7 +125,7 @@
 
         ConnectFuture future = connector.connect( new InetSocketAddress( hostname, port ),
new KerberosClientHandler() );
 
-        future.join();
+        future.awaitUninterruptibly();
 
         IoSession session = future.getSession();
 
@@ -139,7 +139,7 @@
             log.debug( "Unexpected exception.", e );
         }
 
-        session.getCloseFuture().join();
+        session.getCloseFuture().awaitUninterruptibly();
 
         Object message = session.getAttribute( "reply" );
 
@@ -353,11 +353,11 @@
 
         if ( transport.equals( "UDP" ) )
         {
-            connector = new DatagramConnector();
+            connector = new NioDatagramConnector();
         }
         else
         {
-            connector = new SocketConnector();
+            connector = new NioSocketConnector();
         }
 
         return connector;

Modified: directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/protocol/KerberosClientHandler.java
URL: http://svn.apache.org/viewvc/directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/protocol/KerberosClientHandler.java?rev=726234&r1=726233&r2=726234&view=diff
==============================================================================
--- directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/protocol/KerberosClientHandler.java
(original)
+++ directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/protocol/KerberosClientHandler.java
Sat Dec 13 09:02:20 2008
@@ -20,10 +20,8 @@
 package org.apache.directory.client.kerberos.protocol;
 
 
-import org.apache.mina.common.IoHandler;
-import org.apache.mina.common.IoHandlerAdapter;
-import org.apache.mina.common.IoSession;
-import org.apache.mina.common.TransportType;
+import org.apache.mina.core.service.IoHandlerAdapter;
+import org.apache.mina.core.session.IoSession;
 import org.apache.mina.filter.codec.ProtocolCodecFilter;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -44,10 +42,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( KerberosClientUdpCodecFactory.getInstance() ) );
@@ -69,7 +67,7 @@
 
         session.setAttribute( "reply", message );
 
-        session.close();
+        session.close(true);
     }
 
 
@@ -77,6 +75,6 @@
     {
         log.error( session.getRemoteAddress() + " EXCEPTION", cause );
 
-        session.close();
+        session.close(true);
     }
 }

Modified: directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/protocol/KerberosClientTcpCodecFactory.java
URL: http://svn.apache.org/viewvc/directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/protocol/KerberosClientTcpCodecFactory.java?rev=726234&r1=726233&r2=726234&view=diff
==============================================================================
--- directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/protocol/KerberosClientTcpCodecFactory.java
(original)
+++ directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/protocol/KerberosClientTcpCodecFactory.java
Sat Dec 13 09:02:20 2008
@@ -20,6 +20,7 @@
 package org.apache.directory.client.kerberos.protocol;
 
 
+import org.apache.mina.core.session.IoSession;
 import org.apache.mina.filter.codec.ProtocolCodecFactory;
 import org.apache.mina.filter.codec.ProtocolDecoder;
 import org.apache.mina.filter.codec.ProtocolEncoder;
@@ -51,14 +52,14 @@
     }
 
 
-    public ProtocolEncoder getEncoder()
+    public ProtocolEncoder getEncoder( IoSession session )
     {
         // Create a new encoder.
         return new KerberosClientTcpEncoder();
     }
 
 
-    public ProtocolDecoder getDecoder()
+    public ProtocolDecoder getDecoder( IoSession session )
     {
         // Create a new decoder.
         return new KerberosClientTcpDecoder();

Modified: directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/protocol/KerberosClientTcpDecoder.java
URL: http://svn.apache.org/viewvc/directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/protocol/KerberosClientTcpDecoder.java?rev=726234&r1=726233&r2=726234&view=diff
==============================================================================
--- directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/protocol/KerberosClientTcpDecoder.java
(original)
+++ directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/protocol/KerberosClientTcpDecoder.java
Sat Dec 13 09:02:20 2008
@@ -22,9 +22,8 @@
 
 import org.apache.directory.server.kerberos.shared.io.decoder.ErrorMessageDecoder;
 import org.apache.directory.server.kerberos.shared.io.decoder.KdcReplyDecoder;
-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;
 
@@ -80,7 +79,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/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/protocol/KerberosClientTcpEncoder.java
URL: http://svn.apache.org/viewvc/directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/protocol/KerberosClientTcpEncoder.java?rev=726234&r1=726233&r2=726234&view=diff
==============================================================================
--- directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/protocol/KerberosClientTcpEncoder.java
(original)
+++ directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/protocol/KerberosClientTcpEncoder.java
Sat Dec 13 09:02:20 2008
@@ -24,8 +24,8 @@
 
 import org.apache.directory.server.kerberos.shared.io.encoder.KdcRequestEncoder;
 import org.apache.directory.server.kerberos.shared.messages.KdcRequest;
-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;
 
@@ -41,7 +41,7 @@
 
     public void encode( IoSession session, Object message, ProtocolEncoderOutput out ) throws
IOException
     {
-        ByteBuffer buf = ByteBuffer.allocate( 1024 );
+        IoBuffer buf = IoBuffer.allocate( 1024 );
 
         // make space for int length
         buf.putInt( 0 );

Modified: directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/protocol/KerberosClientUdpCodecFactory.java
URL: http://svn.apache.org/viewvc/directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/protocol/KerberosClientUdpCodecFactory.java?rev=726234&r1=726233&r2=726234&view=diff
==============================================================================
--- directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/protocol/KerberosClientUdpCodecFactory.java
(original)
+++ directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/protocol/KerberosClientUdpCodecFactory.java
Sat Dec 13 09:02:20 2008
@@ -20,6 +20,7 @@
 package org.apache.directory.client.kerberos.protocol;
 
 
+import org.apache.mina.core.session.IoSession;
 import org.apache.mina.filter.codec.ProtocolCodecFactory;
 import org.apache.mina.filter.codec.ProtocolDecoder;
 import org.apache.mina.filter.codec.ProtocolEncoder;
@@ -51,14 +52,14 @@
     }
 
 
-    public ProtocolEncoder getEncoder()
+    public ProtocolEncoder getEncoder( IoSession session )
     {
         // Create a new encoder.
         return new KerberosClientUdpEncoder();
     }
 
 
-    public ProtocolDecoder getDecoder()
+    public ProtocolDecoder getDecoder( IoSession session )
     {
         // Create a new decoder.
         return new KerberosClientUdpDecoder();

Modified: directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/protocol/KerberosClientUdpDecoder.java
URL: http://svn.apache.org/viewvc/directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/protocol/KerberosClientUdpDecoder.java?rev=726234&r1=726233&r2=726234&view=diff
==============================================================================
--- directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/protocol/KerberosClientUdpDecoder.java
(original)
+++ directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/protocol/KerberosClientUdpDecoder.java
Sat Dec 13 09:02:20 2008
@@ -24,8 +24,8 @@
 
 import org.apache.directory.server.kerberos.shared.io.decoder.ErrorMessageDecoder;
 import org.apache.directory.server.kerberos.shared.io.decoder.KdcReplyDecoder;
-import org.apache.mina.common.ByteBuffer;
-import org.apache.mina.common.IoSession;
+import org.apache.mina.core.buffer.IoBuffer;
+import org.apache.mina.core.session.IoSession;
 import org.apache.mina.filter.codec.ProtocolDecoderAdapter;
 import org.apache.mina.filter.codec.ProtocolDecoderOutput;
 
@@ -42,7 +42,7 @@
     private ErrorMessageDecoder errorDecoder = new ErrorMessageDecoder();
 
 
-    public void decode( IoSession session, ByteBuffer in, ProtocolDecoderOutput out ) throws
IOException
+    public void decode( IoSession session, IoBuffer in, ProtocolDecoderOutput out ) throws
IOException
     {
         byte header = in.get();
         in.rewind();

Modified: directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/protocol/KerberosClientUdpEncoder.java
URL: http://svn.apache.org/viewvc/directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/protocol/KerberosClientUdpEncoder.java?rev=726234&r1=726233&r2=726234&view=diff
==============================================================================
--- directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/protocol/KerberosClientUdpEncoder.java
(original)
+++ directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/protocol/KerberosClientUdpEncoder.java
Sat Dec 13 09:02:20 2008
@@ -24,8 +24,8 @@
 
 import org.apache.directory.server.kerberos.shared.io.encoder.KdcRequestEncoder;
 import org.apache.directory.server.kerberos.shared.messages.KdcRequest;
-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;
 
@@ -41,7 +41,7 @@
 
     public void encode( IoSession session, Object message, ProtocolEncoderOutput out ) throws
IOException
     {
-        ByteBuffer buf = ByteBuffer.allocate( 1024 );
+        IoBuffer buf = IoBuffer.allocate( 1024 );
 
         requestEncoder.encode( ( KdcRequest ) message, buf.buf() );
 

Modified: directory/clients/trunk/kerberos/password/src/main/java/org/apache/directory/client/password/ChangePassword.java
URL: http://svn.apache.org/viewvc/directory/clients/trunk/kerberos/password/src/main/java/org/apache/directory/client/password/ChangePassword.java?rev=726234&r1=726233&r2=726234&view=diff
==============================================================================
--- directory/clients/trunk/kerberos/password/src/main/java/org/apache/directory/client/password/ChangePassword.java
(original)
+++ directory/clients/trunk/kerberos/password/src/main/java/org/apache/directory/client/password/ChangePassword.java
Sat Dec 13 09:02:20 2008
@@ -57,11 +57,11 @@
 import org.apache.directory.server.kerberos.shared.messages.value.EncryptionKey;
 import org.apache.directory.server.kerberos.shared.messages.value.HostAddress;
 import org.apache.directory.server.kerberos.shared.messages.value.KerberosTime;
-import org.apache.mina.common.ConnectFuture;
-import org.apache.mina.common.IoConnector;
-import org.apache.mina.common.IoSession;
-import org.apache.mina.transport.socket.nio.DatagramConnector;
-import org.apache.mina.transport.socket.nio.SocketConnector;
+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.transport.socket.nio.NioDatagramConnector;
+import org.apache.mina.transport.socket.nio.NioSocketConnector;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -129,7 +129,7 @@
 
         ConnectFuture future = connector.connect( new InetSocketAddress( hostname, port ),
new PasswordClientHandler() );
 
-        future.join();
+        future.awaitUninterruptibly();
 
         IoSession session = future.getSession();
 
@@ -143,7 +143,7 @@
             log.debug( "Unexpected exception.", e );
         }
 
-        session.getCloseFuture().join();
+        session.getCloseFuture().awaitUninterruptibly();
 
         Object message = session.getAttribute( "reply" );
 
@@ -358,11 +358,11 @@
 
         if ( transport.equals( "UDP" ) )
         {
-            connector = new DatagramConnector();
+            connector = new NioDatagramConnector();
         }
         else
         {
-            connector = new SocketConnector();
+            connector = new NioSocketConnector();
         }
 
         return connector;

Modified: directory/clients/trunk/kerberos/password/src/main/java/org/apache/directory/client/password/ExportKey.java
URL: http://svn.apache.org/viewvc/directory/clients/trunk/kerberos/password/src/main/java/org/apache/directory/client/password/ExportKey.java?rev=726234&r1=726233&r2=726234&view=diff
==============================================================================
--- directory/clients/trunk/kerberos/password/src/main/java/org/apache/directory/client/password/ExportKey.java
(original)
+++ directory/clients/trunk/kerberos/password/src/main/java/org/apache/directory/client/password/ExportKey.java
Sat Dec 13 09:02:20 2008
@@ -45,6 +45,7 @@
 import org.apache.directory.server.kerberos.shared.messages.value.KerberosTime;
 import org.apache.directory.server.kerberos.shared.store.PrincipalStoreEntry;
 import org.apache.directory.server.kerberos.shared.store.operations.GetPrincipal;
+import org.apache.directory.shared.ldap.name.LdapDN;
 
 
 /**
@@ -154,7 +155,8 @@
 
                         GetPrincipal getPrincipal = new GetPrincipal( targetPrincipal );
 
-                        return getPrincipal.execute( ctx, null );
+                        
+                        return getPrincipal.execute( ctx, LdapDN.EMPTY_LDAPDN );
                     }
                     catch ( NamingException ne )
                     {

Modified: directory/clients/trunk/kerberos/password/src/main/java/org/apache/directory/client/password/protocol/PasswordClientHandler.java
URL: http://svn.apache.org/viewvc/directory/clients/trunk/kerberos/password/src/main/java/org/apache/directory/client/password/protocol/PasswordClientHandler.java?rev=726234&r1=726233&r2=726234&view=diff
==============================================================================
--- directory/clients/trunk/kerberos/password/src/main/java/org/apache/directory/client/password/protocol/PasswordClientHandler.java
(original)
+++ directory/clients/trunk/kerberos/password/src/main/java/org/apache/directory/client/password/protocol/PasswordClientHandler.java
Sat Dec 13 09:02:20 2008
@@ -20,10 +20,8 @@
 package org.apache.directory.client.password.protocol;
 
 
-import org.apache.mina.common.IoHandler;
-import org.apache.mina.common.IoHandlerAdapter;
-import org.apache.mina.common.IoSession;
-import org.apache.mina.common.TransportType;
+import org.apache.mina.core.service.IoHandlerAdapter;
+import org.apache.mina.core.session.IoSession;
 import org.apache.mina.filter.codec.ProtocolCodecFilter;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -44,10 +42,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( PasswordClientUdpCodecFactory.getInstance() ) );

Modified: directory/clients/trunk/kerberos/password/src/main/java/org/apache/directory/client/password/protocol/PasswordClientTcpCodecFactory.java
URL: http://svn.apache.org/viewvc/directory/clients/trunk/kerberos/password/src/main/java/org/apache/directory/client/password/protocol/PasswordClientTcpCodecFactory.java?rev=726234&r1=726233&r2=726234&view=diff
==============================================================================
--- directory/clients/trunk/kerberos/password/src/main/java/org/apache/directory/client/password/protocol/PasswordClientTcpCodecFactory.java
(original)
+++ directory/clients/trunk/kerberos/password/src/main/java/org/apache/directory/client/password/protocol/PasswordClientTcpCodecFactory.java
Sat Dec 13 09:02:20 2008
@@ -20,6 +20,7 @@
 package org.apache.directory.client.password.protocol;
 
 
+import org.apache.mina.core.session.IoSession;
 import org.apache.mina.filter.codec.ProtocolCodecFactory;
 import org.apache.mina.filter.codec.ProtocolDecoder;
 import org.apache.mina.filter.codec.ProtocolEncoder;
@@ -51,14 +52,14 @@
     }
 
 
-    public ProtocolEncoder getEncoder()
+    public ProtocolEncoder getEncoder( IoSession session )
     {
         // Create a new encoder.
         return new PasswordClientTcpEncoder();
     }
 
 
-    public ProtocolDecoder getDecoder()
+    public ProtocolDecoder getDecoder( IoSession session )
     {
         // Create a new decoder.
         return new PasswordClientTcpDecoder();

Modified: directory/clients/trunk/kerberos/password/src/main/java/org/apache/directory/client/password/protocol/PasswordClientTcpDecoder.java
URL: http://svn.apache.org/viewvc/directory/clients/trunk/kerberos/password/src/main/java/org/apache/directory/client/password/protocol/PasswordClientTcpDecoder.java?rev=726234&r1=726233&r2=726234&view=diff
==============================================================================
--- directory/clients/trunk/kerberos/password/src/main/java/org/apache/directory/client/password/protocol/PasswordClientTcpDecoder.java
(original)
+++ directory/clients/trunk/kerberos/password/src/main/java/org/apache/directory/client/password/protocol/PasswordClientTcpDecoder.java
Sat Dec 13 09:02:20 2008
@@ -22,9 +22,8 @@
 
 import org.apache.directory.server.changepw.io.ChangePasswordErrorDecoder;
 import org.apache.directory.server.changepw.io.ChangePasswordReplyDecoder;
-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;
 
@@ -80,7 +79,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/clients/trunk/kerberos/password/src/main/java/org/apache/directory/client/password/protocol/PasswordClientTcpEncoder.java
URL: http://svn.apache.org/viewvc/directory/clients/trunk/kerberos/password/src/main/java/org/apache/directory/client/password/protocol/PasswordClientTcpEncoder.java?rev=726234&r1=726233&r2=726234&view=diff
==============================================================================
--- directory/clients/trunk/kerberos/password/src/main/java/org/apache/directory/client/password/protocol/PasswordClientTcpEncoder.java
(original)
+++ directory/clients/trunk/kerberos/password/src/main/java/org/apache/directory/client/password/protocol/PasswordClientTcpEncoder.java
Sat Dec 13 09:02:20 2008
@@ -24,8 +24,8 @@
 
 import org.apache.directory.server.changepw.io.ChangePasswordRequestEncoder;
 import org.apache.directory.server.changepw.messages.ChangePasswordRequest;
-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;
 
@@ -41,7 +41,7 @@
 
     public void encode( IoSession session, Object message, ProtocolEncoderOutput out ) throws
IOException
     {
-        ByteBuffer buf = ByteBuffer.allocate( 1024 );
+        IoBuffer buf = IoBuffer.allocate( 1024 );
 
         // make space for int length
         buf.putInt( 0 );

Modified: directory/clients/trunk/kerberos/password/src/main/java/org/apache/directory/client/password/protocol/PasswordClientUdpCodecFactory.java
URL: http://svn.apache.org/viewvc/directory/clients/trunk/kerberos/password/src/main/java/org/apache/directory/client/password/protocol/PasswordClientUdpCodecFactory.java?rev=726234&r1=726233&r2=726234&view=diff
==============================================================================
--- directory/clients/trunk/kerberos/password/src/main/java/org/apache/directory/client/password/protocol/PasswordClientUdpCodecFactory.java
(original)
+++ directory/clients/trunk/kerberos/password/src/main/java/org/apache/directory/client/password/protocol/PasswordClientUdpCodecFactory.java
Sat Dec 13 09:02:20 2008
@@ -20,6 +20,7 @@
 package org.apache.directory.client.password.protocol;
 
 
+import org.apache.mina.core.session.IoSession;
 import org.apache.mina.filter.codec.ProtocolCodecFactory;
 import org.apache.mina.filter.codec.ProtocolDecoder;
 import org.apache.mina.filter.codec.ProtocolEncoder;
@@ -51,14 +52,14 @@
     }
 
 
-    public ProtocolEncoder getEncoder()
+    public ProtocolEncoder getEncoder( IoSession session )
     {
         // Create a new encoder.
         return new PasswordClientUdpEncoder();
     }
 
 
-    public ProtocolDecoder getDecoder()
+    public ProtocolDecoder getDecoder( IoSession session )
     {
         // Create a new decoder.
         return new PasswordClientUdpDecoder();

Modified: directory/clients/trunk/kerberos/password/src/main/java/org/apache/directory/client/password/protocol/PasswordClientUdpDecoder.java
URL: http://svn.apache.org/viewvc/directory/clients/trunk/kerberos/password/src/main/java/org/apache/directory/client/password/protocol/PasswordClientUdpDecoder.java?rev=726234&r1=726233&r2=726234&view=diff
==============================================================================
--- directory/clients/trunk/kerberos/password/src/main/java/org/apache/directory/client/password/protocol/PasswordClientUdpDecoder.java
(original)
+++ directory/clients/trunk/kerberos/password/src/main/java/org/apache/directory/client/password/protocol/PasswordClientUdpDecoder.java
Sat Dec 13 09:02:20 2008
@@ -24,8 +24,8 @@
 
 import org.apache.directory.server.changepw.io.ChangePasswordErrorDecoder;
 import org.apache.directory.server.changepw.io.ChangePasswordReplyDecoder;
-import org.apache.mina.common.ByteBuffer;
-import org.apache.mina.common.IoSession;
+import org.apache.mina.core.buffer.IoBuffer;
+import org.apache.mina.core.session.IoSession;
 import org.apache.mina.filter.codec.ProtocolDecoderAdapter;
 import org.apache.mina.filter.codec.ProtocolDecoderOutput;
 
@@ -42,7 +42,7 @@
     private ChangePasswordErrorDecoder errorDecoder = new ChangePasswordErrorDecoder();
 
 
-    public void decode( IoSession session, ByteBuffer in, ProtocolDecoderOutput out ) throws
IOException
+    public void decode( IoSession session, IoBuffer in, ProtocolDecoderOutput out ) throws
IOException
     {
         // read message length
         in.getShort();

Modified: directory/clients/trunk/kerberos/password/src/main/java/org/apache/directory/client/password/protocol/PasswordClientUdpEncoder.java
URL: http://svn.apache.org/viewvc/directory/clients/trunk/kerberos/password/src/main/java/org/apache/directory/client/password/protocol/PasswordClientUdpEncoder.java?rev=726234&r1=726233&r2=726234&view=diff
==============================================================================
--- directory/clients/trunk/kerberos/password/src/main/java/org/apache/directory/client/password/protocol/PasswordClientUdpEncoder.java
(original)
+++ directory/clients/trunk/kerberos/password/src/main/java/org/apache/directory/client/password/protocol/PasswordClientUdpEncoder.java
Sat Dec 13 09:02:20 2008
@@ -24,8 +24,8 @@
 
 import org.apache.directory.server.changepw.io.ChangePasswordRequestEncoder;
 import org.apache.directory.server.changepw.messages.ChangePasswordRequest;
-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;
 
@@ -41,7 +41,7 @@
 
     public void encode( IoSession session, Object message, ProtocolEncoderOutput out ) throws
IOException
     {
-        ByteBuffer buf = ByteBuffer.allocate( 1024 );
+        IoBuffer buf = IoBuffer.allocate( 1024 );
 
         requestEncoder.encode( buf.buf(), ( ChangePasswordRequest ) message );
 



Mime
View raw message