private void checkNewParent( DN newParent ) throws LdapException
{
if ( newParent.size() != 3 )
{
throw new LdapInvalidDnException(
ResultCodeEnum.NAMING_VIOLATION,
"The parent dn of a objectClass should be at most 3 name components in length." );
}
RDN rdn = newParent.getRdn();
if ( !schemaManager.getAttributeTypeRegistry().getOidByName( rdn.getNormType() ).equals(
SchemaConstants.OU_AT_OID ) )
{
throw new LdapInvalidDnException( ResultCodeEnum.NAMING_VIOLATION,
I18n.err( I18n.ERR_376 ) );
}
if ( !( ( String ) rdn.getNormValue() ).equalsIgnoreCase( SchemaConstants.OBJECT_CLASSES_AT ) )
{
throw new LdapInvalidDnException( ResultCodeEnum.NAMING_VIOLATION,
I18n.err( I18n.ERR_377 ) );
}
}