Package org.apache.directory.server.core

Examples of org.apache.directory.server.core.DefaultDirectoryService$SynchWorker


    private static DirectoryService service;

   
    @BeforeClass public static void init() throws NamingException
    {
        service = new DefaultDirectoryService();
    }
View Full Code Here


     */
    public static class Factory implements DirectoryServiceFactory
    {
        public DirectoryService newInstance() throws Exception
        {
            DirectoryService service = new DefaultDirectoryService();
            service.getChangeLog().setEnabled( true );
           
            Partition foo = new JdbmPartition();
            foo.setId( "foo" );
            foo.setSuffix( "dc=foo,dc=com" );
            service.addPartition( foo );
           
            Partition bar = new JdbmPartition();
            bar.setId( "bar" );
            bar.setSuffix( "dc=bar,dc=com" );
            service.addPartition( bar );
           
            return service;
        }
View Full Code Here

    private static DirectoryService service;

   
    @BeforeClass public static void setup() throws NamingException
    {
        service = new DefaultDirectoryService();

        LdapDN entryName = new LdapDN( "ou=test, ou=system" );
        PROTECTED_ITEMS.add( new ProtectedItem.MaxImmSub( 2 ) );
        ENTRY = new DefaultServerEntry( service.getRegistries(), entryName );
View Full Code Here

    private static DirectoryService service;

   
    @BeforeClass public static void setup() throws NamingException
    {
        service = new DefaultDirectoryService();

        ENTRY_NAME = new LdapDN( "ou=test, ou=system" );
        PROTECTED_ITEMS.add( new ProtectedItem.MaxImmSub( 2 ) );
        ENTRY = new DefaultServerEntry( service.getRegistries(), ENTRY_NAME );
    }
View Full Code Here

        ClonedServerEntry dsEntry = configPartition.lookup( forwardEntry.getId() );

        LOG.debug( "directory service entry {}", dsEntry );

        DirectoryService dirService = new DefaultDirectoryService();
        // MUST attributes
        dirService.setInstanceId( getString( "ads-directoryServiceId", dsEntry ) );
        dirService.setReplicaId( getInt( "ads-dsReplicaId", dsEntry ) );

        DN interceptorsDN = new DN( dsEntry.get( "ads-dsInterceptors" ).getString() );
        interceptorsDN.normalize( configPartition.getSchemaManager().getNormalizerMapping() );
        List<Interceptor> interceptors = getInterceptors( interceptorsDN );
        dirService.setInterceptors( interceptors );

        DN partitionsDN = new DN( dsEntry.get( "ads-dsPartitions" ).getString() );
        partitionsDN.normalize( configPartition.getSchemaManager().getNormalizerMapping() );

        Map<String, Partition> partitions = getPartitions( partitionsDN );

        Partition systemPartition = partitions.remove( "system" );

        if ( systemPartition == null )
        {
            throw new Exception( I18n.err( I18n.ERR_505 ) );
        }

        dirService.setSystemPartition( systemPartition );
        dirService.setPartitions( new HashSet<Partition>( partitions.values() ) );

        // MAY attributes
        EntryAttribute acEnabledAttr = dsEntry.get( "ads-dsAccessControlEnabled" );

        if ( acEnabledAttr != null )
        {
            dirService.setAccessControlEnabled( Boolean.parseBoolean( acEnabledAttr.getString() ) );
        }

        EntryAttribute anonAccessAttr = dsEntry.get( "ads-dsAllowAnonymousAccess" );

        if ( anonAccessAttr != null )
        {
            dirService.setAllowAnonymousAccess( Boolean.parseBoolean( anonAccessAttr.getString() ) );
        }

        EntryAttribute changeLogAttr = dsEntry.get( "ads-dsChangeLog" );

        if ( changeLogAttr != null )
        {
            DN clDN = new DN( changeLogAttr.getString() );
            clDN.normalize( schemaManager.getNormalizerMapping() );
            ChangeLog cl = getChangeLog( clDN );
            dirService.setChangeLog( cl );
        }

        EntryAttribute denormAttr = dsEntry.get( "ads-dsDenormalizeOpAttrsEnabled" );

        if ( denormAttr != null )
        {
            dirService.setDenormalizeOpAttrsEnabled( Boolean.parseBoolean( denormAttr.getString() ) );
        }

        EntryAttribute journalAttr = dsEntry.get( "ads-dsJournal" );

        if ( journalAttr != null )
        {
            DN journalDN = new DN( journalAttr.getString() );
            journalDN.normalize( schemaManager.getNormalizerMapping() );
            dirService.setJournal( getJournal( journalDN ) );
        }

        EntryAttribute maxPduAttr = dsEntry.get( "ads-dsMaxPDUSize" );

        if ( maxPduAttr != null )
        {
            dirService.setMaxPDUSize( Integer.parseInt( maxPduAttr.getString() ) );
        }

        EntryAttribute passwordHidAttr = dsEntry.get( "ads-dsPasswordHidden" );

        if ( passwordHidAttr != null )
        {
            dirService.setPasswordHidden( Boolean.parseBoolean( passwordHidAttr.getString() ) );
        }

        EntryAttribute replAttr = dsEntry.get( "ads-dsReplication" );

        if ( replAttr != null )
        {
            // configure replication
        }

        EntryAttribute syncPeriodAttr = dsEntry.get( "ads-dsSyncPeriodMillis" );

        if ( syncPeriodAttr != null )
        {
            // FIXME the DirectoryService interface doesn't have this setter
            //dirService.setSyncPeriodMillis( Long.parseLong( syncPeriodAttr.getString() ) );
        }

        EntryAttribute testEntryAttr = dsEntry.get( "ads-dsTestEntries" );

        if ( testEntryAttr != null )
        {
            String entryFilePath = testEntryAttr.getString();
            dirService.setTestEntries( getTestEntries( entryFilePath ) );
        }

        if ( !isEnabled( dsEntry ) )
        {
            // will only be useful if we ever allow more than one DS to be configured and
View Full Code Here

       
        directoryService = ldapServer.getDirectoryService();
       
        if ( directoryService == null )
        {
            directoryService = new DefaultDirectoryService();
        }
    }
View Full Code Here

     */
    private void initDirectoryService(final ServletContext servletContext, final File workDir,
            final boolean loadDefaultContent) throws Exception {

        // Initialize the LDAP service
        service = new DefaultDirectoryService();
        service.setWorkingDirectory(workDir);

        // first load the schema
        initSchemaPartition(servletContext);

View Full Code Here

     * Default constructor which creates {@link DefaultDirectoryService} instance and configures {@link AvlPartitionFactory} as
     * the {@link PartitionFactory} implementation.
     */
    public InMemoryDirectoryServiceFactory() {
        try {
            directoryService = new DefaultDirectoryService();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        directoryService.setShutdownHookEnabled(false);
        partitionFactory = new AvlPartitionFactory();
View Full Code Here

    public void stopServer() throws Exception {
        apacheDs.shutdown();
    }

    public void reset(File workingDirectory) {
        service = new DefaultDirectoryService();
        service.setWorkingDirectory(workingDirectory);
        service.getChangeLog().setEnabled(false);
    }
View Full Code Here

    try
    {
      // Creating the instance here so that
      // we we can set some properties like accesscontrol, anon access
      // before starting up the service
      result = new DefaultDirectoryService();

      // No need to register a shutdown hook during tests because this
      // starts a lot of threads and slows down test execution
      result.setShutdownHookEnabled( false );
    }
View Full Code Here

TOP

Related Classes of org.apache.directory.server.core.DefaultDirectoryService$SynchWorker

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.