]> git.argeo.org Git - lgpl/argeo-commons.git/blobdiff - org.argeo.enterprise/src/org/argeo/osgi/useradmin/LdifUserAdmin.java
Fix regression
[lgpl/argeo-commons.git] / org.argeo.enterprise / src / org / argeo / osgi / useradmin / LdifUserAdmin.java
index 8ec967b7007a73c8875e557b6e8ecee6c0305105..aab96dd7ad4cf7c319e34da4fe1c15a9517c003e 100644 (file)
@@ -8,6 +8,7 @@ import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
+import java.net.URI;
 import java.util.ArrayList;
 import java.util.Dictionary;
 import java.util.HashSet;
@@ -17,6 +18,7 @@ import java.util.Set;
 import java.util.SortedMap;
 import java.util.TreeMap;
 
+import javax.naming.NameNotFoundException;
 import javax.naming.NamingEnumeration;
 import javax.naming.directory.Attributes;
 import javax.naming.ldap.LdapName;
@@ -41,11 +43,16 @@ public class LdifUserAdmin extends AbstractUserDirectory {
        }
 
        public LdifUserAdmin(Dictionary<String, ?> properties) {
-               super(properties);
+               super(null, properties);
        }
 
+       public LdifUserAdmin(URI uri, Dictionary<String, ?> properties) {
+               super(uri, properties);
+       }
+
+       @Deprecated
        public LdifUserAdmin(InputStream in) {
-               super(new Hashtable<String, Object>());
+               super(null, new Hashtable<String, Object>());
                load(in);
        }
 
@@ -148,14 +155,16 @@ public class LdifUserAdmin extends AbstractUserDirectory {
                groups = null;
        }
 
-       protected DirectoryUser daoGetRole(LdapName key) {
+       @Override
+       protected DirectoryUser daoGetRole(LdapName key) throws NameNotFoundException {
                if (groups.containsKey(key))
                        return groups.get(key);
                if (users.containsKey(key))
                        return users.get(key);
-               return null;
+               throw new NameNotFoundException(key + " not persisted");
        }
 
+       @Override
        protected Boolean daoHasRole(LdapName dn) {
                return users.containsKey(dn) || groups.containsKey(dn);
        }