if ( this.toOidString( schema ).equals( other.toOidString( schema ) ) )
{
return false;
}
AttributeTypeDescription myAtd = schema.getAttributeTypeDescription( this.getParsedAttributeType() );
AttributeTypeDescription otherAtd = schema.getAttributeTypeDescription( other.getParsedAttributeType() );
// special case *: all user attributes (RFC4511)
if ( SchemaConstants.ALL_USER_ATTRIBUTES.equals( other.description ) && !SchemaUtils.isOperational( myAtd ) )
{
return true;
}
// special case +: all operational attributes (RFC3673)
if ( SchemaConstants.ALL_OPERATIONAL_ATTRIBUTES.equals( other.description )
&& SchemaUtils.isOperational( myAtd ) )
{
return true;
}
// special case @: attributes by object class (RFC4529)
if ( other.description.length() > 1 && other.description.startsWith( "@" ) )
{
String objectClass = other.description.substring( 1 );
ObjectClassDescription ocd = schema.getObjectClassDescription( objectClass );
ocd.getMayAttributeTypes();
ocd.getMustAttributeTypes();
Collection<String> names = new HashSet<String>();
names.addAll( SchemaUtils.getMayAttributeTypeDescriptionNamesTransitive( ocd, schema ) );
names.addAll( SchemaUtils.getMustAttributeTypeDescriptionNamesTransitive( ocd, schema ) );
for ( String name : names )
{
AttributeTypeDescription atd = schema.getAttributeTypeDescription( name );
if ( myAtd == atd )
{
return true;
}
}
}
// check type
if ( myAtd != otherAtd )
{
AttributeTypeDescription superiorAtd = null;
String superiorName = myAtd.getSuperType();
while ( superiorName != null )
{
superiorAtd = schema.getAttributeTypeDescription( superiorName );
if ( superiorAtd == otherAtd )
{
break;
}
superiorName = superiorAtd.getSuperType();
}
if ( superiorAtd != otherAtd )
{
return false;
}