* @param entry the entry to be updated.
*/
protected void addValuesInRDN(Entry entry)
{
// Add the values in the RDN if they are not there
RDN rdn = entry.getDN().getRDN();
for (int i=0; i<rdn.getNumValues(); i++)
{
String attrName = rdn.getAttributeName(i);
AttributeValue value = rdn.getAttributeValue(i);
List<org.nasutekds.server.types.Attribute> attrs =
entry.getAttribute(attrName.toLowerCase());
boolean done = false;
if (attrs != null)
{
for (org.nasutekds.server.types.Attribute attr : attrs)
{
if (attr.getNameWithOptions().equals(attrName))
{
ArrayList<AttributeValue> newValues =
new ArrayList<AttributeValue>();
Iterator<AttributeValue> it = attr.iterator();
while (it.hasNext())
{
newValues.add(it.next());
}
newValues.add(value);
entry.addAttribute(attr, newValues);
done = true;
break;
}
}
}
if (!done)
{
org.nasutekds.server.types.Attribute attr =
Attributes.create(rdn.getAttributeType(i), value);
ArrayList<AttributeValue> newValues =
new ArrayList<AttributeValue>();
newValues.add(value);
entry.addAttribute(attr, newValues);
}