Examples of LDAPConfigurationBuilder


Examples of org.wso2.carbon.ldap.server.configuration.LDAPConfigurationBuilder

     */
    public void start(BundleContext bundleContext) {

        try {
            /*Read the embedded-ldap configuration file.*/
            LDAPConfigurationBuilder configurationBuilder = new LDAPConfigurationBuilder(
                    getLdapConfigurationFile());
            /*Make relevant objects that encapsulate different parts of config file.*/
            configurationBuilder.buildConfigurations();

            boolean embeddedLDAPEnabled = configurationBuilder.isEmbeddedLDAPEnabled();
            //start LDAPServer only if embedded-ldap is enabled.
            if (embeddedLDAPEnabled) {

                LDAPConfiguration ldapConfiguration = configurationBuilder.getLdapConfiguration();
                /*set the embedded-apacheds's schema location which is: carbon-home/repository/data/
                is-default-schema.zip
                */
                setSchemaLocation();

                /* Set working directory where schema directory and ldap partitions are created*/
                setWorkingDirectory(ldapConfiguration);

                startLdapServer(ldapConfiguration);

                /* replace default password with that is provided in the configuration file.*/
                this.ldapServer.changeConnectionUserPassword(
                        configurationBuilder.getConnectionPassword());

                // Add admin (default)partition if it is not already created.
                PartitionManager partitionManager = this.ldapServer.getPartitionManager();
                PartitionInfo defaultPartitionInfo=
                        configurationBuilder.getPartitionConfigurations();
                boolean defaultPartitionAlreadyExisted=partitionManager.partitionDirectoryExists(
                        defaultPartitionInfo.getPartitionId());

                if (!defaultPartitionAlreadyExisted) {
                    partitionManager.addPartition(defaultPartitionInfo);
                } else {
                    partitionManager.initializeExistingPartition(defaultPartitionInfo);
                }

                // Start KDC if enabled
                if (configurationBuilder.isKdcEnabled()) {

                    startKDC(configurationBuilder.getKdcConfigurations());

                    // Add kerberos attributes only if the default partition is newly created.
                    if (!defaultPartitionAlreadyExisted) {

                        kdcServer.kerberizePartition(configurationBuilder.
                                getPartitionConfigurations(), this.ldapServer);
                    }
                }

                //create and register LDAPTenantManager implementation in OSGI.
View Full Code Here

Examples of org.wso2.carbon.ldap.server.configuration.LDAPConfigurationBuilder

        File f = new File(".");
        System.out.println(f.getAbsolutePath());
        File file = new File(configurationFile);
        assertTrue(file.exists());

        this.configurationBuilder = new LDAPConfigurationBuilder(file);
        this.configurationBuilder.setUserMgtXMLFilePath("src" + File.separator + "test" +
                                                        File.separator + "resources" + File.separator);

    }
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.