directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r370074 - in /directory/trunks/apacheds: core/src/main/java/org/apache/ldap/server/partition/impl/btree/gui/MainFrame.java protocols/ldap/src/main/java/org/apache/ldap/server/protocol/support/extended/LaunchDiagnosticUiHandler.java
Date Wed, 18 Jan 2006 07:31:13 GMT
Author: akarasulu
Date: Tue Jan 17 23:31:02 2006
New Revision: 370074

URL: http://svn.apache.org/viewcvs?rev=370074&view=rev
Log:
now launching a frame for each partition that is based on the default btree impl

Modified:
    directory/trunks/apacheds/core/src/main/java/org/apache/ldap/server/partition/impl/btree/gui/MainFrame.java
    directory/trunks/apacheds/protocols/ldap/src/main/java/org/apache/ldap/server/protocol/support/extended/LaunchDiagnosticUiHandler.java

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/ldap/server/partition/impl/btree/gui/MainFrame.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/ldap/server/partition/impl/btree/gui/MainFrame.java?rev=370074&r1=370073&r2=370074&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/ldap/server/partition/impl/btree/gui/MainFrame.java
(original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/ldap/server/partition/impl/btree/gui/MainFrame.java
Tue Jan 17 23:31:02 2006
@@ -136,7 +136,7 @@
     /**
      * This method is called from within the constructor to initialize the form
      */
-    private void initGUI() 
+    private void initGUI() throws NamingException
     {
         mainPnl.setBorder( null );
         mainPnl.setLayout( new java.awt.BorderLayout() );
@@ -160,7 +160,7 @@
         content.add( mainPnl, java.awt.BorderLayout.NORTH );
         getContentPane().add( content, BorderLayout.CENTER );
         // set title
-        setTitle( "Backend DB Viewer" );
+        setTitle( "Partition: " + this.partition.getSuffix( false ).toString() );
         // add status bar
         getContentPane().add( statusBar, BorderLayout.SOUTH );
         // add menu bar

Modified: directory/trunks/apacheds/protocols/ldap/src/main/java/org/apache/ldap/server/protocol/support/extended/LaunchDiagnosticUiHandler.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/protocols/ldap/src/main/java/org/apache/ldap/server/protocol/support/extended/LaunchDiagnosticUiHandler.java?rev=370074&r1=370073&r2=370074&view=diff
==============================================================================
--- directory/trunks/apacheds/protocols/ldap/src/main/java/org/apache/ldap/server/protocol/support/extended/LaunchDiagnosticUiHandler.java
(original)
+++ directory/trunks/apacheds/protocols/ldap/src/main/java/org/apache/ldap/server/protocol/support/extended/LaunchDiagnosticUiHandler.java
Tue Jan 17 23:31:02 2006
@@ -17,6 +17,8 @@
 package org.apache.ldap.server.protocol.support.extended;
 
 
+import java.util.Iterator;
+
 import javax.naming.NamingException;
 import javax.naming.ldap.LdapContext;
 
@@ -24,8 +26,10 @@
 import org.apache.ldap.common.message.ResultCodeEnum;
 import org.apache.ldap.common.message.extended.LaunchDiagnosticUiRequest;
 import org.apache.ldap.common.message.extended.LaunchDiagnosticUiResponse;
+import org.apache.ldap.common.name.LdapName;
 import org.apache.ldap.server.DirectoryService;
 import org.apache.ldap.server.jndi.ServerLdapContext;
+import org.apache.ldap.server.partition.DirectoryPartition;
 import org.apache.ldap.server.partition.DirectoryPartitionNexus;
 import org.apache.ldap.server.partition.impl.btree.BTreeDirectoryPartition;
 import org.apache.ldap.server.partition.impl.btree.gui.MainFrame;
@@ -59,11 +63,21 @@
             }
 
             session.write( new LaunchDiagnosticUiResponse( req.getMessageId() ) );
+
+            DirectoryPartitionNexus nexus = service.getConfiguration().getPartitionNexus();
+            Iterator list = nexus.listSuffixes( true );
+            while ( list.hasNext() )
+            {
+                LdapName dn = new LdapName( ( String ) list.next() );
+                DirectoryPartition partition = nexus.getPartition( dn );
+                if ( partition instanceof BTreeDirectoryPartition )
+                {
+                    BTreeDirectoryPartition btPartition = ( BTreeDirectoryPartition ) partition;
+                    MainFrame frame = new MainFrame( btPartition, btPartition.getSearchEngine()
);
+                    frame.setVisible( true );
+                }
+            }
             
-            // Launch UI here using the provider, session registry and directory service
-            BTreeDirectoryPartition partition = ( BTreeDirectoryPartition ) service.getConfiguration().getPartitionNexus().getSystemPartition();
-            MainFrame frame = new MainFrame( partition, partition.getSearchEngine() );
-            frame.setVisible( true );
             return;
         }
 



Mime
View raw message