directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1201905 - in /directory: apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/ apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/ apacheds/trunk/core-integ/src/test/java/or...
Date Mon, 14 Nov 2011 21:09:49 GMT
Author: elecharny
Date: Mon Nov 14 21:09:48 2011
New Revision: 1201905

URL: http://svn.apache.org/viewvc?rev=1201905&view=rev
Log:
Fixed fetRootDSE issues

Added:
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/getRootDse/GetRootDseTest.java
Modified:
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/LdapCoreSessionConnection.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/LookupOperationContext.java
    directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/partition/DefaultPartitionNexus.java
    directory/apacheds/trunk/interceptors/operational/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
    directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapConnection.java
    directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/LdapCoreSessionConnection.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/LdapCoreSessionConnection.java?rev=1201905&r1=1201904&r2=1201905&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/LdapCoreSessionConnection.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/LdapCoreSessionConnection.java
Mon Nov 14 21:09:48 2011
@@ -557,7 +557,7 @@ public class LdapCoreSessionConnection i
         }
         catch ( LdapNoPermissionException lnpe )
         {
-            // Special case to deal with insufficient permissions 
+            // Special case to deal with insufficient permissions
             return false;
         }
         catch ( LdapException le )
@@ -570,6 +570,24 @@ public class LdapCoreSessionConnection i
     /**
      * {@inheritDoc}
      */
+    public Entry getRootDse() throws LdapException
+    {
+        return lookup( Dn.ROOT_DSE, SchemaConstants.ALL_USER_ATTRIBUTES_ARRAY );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public Entry getRootDse( String... attributes ) throws LdapException
+    {
+        return lookup( Dn.ROOT_DSE, attributes );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
     public Entry lookup( Dn dn ) throws LdapException
     {
         return _lookup( dn, null );

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/LookupOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/LookupOperationContext.java?rev=1201905&r1=1201904&r2=1201905&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/LookupOperationContext.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/LookupOperationContext.java
Mon Nov 14 21:09:48 2011
@@ -148,6 +148,7 @@ public class LookupOperationContext exte
         if ( ( attrsId != null ) && ( attrsId.length > 0 ) )
         {
             this.attrsId = new ArrayList<String>( Arrays.asList( attrsId ) );
+            int nbNoAttribute = 0;
 
             // filter out the '+' and '*' and set boolean parameters
             for ( String id : this.attrsId )
@@ -163,11 +164,7 @@ public class LookupOperationContext exte
                 else if ( id.equals( SchemaConstants.NO_ATTRIBUTE ) )
                 {
                     noAttribute = true;
-                    allOperational = null;
-                    allUser = null;
-
-                    // We can stop here
-                    break;
+                    nbNoAttribute++;
                 }
             }
 
@@ -183,7 +180,16 @@ public class LookupOperationContext exte
 
             if ( noAttribute != null )
             {
-                this.attrsId.clear();
+                if ( attrsId.length == nbNoAttribute )
+                {
+                    this.attrsId.clear();
+                }
+                else
+                {
+                    // We have to ignore the 1.1
+                    this.attrsId.remove( SchemaConstants.NO_ATTRIBUTE );
+                    noAttribute = false;
+                }
             }
         }
     }
@@ -262,7 +268,7 @@ public class LookupOperationContext exte
 
 
     /**
-     * @return The flag telling if the "+" attribute has been used
+     * @return The flag telling if the "1.1" attribute has been used
      */
     public boolean hasNoAttribute()
     {

Added: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/getRootDse/GetRootDseTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/getRootDse/GetRootDseTest.java?rev=1201905&view=auto
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/getRootDse/GetRootDseTest.java
(added)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/getRootDse/GetRootDseTest.java
Mon Nov 14 21:09:48 2011
@@ -0,0 +1,239 @@
+/*
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *   or more contributor license agreements.  See the NOTICE file
+ *   distributed with this work for additional information
+ *   regarding copyright ownership.  The ASF licenses this file
+ *   to you under the Apache License, Version 2.0 (the
+ *   "License"); you may not use this file except in compliance
+ *   with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing,
+ *   software distributed under the License is distributed on an
+ *   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *   KIND, either express or implied.  See the License for the
+ *   specific language governing permissions and limitations
+ *   under the License.
+ *
+ */
+
+package org.apache.directory.server.core.operations.getRootDse;
+
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import org.apache.directory.ldap.client.api.LdapConnection;
+import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
+import org.apache.directory.server.core.integ.FrameworkRunner;
+import org.apache.directory.server.core.integ.IntegrationUtils;
+import org.apache.directory.shared.ldap.model.entry.Entry;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+
+/**
+ * A class to test the GetRootDse operation with a returningAttributes parameter
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+@RunWith(FrameworkRunner.class)
+public class GetRootDseTest extends AbstractLdapTestUnit
+{
+    private LdapConnection connection;
+
+
+    @Before
+    public void setup() throws Exception
+    {
+        connection = IntegrationUtils.getAdminConnection( getService() );
+    }
+
+
+    /**
+     * Test a lookup requesting all the attributes (* and +)
+     *
+     * @throws Exception
+     */
+    @Test
+    public void testGetRootDse() throws Exception
+    {
+        Entry rootDse = connection.getRootDse();
+        
+        assertNotNull( rootDse );
+
+        assertEquals( 1, rootDse.size() );
+        assertTrue( rootDse.containsAttribute( "objectClass" ) );
+    }
+
+
+    /**
+     * Test a lookup requesting all the user attributes (*)
+     *
+     * @throws Exception
+     */
+    @Test
+    public void testGetRooDseAllUserAttributes() throws Exception
+    {
+        Entry rootDse = connection.getRootDse( "*" );
+
+        assertNotNull( rootDse );
+
+        assertEquals( 1, rootDse.size() );
+        assertTrue( rootDse.containsAttribute( "objectClass" ) );
+    }
+
+
+    /**
+     * Test a lookup requesting all the operational attributes (+)
+     *
+     * @throws Exception
+     */
+    @Test
+    public void testGetRooDseAllOperationalAttributes() throws Exception
+    {
+        Entry rootDse = connection.getRootDse( "+" );
+
+        assertNotNull( rootDse );
+        
+        assertEquals( 9, rootDse.size() );
+        assertTrue( rootDse.containsAttribute( "entryUUID" ) );
+        assertTrue( rootDse.containsAttribute( "namingContexts" ) );
+        assertTrue( rootDse.containsAttribute( "subschemaSubentry" ) );
+        assertTrue( rootDse.containsAttribute( "supportedControl" ) );
+        assertTrue( rootDse.containsAttribute( "supportedExtension" ) );
+        assertTrue( rootDse.containsAttribute( "supportedFeatures" ) );
+        assertTrue( rootDse.containsAttribute( "supportedLDAPVersion" ) );
+        assertTrue( rootDse.containsAttribute( "vendorName" ) );
+        assertTrue( rootDse.containsAttribute( "vendorVersion" ) );
+    }
+
+
+    /**
+     * Test a lookup requesting a few attributes (Objectclass, vendorName and vendorVersion)
+     *
+     * @throws Exception
+     */
+    @Test
+    public void testGetRooDseSelectedAttributes() throws Exception
+    {
+        Entry rootDse = connection.getRootDse( "objectClass", "vendorName", "vendorVersion"
);
+
+        assertNotNull( rootDse );
+        
+        assertEquals( 3, rootDse.size() );
+        assertTrue( rootDse.containsAttribute( "objectClass" ) );
+        assertTrue( rootDse.containsAttribute( "vendorName" ) );
+        assertTrue( rootDse.containsAttribute( "vendorVersion" ) );
+    }
+
+
+    /**
+     * Test a lookup requesting a few operational attributes (vendorName and vendorVersion)
+     * and all user attributes (*)
+     *
+     * @throws Exception
+     */
+    @Test
+    public void testGetRooDseSomeOpAttributesAllUserAttributes() throws Exception
+    {
+        Entry rootDse = connection.getRootDse( "*", "vendorName", "vendorVersion" );
+
+        assertNotNull( rootDse );
+        
+        assertEquals( 3, rootDse.size() );
+        assertTrue( rootDse.containsAttribute( "objectClass" ) );
+        assertTrue( rootDse.containsAttribute( "vendorName" ) );
+        assertTrue( rootDse.containsAttribute( "vendorVersion" ) );
+    }
+
+
+    /**
+     * Test a lookup requesting a few user attributes (objectClass)
+     * and all operational attributes (+)
+     *
+     * @throws Exception
+     */
+    @Test
+    public void testGetRooDseSomeUserAttributesAllOpAttributes() throws Exception
+    {
+        Entry rootDse = connection.getRootDse( "+", "Objectclass" );
+
+        assertNotNull( rootDse );
+        
+        assertEquals( 10, rootDse.size() );
+        assertTrue( rootDse.containsAttribute( "objectClass" ) );
+        assertTrue( rootDse.containsAttribute( "entryUUID" ) );
+        assertTrue( rootDse.containsAttribute( "namingContexts" ) );
+        assertTrue( rootDse.containsAttribute( "subschemaSubentry" ) );
+        assertTrue( rootDse.containsAttribute( "supportedControl" ) );
+        assertTrue( rootDse.containsAttribute( "supportedExtension" ) );
+        assertTrue( rootDse.containsAttribute( "supportedFeatures" ) );
+        assertTrue( rootDse.containsAttribute( "supportedLDAPVersion" ) );
+        assertTrue( rootDse.containsAttribute( "vendorName" ) );
+        assertTrue( rootDse.containsAttribute( "vendorVersion" ) );
+    }
+
+
+    /**
+     * Test a lookup requesting a all user attributes (*)
+     * and all operational attributes (+)
+     *
+     * @throws Exception
+     */
+    @Test
+    public void testGetRooDseAllUserAttributesAllOpAttributes() throws Exception
+    {
+        Entry rootDse = connection.getRootDse( "+", "*" );
+
+        assertNotNull( rootDse );
+        
+        assertEquals( 10, rootDse.size() );
+        assertTrue( rootDse.containsAttribute( "objectClass" ) );
+        assertTrue( rootDse.containsAttribute( "entryUUID" ) );
+        assertTrue( rootDse.containsAttribute( "namingContexts" ) );
+        assertTrue( rootDse.containsAttribute( "subschemaSubentry" ) );
+        assertTrue( rootDse.containsAttribute( "supportedControl" ) );
+        assertTrue( rootDse.containsAttribute( "supportedExtension" ) );
+        assertTrue( rootDse.containsAttribute( "supportedFeatures" ) );
+        assertTrue( rootDse.containsAttribute( "supportedLDAPVersion" ) );
+        assertTrue( rootDse.containsAttribute( "vendorName" ) );
+        assertTrue( rootDse.containsAttribute( "vendorVersion" ) );
+    }
+
+
+    /**
+     * Test a lookup requesting no attributes (1.1)
+     *
+     * @throws Exception
+     */
+    @Test
+    public void testGetRooDseNoAttribute() throws Exception
+    {
+        Entry rootDse = connection.getRootDse( "1.1" );
+
+        assertNotNull( rootDse );
+        
+        assertEquals( 0, rootDse.size() );
+    }
+
+
+    /**
+     * Test a lookup requesting no attributes (1.1) with some attributes
+     *
+     * @throws Exception
+     */
+    @Test
+    public void testGetRooDseNoAttributeSomeUserAttributes() throws Exception
+    {
+        Entry rootDse = connection.getRootDse( "1.1", "objectClass" );
+
+        assertNotNull( rootDse );
+        
+        assertEquals( 1, rootDse.size() );
+        assertTrue( rootDse.containsAttribute( "objectClass" ) );
+    }
+}

Modified: directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/partition/DefaultPartitionNexus.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/partition/DefaultPartitionNexus.java?rev=1201905&r1=1201904&r2=1201905&view=diff
==============================================================================
--- directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/partition/DefaultPartitionNexus.java
(original)
+++ directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/partition/DefaultPartitionNexus.java
Mon Nov 14 21:09:48 2011
@@ -569,7 +569,10 @@ public class DefaultPartitionNexus exten
         if ( dn.size() == 0 )
         {
             Entry retval = new ClonedServerEntry( rootDse );
-
+            
+            return retval;
+            
+            /*
             if ( ( lookupContext.getAttrsId() != null ) && !lookupContext.getAttrsId().isEmpty()
)
             {
                 for ( Attribute attribute : rootDse.getAttributes() )
@@ -589,6 +592,7 @@ public class DefaultPartitionNexus exten
             {
                 return new ClonedServerEntry( rootDse );
             }
+            */
         }
 
         Partition partition = getPartition( dn );

Modified: directory/apacheds/trunk/interceptors/operational/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/operational/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java?rev=1201905&r1=1201904&r2=1201905&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/operational/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
(original)
+++ directory/apacheds/trunk/interceptors/operational/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
Mon Nov 14 21:09:48 2011
@@ -256,16 +256,46 @@ public class OperationalAttributeInterce
     public Entry lookup( LookupOperationContext lookupContext ) throws LdapException
     {
         Entry result = next( lookupContext );
-
-        if ( lookupContext.getAttrsId() == null )
+        
+        if ( lookupContext.hasAllUser() )
         {
-            filterOperationalAttributes( result );
+            if ( lookupContext.hasAllOperational() )
+            {
+                // The user has requested '+' and '*', return everything.
+                return result;
+            }
+            else
+            {
+                filter( lookupContext, result );
+            }
         }
-        else if ( !lookupContext.hasAllOperational() )
+        else
         {
-            filter( lookupContext, result );
+            if ( lookupContext.hasAllOperational() )
+            {
+                // Select the user attrinbutes from the result, depending on the returning
attributes list
+                filterUserAttributes( lookupContext, result );
+            }
+            else if ( ( lookupContext.getAttrsId() == null ) || ( lookupContext.getAttrsId().size()
== 0 ) )
+            {
+                // No returning attributes, return all the user attributes
+                // unless the user has requested no attributes
+                if ( lookupContext.hasNoAttribute() )
+                {
+                    result.clear();
+                }
+                else
+                {
+                    filterOperationalAttributes( result );
+                }
+            }
+            else
+            {
+                // Deal with the returning attributes
+                filterList( lookupContext, result );
+            }
         }
-
+        
         denormalizeEntryOpAttrs( result );
 
         return result;
@@ -490,13 +520,52 @@ public class OperationalAttributeInterce
     }
 
 
+    /**
+     * Filters out the user attributes within a search results attributes. The attributes
are directly
+     * modified.
+     *
+     * @param attributes the resultant attributes to filter
+     * @return true always
+     * @throws Exception if there are failures in evaluation
+     */
+    private boolean filterUserAttributes( LookupOperationContext lookupContext, Entry attributes
) throws LdapException
+    {
+        Set<String> removedAttributes = new HashSet<String>();
+
+        // Build a list of attributeType to remove
+        for ( Attribute attribute : attributes.getAttributes() )
+        {
+            AttributeType attributeType = attribute.getAttributeType();
+
+            if ( attributeType.getUsage() == UsageEnum.USER_APPLICATIONS )
+            {
+                removedAttributes.add( attributeType.getOid() );
+            }
+        }
+
+        // Now remove the attributes which are not in the list to be returned
+        for ( String returningAttribute : lookupContext.getAttrsId() )
+        {
+            removedAttributes.remove( returningAttribute );
+        }
+        
+        // Now, remove the attributes from the result
+        for ( String attribute : removedAttributes )
+        {
+            attributes.removeAttributes( attribute );
+        }
+
+        return true;
+    }
+
+
     private void filter( LookupOperationContext lookupContext, Entry entry ) throws LdapException
     {
         Dn dn = lookupContext.getDn();
         List<String> ids = lookupContext.getAttrsId();
 
         // still need to protect against returning op attrs when ids is null
-        if ( ids == null || ids.isEmpty() )
+        if ( ( ids == null ) || ids.isEmpty() )
         {
             filterOperationalAttributes( entry );
             return;
@@ -504,15 +573,67 @@ public class OperationalAttributeInterce
 
         if ( dn.size() == 0 )
         {
+            Set<AttributeType> removedAttributes = new HashSet<AttributeType>();
+
             for ( Attribute attribute : entry.getAttributes() )
             {
                 AttributeType attributeType = attribute.getAttributeType();
+                
+                if ( attributeType.getUsage() != UsageEnum.USER_APPLICATIONS )
+                {
+                    // If it's not in the list of returning attribute, remove it
+                    if ( !ids.contains( attributeType.getOid() ) )
+                    {
+                        removedAttributes.add( attributeType );
+                    }
+                }
+            }
+            
+            for ( AttributeType attributeType : removedAttributes )
+            {
+                entry.removeAttributes( attributeType );
+            }
+        }
+
+        denormalizeEntryOpAttrs( entry );
+
+        // do nothing past here since this explicity specifies which
+        // attributes to include - backends will automatically populate
+        // with right set of attributes using ids array
+    }
 
+
+    private void filterList( LookupOperationContext lookupContext, Entry entry ) throws LdapException
+    {
+        Dn dn = lookupContext.getDn();
+        List<String> ids = lookupContext.getAttrsId();
+
+        // still need to protect against returning op attrs when ids is null
+        if ( ( ids == null ) || ids.isEmpty() )
+        {
+            filterOperationalAttributes( entry );
+            return;
+        }
+
+        if ( dn.size() == 0 )
+        {
+            Set<AttributeType> removedAttributes = new HashSet<AttributeType>();
+
+            for ( Attribute attribute : entry.getAttributes() )
+            {
+                AttributeType attributeType = attribute.getAttributeType();
+                
+                // If it's not in the list of returning attribute, remove it
                 if ( !ids.contains( attributeType.getOid() ) )
                 {
-                    entry.removeAttributes( attributeType );
+                    removedAttributes.add( attributeType );
                 }
             }
+            
+            for ( AttributeType attributeType : removedAttributes )
+            {
+                entry.removeAttributes( attributeType );
+            }
         }
 
         denormalizeEntryOpAttrs( entry );

Modified: directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapConnection.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapConnection.java?rev=1201905&r1=1201904&r2=1201905&view=diff
==============================================================================
--- directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapConnection.java
(original)
+++ directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapConnection.java
Mon Nov 14 21:09:48 2011
@@ -653,9 +653,9 @@ public interface LdapConnection
      * Tells if an Entry exists in the server.
      * 
      * @param dn The Dn for the entry we want to check the existence
-     * @return <code>true</code> if the entry exists, <code>false</code>
otherwise. 
+     * @return <code>true</code> if the entry exists, <code>false</code>
otherwise.
      * Note that if the entry exists but if the user does not have the permission to
-     * read it, <code>false</code> will also be returned 
+     * read it, <code>false</code> will also be returned
      * @throws LdapException if some error occurred
      */
     boolean exists( String dn ) throws LdapException;
@@ -665,12 +665,33 @@ public interface LdapConnection
      * Tells if an Entry exists in the server.
      * 
      * @param dn The Dn for the entry we want to check the existence
-     * @return <code>true</code> if the entry exists, <code>false</code>
otherwise. 
+     * @return <code>true</code> if the entry exists, <code>false</code>
otherwise.
      * Note that if the entry exists but if the user does not have the permission to
-     * read it, <code>false</code> will also be returned 
+     * read it, <code>false</code> will also be returned
      * @throws LdapException if some error occurred
      */
     boolean exists( Dn dn ) throws LdapException;
+    
+    
+    /**
+     * Get back the RooDSE from the connected server. We only return the user attributes.
+     * 
+     * @return The Entry containing all the information about the rootDSE
+     * @throws LdapException If the rootDSE can't be read
+     */
+    Entry getRootDse() throws LdapException;
+    
+    
+    /**
+     * Get back the RooDSE from the connected server. The user can provide the
+     * list of attributes he wants to get back. Sending "*" will return all the
+     * user attributes, sending "+" will return all the operational attributes;
+     * 
+     * @param attributes The list of attributes to return
+     * @return The Entry containing all the information about the rootDSE
+     * @throws LdapException If the rootDSE can't be read
+     */
+    Entry getRootDse( String... attributes ) throws LdapException;
 
 
     /**
@@ -778,7 +799,7 @@ public interface LdapConnection
 
     
     /**
-     * Gets the LDAP CODEC service responsible for encoding and decoding 
+     * Gets the LDAP CODEC service responsible for encoding and decoding
      * messages.
      * 
      * @return The LDAP CODEC service.

Modified: directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java?rev=1201905&r1=1201904&r2=1201905&view=diff
==============================================================================
--- directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
(original)
+++ directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
Mon Nov 14 21:09:48 2011
@@ -188,7 +188,7 @@ public class LdapNetworkConnection exten
     private IoConnector connector;
 
     /** A mutex used to avoid a double close of the connector */
-    private ReentrantLock connectorMutex = new ReentrantLock(); 
+    private ReentrantLock connectorMutex = new ReentrantLock();
 
     /**
      * The created session, created when we open a connection with
@@ -3273,6 +3273,24 @@ public class LdapNetworkConnection exten
     /**
      * {@inheritDoc}
      */
+    public Entry getRootDse() throws LdapException
+    {
+        return lookup( Dn.ROOT_DSE, SchemaConstants.ALL_USER_ATTRIBUTES_ARRAY );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public Entry getRootDse( String... attributes ) throws LdapException
+    {
+        return lookup( Dn.ROOT_DSE, attributes );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
     public Entry lookup( Dn dn ) throws LdapException
     {
         return lookup( dn, SchemaConstants.ALL_USER_ATTRIBUTES_ARRAY );



Mime
View raw message