import javax.naming.directory.BasicAttribute;
import javax.naming.ldap.LdapName;
-import org.argeo.util.naming.AuthPassword;
+import org.argeo.util.directory.Person;
import org.argeo.util.naming.LdapAttrs;
import org.argeo.util.naming.LdapObjs;
import org.argeo.util.naming.SharedSecret;
+import org.argeo.util.naming.ldap.AuthPassword;
/** Directory user implementation */
abstract class LdifUser implements DirectoryUser {
/** Should only be called from working copy thread. */
private synchronized Attributes getModifiedAttributes() {
assert getWc() != null;
- return getWc().getAttributes(getDn());
+ return getWc().getModifiedData().get(getDn());
}
protected synchronized boolean isEditing() {
return getWc() != null && getModifiedAttributes() != null;
}
- private synchronized UserDirectoryWorkingCopy getWc() {
+ private synchronized DirectoryUserWorkingCopy getWc() {
return userAdmin.getWorkingCopy();
}
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();
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());
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);
}
}
else
return null;
} catch (NamingException e) {
- throw new UserDirectoryException("Cannot remove attribute " + key, e);
+ throw new IllegalStateException("Cannot remove attribute " + key, e);
}
}
}