Package org.apache.ldap.server.schema

Examples of org.apache.ldap.server.schema.AttributeTypeRegistry


        suffix.add( SystemPartition.SUFFIX );

        Database db = new JdbmDatabase( suffix, suffix, wkdir );

        AttributeTypeRegistry attributeTypeRegistry;

        attributeTypeRegistry = bootstrapRegistries .getAttributeTypeRegistry();

        OidRegistry oidRegistry;

        oidRegistry = bootstrapRegistries.getOidRegistry();

        ExpressionEvaluator evaluator;

        evaluator = new ExpressionEvaluator( db, oidRegistry, attributeTypeRegistry );

        ExpressionEnumerator enumerator;

        enumerator = new ExpressionEnumerator( db, attributeTypeRegistry, evaluator );

        SearchEngine eng = new DefaultSearchEngine( db, evaluator, enumerator );

        AttributeType[] attributes = new AttributeType[]
        {
            attributeTypeRegistry.lookup( SystemPartition.ALIAS_OID ),

            attributeTypeRegistry.lookup( SystemPartition.EXISTANCE_OID ),

            attributeTypeRegistry.lookup( SystemPartition.HIERARCHY_OID ),

            attributeTypeRegistry.lookup( SystemPartition.NDN_OID ),

            attributeTypeRegistry.lookup( SystemPartition.ONEALIAS_OID ),

            attributeTypeRegistry.lookup( SystemPartition.SUBALIAS_OID ),

            attributeTypeRegistry.lookup( SystemPartition.UPDN_OID )
        };

        system = new SystemPartition( db, eng, attributes );

        globalRegistries = new GlobalRegistries( system, bootstrapRegistries );
View Full Code Here


     */
    protected void startUpAppPartitions( String eveWkdir ) throws NamingException
    {
        OidRegistry oidRegistry = globalRegistries.getOidRegistry();

        AttributeTypeRegistry attributeTypeRegistry;

        attributeTypeRegistry = globalRegistries.getAttributeTypeRegistry();

        MatchingRuleRegistry reg = globalRegistries.getMatchingRuleRegistry();

        // start getting all the parameters from the initial environment
        ContextPartitionConfig[] configs = null;

        configs = PartitionConfigBuilder.getContextPartitionConfigs( initialEnv );

        for ( int ii = 0; ii < configs.length; ii++ )
        {
            // ----------------------------------------------------------------
            // create working directory under eve directory for app partition
            // ----------------------------------------------------------------

            String wkdir = eveWkdir + File.separator + configs[ii].getId();

            mkdirs( eveWkdir, configs[ii].getId() );

            // ----------------------------------------------------------------
            // create the database/store
            // ----------------------------------------------------------------

            Name upSuffix = new LdapName( configs[ii].getSuffix() );

            Normalizer dnNorm = reg.lookup( "distinguishedNameMatch" ) .getNormalizer();

            Name normSuffix = new LdapName( ( String ) dnNorm.normalize( configs[ii].getSuffix() ) );

            Database db = new JdbmDatabase( upSuffix, normSuffix, wkdir );

            // ----------------------------------------------------------------
            // create the search engine using db, enumerators and evaluators
            // ----------------------------------------------------------------

            ExpressionEvaluator evaluator;

            evaluator = new ExpressionEvaluator( db, oidRegistry, attributeTypeRegistry );

            ExpressionEnumerator enumerator;

            enumerator = new ExpressionEnumerator( db, attributeTypeRegistry, evaluator );

            SearchEngine eng = new DefaultSearchEngine( db, evaluator, enumerator );

            // ----------------------------------------------------------------
            // fill up a list with the AttributeTypes for the system indices
            // ----------------------------------------------------------------

            ArrayList attributeTypeList = new ArrayList();

            attributeTypeList.add( attributeTypeRegistry.lookup( SystemPartition.ALIAS_OID ) );

            attributeTypeList.add( attributeTypeRegistry.lookup( SystemPartition.EXISTANCE_OID ) );

            attributeTypeList.add( attributeTypeRegistry.lookup( SystemPartition.HIERARCHY_OID ) );

            attributeTypeList.add( attributeTypeRegistry.lookup( SystemPartition.NDN_OID ) );

            attributeTypeList.add( attributeTypeRegistry.lookup( SystemPartition.ONEALIAS_OID ) );

            attributeTypeList.add( attributeTypeRegistry.lookup( SystemPartition.SUBALIAS_OID ) );

            attributeTypeList.add( attributeTypeRegistry.lookup( SystemPartition.UPDN_OID ) );

            // ----------------------------------------------------------------
            // if user indices are specified add those attribute types as well
            // ----------------------------------------------------------------

            for ( int jj = 0; jj < configs[ii].getIndices().length; jj++ )
            {
                attributeTypeList.add( attributeTypeRegistry
                        .lookup( configs[ii].getIndices()[jj] ) );
            }

            // ----------------------------------------------------------------
            // fire up the appPartition & register it with the nexus
View Full Code Here

    }


    public void init( InterceptorContext ctx ) throws NamingException
    {
        AttributeTypeRegistry atr = ctx.getGlobalRegistries().getAttributeTypeRegistry();
        dnParser = new DnParser( new ConcreteNameComponentNormalizer( atr ) );
    }
View Full Code Here

    private DnParser parser;


    public void init( InterceptorContext context ) throws NamingException
    {
        AttributeTypeRegistry attributeRegistry = context.getGlobalRegistries().getAttributeTypeRegistry();

        parser = new DnParser( new PerComponentNormalizer( attributeRegistry ) );
    }
View Full Code Here

    }


    public void init( DirectoryServiceConfiguration factoryCfg, InterceptorConfiguration cfg ) throws NamingException
    {
        AttributeTypeRegistry atr = factoryCfg.getGlobalRegistries().getAttributeTypeRegistry();
        dnParser = new DnParser( new ConcreteNameComponentNormalizer( atr ) );

        // disable this static module if basic access control mechanisms are enabled
        enabled = ! factoryCfg.getStartupConfiguration().isAccessControlEnabled();
    }
View Full Code Here

    public void init( DirectoryServiceConfiguration factoryCfg, InterceptorConfiguration cfg ) throws NamingException
    {
        super.init( factoryCfg, cfg );

        OidRegistry oidRegistry = factoryCfg.getGlobalRegistries().getOidRegistry();
        AttributeTypeRegistry attrRegistry = factoryCfg.getGlobalRegistries().getAttributeTypeRegistry();
        evaluator = new ExpressionEvaluator( oidRegistry, attrRegistry );
        nexus = factoryCfg.getPartitionNexus();
    }
View Full Code Here


    public boolean compare( Name name, String oid, Object value ) throws NamingException
    {
        DirectoryPartition partition = getBackend( name );
        AttributeTypeRegistry registry = factoryCfg.getGlobalRegistries().getAttributeTypeRegistry();

        // complain if we do not recognize the attribute being compared
        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 )
        {
View Full Code Here

                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 ):
                ObjectClass objectClass = ( ObjectClass ) schemaObject;
                ObjectClassRegistry objectClassRegistry;
                objectClassRegistry = registries.getObjectClassRegistry();
View Full Code Here

            Attributes entry = ( Attributes ) i.next();
            entry.put( "creatorsName", DirectoryPartitionNexus.ADMIN_PRINCIPAL );
            entry.put( "createTimestamp", DateUtils.getGeneralizedTime() );
           
            Attribute dn = ( Attribute ) entry.get( "dn" ).clone();
            AttributeTypeRegistry registry = globalRegistries.getAttributeTypeRegistry();
            NameComponentNormalizer ncn = new ConcreteNameComponentNormalizer( registry );
            DnParser parser = new DnParser( ncn );
            Name ndn = parser.parse( ( String ) dn.get() );
           
            partitionNexus.add( ( String ) dn.get(), ndn, entry );
View Full Code Here

                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 ):
                ObjectClass objectClass = ( ObjectClass ) schemaObject;
                ObjectClassRegistry objectClassRegistry;
                objectClassRegistry = registries.getObjectClassRegistry();
View Full Code Here

TOP

Related Classes of org.apache.ldap.server.schema.AttributeTypeRegistry

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.