{
// Collective Attributes are not allowed in MAY or MUST
String msg = I18n.err( I18n.ERR_04484_COLLECTIVE_NOT_ALLOWED_IN_MUST, mustAttributeTypeName,
oid );
LdapSchemaException ldapSchemaException = new LdapSchemaException(
LdapSchemaExceptionCodes.OC_COLLECTIVE_NOT_ALLOWED_IN_MUST, msg );
ldapSchemaException.setSourceObject( this );
ldapSchemaException.setRelatedId( mustAttributeTypeName );
errors.add( ldapSchemaException );
break;
}
if ( mustAttributeTypes.contains( attributeType ) )
{
// Already registered : this is an error
String msg = I18n.err( I18n.ERR_04324, oid, mustAttributeTypeName );
LdapSchemaException ldapSchemaException = new LdapSchemaException(
LdapSchemaExceptionCodes.OC_DUPLICATE_AT_IN_MUST, msg );
ldapSchemaException.setSourceObject( this );
ldapSchemaException.setRelatedId( mustAttributeTypeName );
errors.add( ldapSchemaException );
break;
}
// Check that the MUST AT is not also present in the MAY AT
if ( mayAttributeTypes.contains( attributeType ) )
{
// Already registered : this is an error
String msg = I18n.err( I18n.ERR_04325, oid, mustAttributeTypeName );
LdapSchemaException ldapSchemaException = new LdapSchemaException(
LdapSchemaExceptionCodes.OC_DUPLICATE_AT_IN_MAY_AND_MUST,
msg );
ldapSchemaException.setSourceObject( this );
ldapSchemaException.setRelatedId( mustAttributeTypeName );
errors.add( ldapSchemaException );
break;
}
mustAttributeTypes.add( attributeType );
}
catch ( LdapException ne )
{
// Cannot find the AT
String msg = I18n.err( I18n.ERR_04326, oid, mustAttributeTypeName );
LdapSchemaException ldapSchemaException = new LdapSchemaException(
LdapSchemaExceptionCodes.OC_NONEXISTENT_MUST_AT, msg );
ldapSchemaException.setSourceObject( this );
ldapSchemaException.setRelatedId( mustAttributeTypeName );
errors.add( ldapSchemaException );
break;
}
}
}