Examples of DirectoryServiceFactory


Examples of org.apache.directory.server.core.factory.DirectoryServiceFactory

{

    @Test
    public void testAddAndRemove() throws Exception
    {
        DirectoryServiceFactory dsFactory = DefaultDirectoryServiceFactory.class.newInstance();
        PartitionFactory partitionFactory = dsFactory.getPartitionFactory();
        Partition partition = partitionFactory.createPartition( getService().getSchemaManager(),
            getService().getDnFactory(), "removable",
            "ou=removable", 100, getService()
                .getInstanceLayout().getPartitionsDirectory() );
View Full Code Here

Examples of org.apache.directory.server.core.factory.DirectoryServiceFactory

                DSAnnotationProcessor.applyLdifs( getDescription(), classDS );
            }
            else
            {
                // No : define a default class DS then
                DirectoryServiceFactory dsf = DefaultDirectoryServiceFactory.class.newInstance();

                directoryService = dsf.getDirectoryService();
                // enable CL explicitly cause we are not using DSAnnotationProcessor
                directoryService.getChangeLog().setEnabled( true );

                dsf.init( "default" + UUID.randomUUID().toString() );

                // Stores the defaultDS in the classDS
                classDS = directoryService;

                // Load the schemas
                DSAnnotationProcessor.loadSchemas( getDescription(), directoryService );

                // Apply the class LDIFs
                DSAnnotationProcessor.applyLdifs( getDescription(), directoryService );
            }

            // check if it has a LdapServerBuilder
            // then use the DS created above
            if ( classLdapServerBuilder != null )
            {
                classLdapServer = ServerAnnotationProcessor.createLdapServer( getDescription(), directoryService );
            }

            if ( classKdcServer == null )
            {
                int minPort = getMinPort();

                classKdcServer = ServerAnnotationProcessor.getKdcServer( getDescription(), directoryService,
                    minPort + 1 );
            }

            // print out information which partition factory we use
            DirectoryServiceFactory dsFactory = DefaultDirectoryServiceFactory.class.newInstance();
            PartitionFactory partitionFactory = dsFactory.getPartitionFactory();
            LOG.debug( "Using partition factory {}", partitionFactory.getClass().getSimpleName() );

            // Now run the class
            super.run( notifier );
View Full Code Here

Examples of org.apache.directory.server.core.factory.DirectoryServiceFactory

                DSAnnotationProcessor.applyLdifs( getDescription(), classDS );
            }
            else
            {
                // No : define a default class DS then
                DirectoryServiceFactory dsf = DefaultDirectoryServiceFactory.class.newInstance();

                directoryService = dsf.getDirectoryService();
                // enable CL explicitly cause we are not using DSAnnotationProcessor
                directoryService.getChangeLog().setEnabled( true );

                dsf.init( "default" + UUID.randomUUID().toString() );

                // Stores the defaultDS in the classDS
                classDS = directoryService;

                // Load the schemas
                DSAnnotationProcessor.loadSchemas( getDescription(), directoryService );

                // Apply the class LDIFs
                DSAnnotationProcessor.applyLdifs( getDescription(), directoryService );
            }

            // check if it has a LdapServerBuilder
            // then use the DS created above
            if ( classLdapServerBuilder != null )
            {
                classLdapServer = ServerAnnotationProcessor.createLdapServer( getDescription(), directoryService );
            }

            if ( classKdcServer == null )
            {
                int minPort = getMinPort();

                classKdcServer = ServerAnnotationProcessor.getKdcServer( getDescription(), directoryService,
                    minPort + 1 );
            }

            // print out information which partition factory we use
            DirectoryServiceFactory dsFactory = DefaultDirectoryServiceFactory.class.newInstance();
            PartitionFactory partitionFactory = dsFactory.getPartitionFactory();
            LOG.debug( "Using partition factory {}", partitionFactory.getClass().getSimpleName() );

            // Now run the class
            super.run( notifier );
View Full Code Here

Examples of org.apache.directory.server.core.factory.DirectoryServiceFactory

                        DSAnnotationProcessor.applyLdifs( getDescription(), directoryService );
                    }
                    else
                    {
                        // No : define a default DS for the suite then
                        DirectoryServiceFactory dsf = DefaultDirectoryServiceFactory.DEFAULT;

                        directoryService = dsf.getDirectoryService();
                        // enable CL explicitly cause we are not using DSAnnotationProcessor
                        directoryService.getChangeLog().setEnabled( true );

                        dsf.init( "default" + UUID.randomUUID().toString() );

                        // Stores it into the suite
                        suite.setDirectoryService( directoryService );

                        // Apply the suite LDIF first
                        DSAnnotationProcessor.applyLdifs( suite.getDescription(), directoryService );

                        // Then tag for reversion and apply the class LDIFs
                        revision = getCurrentRevision( directoryService );

                        DSAnnotationProcessor.applyLdifs( getDescription(), directoryService );
                    }
                }
                else
                {
                    // No : define a default class DS then
                    DirectoryServiceFactory dsf = DefaultDirectoryServiceFactory.DEFAULT;

                    directoryService = dsf.getDirectoryService();
                    // enable CL explicitly cause we are not using DSAnnotationProcessor
                    directoryService.getChangeLog().setEnabled( true );

                    dsf.init( "default" + UUID.randomUUID().toString() );

                    // Stores the defaultDS in the classDS
                    classDS = directoryService;

                    // Apply the class LDIFs
View Full Code Here

Examples of org.apache.directory.server.core.factory.DirectoryServiceFactory

            datagramSocket.close();
        } catch (Exception e) {
            return false;
        }

        DirectoryServiceFactory directoryServiceFactory = DefaultDirectoryServiceFactory.DEFAULT;
        directoryService = directoryServiceFactory.getDirectoryService();
        directoryService.setAccessControlEnabled(false);
        directoryService.setAllowAnonymousAccess(false);
        directoryService.getChangeLog().setEnabled(true);

        List<Interceptor> interceptors = directoryService.getInterceptors();
        interceptors.add(new KeyDerivationInterceptor());
        directoryService.setInterceptors(interceptors);
        directoryServiceFactory.init("defaultDS");

        PartitionFactory partitionFactory = directoryServiceFactory.getPartitionFactory();
        Partition partition = partitionFactory.createPartition("example", "dc=example,dc=com",
                1000, new File(directoryService.getWorkingDirectory(), "example"));

        partitionFactory.addIndex(partition, "objectClass", 1000);
        partitionFactory.addIndex(partition, "dc", 1000);
View Full Code Here

Examples of org.apache.directory.server.core.factory.DirectoryServiceFactory

    public void run( final RunNotifier notifier )
    {
        try
        {
            // print out information which partition factory we use
            DirectoryServiceFactory dsFactory = DefaultDirectoryServiceFactory.class.newInstance();
            PartitionFactory partitionFactory = dsFactory.getPartitionFactory();
            LOG.debug( "Using partition factory {}", partitionFactory.getClass().getSimpleName() );

            // Create and initialize the Suite DS
            startDS( getDescription() );
           
View Full Code Here

Examples of org.apache.directory.server.core.factory.DirectoryServiceFactory

                        DSAnnotationProcessor.applyLdifs( getDescription(), directoryService );
                    }
                    else
                    {
                        // No : define a default DS for the suite then
                        DirectoryServiceFactory dsf = DefaultDirectoryServiceFactory.class.newInstance();

                        directoryService = dsf.getDirectoryService();
                        // enable CL explicitly cause we are not using DSAnnotationProcessor
                        directoryService.getChangeLog().setEnabled( true );

                        dsf.init( "default" + UUID.randomUUID().toString() );

                        // Stores it into the suite
                        suite.setDirectoryService( directoryService );

                        // Apply the suite LDIF first
                        DSAnnotationProcessor.applyLdifs( suite.getDescription(), directoryService );

                        // Then tag for reversion and apply the class LDIFs
                        revision = getCurrentRevision( directoryService );

                        DSAnnotationProcessor.applyLdifs( getDescription(), directoryService );
                    }
                }
                else
                {
                    // No : define a default class DS then
                    DirectoryServiceFactory dsf = DefaultDirectoryServiceFactory.class.newInstance();

                    directoryService = dsf.getDirectoryService();
                    // enable CL explicitly cause we are not using DSAnnotationProcessor
                    directoryService.getChangeLog().setEnabled( true );

                    dsf.init( "default" + UUID.randomUUID().toString() );

                    // Stores the defaultDS in the classDS
                    classDS = directoryService;

                    // Apply the class LDIFs
                    DSAnnotationProcessor.applyLdifs( getDescription(), directoryService );
                }
            }

            // check if it has a LdapServerBuilder
            // then use the DS created above
            if ( classLdapServerBuilder != null )
            {
                classLdapServer = ServerAnnotationProcessor.createLdapServer( getDescription(), directoryService );
            }
            else if ( ( suite != null ) && ( suite.getLdapServer() != null ) )
            {
                classLdapServer = suite.getLdapServer();
               
                // set directoryService only if there is no class level DS
                if ( directoryService == null )
                {
                    directoryService = classLdapServer.getDirectoryService();
                }
               
                // no need to inject the LDIF data that would have been done above
                // if ApplyLdifs is present
            }

            if ( classKdcServer == null )
            {
                int minPort = getMinPort();

                classKdcServer = ServerAnnotationProcessor.getKdcServer( getDescription(), directoryService,
                    minPort + 1 );
            }
            else if ( suite != null )
            {
                // TODO add suite level KdcServer support
            }

            if ( suite == null )
            {
                // print out information which partition factory we use
                DirectoryServiceFactory dsFactory = DefaultDirectoryServiceFactory.class.newInstance();
                PartitionFactory partitionFactory = dsFactory.getPartitionFactory();
                LOG.debug( "Using partition factory {}", partitionFactory.getClass().getSimpleName() );
            }

            // Now run the class
            super.run( notifier );
View Full Code Here

Examples of org.apache.directory.server.core.factory.DirectoryServiceFactory

    protected void initializeDefaultDirectoryService()
            throws DirectoryServerException {
        try {

            DirectoryServiceFactory factory = CarbonDirectoryServiceFactory.DEFAULT;
            this.service = factory.getDirectoryService();

            configureDirectoryService();

            factory.init(this.ldapConfigurations.getInstanceId());

        } catch (Exception e) {
            throw new DirectoryServerException("Can not start the Default apacheds service ", e);
        }
    }
View Full Code Here

Examples of org.apache.directory.server.core.factory.DirectoryServiceFactory

        nisEntry = connection.lookup( "cn=nis,ou=schema" );
        isNisDisabled = nisEntry.contains( "m-disabled", "TRUE" );

        Partition systemPartition = getService().getSystemPartition();
        DirectoryServiceFactory dsFactory = DefaultDirectoryServiceFactory.class.newInstance();
        dsFactory.getPartitionFactory().addIndex( systemPartition, "gidNumber", 100 );
       
        // Restart the service so that the index is created
        getService().shutdown();
        getService().startup();
View Full Code Here

Examples of org.apache.directory.server.core.factory.DirectoryServiceFactory

{

    @Test
    public void testAddAndRemove() throws Exception
    {
        DirectoryServiceFactory dsFactory = DefaultDirectoryServiceFactory.class.newInstance();
        PartitionFactory partitionFactory = dsFactory.getPartitionFactory();
        Partition partition = partitionFactory.createPartition( getService().getSchemaManager(), "removable", "ou=removable", 100, getService()
            .getInstanceLayout().getPartitionsDirectory() );

        // Test AddContextPartition
        getService().addPartition( partition );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.