List<Attribute> ldapSyntaxList = entry.getAttribute(ldapSyntaxAttrType);
if ((ldapSyntaxList != null) && (! ldapSyntaxList.isEmpty()))
{
for (Attribute a : ldapSyntaxList)
{
mods.add(new Modification(ModificationType.ADD, a));
}
}
AttributeTypeSyntax attrTypeSyntax;
try
{
attrTypeSyntax = (AttributeTypeSyntax)
schema.getSyntax(SYNTAX_ATTRIBUTE_TYPE_OID);
if (attrTypeSyntax == null)
{
attrTypeSyntax = new AttributeTypeSyntax();
attrTypeSyntax.initializeSyntax(null);
}
}
catch (Exception e)
{
if (debugEnabled())
{
TRACER.debugCaught(DebugLogLevel.ERROR, e);
}
attrTypeSyntax = new AttributeTypeSyntax();
attrTypeSyntax.initializeSyntax(null);
}
AttributeType attributeAttrType =
schema.getAttributeType(ATTR_ATTRIBUTE_TYPES_LC);
if (attributeAttrType == null)
{
attributeAttrType =
DirectoryServer.getDefaultAttributeType(ATTR_ATTRIBUTE_TYPES,
attrTypeSyntax);
}
List<Attribute> attrList = entry.getAttribute(attributeAttrType);
if ((attrList != null) && (! attrList.isEmpty()))
{
for (Attribute a : attrList)
{
mods.add(new Modification(ModificationType.ADD, a));
}
}
// Get the objectClasses attribute from the entry.
ObjectClassSyntax ocSyntax;
try
{
ocSyntax = (ObjectClassSyntax) schema.getSyntax(SYNTAX_OBJECTCLASS_OID);
if (ocSyntax == null)
{
ocSyntax = new ObjectClassSyntax();
ocSyntax.initializeSyntax(null);
}
}
catch (Exception e)
{
if (debugEnabled())
{
TRACER.debugCaught(DebugLogLevel.ERROR, e);
}
ocSyntax = new ObjectClassSyntax();
ocSyntax.initializeSyntax(null);
}
AttributeType objectclassAttrType =
schema.getAttributeType(ATTR_OBJECTCLASSES_LC);
if (objectclassAttrType == null)
{
objectclassAttrType =
DirectoryServer.getDefaultAttributeType(ATTR_OBJECTCLASSES,
ocSyntax);
}
List<Attribute> ocList = entry.getAttribute(objectclassAttrType);
if ((ocList != null) && (! ocList.isEmpty()))
{
for (Attribute a : ocList)
{
mods.add(new Modification(ModificationType.ADD, a));
}
}
// Get the name forms attribute from the entry.
NameFormSyntax nfSyntax;
try
{
nfSyntax = (NameFormSyntax) schema.getSyntax(SYNTAX_NAME_FORM_OID);
if (nfSyntax == null)
{
nfSyntax = new NameFormSyntax();
nfSyntax.initializeSyntax(null);
}
}
catch (Exception e)
{
if (debugEnabled())
{
TRACER.debugCaught(DebugLogLevel.ERROR, e);
}
nfSyntax = new NameFormSyntax();
nfSyntax.initializeSyntax(null);
}
AttributeType nameFormAttrType =
schema.getAttributeType(ATTR_NAME_FORMS_LC);
if (nameFormAttrType == null)
{
nameFormAttrType =
DirectoryServer.getDefaultAttributeType(ATTR_NAME_FORMS, nfSyntax);
}
List<Attribute> nfList = entry.getAttribute(nameFormAttrType);
if ((nfList != null) && (! nfList.isEmpty()))
{
for (Attribute a : nfList)
{
mods.add(new Modification(ModificationType.ADD, a));
}
}
// Get the DIT content rules attribute from the entry.
DITContentRuleSyntax dcrSyntax;
try
{
dcrSyntax = (DITContentRuleSyntax)
schema.getSyntax(SYNTAX_DIT_CONTENT_RULE_OID);
if (dcrSyntax == null)
{
dcrSyntax = new DITContentRuleSyntax();
dcrSyntax.initializeSyntax(null);
}
}
catch (Exception e)
{
if (debugEnabled())
{
TRACER.debugCaught(DebugLogLevel.ERROR, e);
}
dcrSyntax = new DITContentRuleSyntax();
dcrSyntax.initializeSyntax(null);
}
AttributeType dcrAttrType =
schema.getAttributeType(ATTR_DIT_CONTENT_RULES_LC);
if (dcrAttrType == null)
{
dcrAttrType =
DirectoryServer.getDefaultAttributeType(ATTR_DIT_CONTENT_RULES,
dcrSyntax);
}
List<Attribute> dcrList = entry.getAttribute(dcrAttrType);
if ((dcrList != null) && (! dcrList.isEmpty()))
{
for (Attribute a : dcrList)
{
mods.add(new Modification(ModificationType.ADD, a));
}
}
// Get the DIT structure rules attribute from the entry.
DITStructureRuleSyntax dsrSyntax;
try
{
dsrSyntax = (DITStructureRuleSyntax)
schema.getSyntax(SYNTAX_DIT_STRUCTURE_RULE_OID);
if (dsrSyntax == null)
{
dsrSyntax = new DITStructureRuleSyntax();
dsrSyntax.initializeSyntax(null);
}
}
catch (Exception e)
{
if (debugEnabled())
{
TRACER.debugCaught(DebugLogLevel.ERROR, e);
}
dsrSyntax = new DITStructureRuleSyntax();
dsrSyntax.initializeSyntax(null);
}
AttributeType dsrAttrType =
schema.getAttributeType(ATTR_DIT_STRUCTURE_RULES_LC);
if (dsrAttrType == null)
{
dsrAttrType =
DirectoryServer.getDefaultAttributeType(ATTR_DIT_STRUCTURE_RULES,
dsrSyntax);
}
List<Attribute> dsrList = entry.getAttribute(dsrAttrType);
if ((dsrList != null) && (! dsrList.isEmpty()))
{
for (Attribute a : dsrList)
{
mods.add(new Modification(ModificationType.ADD, a));
}
}
// Get the matching rule uses attribute from the entry.
MatchingRuleUseSyntax mruSyntax;
try
{
mruSyntax = (MatchingRuleUseSyntax)
schema.getSyntax(SYNTAX_MATCHING_RULE_USE_OID);
if (mruSyntax == null)
{
mruSyntax = new MatchingRuleUseSyntax();
mruSyntax.initializeSyntax(null);
}
}
catch (Exception e)
{
if (debugEnabled())
{
TRACER.debugCaught(DebugLogLevel.ERROR, e);
}
mruSyntax = new MatchingRuleUseSyntax();
mruSyntax.initializeSyntax(null);
}
AttributeType mruAttrType =
schema.getAttributeType(ATTR_MATCHING_RULE_USE_LC);
if (mruAttrType == null)
{
mruAttrType =
DirectoryServer.getDefaultAttributeType(ATTR_MATCHING_RULE_USE,
mruSyntax);
}
List<Attribute> mruList = entry.getAttribute(mruAttrType);
if ((mruList != null) && (! mruList.isEmpty()))
{
for (Attribute a : mruList)
{
mods.add(new Modification(ModificationType.ADD, a));
}
}
// Loop on all the attribute of the schema entry to
// find the extra attribute that shoule be loaded in the Schema.