+ protected Attributes addAttributes(SortedMap<LdapName, Attributes> res,
+ int lineNumber, LdapName currentDn, Attributes currentAttributes) {
+ try {
+ Rdn nameRdn = currentDn.getRdn(currentDn.size() - 1);
+ Attribute nameAttr = currentAttributes.get(nameRdn.getType());
+ if (nameAttr == null)
+ currentAttributes.put(nameRdn.getType(), nameRdn.getValue());
+ else if (!nameAttr.get().equals(nameRdn.getValue()))
+ throw new UserDirectoryException("Attribute "
+ + nameAttr.getID() + "=" + nameAttr.get()
+ + " not consistent with DN " + currentDn
+ + " (shortly before line " + lineNumber
+ + " in LDIF file)");
+ Attributes previous = res.put(currentDn, currentAttributes);
+ if (log.isTraceEnabled())
+ log.trace("Added " + currentDn);
+ return previous;
+ } catch (NamingException e) {
+ throw new UserDirectoryException("Cannot add " + currentDn, e);
+ }
+ }
+
+ static void checkDnConsistency() {
+
+ }
+