if ( objectClass == null )
{
String msg = "Entry " + entryDn.getUpName() + " contains no objectClass attribute: " + entry;
ResultCodeEnum rc = ResultCodeEnum.OBJECT_CLASS_VIOLATION;
NamingException e = new LdapSchemaViolationException( msg, rc );
e.setResolvedName( entryDn );
throw e;
}
// 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, entryDn, aliasAttr.getString() );
}
if ( !Character.isDigit( entryDn.toNormName().charAt( 0 ) ) )
{
throw new IllegalStateException( "Not a normalized name: " + entryDn.toNormName() );
}
ndnIdx.add( entryDn.toNormName(), id );
updnIdx.add( entryDn.getUpName(), id );
oneLevelIdx.add( parentId, id );
// Update the EntryCsn index
EntryAttribute entryCsn = entry.get( ENTRY_CSN_AT );
if ( entryCsn == null )
{
String msg = "Entry " + entryDn.getUpName() + " contains no entryCsn attribute: " + entry;
throw new LdapSchemaViolationException( msg, ResultCodeEnum.OBJECT_CLASS_VIOLATION );
}
entryCsnIdx.add( entryCsn.getString(), id );
// Update the EntryUuid index
EntryAttribute entryUuid = entry.get( ENTRY_UUID_AT );
if ( entryUuid == null )
{
String msg = "Entry " + entryDn.getUpName() + " contains no entryUuid attribute: " + entry;
throw new LdapSchemaViolationException( msg, ResultCodeEnum.OBJECT_CLASS_VIOLATION );
}
entryUuidIdx.add( entryUuid.getBytes(), id );
Long tempId = parentId;