directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From szoer...@apache.org
Subject svn commit: r537147 - in /directory/ldapstudio/trunk/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core: internal/model/RootDSE.java model/IRootDSE.java
Date Fri, 11 May 2007 09:45:19 GMT
Author: szoerner
Date: Fri May 11 02:45:18 2007
New Revision: 537147

URL: http://svn.apache.org/viewvc?view=rev&rev=537147
Log:
DIRSTUDIO-100: Root DSE now always returns OIDs (translation of OIDs into descriptions removed)

Modified:
    directory/ldapstudio/trunk/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/internal/model/RootDSE.java
    directory/ldapstudio/trunk/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/model/IRootDSE.java

Modified: directory/ldapstudio/trunk/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/internal/model/RootDSE.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/internal/model/RootDSE.java?view=diff&rev=537147&r1=537146&r2=537147
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/internal/model/RootDSE.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/internal/model/RootDSE.java
Fri May 11 02:45:18 2007
@@ -21,11 +21,10 @@
 package org.apache.directory.ldapstudio.browser.core.internal.model;
 
 
-import java.net.URL;
 import java.util.Arrays;
-import java.util.Properties;
 
 import org.apache.directory.ldapstudio.browser.core.model.DN;
+import org.apache.directory.ldapstudio.browser.core.model.IAttribute;
 import org.apache.directory.ldapstudio.browser.core.model.IConnection;
 import org.apache.directory.ldapstudio.browser.core.model.IEntry;
 import org.apache.directory.ldapstudio.browser.core.model.IRootDSE;
@@ -37,25 +36,6 @@
 
     private static final long serialVersionUID = -8445018787232919754L;
 
-    public static Properties oidMap = new Properties();
-    static
-    {
-
-        try
-        {
-            URL url = RootDSE.class.getClassLoader().getResource(
-                "org/apache/directory/ldapstudio/browser/core/model/ldap_oids.txt" ); //$NON-NLS-1$
-            if(url != null)
-            {
-                oidMap.load( url.openStream() );
-            }
-        }
-        catch ( Exception e )
-        {
-            e.printStackTrace();
-        }
-    }
-
 
     protected RootDSE()
     {
@@ -67,18 +47,21 @@
         super( new DN(), connection );
     }
 
-    
+
     public IEntry getParententry()
     {
         return null;
     }
-    
+
 
     public String[] getSupportedExtensions()
     {
-        if ( getAttribute( IRootDSE.ROOTDSE_ATTRIBUTE_SUPPORTEDEXTENSION ) != null )
+        IAttribute supportedExtensionsAttr = getAttribute( IRootDSE.ROOTDSE_ATTRIBUTE_SUPPORTEDEXTENSION
);
+        if ( supportedExtensionsAttr != null )
         {
-            return get( getAttribute( IRootDSE.ROOTDSE_ATTRIBUTE_SUPPORTEDEXTENSION ).getStringValues()
);
+            String[] stringValues = supportedExtensionsAttr.getStringValues();
+            Arrays.sort( stringValues );
+            return stringValues;
         }
         else
         {
@@ -89,9 +72,12 @@
 
     public String[] getSupportedControls()
     {
-        if ( getAttribute( IRootDSE.ROOTDSE_ATTRIBUTE_SUPPORTEDCONTROL ) != null )
+        IAttribute supportedControlsAttr = getAttribute( IRootDSE.ROOTDSE_ATTRIBUTE_SUPPORTEDCONTROL
);
+        if ( supportedControlsAttr != null )
         {
-            return get( getAttribute( IRootDSE.ROOTDSE_ATTRIBUTE_SUPPORTEDCONTROL ).getStringValues()
);
+            String[] stringValues = supportedControlsAttr.getStringValues();
+            Arrays.sort( stringValues );
+            return stringValues;
         }
         else
         {
@@ -102,32 +88,17 @@
 
     public String[] getSupportedFeatures()
     {
-        if ( getAttribute( IRootDSE.ROOTDSE_ATTRIBUTE_SUPPORTEDFEATURES ) != null )
+        IAttribute supportedFeaturesAttr = getAttribute( IRootDSE.ROOTDSE_ATTRIBUTE_SUPPORTEDFEATURES
);
+        if ( supportedFeaturesAttr != null )
         {
-            return get( getAttribute( IRootDSE.ROOTDSE_ATTRIBUTE_SUPPORTEDFEATURES ).getStringValues()
);
+            String[] stringValues = supportedFeaturesAttr.getStringValues();
+            Arrays.sort( stringValues );
+            return stringValues;
         }
         else
         {
             return new String[0];
         }
-    }
-
-
-    private String[] get( String[] a )
-    {
-        for ( int i = 0; i < a.length; i++ )
-        {
-            if ( oidMap.containsKey( a[i] ) )
-            {
-                String s = ( String ) oidMap.get( a[i] );
-                a[i] = s;
-                if ( s.matches( "^\".*\"" ) ) { //$NON-NLS-1$
-                    a[i] = s.substring( 1, s.indexOf( "\"", 1 ) ); //$NON-NLS-1$
-                }
-            }
-        }
-        Arrays.sort( a );
-        return a;
     }
 
 }

Modified: directory/ldapstudio/trunk/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/model/IRootDSE.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/model/IRootDSE.java?view=diff&rev=537147&r1=537146&r2=537147
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/model/IRootDSE.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/model/IRootDSE.java
Fri May 11 02:45:18 2007
@@ -67,7 +67,7 @@
     /**
      * Gets the supported extensions.
      * 
-     * @return the supported extensions
+     * @return the OIDs of the supported extensions
      */
     public String[] getSupportedExtensions();
 
@@ -75,7 +75,7 @@
     /**
      * Gets the supported controls.
      * 
-     * @return the supported controls
+     * @return the OIDs of the the supported controls
      */
     public String[] getSupportedControls();
 
@@ -83,7 +83,7 @@
     /**
      * Gets the supported features.
      * 
-     * @return the supported features
+     * @return the OIDs of the the supported features
      */
     public String[] getSupportedFeatures();
 



Mime
View raw message