Package org.apache.ldap.common.schema

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


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

        AttributeType attributeType = ( AttributeType ) byOid.get( id );
        monitor.lookedUp( attributeType );
        return attributeType;
    }
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

        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

        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

    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

            }

            exclusions = new HashSet();
            for ( int ii = 0; ii < collectiveExclusions.size(); ii++ )
            {
                AttributeType attrType = registry.lookup( ( String ) collectiveExclusions.get( ii ) );
                exclusions.add( attrType.getOid() );
            }
        }
        else
        {
            exclusions = Collections.EMPTY_SET;
        }

        /*
         * For each collective subentry referenced by the entry we lookup the
         * attributes of the subentry and copy collective attributes from the
         * subentry into the entry.
         */
        for ( int ii = 0; ii < subentries.size(); ii++ )
        {
            String subentryDnStr = ( String ) subentries.get( ii );
            Name subentryDn = new LdapName( subentryDnStr );
            Attributes subentry = nexus.lookup( subentryDn );
            NamingEnumeration attrIds = subentry.getIDs();
            while ( attrIds.hasMore() )
            {
                String attrId = ( String ) attrIds.next();
                AttributeType attrType = registry.lookup( attrId );

                // skip the addition of this collective attribute if it is excluded
                if ( exclusions.contains( attrType.getOid() ) )
                {
                    continue;
                }

                /*
                 * If the attribute type of the subentry attribute is collective
                 * then we need to add all the values of the collective attribute
                 * to the entry making sure we do not overwrite values already
                 * existing for the collective attribute in case multiple
                 * subentries add the same collective attributes to this entry.
                 */

                if ( attrType.isCollective() )
                {
                    Attribute subentryColAttr = subentry.get( attrId );
                    Attribute entryColAttr = entry.get( attrId );

                    // if entry does not have attribute for colattr then create it
View Full Code Here

     */
    private class PerComponentNormalizer implements NameComponentNormalizer
    {
        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

        }

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

        list = matchingRuleRegistry.list();
        while ( list.hasNext() )
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

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.