Package org.apache.ldap.common.schema

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


        }


        public String normalizeByName( String name, String value ) throws NamingException
        {
            AttributeType type = registry.lookup( name );

            return ( String ) type.getEquality().getNormalizer().normalize( value );
        }
View Full Code Here


        }


        public String normalizeByOid( String oid, String value ) throws NamingException
        {
            AttributeType type = registry.lookup( oid );

            return ( String ) type.getEquality().getNormalizer().normalize( value );
        }
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

     * @return the Normalizer to use for normalizing the value of the attribute
     * @throws NamingException if there are failures resolving the Normalizer
     */
    private Normalizer lookup( String id ) throws NamingException
    {
        AttributeType type = registry.lookup( id );
        return type.getEquality().getNormalizer();
    }
View Full Code Here

     * @return the Normalizer to use for normalizing the value of the attribute
     * @throws NamingException if there are failures resolving the Normalizer
     */
    private Normalizer lookup( String id ) throws NamingException
    {
        AttributeType type = registry.lookup( id );
        return type.getEquality().getNormalizer();
    }
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

        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();

        if ( db.hasUserIndexOn( snode.getAttribute() ) )
        {
            Index idx = db.getUserIndex( snode.getAttribute() );
       
View Full Code Here

            // add all operational attributes
            NamingEnumeration list = rec.getAttributes().getIDs();
            while ( list.hasMore() )
            {
                String attrId = ( String ) list.next();
                AttributeType attrType = registry.lookup( attrId );
                if ( attrType.getUsage() == UsageEnum.USERAPPLICATIONS )
                {
                    continue;
                }

                Attribute attr = ( Attribute ) rec.getAttributes().get( attrId ).clone();
                entry.put( attr );
            }
        }
        else if ( attrIdsHasStar )
        {
            entry = new LockableAttributesImpl();

            // add all listed operational attributes
            for ( int ii = 0; ii < attrIds.length; ii++ )
            {
                if ( attrIds[ii].equals( "*") )
                {
                    continue;
                }
                // there is no attribute by that name in the entry so we continue
                if ( null == rec.getAttributes().get( attrIds[ii] ) )
                {
                    continue;
                }

                // clone attribute to stuff into the new resultant entry
                Attribute attr = ( Attribute ) rec.getAttributes().get( attrIds[ii] ).clone();
                entry.put( attr );
            }

            // add all user attributes
            NamingEnumeration list = rec.getAttributes().getIDs();
            while ( list.hasMore() )
            {
                String attrId = ( String ) list.next();
                AttributeType attrType = registry.lookup( attrId );
                if ( attrType.getUsage() == UsageEnum.USERAPPLICATIONS )
                {
                    Attribute attr = ( Attribute ) rec.getAttributes().get( attrId ).clone();
                    entry.put( attr );
                }
            }
View Full Code Here

        throws NamingException
    {
        RE regex = null;
        Index idx = null;
        final SubstringNode snode = ( SubstringNode ) node;
        AttributeType type = attributeTypeRegistry.lookup( snode.getAttribute() );
        Normalizer normalizer = type.getSubstr().getNormalizer();

        if ( db.hasUserIndexOn( snode.getAttribute() ) )
        {
            /*
             * Build out regex in this block so we do not do it twice in the
View Full Code Here

        Iterator i = cfg.getIndexedAttributes().iterator();
        while( i.hasNext() )
        {
            String name = ( String ) i.next();
            String oid = oidRegistry.getOid( name );
            AttributeType type = attributeTypeRegistry.lookup( oid );
           
            // check if attribute is a system attribute
            if ( sysOidSet.contains( oid ) )
            {
                if ( oid.equals( Oid.EXISTANCE ) )
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.