directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r664466 - in /directory/apacheds/branches/bigbang/protocol-newldap/src: main/java/org/apache/directory/server/newldap/ main/java/org/apache/directory/server/newldap/gui/ main/java/org/apache/directory/server/newldap/handlers/bind/ main/java...
Date Sun, 08 Jun 2008 07:55:29 GMT
Author: akarasulu
Date: Sun Jun  8 00:55:28 2008
New Revision: 664466

URL: http://svn.apache.org/viewvc?rev=664466&view=rev
Log:
checkpointing work with corrections after interface changes

Added:
    directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/handlers/bind/PlainMechanismHandler.java
      - copied, changed from r664456, directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/handlers/bind/SimpleMechanismHandler.java
Removed:
    directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/handlers/bind/SimpleMechanismHandler.java
Modified:
    directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/LdapServer.java
    directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/LdapSession.java
    directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/gui/OutstandingRequestsDialog.java
    directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/gui/SessionsFrame.java
    directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/gui/SessionsModel.java
    directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/handlers/bind/CramMd5CallbackHandler.java
    directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/handlers/bind/CramMd5MechanismHandler.java
    directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/handlers/bind/DigestMd5CallbackHandler.java
    directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/handlers/bind/DigestMd5MechanismHandler.java
    directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/handlers/bind/GssapiMechanismHandler.java
    directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/handlers/bind/ntlm/NtlmMechanismHandler.java
    directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/handlers/extended/LaunchDiagnosticUiHandler.java
    directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/handlers/extended/StartTlsHandler.java
    directory/apacheds/branches/bigbang/protocol-newldap/src/test/java/org/apache/directory/server/newldap/LdapServerSettingsTest.java

Modified: directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/LdapServer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/LdapServer.java?rev=664466&r1=664465&r2=664466&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/LdapServer.java
(original)
+++ directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/LdapServer.java
Sun Jun  8 00:55:28 2008
@@ -1028,6 +1028,12 @@
     Map<IoSession, LdapSession> ldapSessions = new ConcurrentHashMap<IoSession,
LdapSession>( 100 );
 
     
+    public LdapSession[] getSessions()
+    {
+        return ldapSessions.values().toArray( new LdapSession[0] );
+    }
+    
+    
     public LdapSession removeLdapSession( IoSession session )
     {
         LdapSession ldapSession = null; 

Modified: directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/LdapSession.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/LdapSession.java?rev=664466&r1=664465&r2=664466&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/LdapSession.java
(original)
+++ directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/LdapSession.java
Sun Jun  8 00:55:28 2008
@@ -20,6 +20,7 @@
 package org.apache.directory.server.newldap;
 
 
+import java.util.Collections;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 
@@ -181,4 +182,13 @@
             outstandingRequests.remove( request.getMessageId() );
         }
     }
+    
+    
+    public Map<Integer, AbandonableRequest> getOutstandingRequests()
+    {
+        synchronized( outstandingLock )
+        {
+            return Collections.unmodifiableMap( outstandingRequests );
+        }
+    }
 }

Modified: directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/gui/OutstandingRequestsDialog.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/gui/OutstandingRequestsDialog.java?rev=664466&r1=664465&r2=664466&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/gui/OutstandingRequestsDialog.java
(original)
+++ directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/gui/OutstandingRequestsDialog.java
Sun Jun  8 00:55:28 2008
@@ -31,10 +31,9 @@
 import javax.swing.JTable;
 import javax.swing.JButton;
 
-import org.apache.directory.server.newldap.SessionRegistry;
+import org.apache.directory.server.newldap.LdapServer;
+import org.apache.directory.server.newldap.LdapSession;
 import org.apache.directory.shared.ldap.message.AbandonableRequest;
-import org.apache.directory.shared.ldap.message.Request;
-import org.apache.mina.common.IoSession;
 import javax.swing.JTextArea;
 import javax.swing.event.ListSelectionEvent;
 import javax.swing.event.ListSelectionListener;
@@ -51,8 +50,8 @@
     private JPanel jPanel1;
     private JButton jButton;
 
-    final IoSession session;
-    final SessionRegistry registry;
+    final LdapSession session;
+    final LdapServer ldapServer;
 
     private JPanel jPanel2;
     private JTextArea jTextArea;
@@ -66,17 +65,17 @@
      * @param session the MINA IoSession to get outstanding requests for
      * @param sessionRegistry the session registry
      */
-    public OutstandingRequestsDialog( JFrame owner, IoSession session, SessionRegistry sessionRegistry
)
+    public OutstandingRequestsDialog( JFrame owner, LdapSession session, LdapServer ldapServer
)
     {
         super( owner, true );
         this.session = session;
-        this.registry = sessionRegistry;
+        this.ldapServer = ldapServer;
 
         StringBuffer buf = new StringBuffer();
         buf.append( "Outstanding Requests: " );
-        buf.append( ( ( InetSocketAddress ) session.getRemoteAddress() ).getHostName() );
+        buf.append( ( ( InetSocketAddress ) session.getIoSession().getRemoteAddress() ).getHostName()
);
         buf.append( ":" );
-        buf.append( ( ( InetSocketAddress ) session.getRemoteAddress() ).getPort() );
+        buf.append( ( ( InetSocketAddress ) session.getIoSession().getRemoteAddress() ).getPort()
);
         setTitle( buf.toString() );
         initialize();
     }
@@ -185,7 +184,7 @@
     private void setRequestsModel()
     {
         AbandonableRequest[] requests;
-        Map<Integer, Request> reqsMap = registry.getOutstandingRequests( session );
+        Map<Integer, AbandonableRequest> reqsMap = session.getOutstandingRequests();
         
         if ( reqsMap != null )
         {
@@ -328,7 +327,7 @@
                     AbandonableRequest req = ( ( OutstandingRequestsModel ) jTable.getModel()
)
                         .getAbandonableRequest( row );
                     req.abandon();
-                    registry.removeOutstandingRequest( session, req.getMessageId() );
+                    session.abandonOutstandingRequest( req.getMessageId() );
                     setRequestsModel();
                 }
             } );

Modified: directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/gui/SessionsFrame.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/gui/SessionsFrame.java?rev=664466&r1=664465&r2=664466&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/gui/SessionsFrame.java
(original)
+++ directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/gui/SessionsFrame.java
Sun Jun  8 00:55:28 2008
@@ -45,7 +45,8 @@
 import javax.swing.event.ListSelectionEvent;
 import javax.swing.event.ListSelectionListener;
 
-import org.apache.directory.server.newldap.SessionRegistry;
+import org.apache.directory.server.newldap.LdapServer;
+import org.apache.directory.server.newldap.LdapSession;
 import org.apache.directory.server.newldap.handlers.extended.GracefulShutdownHandler;
 import org.apache.directory.shared.ldap.message.extended.GracefulDisconnect;
 import org.apache.directory.shared.ldap.message.extended.NoticeOfDisconnect;
@@ -88,20 +89,20 @@
     private JMenuItem showRequests;
     private JButton refreshButton;
 
-    private IoSession selected;
+    private LdapSession selected;
     private JMenuItem unbindItem;
     private JMenuItem bindItem;
-    private SessionRegistry registry;
+    private LdapServer ldapServer;
 
 
     /**
      * This is the default constructor
-     * @param registry the session registry
+     * @param ldapServer the session registry
      */
-    public SessionsFrame( SessionRegistry registry )
+    public SessionsFrame( LdapServer ldapServer )
     {
         super();
-        this.registry = registry;
+        this.ldapServer = ldapServer;
         initialize();
     }
 
@@ -190,7 +191,7 @@
         {
             sessionsTable = new JTable();
             sessionsTable.setSelectionMode( javax.swing.ListSelectionModel.SINGLE_SELECTION
);
-            sessionsTable.setModel( new SessionsModel( registry.getSessions() ) );
+            sessionsTable.setModel( new SessionsModel( ldapServer.getSessions() ) );
             sessionsTable.getSelectionModel().addListSelectionListener( new ListSelectionListener()
             {
                 public void valueChanged( ListSelectionEvent e )
@@ -202,7 +203,7 @@
                     }
                     else
                     {
-                        selected = ( ( SessionsModel ) sessionsTable.getModel() ).getIoSession(
row );
+                        selected = ( ( SessionsModel ) sessionsTable.getModel() ).getLdapSession(
row );
                         closeItem.setEnabled( true );
                         menuSendNoD.setEnabled( true );
                         showRequests.setEnabled( true );
@@ -362,7 +363,7 @@
             {
                 public void actionPerformed( java.awt.event.ActionEvent e )
                 {
-                    registry.terminateSession( selected );
+                    ldapServer.removeLdapSession( selected.getIoSession() );
                     try
                     {
                         Thread.sleep( 250 );
@@ -413,7 +414,7 @@
             {
                 public void actionPerformed( java.awt.event.ActionEvent e )
                 {
-                    selected.write( NoticeOfDisconnect.UNAVAILABLE );
+                    selected.getIoSession().write( NoticeOfDisconnect.UNAVAILABLE );
                     try
                     {
                         Thread.sleep( 250 );
@@ -445,7 +446,7 @@
             {
                 public void actionPerformed( java.awt.event.ActionEvent e )
                 {
-                    selected.write( NoticeOfDisconnect.PROTOCOLERROR );
+                    selected.getIoSession().write( NoticeOfDisconnect.PROTOCOLERROR );
                     try
                     {
                         Thread.sleep( 250 );
@@ -477,11 +478,11 @@
             {
                 public void actionPerformed( java.awt.event.ActionEvent e )
                 {
-                    WriteFuture future = selected.write( NoticeOfDisconnect.STRONGAUTHREQUIRED
);
+                    WriteFuture future = selected.getIoSession().write( NoticeOfDisconnect.STRONGAUTHREQUIRED
);
                     try
                     {
                         future.join( 1000 );
-                        CloseFuture cfuture = selected.close();
+                        CloseFuture cfuture = selected.getIoSession().close();
                         cfuture.join( 1000 );
                     }
                     catch ( Exception e1 )
@@ -547,7 +548,7 @@
                 public void actionPerformed( java.awt.event.ActionEvent e )
                 {
                     OutstandingRequestsDialog dialog =
-                            new OutstandingRequestsDialog( SessionsFrame.this, selected,
registry );
+                            new OutstandingRequestsDialog( SessionsFrame.this, selected,
ldapServer );
                     dialog.addWindowListener( new WindowAdapter()
                     {
                         public void windowClosed( WindowEvent e )
@@ -690,7 +691,7 @@
     private void refresh()
     {
         LOG.info( "Refreshing Sessions UI" );
-        sessionsTable.setModel( new SessionsModel( registry.getSessions() ) );
+        sessionsTable.setModel( new SessionsModel( ldapServer.getSessions() ) );
         closeItem.setEnabled( false );
         menuSendNoD.setEnabled( false );
         showRequests.setEnabled( false );

Modified: directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/gui/SessionsModel.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/gui/SessionsModel.java?rev=664466&r1=664465&r2=664466&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/gui/SessionsModel.java
(original)
+++ directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/gui/SessionsModel.java
Sun Jun  8 00:55:28 2008
@@ -25,7 +25,7 @@
 import javax.swing.event.TableModelListener;
 import javax.swing.table.TableModel;
 
-import org.apache.mina.common.IoSession;
+import org.apache.directory.server.newldap.LdapSession;
 
 
 public class SessionsModel implements TableModel
@@ -34,16 +34,16 @@
         { "client address", "client port", "server address", "server port" };
     final Class<?>[] columnClasses = new Class[]
         { String.class, Integer.class, String.class, Integer.class };
-    final IoSession[] sessions;
+    final LdapSession[] sessions;
 
 
-    SessionsModel(IoSession[] sessions)
+    SessionsModel( LdapSession[] sessions )
     {
         this.sessions = sessions;
     }
 
 
-    IoSession getIoSession( int row )
+    LdapSession getLdapSession( int row )
     {
         return sessions[row];
     }
@@ -81,18 +81,18 @@
 
     public Object getValueAt( int rowIndex, int columnIndex )
     {
-        IoSession session = sessions[rowIndex];
+        LdapSession session = sessions[rowIndex];
 
         switch ( columnIndex )
         {
             case ( 0 ):
-                return ( ( InetSocketAddress ) session.getRemoteAddress() ).getHostName();
+                return ( ( InetSocketAddress ) session.getIoSession().getRemoteAddress()
).getHostName();
             case ( 1 ):
-                return new Integer( ( ( InetSocketAddress ) session.getRemoteAddress() ).getPort()
);
+                return new Integer( ( ( InetSocketAddress ) session.getIoSession().getRemoteAddress()
).getPort() );
             case ( 2 ):
-                return ( ( InetSocketAddress ) session.getLocalAddress() ).getHostName();
+                return ( ( InetSocketAddress ) session.getIoSession().getLocalAddress() ).getHostName();
             case ( 3 ):
-                return new Integer( ( ( InetSocketAddress ) session.getLocalAddress() ).getPort()
);
+                return new Integer( ( ( InetSocketAddress ) session.getIoSession().getLocalAddress()
).getPort() );
             default:
                 throw new IndexOutOfBoundsException( "column index max is " + ( columns.length
- 1 ) );
         }

Modified: directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/handlers/bind/CramMd5CallbackHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/handlers/bind/CramMd5CallbackHandler.java?rev=664466&r1=664465&r2=664466&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/handlers/bind/CramMd5CallbackHandler.java
(original)
+++ directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/handlers/bind/CramMd5CallbackHandler.java
Sun Jun  8 00:55:28 2008
@@ -20,8 +20,8 @@
 package org.apache.directory.server.newldap.handlers.bind;
 
 
-import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.newldap.LdapSession;
+import org.apache.directory.shared.ldap.NotImplementedException;
 import org.apache.directory.shared.ldap.message.BindRequest;
 
 import org.slf4j.Logger;
@@ -52,23 +52,16 @@
      * @param bindRequest the bind message
      * @param directoryService the directory service core
      */
-    public CramMd5CallbackHandler( DirectoryService directoryService,  LdapSession session,
BindRequest bindRequest )
+    public CramMd5CallbackHandler( LdapSession session, BindRequest bindRequest )
     {
-        super( directoryService );
+        super( session.getCoreSession().getDirectoryService() );
         this.session = session;
     }
 
 
     protected String lookupPassword( String username, String realm )
     {
-        GetBindDn getDn = new GetBindDn( username );
-
-        // Don't actually want the entry, rather the hacked in dn.
-        getDn.execute( session, null );
-        bindDn = getDn.getBindDn();
-        userPassword = getDn.getUserPassword();
-
-        return userPassword;
+        throw new NotImplementedException();
     }
 
 

Modified: directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/handlers/bind/CramMd5MechanismHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/handlers/bind/CramMd5MechanismHandler.java?rev=664466&r1=664465&r2=664466&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/handlers/bind/CramMd5MechanismHandler.java
(original)
+++ directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/handlers/bind/CramMd5MechanismHandler.java
Sun Jun  8 00:55:28 2008
@@ -24,7 +24,6 @@
 import org.apache.directory.server.newldap.LdapSession;
 import org.apache.directory.shared.ldap.constants.SupportedSaslMechanisms;
 import org.apache.directory.shared.ldap.message.BindRequest;
-import org.apache.mina.common.IoSession;
 
 import javax.security.auth.callback.CallbackHandler;
 import javax.security.sasl.Sasl;
@@ -70,7 +69,7 @@
              */
             Map<String, String> saslProps = new HashMap<String, String>();
 
-            CallbackHandler callbackHandler = new CramMd5CallbackHandler( directoryService,
session, bindRequest );
+            CallbackHandler callbackHandler = new CramMd5CallbackHandler( session, bindRequest
);
 
             ss = Sasl.createSaslServer( SupportedSaslMechanisms.CRAM_MD5, "ldap", saslHost,
saslProps, callbackHandler );
             session.getIoSession().setAttribute( SASL_CONTEXT, ss );

Modified: directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/handlers/bind/DigestMd5CallbackHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/handlers/bind/DigestMd5CallbackHandler.java?rev=664466&r1=664465&r2=664466&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/handlers/bind/DigestMd5CallbackHandler.java
(original)
+++ directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/handlers/bind/DigestMd5CallbackHandler.java
Sun Jun  8 00:55:28 2008
@@ -21,15 +21,14 @@
 
 
 import org.apache.directory.server.core.DirectoryService;
+import org.apache.directory.shared.ldap.NotImplementedException;
 import org.apache.directory.shared.ldap.message.BindRequest;
 import org.apache.mina.common.IoSession;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import javax.naming.Context;
-import javax.naming.ldap.LdapContext;
 import javax.security.sasl.AuthorizeCallback;
-import java.util.Hashtable;
 
 
 /**
@@ -54,30 +53,18 @@
      * @param bindRequest the bind message
      * @param directoryService the directory service core
      */
-    public DigestMd5CallbackHandler( DirectoryService directoryService, IoSession session,
BindRequest bindRequest )
+    public DigestMd5CallbackHandler( DirectoryService directoryService, BindRequest bindRequest
)
     {
         super( directoryService );
-        this.session = session;
         this.bindRequest = bindRequest;
     }
 
 
+    // TODO - should return not be a byte[]
     protected String lookupPassword( String username, String realm )
     {
-        Hashtable<String, Object> env = getEnvironment( session );
-
-        LdapContext ctx = getContext( session, bindRequest, env );
-
         // TODO - Use realm with multi-realm support.
-
-        GetBindDn getDn = new GetBindDn( username );
-
-        // Don't actually want the entry, rather the hacked in dn.
-        getDn.execute( ctx, null );
-        bindDn = getDn.getBindDn();
-        userPassword = getDn.getUserPassword();
-
-        return userPassword;
+        throw new NotImplementedException();
     }
 
 

Modified: directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/handlers/bind/DigestMd5MechanismHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/handlers/bind/DigestMd5MechanismHandler.java?rev=664466&r1=664465&r2=664466&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/handlers/bind/DigestMd5MechanismHandler.java
(original)
+++ directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/handlers/bind/DigestMd5MechanismHandler.java
Sun Jun  8 00:55:28 2008
@@ -21,9 +21,9 @@
 
 
 import org.apache.directory.server.core.DirectoryService;
+import org.apache.directory.server.newldap.LdapSession;
 import org.apache.directory.shared.ldap.constants.SupportedSaslMechanisms;
 import org.apache.directory.shared.ldap.message.BindRequest;
-import org.apache.mina.common.IoSession;
 
 import javax.security.auth.callback.CallbackHandler;
 import javax.security.sasl.Sasl;
@@ -49,23 +49,23 @@
     }
 
     
-    public SaslServer handleMechanism( IoSession session, BindRequest bindRequest ) throws
Exception
+    public SaslServer handleMechanism( LdapSession session, BindRequest bindRequest ) throws
Exception
     {
         SaslServer ss;
 
-        if ( session.containsAttribute( SASL_CONTEXT ) )
+        if ( session.getIoSession().containsAttribute( SASL_CONTEXT ) )
         {
-            ss = ( SaslServer ) session.getAttribute( SASL_CONTEXT );
+            ss = ( SaslServer ) session.getIoSession().getAttribute( SASL_CONTEXT );
         }
         else
         {
-            String saslHost = ( String ) session.getAttribute( "saslHost" );
-            Map<String, String> saslProps = ( Map<String, String> ) session.getAttribute(
"saslProps" );
+            String saslHost = ( String ) session.getIoSession().getAttribute( "saslHost"
);
+            Map<String, String> saslProps = ( Map<String, String> ) session.getIoSession().getAttribute(
"saslProps" );
 
-            CallbackHandler callbackHandler = new DigestMd5CallbackHandler( directoryService,
session, bindRequest );
+            CallbackHandler callbackHandler = new DigestMd5CallbackHandler( directoryService,
bindRequest );
 
             ss = Sasl.createSaslServer( SupportedSaslMechanisms.DIGEST_MD5, "ldap", saslHost,
saslProps, callbackHandler );
-            session.setAttribute( SASL_CONTEXT, ss );
+            session.getIoSession().setAttribute( SASL_CONTEXT, ss );
         }
 
         return ss;

Modified: directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/handlers/bind/GssapiMechanismHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/handlers/bind/GssapiMechanismHandler.java?rev=664466&r1=664465&r2=664466&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/handlers/bind/GssapiMechanismHandler.java
(original)
+++ directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/handlers/bind/GssapiMechanismHandler.java
Sun Jun  8 00:55:28 2008
@@ -21,9 +21,9 @@
 
 
 import org.apache.directory.server.core.DirectoryService;
+import org.apache.directory.server.newldap.LdapSession;
 import org.apache.directory.shared.ldap.constants.SupportedSaslMechanisms;
 import org.apache.directory.shared.ldap.message.BindRequest;
-import org.apache.mina.common.IoSession;
 
 import javax.security.auth.Subject;
 import javax.security.auth.callback.CallbackHandler;
@@ -51,22 +51,22 @@
     }
 
     
-    public SaslServer handleMechanism( IoSession session, BindRequest bindRequest ) throws
Exception
+    public SaslServer handleMechanism( LdapSession session, BindRequest bindRequest ) throws
Exception
     {
         SaslServer ss;
 
-        if ( session.containsAttribute( SASL_CONTEXT ) )
+        if ( session.getIoSession().containsAttribute( SASL_CONTEXT ) )
         {
-            ss = ( SaslServer ) session.getAttribute( SASL_CONTEXT );
+            ss = ( SaslServer ) session.getIoSession().getAttribute( SASL_CONTEXT );
         }
         else
         {
-            Subject subject = ( Subject ) session.getAttribute( "saslSubject" );
+            Subject subject = ( Subject ) session.getIoSession().getAttribute( "saslSubject"
);
 
-            final Map<String, String> saslProps = ( Map<String, String> ) session.getAttribute(
"saslProps" );
-            final String saslHost = ( String ) session.getAttribute( "saslHost" );
+            final Map<String, String> saslProps = ( Map<String, String> ) session.getIoSession().getAttribute(
"saslProps" );
+            final String saslHost = ( String ) session.getIoSession().getAttribute( "saslHost"
);
 
-            final CallbackHandler callbackHandler = new GssapiCallbackHandler( directoryService,
session, bindRequest );
+            final CallbackHandler callbackHandler = new GssapiCallbackHandler( directoryService,
session.getIoSession(), bindRequest );
 
             ss = ( SaslServer ) Subject.doAs( subject, new PrivilegedExceptionAction<SaslServer>()
             {
@@ -76,7 +76,7 @@
                 }
             } );
 
-            session.setAttribute( SASL_CONTEXT, ss );
+            session.getIoSession().setAttribute( SASL_CONTEXT, ss );
         }
 
         return ss;

Copied: directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/handlers/bind/PlainMechanismHandler.java
(from r664456, directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/handlers/bind/SimpleMechanismHandler.java)
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/handlers/bind/PlainMechanismHandler.java?p2=directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/handlers/bind/PlainMechanismHandler.java&p1=directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/handlers/bind/SimpleMechanismHandler.java&r1=664456&r2=664466&rev=664466&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/handlers/bind/SimpleMechanismHandler.java
(original)
+++ directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/handlers/bind/PlainMechanismHandler.java
Sun Jun  8 00:55:28 2008
@@ -20,7 +20,7 @@
 package org.apache.directory.server.newldap.handlers.bind;
 
 
-import org.apache.mina.common.IoSession;
+import org.apache.directory.server.newldap.LdapSession;
 import org.apache.directory.shared.ldap.message.BindRequest;
 
 import javax.security.sasl.SaslServer;
@@ -34,9 +34,9 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $$Rev$$
  */
-public class SimpleMechanismHandler implements MechanismHandler
+public class PlainMechanismHandler implements MechanismHandler
 {
-    public SaslServer handleMechanism( IoSession session, BindRequest bindRequest ) throws
Exception
+    public SaslServer handleMechanism( LdapSession session, BindRequest bindRequest ) throws
Exception
     {
         return null;
     }

Modified: directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/handlers/bind/ntlm/NtlmMechanismHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/handlers/bind/ntlm/NtlmMechanismHandler.java?rev=664466&r1=664465&r2=664466&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/handlers/bind/ntlm/NtlmMechanismHandler.java
(original)
+++ directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/handlers/bind/ntlm/NtlmMechanismHandler.java
Sun Jun  8 00:55:28 2008
@@ -20,9 +20,9 @@
 package org.apache.directory.server.newldap.handlers.bind.ntlm;
 
 
+import org.apache.directory.server.newldap.LdapSession;
 import org.apache.directory.server.newldap.handlers.bind.MechanismHandler;
 import org.apache.directory.shared.ldap.message.BindRequest;
-import org.apache.mina.common.IoSession;
 
 import javax.security.sasl.SaslServer;
 
@@ -54,13 +54,13 @@
     }
 
 
-    public SaslServer handleMechanism( IoSession session, BindRequest bindRequest ) throws
Exception
+    public SaslServer handleMechanism( LdapSession session, BindRequest bindRequest ) throws
Exception
     {
         SaslServer ss;
 
-        if ( session.containsAttribute( SASL_CONTEXT ) )
+        if ( session.getIoSession().containsAttribute( SASL_CONTEXT ) )
         {
-            ss = ( SaslServer ) session.getAttribute( SASL_CONTEXT );
+            ss = ( SaslServer ) session.getIoSession().getAttribute( SASL_CONTEXT );
         }
         else
         {
@@ -69,8 +69,8 @@
                 initProvider();
             }
             
-            ss = new NtlmSaslServer( provider, bindRequest, session );
-            session.setAttribute( SASL_CONTEXT, ss );
+            ss = new NtlmSaslServer( provider, bindRequest, session.getIoSession() );
+            session.getIoSession().setAttribute( SASL_CONTEXT, ss );
         }
 
         return ss;

Modified: directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/handlers/extended/LaunchDiagnosticUiHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/handlers/extended/LaunchDiagnosticUiHandler.java?rev=664466&r1=664465&r2=664466&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/handlers/extended/LaunchDiagnosticUiHandler.java
(original)
+++ directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/handlers/extended/LaunchDiagnosticUiHandler.java
Sun Jun  8 00:55:28 2008
@@ -43,7 +43,6 @@
 import org.apache.directory.server.core.partition.impl.btree.gui.PartitionFrame;
 import org.apache.directory.server.newldap.ExtendedOperationHandler;
 import org.apache.directory.server.newldap.LdapServer;
-import org.apache.directory.server.newldap.SessionRegistry;
 import org.apache.directory.server.newldap.gui.SessionsFrame;
 import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
 import org.apache.directory.shared.ldap.message.ExtendedRequest;

Modified: directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/handlers/extended/StartTlsHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/handlers/extended/StartTlsHandler.java?rev=664466&r1=664465&r2=664466&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/handlers/extended/StartTlsHandler.java
(original)
+++ directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/handlers/extended/StartTlsHandler.java
Sun Jun  8 00:55:28 2008
@@ -38,14 +38,13 @@
 import org.apache.directory.server.core.security.CoreKeyStoreSpi;
 import org.apache.directory.server.newldap.ExtendedOperationHandler;
 import org.apache.directory.server.newldap.LdapServer;
-import org.apache.directory.server.newldap.SessionRegistry;
+import org.apache.directory.server.newldap.LdapSession;
 import org.apache.directory.shared.ldap.message.ExtendedRequest;
 import org.apache.directory.shared.ldap.message.ExtendedResponse;
 import org.apache.directory.shared.ldap.message.ExtendedResponseImpl;
 import org.apache.directory.shared.ldap.message.LdapResult;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.mina.common.IoFilterChain;
-import org.apache.mina.common.IoSession;
 import org.apache.mina.filter.SSLFilter;
 
 import org.slf4j.Logger;
@@ -78,11 +77,11 @@
     }
     
 
-    public void handleExtendedOperation( IoSession session, SessionRegistry registry, ExtendedRequest
req ) throws Exception
+    public void handleExtendedOperation( LdapSession session, ExtendedRequest req ) throws
Exception
     {
         LOG.info( "Handling StartTLS request." );
         
-        IoFilterChain chain = session.getFilterChain();
+        IoFilterChain chain = session.getIoSession().getFilterChain();
         SSLFilter sslFilter = ( SSLFilter ) chain.get( "sslFilter" );
         if( sslFilter == null )
         {
@@ -91,7 +90,7 @@
         }
         else
         {
-            sslFilter.startSSL( session );
+            sslFilter.startSSL( session.getIoSession() );
         }
         
         ExtendedResponse res = new ExtendedResponseImpl( req.getMessageId() );
@@ -101,8 +100,8 @@
         res.setResponse( new byte[ 0 ] );
 
         // Send a response.
-        session.setAttribute( SSLFilter.DISABLE_ENCRYPTION_ONCE );
-        session.write( res );
+        session.getIoSession().setAttribute( SSLFilter.DISABLE_ENCRYPTION_ONCE );
+        session.getIoSession().write( res );
     }
     
     
@@ -194,4 +193,10 @@
             throw new RuntimeException( "Failed to initialize SSLContext", e );
         }
     }
+
+
+    public void setLdapServer( LdapServer ldapServer )
+    {
+        // do nothing
+    }
 }

Modified: directory/apacheds/branches/bigbang/protocol-newldap/src/test/java/org/apache/directory/server/newldap/LdapServerSettingsTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-newldap/src/test/java/org/apache/directory/server/newldap/LdapServerSettingsTest.java?rev=664466&r1=664465&r2=664466&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/protocol-newldap/src/test/java/org/apache/directory/server/newldap/LdapServerSettingsTest.java
(original)
+++ directory/apacheds/branches/bigbang/protocol-newldap/src/test/java/org/apache/directory/server/newldap/LdapServerSettingsTest.java
Sun Jun  8 00:55:28 2008
@@ -28,7 +28,7 @@
 import org.apache.directory.server.newldap.ExtendedOperationHandler;
 import org.apache.directory.server.newldap.LdapServer;
 import org.apache.directory.server.newldap.handlers.bind.MechanismHandler;
-import org.apache.directory.server.newldap.handlers.bind.SimpleMechanismHandler;
+import org.apache.directory.server.newldap.handlers.bind.PlainMechanismHandler;
 import org.apache.directory.server.newldap.handlers.extended.StartTlsHandler;
 import org.apache.directory.shared.ldap.constants.SupportedSaslMechanisms;
 
@@ -77,7 +77,7 @@
     {
         LdapServer server = new LdapServer();
         Map<String, MechanismHandler> handlers = new HashMap<String,MechanismHandler>();
-        MechanismHandler handler = new SimpleMechanismHandler();
+        MechanismHandler handler = new PlainMechanismHandler();
         handlers.put( SupportedSaslMechanisms.PLAIN, handler );
         server.setSaslMechanismHandlers( handlers );
         assertEquals( handler, server.getMechanismHandler( SupportedSaslMechanisms.PLAIN
) );



Mime
View raw message