// if the supertype is provided make sure it exists in some schema
if ( ( attributeType.getSuperiorOid() != null )
&& !schemaManager.getAttributeTypeRegistry().contains( attributeType.getSuperiorOid() ) )
{
throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM,
I18n.err( I18n.ERR_409, attributeType.getSuperiorOid() ) );
}
// if the syntax is provided by the description make sure it exists in some schema
if ( ( attributeType.getSyntaxOid() != null )
&& !schemaManager.getLdapSyntaxRegistry().contains( attributeType.getSyntaxOid() ) )
{
throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM,
I18n.err( I18n.ERR_410, attributeType.getSyntaxOid() ) );
}
// if the matchingRule is provided make sure it exists in some schema
if ( ( attributeType.getEqualityOid() != null )
&& !schemaManager.getMatchingRuleRegistry().contains( attributeType.getEqualityOid() ) )
{
throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM,
I18n.err( I18n.ERR_411, attributeType.getEqualityOid() ) );
}
// if the matchingRule is provided make sure it exists in some schema
if ( ( attributeType.getOrderingOid() != null )
&& !schemaManager.getMatchingRuleRegistry().contains( attributeType.getOrderingOid() ) )
{
throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM,
I18n.err( I18n.ERR_412, attributeType.getOrderingOid() ) );
}
// if the matchingRule is provided make sure it exists in some schema
if ( ( attributeType.getSubstringOid() != null )
&& !schemaManager.getMatchingRuleRegistry().contains( attributeType.getSubstringOid() ) )
{
throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM,
I18n.err( I18n.ERR_413, attributeType.getSubstringOid() ) );
}
attributeTypes[pos++] = attributeType;
}