if ( objectClass == null )
{
String msg = I18n.err( I18n.ERR_217, entryDn.getName(), entry );
ResultCodeEnum rc = ResultCodeEnum.OBJECT_CLASS_VIOLATION;
LdapSchemaViolationException e = new LdapSchemaViolationException( rc, msg );
//e.setResolvedName( entryDn );
throw e;
}
for ( Value<?> value : objectClass )
{
objectClassIdx.add( value.getString(), id );
}
if ( objectClass.contains( SchemaConstants.ALIAS_OC ) )
{
Attribute aliasAttr = entry.get( ALIASED_OBJECT_NAME_AT );
addAliasIndices( id, entryDn, aliasAttr.getString() );
}
// Update the OneLevel index
oneLevelIdx.add( parentId, id );
// Update the SubLevel index
ID tempId = parentId;
while ( ( tempId != null ) && ( !tempId.equals( getRootId() ) ) && ( !tempId.equals( getSuffixId() ) ) )
{
subLevelIdx.add( tempId, id );
tempId = getParentId( tempId );
}
// making entry an ancestor/descendent of itself in sublevel index
subLevelIdx.add( id, id );
// Update the EntryCsn index
Attribute entryCsn = entry.get( ENTRY_CSN_AT );
if ( entryCsn == null )
{
String msg = I18n.err( I18n.ERR_219, entryDn.getName(), entry );
throw new LdapSchemaViolationException( ResultCodeEnum.OBJECT_CLASS_VIOLATION, msg );
}
entryCsnIdx.add( entryCsn.getString(), id );
// Update the EntryUuid index
Attribute entryUuid = entry.get( ENTRY_UUID_AT );
if ( entryUuid == null )
{
String msg = I18n.err( I18n.ERR_220, entryDn.getName(), entry );
throw new LdapSchemaViolationException( ResultCodeEnum.OBJECT_CLASS_VIOLATION, msg );
}
entryUuidIdx.add( entryUuid.getString(), id );
// Now work on the user defined userIndices