if ( attributeType.isCollective() )
{
// Collective Attributes are not allowed in MAY or MUST
String msg = I18n.err( I18n.ERR_04485_COLLECTIVE_NOT_ALLOWED_IN_MAY, mayAttributeTypeName, oid );
LdapSchemaException ldapSchemaException = new LdapSchemaException(
LdapSchemaExceptionCodes.OC_COLLECTIVE_NOT_ALLOWED_IN_MAY, msg );
ldapSchemaException.setSourceObject( this );
ldapSchemaException.setRelatedId( mayAttributeTypeName );
errors.add( ldapSchemaException );
break;
}
if ( mayAttributeTypes.contains( attributeType ) )
{
// Already registered : this is an error
String msg = I18n.err( I18n.ERR_04322, oid, mayAttributeTypeName );
LdapSchemaException ldapSchemaException = new LdapSchemaException(
LdapSchemaExceptionCodes.OC_DUPLICATE_AT_IN_MAY, msg );
ldapSchemaException.setSourceObject( this );
ldapSchemaException.setRelatedId( mayAttributeTypeName );
errors.add( ldapSchemaException );
break;
}
mayAttributeTypes.add( attributeType );
}
catch ( LdapException ne )
{
// Cannot find the AT
String msg = I18n.err( I18n.ERR_04323, oid, mayAttributeTypeName );
LdapSchemaException ldapSchemaException = new LdapSchemaException(
LdapSchemaExceptionCodes.OC_NONEXISTENT_MAY_AT, msg, ne );
ldapSchemaException.setSourceObject( this );
ldapSchemaException.setRelatedId( mayAttributeTypeName );
errors.add( ldapSchemaException );
break;
}
}
}