Package org.apache.ldap.common.schema

Examples of org.apache.ldap.common.schema.AttributeType


    private MatchingRule getMatchingRule( String attrId, int matchType )
        throws NamingException
    {
        MatchingRule mrule = null;
        String oid = oidRegistry.getOid( attrId );
        AttributeType type = attributeTypeRegistry.lookup( oid );

        switch( matchType )
        {
            case( EQUALITY_MATCH ):
                mrule = type.getEquality();
                break;
            case( SUBSTRING_MATCH ):
                mrule = type.getSubstr();
                break;
            case( ORDERING_MATCH ):
                mrule = type.getOrdering();
                break;
            default:
                throw new NamingException( "Unknown match type: " + matchType );
        }
View Full Code Here


                + id + " not registered!" );
            monitor.lookupFailed( id, e );
            throw e;
        }

        AttributeType attributeType = ( AttributeType ) byOid.get( id );

        if ( attributeType == null )
        {
            attributeType = bootstrap.lookup( id );
        }
View Full Code Here

        throws NamingException
    {
        RE regex = null;
        SubstringNode snode = ( SubstringNode ) node;
        String oid = oidRegistry.getOid( snode.getAttribute() );
        AttributeType type = attributeTypeRegistry.lookup( oid );
        Normalizer normalizer = type.getSubstr().getNormalizer();

        // get the attribute
        Attribute attr = entry.get( snode.getAttribute() );
       
        // if the attribute does not exist just return false
View Full Code Here

        if ( ! registry.hasAttributeType( oid ) )
        {
            throw new LdapInvalidAttributeIdentifierException( oid + " not found within the attributeType registry" );
        }

        AttributeType attrType = registry.lookup( oid );
        Attribute attr = partition.lookup( name ).get( attrType.getName() );

        // complain if the attribute being compared does not exist in the entry
        if ( attr == null )
        {
            throw new LdapNoSuchAttributeException();
        }

        // see first if simple match without normalization succeeds
        if ( attr.contains( value ) )
        {
            return true;
        }

        // now must apply normalization to all values (attr and in request) to compare

        /*
         * Get ahold of the normalizer for the attribute and normalize the request
         * assertion value for comparisons with normalized attribute values.  Loop
         * through all values looking for a match.
         */
        Normalizer normalizer = attrType.getEquality().getNormalizer();
        String reqVal = ( String ) normalizer.normalize( value );
        for ( int ii = 0; ii < attr.size(); ii++ )
        {
            String attrVal = ( String ) normalizer.normalize( attr.get( ii ) );
            if ( attrVal.equals( reqVal ) )
View Full Code Here

        }

        list = attributeTypeRegistry.list();
        while ( list.hasNext() )
        {
            AttributeType at = ( AttributeType ) list.next();
            resolve( at, errors );
        }

        list = matchingRuleRegistry.list();
        while ( list.hasNext() )
View Full Code Here

                MatchingRuleRegistry matchingRuleRegistry;
                matchingRuleRegistry = registries.getMatchingRuleRegistry();
                matchingRuleRegistry.register( schema.getSchemaName(), matchingRule );
                break;
            case( ProducerTypeEnum.ATTRIBUTE_TYPE_PRODUCER_VAL ):
                AttributeType attributeType = ( AttributeType ) schemaObject;
                AttributeTypeRegistry attributeTypeRegistry;
                attributeTypeRegistry = registries.getAttributeTypeRegistry();
                attributeTypeRegistry.register( schema.getSchemaName(), attributeType );
                break;
            case( ProducerTypeEnum.OBJECT_CLASS_PRODUCER_VAL ):
View Full Code Here

        while ( list.hasMore() )
        {
            String attrId = ( String ) list.next();

            AttributeType type = null;

            if ( registry.hasAttributeType( attrId ) )
            {
                type = registry.lookup( attrId );
            }

            if ( type != null && type.getUsage() != UsageEnum.USERAPPLICATIONS )
            {
                attributes.remove( attrId );
            }
        }
        return true;
View Full Code Here

        {
            attr = new LockableAttributeImpl( attrs, "attributeTypes" );
            Iterator list = globalRegistries.getAttributeTypeRegistry().list();
            while ( list.hasNext() )
            {
                AttributeType at = ( AttributeType ) list.next();
                attr.add( SchemaUtils.render( at ).toString() );
            }
            attrs.put( attr );
        }
View Full Code Here

            binaries = new HashSet( binaryArray.length );

            for ( int ii = 0; ii < binaryArray.length; ii++ )
            {
                AttributeType type = globalRegistries.getAttributeTypeRegistry().lookup( binaryArray[ii] );

                binaries.add( type );
            }
        }

        /*
        * start converting values of attributes to byte[]s which are not
        * human readable and those that are in the binaries set
        */
        NamingEnumeration list = entry.getIDs();

        while ( list.hasMore() )
        {
            String id = ( String ) list.next();

            AttributeType type = null;

            boolean asBinary = false;

            if ( globalRegistries.getAttributeTypeRegistry().hasAttributeType( id ) )
            {
                type = globalRegistries.getAttributeTypeRegistry().lookup( id );
            }

            if ( type != null )
            {
                asBinary = !type.getSyntax().isHumanReadible();

                asBinary = asBinary || binaries.contains( type );
            }

            if ( asBinary )
View Full Code Here

    private MatchingRule getMatchingRule( String attrId, int matchType )
        throws NamingException
    {
        MatchingRule mrule = null;
        String oid = oidRegistry.getOid( attrId );
        AttributeType type = attributeTypeRegistry.lookup( oid );

        switch( matchType )
        {
            case( EQUALITY_MATCH ):
                mrule = type.getEquality();
                break;
            case( SUBSTRING_MATCH ):
                mrule = type.getSubstr();
                break;
            case( ORDERING_MATCH ):
                mrule = type.getOrdering();
                break;
            default:
                throw new NamingException( "Unknown match type: " + matchType );
        }
View Full Code Here

TOP

Related Classes of org.apache.ldap.common.schema.AttributeType

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.