EntryAttribute objectClass = entry.get( OBJECT_CLASS_AT );
if ( objectClass == null )
{
String msg = I18n.err( I18n.ERR_217, normName.getName(), entry );
throw new LdapSchemaViolationException( ResultCodeEnum.OBJECT_CLASS_VIOLATION, msg );
}
// Start adding the system userIndices
// Why bother doing a lookup if this is not an alias.
// First, the ObjectClass index
for ( Value<?> value : objectClass )
{
objectClassIdx.add( value.getString(), id );
}
if ( objectClass.contains( SchemaConstants.ALIAS_OC ) )
{
EntryAttribute aliasAttr = entry.get( ALIASED_OBJECT_NAME_AT );
addAliasIndices( id, normName, aliasAttr.getString() );
}
if ( !Character.isDigit( normName.getNormName().charAt( 0 ) ) )
{
throw new IllegalStateException( I18n.err( I18n.ERR_218, normName.getNormName() ) );
}
ndnIdx.add( normName.getNormName(), id );
updnIdx.add( normName.getName(), id );
oneLevelIdx.add( parentId, id );
// Update the EntryCsn index
EntryAttribute entryCsn = entry.get( SchemaConstants.ENTRY_CSN_AT );
if ( entryCsn == null )
{
String msg = I18n.err( I18n.ERR_219, normName.getName(), entry );
throw new LdapSchemaViolationException( ResultCodeEnum.OBJECT_CLASS_VIOLATION, msg );
}
entryCsnIdx.add( entryCsn.getString(), id );
// Update the EntryUuid index
EntryAttribute entryUuid = entry.get( SchemaConstants.ENTRY_UUID_AT );
if ( entryUuid == null )
{
String msg = I18n.err( I18n.ERR_220, normName.getName(), entry );
throw new LdapSchemaViolationException( ResultCodeEnum.OBJECT_CLASS_VIOLATION, msg );
}
entryUuidIdx.add( entryUuid.getString(), id );
Long tempId = parentId;