directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r379047 - in /directory/trunks/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap: ./ gui/ support/extended/
Date Mon, 20 Feb 2006 07:53:07 GMT
Author: trustin
Date: Sun Feb 19 23:53:05 2006
New Revision: 379047

URL: http://svn.apache.org/viewcvs?rev=379047&view=rev
Log:
Fixed compilation errors in 'apacheds-protocol-ldap'

Modified:
    directory/trunks/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/ExtendedOperationHandler.java
    directory/trunks/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/gui/SessionsFrame.java
    directory/trunks/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/extended/GracefulShutdownHandler.java
    directory/trunks/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/extended/LaunchDiagnosticUiHandler.java

Modified: directory/trunks/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/ExtendedOperationHandler.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/ExtendedOperationHandler.java?rev=379047&r1=379046&r2=379047&view=diff
==============================================================================
--- directory/trunks/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/ExtendedOperationHandler.java
(original)
+++ directory/trunks/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/ExtendedOperationHandler.java
Sun Feb 19 23:53:05 2006
@@ -23,8 +23,6 @@
 
 import org.apache.directory.shared.ldap.message.ExtendedRequest;
 import org.apache.mina.common.IoSession;
-import org.apache.mina.registry.Service;
-import org.apache.mina.registry.ServiceRegistry;
 
 
 /**
@@ -70,20 +68,4 @@
      * @param provider the ldap protocol provider 
      */
     void setLdapProvider( LdapProtocolProvider provider );
-
-
-    /**
-     * Sets the LDAP service for the this extenedOperation handler.
-     * 
-     * @param service the MINA service for LDAP or LDAPS
-     */
-    void setLdapService( Service service );
-
-
-    /**
-     * Sets the MINA service registry for this extendedOperation handler.
-     * 
-     * @param registry the MINA service registry
-     */
-    void setServiceRegistry( ServiceRegistry registry );
 }

Modified: directory/trunks/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/gui/SessionsFrame.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/gui/SessionsFrame.java?rev=379047&r1=379046&r2=379047&view=diff
==============================================================================
--- directory/trunks/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/gui/SessionsFrame.java
(original)
+++ directory/trunks/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/gui/SessionsFrame.java
Sun Feb 19 23:53:05 2006
@@ -35,8 +35,6 @@
 import org.apache.mina.common.IoHandler;
 import org.apache.mina.common.IoSession;
 import org.apache.mina.common.WriteFuture;
-import org.apache.mina.registry.Service;
-import org.apache.mina.registry.ServiceRegistry;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -50,8 +48,6 @@
 
     boolean isServiceBound = true;
     private IoSession requestor;
-    private ServiceRegistry minaRegistry;
-    private Service ldapService;
     private IoHandler ldapProvider;
     private JPanel jContentPane = null;
     private JPanel mainPanel = null;
@@ -97,8 +93,6 @@
 
     /**
      * This method initializes this
-     * 
-     * @return void
      */
     private void initialize()
     {
@@ -716,25 +710,11 @@
         bindItem.setEnabled( !isServiceBound );
     }
 
-
-    public void setMinaRegistry( ServiceRegistry minaRegistry )
-    {
-        this.minaRegistry = minaRegistry;
-    }
-
-
-    public void setLdapService( Service ldapService )
-    {
-        this.ldapService = ldapService;
-    }
-
-
     public void setRequestor( IoSession requestor )
     {
         this.requestor = requestor;
     }
 
-
     /**
      * This method initializes jMenuItem	
      * 	
@@ -755,8 +735,8 @@
                         "Selecting no will send a notice of disconnect ONLY.  "
                             + "\nSelecting yes will send both.  Cancel will abort unbind.",
                         "Send graceful disconnect before disconnect notice?", JOptionPane.YES_NO_CANCEL_OPTION
);
-                    IoAcceptor acceptor = minaRegistry.getAcceptor( ldapService.getTransportType()
);
-                    List sessions = new ArrayList( acceptor.getManagedSessions( ldapService.getAddress()
) );
+                    IoAcceptor acceptor = ( IoAcceptor ) requestor.getService();
+                    List sessions = new ArrayList( acceptor.getManagedSessions( requestor.getServiceAddress()
) );
                     //                    ServerLdapContext ctx;
                     //                    try
                     //                    {
@@ -782,12 +762,12 @@
                     else if ( input == JOptionPane.NO_OPTION )
                     {
                         GracefulShutdownHandler.sendNoticeOfDisconnect( sessions, requestor
);
-                        minaRegistry.unbind( ldapService );
+                        acceptor.unbind( requestor.getServiceAddress() );
                         isServiceBound = false;
                         unbindItem.setEnabled( isServiceBound );
                         bindItem.setEnabled( !isServiceBound );
                         JOptionPane.showMessageDialog( SessionsFrame.this, "Ldap service
for "
-                            + ldapService.getAddress() + " has been successfully unbound.",
"Success!",
+                            + requestor.getLocalAddress() + " has been successfully unbound.",
"Success!",
                             JOptionPane.INFORMATION_MESSAGE );
                         refresh();
                         return;
@@ -812,7 +792,7 @@
                         int delay = dialog.getDelay();
                         GracefulDisconnect graceful = new GracefulDisconnect( timeOffline,
delay );
                         GracefulShutdownHandler.sendGracefulDisconnect( sessions, graceful,
requestor );
-                        minaRegistry.unbind( ldapService );
+                        acceptor.unbind( requestor.getServiceAddress() );
                         isServiceBound = false;
                         unbindItem.setEnabled( isServiceBound );
                         bindItem.setEnabled( !isServiceBound );
@@ -832,7 +812,7 @@
                         // now send the notice of disconnect
                         GracefulShutdownHandler.sendNoticeOfDisconnect( sessions, requestor
);
                         JOptionPane.showMessageDialog( SessionsFrame.this, "Ldap service
for "
-                            + ldapService.getAddress() + " has been successfully unbound.",
"Success!",
+                            + requestor.getLocalAddress() + " has been successfully unbound.",
"Success!",
                             JOptionPane.OK_OPTION );
                         refresh();
                     }
@@ -875,8 +855,8 @@
                 {
                     try
                     {
-                        minaRegistry.bind( ldapService, getLdapProvider() );
-                        JOptionPane.showMessageDialog( SessionsFrame.this, "Ldap service
" + ldapService.getAddress()
+                        ( ( IoAcceptor ) requestor.getService() ).bind( requestor.getServiceAddress(),
getLdapProvider() );
+                        JOptionPane.showMessageDialog( SessionsFrame.this, "Ldap service
" + requestor.getServiceAddress()
                             + " has been successfully bound.\n" + " Clients may now connect
to the server once again.",
                             "Success!", JOptionPane.INFORMATION_MESSAGE );
                         isServiceBound = true;

Modified: directory/trunks/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/extended/GracefulShutdownHandler.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/extended/GracefulShutdownHandler.java?rev=379047&r1=379046&r2=379047&view=diff
==============================================================================
--- directory/trunks/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/extended/GracefulShutdownHandler.java
(original)
+++ directory/trunks/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/extended/GracefulShutdownHandler.java
Sun Feb 19 23:53:05 2006
@@ -40,13 +40,9 @@
 import org.apache.directory.shared.ldap.message.extended.GracefulShutdownRequest;
 import org.apache.directory.shared.ldap.message.extended.GracefulShutdownResponse;
 import org.apache.directory.shared.ldap.message.extended.NoticeOfDisconnect;
-
 import org.apache.mina.common.IoAcceptor;
 import org.apache.mina.common.IoSession;
 import org.apache.mina.common.WriteFuture;
-import org.apache.mina.registry.Service;
-import org.apache.mina.registry.ServiceRegistry;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -65,9 +61,6 @@
         EXTENSION_OIDS = Collections.unmodifiableSet( set );
     }
 
-    private ServiceRegistry serviceRegistry;
-    private Service ldapService;
-
 
     public String getOid()
     {
@@ -119,8 +112,8 @@
         // handle the body of this operation below here
         // -------------------------------------------------------------------
 
-        IoAcceptor acceptor = serviceRegistry.getAcceptor( ldapService.getTransportType()
);
-        List sessions = new ArrayList( acceptor.getManagedSessions( ldapService.getAddress()
) );
+        IoAcceptor acceptor = ( IoAcceptor ) requestor.getService();
+        List sessions = new ArrayList( acceptor.getManagedSessions( requestor.getServiceAddress()
) );
         StartupConfiguration cfg = service.getConfiguration().getStartupConfiguration();
         GracefulShutdownRequest gsreq = ( GracefulShutdownRequest ) req;
 
@@ -143,7 +136,8 @@
         // minaRegistry.getAcceptor( service.getTransportType() )
         //                       .setDisconnectClientsOnUnbind( false );
         // -------------------------------------------------------------------
-        serviceRegistry.unbind( ldapService );
+        // This might not work, either.
+        acceptor.unbind( requestor.getServiceAddress() );
 
         // -------------------------------------------------------------------
         // synchronously send a NoD to clients that are not aware of this resp
@@ -350,17 +344,5 @@
 
     public void setLdapProvider( LdapProtocolProvider provider )
     {
-    }
-
-
-    public void setServiceRegistry( ServiceRegistry registry )
-    {
-        this.serviceRegistry = registry;
-    }
-
-
-    public void setLdapService( Service service )
-    {
-        this.ldapService = service;
     }
 }

Modified: directory/trunks/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/extended/LaunchDiagnosticUiHandler.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/extended/LaunchDiagnosticUiHandler.java?rev=379047&r1=379046&r2=379047&view=diff
==============================================================================
--- directory/trunks/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/extended/LaunchDiagnosticUiHandler.java
(original)
+++ directory/trunks/apacheds/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/extended/LaunchDiagnosticUiHandler.java
Sun Feb 19 23:53:05 2006
@@ -45,8 +45,6 @@
 import org.apache.directory.shared.ldap.message.extended.LaunchDiagnosticUiResponse;
 import org.apache.directory.shared.ldap.name.LdapName;
 import org.apache.mina.common.IoSession;
-import org.apache.mina.registry.Service;
-import org.apache.mina.registry.ServiceRegistry;
 
 
 public class LaunchDiagnosticUiHandler implements ExtendedOperationHandler
@@ -61,8 +59,6 @@
         EXTENSION_OIDS = Collections.unmodifiableSet( set );
     }
 
-    private Service ldapService;
-    private ServiceRegistry minaRegistry;
     private LdapProtocolProvider ldapProvider;
 
 
@@ -114,8 +110,6 @@
             }
 
             SessionsFrame sessions = new SessionsFrame();
-            sessions.setMinaRegistry( minaRegistry );
-            sessions.setLdapService( ldapService );
             sessions.setRequestor( requestor );
             sessions.setLdapProvider( ldapProvider.getHandler() );
             Point pos = getCenteredPosition( sessions );
@@ -135,7 +129,7 @@
     {
         Toolkit tk = Toolkit.getDefaultToolkit();
         Dimension screenSize = tk.getScreenSize();
-        return ( double ) screenSize.getWidth() / ( double ) screenSize.getHeight();
+        return screenSize.getWidth() / screenSize.getHeight();
     }
 
 
@@ -159,17 +153,5 @@
     public void setLdapProvider( LdapProtocolProvider provider )
     {
         this.ldapProvider = provider;
-    }
-
-
-    public void setLdapService( Service service )
-    {
-        this.ldapService = service;
-    }
-
-
-    public void setServiceRegistry( ServiceRegistry registry )
-    {
-        this.minaRegistry = registry;
     }
 }



Mime
View raw message