Examples of MutableServerStartupConfiguration


Examples of org.apache.activemq.jaas.ldap.MutableServerStartupConfiguration

        context.logout();
    }

    @SuppressWarnings("unchecked")
    public void setUp() throws Exception {
        MutableServerStartupConfiguration startup = new MutableServerStartupConfiguration();
        // put some mandatory JNDI properties here
        startup.setWorkingDirectory(new File("target/ldap"));
        startup.setAllowAnonymousAccess(true);
        startup.setLdapPort(9389);
        startup.setEnableNetworking(true);
        startup.setHost(InetAddress.getByName("localhost"));

        Properties env = new Properties();
        env.putAll(startup.toJndiEnvironment());
        env.put(Context.INITIAL_CONTEXT_FACTORY, ServerContextFactory.class.getName());
        env.put(Context.PROVIDER_URL, "ou=system");
        env.put(Context.SECURITY_AUTHENTICATION, "simple");
        env.put(Context.SECURITY_PRINCIPAL, PRINCIPAL);
        env.put(Context.SECURITY_CREDENTIALS, CREDENTIALS);
View Full Code Here

Examples of org.apache.activemq.jaas.ldap.MutableServerStartupConfiguration

        context.login();
        context.logout();
    }

    public void setUp() throws Exception {
        MutableServerStartupConfiguration startup = new MutableServerStartupConfiguration();
        // put some mandatory JNDI properties here
        startup.setWorkingDirectory(new File("target/ldap"));
        startup.setAllowAnonymousAccess(true);
        startup.setLdapPort(9389);
        startup.setEnableNetworking(true);
        startup.setHost(InetAddress.getByName("localhost"));

        Properties env = new Properties();
        env.putAll(startup.toJndiEnvironment());
        env.put(Context.INITIAL_CONTEXT_FACTORY, ServerContextFactory.class.getName());
        env.put(Context.PROVIDER_URL, "ou=system");
        env.put(Context.SECURITY_AUTHENTICATION, "simple");
        env.put(Context.SECURITY_PRINCIPAL, PRINCIPAL);
        env.put(Context.SECURITY_CREDENTIALS, CREDENTIALS);
View Full Code Here

Examples of org.apache.directory.server.configuration.MutableServerStartupConfiguration

            {
                LOG.info( "Starting Embedded Directory Server..." );
            }

            // Create the baseline configuration
            MutableServerStartupConfiguration cfg = new MutableServerStartupConfiguration();

            /*
             * *************** Update the baseline configuration
             * *****************
             */
            // Access Control
            cfg.setAccessControlEnabled( this.accessControlEnabled );
            cfg.setAllowAnonymousAccess( this.anonymousAccess );

            // Wire protocols
            cfg.setEnableNetworking( this.ldapNetworkingSupport );
            cfg.setLdapPort( this.ldapPort );
            cfg.setLdapsPort( this.ldapsPort );

            cfg.setEnableNtp( enableNtp );
            cfg.setEnableKerberos( enableKerberos );
            cfg.setEnableChangePassword( enableChangePassword );

            // Work folder
            cfg.setWorkingDirectory( new File( this.wkDir ) );

            // LDIF import
            cfg.setLdifDirectory( new File( this.ldifDir ) );
            cfg.setLdifFilters( addCustomLdifFilters() );

            // Addditional bootstrap schema
            cfg.setBootstrapSchemas( addCustomBootstrapSchema( cfg.getBootstrapSchemas() ) );

            // Single custom partition
            if ( ( null != this.customRootPartitionName ) && ( this.customRootPartitionName.length() > 0 ) )
            {
                if ( LOG.isDebugEnabled() )
                {
                    LOG.debug( "Adding custom root partition name: " + this.customRootPartitionName );
                }

                Set pcfgs = addCustomPartition();
                cfg.setContextPartitionConfigurations( pcfgs );
            }

            // Put the configuration instruction to the environment variable.
            env.putAll( cfg.toJndiEnvironment() );

            new InitialDirContext( env );
        }
        else
        {
View Full Code Here

Examples of org.apache.directory.server.configuration.MutableServerStartupConfiguration

        environment.setProperty( "java.naming.security.principal", "uid=admin,ou=system" );
        if ( password != null )
        {
            environment.setProperty( "java.naming.security.credentials", password );
        }
        MutableServerStartupConfiguration configuration = new MutableServerStartupConfiguration();
        configuration.setWorkingDirectory( basedir );
        configuration.setAllowAnonymousAccess( true );
        //configuration.setEnableNtp( false );
        //configuration.setEnableKerberos( false );
        //configuration.setEnableChangePassword( false );
        LdapConfiguration config = new LdapConfiguration();
        config.setIpPort( port );
        configuration.setLdapConfiguration( config );
        configuration.setEnableNetworking( enableNetworking );
        configuration.setSynchPeriodMillis( 100 );

        if ( configuration.getPartitionConfigurations() == null || ( configuration.getPartitionConfigurations() != null
            && configuration.getPartitionConfigurations().isEmpty() ) )
        {
            configuration.setPartitionConfigurations( partitionConfigurations );
        }
        Properties env = new Properties();
        env.setProperty( Context.SECURITY_PRINCIPAL, "uid=admin,ou=system" );
        if ( password != null )
        {
            env.setProperty( Context.SECURITY_CREDENTIALS, password );
        }
        env.setProperty( Context.SECURITY_AUTHENTICATION, "simple" );
        env.setProperty( Context.PROVIDER_URL, "ou=system" );
        env.setProperty( Context.INITIAL_CONTEXT_FACTORY, ServerContextFactory.class.getName() );
        env.putAll( configuration.toJndiEnvironment() );
        InitialDirContext context = new InitialDirContext( env );

        //Attributes inetAttributes = context.getAttributes( "cn=inetorgperson,ou=schema" );

        //inetAttributes.remove( "m-disabled" );
View Full Code Here

Examples of org.apache.directory.server.configuration.MutableServerStartupConfiguration

    public static DirContext startApacheDirectoryServer(int port,
            String defaultPartitionSuffix, String defaultPartitionName,
            String principal, String credentials, boolean anonymousEnabled)
            throws NamingException {
   
        MutableServerStartupConfiguration cfg = new MutableServerStartupConfiguration();
        cfg.setAllowAnonymousAccess(anonymousEnabled);
        // Determine an appropriate working directory
        String tempDir = System.getProperty("java.io.tmpdir");
        cfg.setWorkingDirectory(new File(tempDir));
   
        cfg.setLdapPort(port);
   
        MutableBTreePartitionConfiguration partitionConfiguration = new MutableBTreePartitionConfiguration();
        partitionConfiguration.setSuffix(defaultPartitionSuffix);
        partitionConfiguration
                .setContextEntry(getRootPartitionAttributes(defaultPartitionName));
        partitionConfiguration.setName(defaultPartitionName);
   
        cfg.setContextPartitionConfigurations(Collections
                .singleton(partitionConfiguration));
        // Start the Server
   
        Hashtable<String, String> env = createEnv(principal, credentials);
        env.putAll(cfg.toJndiEnvironment());
        return new InitialDirContext(env);
    }
View Full Code Here

Examples of org.apache.ldap.server.configuration.MutableServerStartupConfiguration

        }
        else
        {
            log.info( "server: using default settings ..." );
            env = new Properties();
            cfg = new MutableServerStartupConfiguration();
        }

        env.setProperty( Context.PROVIDER_URL, "ou=system" );
        env.setProperty( Context.INITIAL_CONTEXT_FACTORY, ServerContextFactory.class.getName() );
        env.putAll( cfg.toJndiEnvironment() );
View Full Code Here

Examples of org.apache.ldap.server.configuration.MutableServerStartupConfiguration

        }
        else
        {
            log.info( "server: using default settings ..." );
            env = new Properties();
            cfg = new MutableServerStartupConfiguration();
        }

        env.setProperty( Context.PROVIDER_URL, "ou=system" );
        env.setProperty( Context.INITIAL_CONTEXT_FACTORY, ServerContextFactory.class.getName() );
        env.putAll( cfg.toJndiEnvironment() );
View Full Code Here

Examples of org.apache.ldap.server.configuration.MutableServerStartupConfiguration

        try { new InitialContext( env ); } catch( Exception e ) {}

        sysRoot = null;
        doDelete( configuration.getWorkingDirectory() );
        configuration = new MutableServerStartupConfiguration();
    }
View Full Code Here

Examples of org.apache.ldap.server.configuration.MutableServerStartupConfiguration

        try { new InitialContext( env ); } catch( Exception e ) {}

        sysRoot = null;
        doDelete( configuration.getWorkingDirectory() );
        configuration = new MutableServerStartupConfiguration();
    }
View Full Code Here

Examples of org.apache.ldap.server.configuration.MutableServerStartupConfiguration

        try { new InitialContext( env ); } catch( Exception e ) {}

        sysRoot = null;
        doDelete( configuration.getWorkingDirectory() );
        configuration = new MutableServerStartupConfiguration();
    }
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.