Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 74806 invoked from network); 11 May 2007 09:45:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 May 2007 09:45:41 -0000 Received: (qmail 80437 invoked by uid 500); 11 May 2007 09:45:47 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 80388 invoked by uid 500); 11 May 2007 09:45:47 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 80330 invoked by uid 99); 11 May 2007 09:45:46 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 May 2007 02:45:46 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 May 2007 02:45:39 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 9E0891A9838; Fri, 11 May 2007 02:45:19 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@directory.apache.org From: szoerner@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070511094519.9E0891A9838@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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();