]> git.argeo.org Git - lgpl/argeo-commons.git/blobdiff - org.argeo.util/src/org/argeo/util/directory/ldap/LdifDao.java
Directory as a hierarchy unit.
[lgpl/argeo-commons.git] / org.argeo.util / src / org / argeo / util / directory / ldap / LdifDao.java
index c805d12725856fce3fb6edd853a833472965c141..740a4762468405e762bba24ad8b61e3b01a1d4ef 100644 (file)
@@ -217,7 +217,7 @@ public class LdifDao extends AbstractLdapDirectoryDao {
         */
 
        @Override
-       public LdapEntry daoGetEntry(LdapName key) throws NameNotFoundException {
+       public LdapEntry doGetEntry(LdapName key) throws NameNotFoundException {
 //             if (groups.containsKey(key))
 //                     return groups.get(key);
 //             if (users.containsKey(key))
@@ -228,7 +228,7 @@ public class LdifDao extends AbstractLdapDirectoryDao {
        }
 
        @Override
-       public Boolean daoHasEntry(LdapName dn) {
+       public Boolean entryExists(LdapName dn) {
                return entries.containsKey(dn);// || groups.containsKey(dn);
        }
 
@@ -281,7 +281,7 @@ public class LdifDao extends AbstractLdapDirectoryDao {
                entries: for (LdapName name : entries.keySet()) {
                        LdapEntry group;
                        try {
-                               LdapEntry entry = daoGetEntry(name);
+                               LdapEntry entry = doGetEntry(name);
                                if (AbstractLdapDirectory.hasObjectClass(entry.getAttributes(), getDirectory().getGroupObjectClass())) {
                                        group = entry;
                                } else {
@@ -329,7 +329,7 @@ public class LdifDao extends AbstractLdapDirectoryDao {
                        Attributes modifiedAttrs = wc.getModifiedData().get(dn);
                        LdapEntry user;
                        try {
-                               user = daoGetEntry(dn);
+                               user = doGetEntry(dn);
                        } catch (NameNotFoundException e) {
                                throw new IllegalStateException("User to modify no found " + dn, e);
                        }
@@ -364,6 +364,8 @@ public class LdifDao extends AbstractLdapDirectoryDao {
 //     }
        @Override
        public HierarchyUnit doGetHierarchyUnit(LdapName dn) {
+               if (getDirectory().getBaseDn().equals(dn))
+                       return getDirectory();
                return hierarchy.get(dn);
        }