LDAP support for hierarchy unit. Code clean up.
[lgpl/argeo-commons.git] / org.argeo.util / src / org / argeo / osgi / useradmin / LdifUser.java
index c4c02a748f8e0eb4130eb9da2cc9bbce4ab70496..db83b81e47b99a9e247a1e141c6bc22b219fe964 100644 (file)
@@ -195,9 +195,9 @@ abstract class LdifUser implements DirectoryUser {
 
        protected synchronized void startEditing() {
                if (frozen)
-                       throw new UserDirectoryException("Cannot edit frozen view");
+                       throw new IllegalStateException("Cannot edit frozen view");
                if (getUserAdmin().isReadOnly())
-                       throw new UserDirectoryException("User directory is read-only");
+                       throw new IllegalStateException("User directory is read-only");
                assert getModifiedAttributes() == null;
                getWc().startEditing(this);
                // modifiedAttributes = (Attributes) publishedAttributes.clone();
@@ -254,7 +254,7 @@ abstract class LdifUser implements DirectoryUser {
                                                effectiveKeys.add(id);
                                }
                        } catch (NamingException e) {
-                               throw new UserDirectoryException("Cannot initialise attribute dictionary", e);
+                               throw new IllegalStateException("Cannot initialise attribute dictionary", e);
                        }
                        if (!credentials)
                                effectiveKeys.add(LdapAttrs.objectClasses.name());
@@ -383,7 +383,7 @@ abstract class LdifUser implements DirectoryUser {
                                else
                                        return null;
                        } catch (NamingException e) {
-                               throw new UserDirectoryException("Cannot get value for attribute " + key, e);
+                               throw new IllegalStateException("Cannot get value for attribute " + key, e);
                        }
                }
 
@@ -405,7 +405,7 @@ abstract class LdifUser implements DirectoryUser {
                                else
                                        return null;
                        } catch (NamingException e) {
-                               throw new UserDirectoryException("Cannot remove attribute " + key, e);
+                               throw new IllegalStateException("Cannot remove attribute " + key, e);
                        }
                }
        }