DirectoryException lastException = null;
boolean oneRegistered = false;
Set<String> registeredAttrs = new HashSet<String>();
for (String attrDefinition : remainingAttrs)
{
ByteStringBuilder sb = new ByteStringBuilder();
sb.append(attrDefinition);
try
{
AttributeType attrType =
AttributeTypeSyntax.decodeAttributeType(sb, schema, false);
schema.registerAttributeType(attrType, true);
oneRegistered = true;
registeredAttrs.add(attrDefinition);
}
catch (DirectoryException de)
{
lastException = de;
}
}
if (!oneRegistered)
{
throw lastException;
}
remainingAttrs.removeAll(registeredAttrs);
}
List<Object> objectClasses =
csr.getAttributeValues(ConfigConstants.ATTR_OBJECTCLASSES_LC);
Set<String> remainingOcs = new HashSet<String>();
for (Object o : objectClasses)
{
remainingOcs.add((String)o);
}
while (!remainingOcs.isEmpty())
{
DirectoryException lastException = null;
boolean oneRegistered = false;
Set<String> registeredOcs = new HashSet<String>();
for (String ocDefinition : remainingOcs)
{
ByteStringBuilder sb = new ByteStringBuilder();
sb.append(ocDefinition);
try
{
ObjectClass oc =
ObjectClassSyntax.decodeObjectClass(sb, schema, false);
schema.registerObjectClass(oc, true);