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

Examples of org.apache.directory.shared.ldap.schema.SchemaManager



    public void init( DirectoryService directoryService ) throws Exception
    {
        nexus = directoryService.getPartitionNexus();
        SchemaManager schemaManager = directoryService.getSchemaManager();

        USER_BASE_DN = new DN( ServerDNConstants.ADMIN_SYSTEM_DN );
        USER_BASE_DN.normalize( schemaManager.getNormalizerMapping() );
       
        GROUP_BASE_DN = new DN( ServerDNConstants.GROUPS_SYSTEM_DN );
        GROUP_BASE_DN.normalize( schemaManager.getNormalizerMapping() );
    
        ADMIN_GROUP_DN = new DN( ServerDNConstants.ADMINISTRATORS_GROUP_DN );
        ADMIN_GROUP_DN.normalize( schemaManager.getNormalizerMapping() );

        uniqueMemberAT = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.UNIQUE_MEMBER_AT_OID );
       
        loadAdministrators( directoryService );
    }
View Full Code Here


    public void init( DirectoryService directoryService ) throws Exception
    {
        super.init( directoryService );
       
        triggerSpecCache = new TriggerSpecCache( directoryService );
        final SchemaManager schemaManager = directoryService.getSchemaManager();

        triggerParser = new TriggerSpecificationParser
            ( new NormalizerMappingResolver()
                {
                    public Map<String, OidNormalizer> getNormalizerMapping() throws Exception
                    {
                        return schemaManager.getNormalizerMapping();
                    }
                }
            );
        chain = directoryService.getInterceptorChain();
       
View Full Code Here

     * @param directoryService the directory service core
     * @throws LdapException if there are failures on initialization
     */
    public GroupCache( CoreSession session ) throws Exception
    {
        SchemaManager schemaManager = session.getDirectoryService().getSchemaManager();
        normalizerMap = schemaManager.getNormalizerMapping();
        nexus = session.getDirectoryService().getPartitionNexus();
        memberAT = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.MEMBER_AT_OID );
        uniqueMemberAT = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.UNIQUE_MEMBER_AT_OID );

        // stuff for dealing with the admin group
        administratorsGroupDn = parseNormalized( ServerDNConstants.ADMINISTRATORS_GROUP_DN );

        initialize( session );
View Full Code Here

        // --------------------------------------------------------------------
        directoryService = new DefaultDirectoryService();
        directoryService.setWorkingDirectory( getInstanceLayout().getPartitionsDir() );
        directoryService.startup();

        SchemaManager schemaManager = directoryService.getSchemaManager();
       
        return schemaManager;
    }
View Full Code Here

    {
        LOG.debug( "Starting the server" );
       
        initSchema();
       
        SchemaManager schemaManager = directoryService.getSchemaManager();
       
        if ( ! directoryService.isStarted() )
        {
            // inject the schema manager and set the partition directory
            // once the CiDIT gets done we need not do this kind of dirty hack
View Full Code Here

        }

        schemaPartition.setWrappedPartition( ldifPartition );

        SchemaLoader loader = new LdifSchemaLoader( schemaRepository );
        SchemaManager schemaManager = new DefaultSchemaManager( loader );
        directoryService.setSchemaManager( schemaManager );

        // We have to load the schema now, otherwise we won't be able
        // to initialize the Partitions, as we won't be able to parse
        // and normalize their suffix DN
        schemaManager.loadAllEnabled();
       
        schemaPartition.setSchemaManager( schemaManager );

        List<Throwable> errors = schemaManager.getErrors();

        if ( errors.size() != 0 )
        {
            throw new Exception( I18n.err( I18n.ERR_317, ExceptionUtils.printErrors( errors ) ) );
        }
View Full Code Here

        extractor.extractOrCopy(true);

        schemaPartition.setWrappedPartition(ldifPartition);

        final SchemaLoader loader = new LdifSchemaLoader(schemaRepository);
        final SchemaManager schemaManager = new DefaultSchemaManager(loader);
        service.setSchemaManager(schemaManager);

        // Enable nis so that posixAccount and posixGroup are available
        schemaManager.enable("nis");
        // We have to load the schema now, otherwise we won't be able
        // to initialize the Partitions, as we won't be able to parse
        // and normalize their suffix DN
        schemaManager.loadAllEnabled();

        schemaPartition.setSchemaManager(schemaManager);

        final List<Throwable> errors = schemaManager.getErrors();
        if (!errors.isEmpty()) {
            throw new RuntimeException("Schema load failed : " + errors);
        }
    }
View Full Code Here

        // --------------------------------------------------------------------
        directoryService = new DefaultDirectoryService();
        directoryService.setWorkingDirectory( getInstanceLayout().getPartitionsDir() );
        directoryService.startup();

        SchemaManager schemaManager = directoryService.getSchemaManager();
       
        return schemaManager;
    }
View Full Code Here

    {
        LOG.debug( "Starting the server" );
       
        initSchema();
       
        SchemaManager schemaManager = directoryService.getSchemaManager();
       
        if ( ! directoryService.isStarted() )
        {
            // inject the schema manager and set the partition directory
            // once the CiDIT gets done we need not do this kind of dirty hack
View Full Code Here

        }

        schemaPartition.setWrappedPartition( ldifPartition );

        SchemaLoader loader = new LdifSchemaLoader( schemaRepository );
        SchemaManager schemaManager = new DefaultSchemaManager( loader );
        directoryService.setSchemaManager( schemaManager );

        // We have to load the schema now, otherwise we won't be able
        // to initialize the Partitions, as we won't be able to parse
        // and normalize their suffix DN
        schemaManager.loadAllEnabled();
       
        schemaPartition.setSchemaManager( schemaManager );

        List<Throwable> errors = schemaManager.getErrors();

        if ( errors.size() != 0 )
        {
            throw new Exception( I18n.err( I18n.ERR_317, ExceptionUtils.printErrors( errors ) ) );
        }
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.ldap.schema.SchemaManager

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.