return null;
}
// Get the information about the RDN attributes.
RDN rdn = dn.getRDN();
int numAVAs = rdn.getNumValues();
// If there is only one RDN attribute, then see which objectclass we should
// use.
ObjectClass structuralClass;
if (numAVAs == 1)
{
AttributeType attrType = rdn.getAttributeType(0);
if (attrType.hasName(ATTR_C))
{
structuralClass = DirectoryServer.getObjectClass(OC_COUNTRY, true);
}
else if (attrType.hasName(ATTR_DC))
{
structuralClass = DirectoryServer.getObjectClass(OC_DOMAIN, true);
}
else if (attrType.hasName(ATTR_O))
{
structuralClass = DirectoryServer.getObjectClass(OC_ORGANIZATION, true);
}
else if (attrType.hasName(ATTR_OU))
{
structuralClass =
DirectoryServer.getObjectClass(OC_ORGANIZATIONAL_UNIT_LC, true);
}
else
{
structuralClass =
DirectoryServer.getObjectClass(OC_UNTYPED_OBJECT_LC, true);
}
}
else
{
structuralClass =
DirectoryServer.getObjectClass(OC_UNTYPED_OBJECT_LC, true);
}
// Get the top and untypedObject classes to include in the entry.
LinkedHashMap<ObjectClass,String> objectClasses =
new LinkedHashMap<ObjectClass,String>(3);
objectClasses.put(DirectoryServer.getTopObjectClass(), OC_TOP);
objectClasses.put(structuralClass, structuralClass.getNameOrOID());
// Iterate through the RDN attributes and add them to the set of user or
// operational attributes.
LinkedHashMap<AttributeType,List<Attribute>> userAttributes =
new LinkedHashMap<AttributeType,List<Attribute>>();
LinkedHashMap<AttributeType,List<Attribute>> operationalAttributes =
new LinkedHashMap<AttributeType,List<Attribute>>();
boolean extensibleObjectAdded = false;
for (int i=0; i < numAVAs; i++)
{
AttributeType attrType = rdn.getAttributeType(i);
AttributeValue attrValue = rdn.getAttributeValue(i);
String attrName = rdn.getAttributeName(i);
// First, see if this type is allowed by the untypedObject class. If not,
// then we'll need to include the extensibleObject class.
if ((! structuralClass.isRequiredOrOptional(attrType)) &&
(! extensibleObjectAdded))