Package org.apache.directory.shared.ldap.schema.parsers

Examples of org.apache.directory.shared.ldap.schema.parsers.AttributeTypeDescription


        // check all the attributes
        for ( String attributeDescription : attributeDescriptions )
        {
            // get attribute type schema information
            Schema schema = oldEntry.getBrowserConnection().getSchema();
            AttributeTypeDescription atd = schema.getAttributeTypeDescription( attributeDescription );
            boolean hasEMR = SchemaUtils.getEqualityMatchingRuleNameOrNumericOidTransitive( atd, schema ) != null;
            boolean isReplaceForced = ( hasEMR && modifyMode == ModifyMode.REPLACE )
                || ( !hasEMR && modifyModeNoEMR == ModifyMode.REPLACE );
            boolean isAddDelForced = ( hasEMR && modifyMode == ModifyMode.ADD_DELETE )
                || ( !hasEMR && modifyModeNoEMR == ModifyMode.ADD_DELETE );
            boolean isOrderedValue = atd.getExtensions().containsKey( "X-ORDERED" )
                && atd.getExtensions().get( "X-ORDERED" ).contains( "VALUES" );

            // get old an new values for comparison
            IAttribute oldAttribute = oldEntry.getAttribute( attributeDescription );
            Set<String> oldValues = new HashSet<String>();
            Map<String, LdifAttrValLine> oldAttrValLines = new LinkedHashMap<String, LdifAttrValLine>();
View Full Code Here


        if ( schema == null )
        {
            return description;
        }

        AttributeTypeDescription atd = schema.getAttributeTypeDescription( parsedAttributeType );
        String oidString = atd.getNumericOid();

        if ( !parsedLangList.isEmpty() )
        {
            for ( Iterator<String> it = parsedLangList.iterator(); it.hasNext(); )
            {
View Full Code Here

        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;
            }
View Full Code Here

        for ( ObjectClassDescription ocd : entry.getObjectClassDescriptions() )
        {
            Collection<String> musts = getMustAttributeTypeDescriptionNamesTransitive( ocd, schema );
            for ( String must : musts )
            {
                AttributeTypeDescription atd = schema.getAttributeTypeDescription( must );
                atds.add( atd );
            }
        }
        return atds;
    }
View Full Code Here

        for ( ObjectClassDescription ocd : entry.getObjectClassDescriptions() )
        {
            Collection<String> mays = getMayAttributeTypeDescriptionNamesTransitive( ocd, schema );
            for ( String may : mays )
            {
                AttributeTypeDescription atd = schema.getAttributeTypeDescription( may );
                atds.add( atd );
            }
        }
        return atds;
    }
View Full Code Here

            return atd.getEqualityMatchingRule();
        }

        if ( atd.getSuperType() != null && schema.hasAttributeTypeDescription( atd.getSuperType() ) )
        {
            AttributeTypeDescription superior = schema.getAttributeTypeDescription( atd.getSuperType() );
            return getEqualityMatchingRuleNameOrNumericOidTransitive( superior, schema );
        }

        return null;
    }
View Full Code Here

            return atd.getSubstringsMatchingRule();
        }

        if ( atd.getSuperType() != null && schema.hasAttributeTypeDescription( atd.getSuperType() ) )
        {
            AttributeTypeDescription superior = schema.getAttributeTypeDescription( atd.getSuperType() );
            return getSubstringMatchingRuleNameOrNumericOidTransitive( superior, schema );
        }

        return null;
    }
View Full Code Here

            return atd.getOrderingMatchingRule();
        }

        if ( atd.getSuperType() != null && schema.hasAttributeTypeDescription( atd.getSuperType() ) )
        {
            AttributeTypeDescription superior = schema.getAttributeTypeDescription( atd.getSuperType() );
            return getOrderingMatchingRuleNameOrNumericOidTransitive( superior, schema );
        }

        return null;
    }
View Full Code Here

            return atd.getSyntax();
        }

        if ( atd.getSuperType() != null && schema.hasAttributeTypeDescription( atd.getSuperType() ) )
        {
            AttributeTypeDescription superior = schema.getAttributeTypeDescription( atd.getSuperType() );
            return getSyntaxNumericOidTransitive( superior, schema );
        }

        return null;
    }
View Full Code Here

            return atd.getSyntaxLength();
        }

        if ( atd.getSuperType() != null && schema.hasAttributeTypeDescription( atd.getSuperType() ) )
        {
            AttributeTypeDescription superior = schema.getAttributeTypeDescription( atd.getSuperType() );
            return getSyntaxLengthTransitive( superior, schema );
        }

        return -1;
    }
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.ldap.schema.parsers.AttributeTypeDescription

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.