Attributes at = new BasicAttributes();
at.put("facsimileTelephoneNumber", password);
at.put(objectClassAttr);
Array others = new Array();
if (params != null) {
for (int i=0,l=params.length; i<l; i++) {
String key = params[i][0];
String val = params[i][1];
if (LDAPCitizen.ATTRMAP_C.containsKey(key)) {
at.put((String)LDAPCitizen.ATTRMAP_C.get(key), val);
//System.err.println ("Save: OK attr: "+LDAPCitizen.ATTRMAP_C.get(key)+" = "+val);
} else {
others.put(Any.create(key), Any.create(val));
//System.err.println ("Save: Unknown attr: "+LDAPCitizen.ATTRMAP_C.get(key)+" = "+val);
}
}
}
at.put("cn", username);
if (at.get("sn") == null) {
at.put("sn", username);
}
if (others.size() > 0) {
try {
String sothers = Serialization.serialize(null, others);
at.put(LDAPCitizen.OTHERS_ATTR, sothers);
} catch(IOException ioe) {
throw new OperationFailedException("Data serialization failed: "+ioe);