Examples of LdapConfiguration


Examples of org.apache.archiva.configuration.LdapConfiguration

        return value;
    }
   
    private LdapConfiguration readLdapConfiguration( String prefix, Registry registry )
    {
        LdapConfiguration value = new LdapConfiguration();

    //String hostName = registry.getString( prefix + "hostName", value.getHostName() );

    List<String> hostNameList = registry.getList( prefix + "hostName" );
    String hostName = value.getHostName();
    if (hostNameList != null && !hostNameList.isEmpty() )
    {
        StringBuilder sb = new StringBuilder(  );
        for (int i = 0,size = hostNameList.size();i<size;i++)
        {
            sb.append( hostNameList.get( i ) );
            if (i<size - 1)
            {
                sb.append( ',' );
            }
        }
        hostName = sb.toString();
    }

        value.setHostName( hostName );
    int port = registry.getInt( prefix + "port", value.getPort() );
        value.setPort( port );
        boolean ssl = registry.getBoolean( prefix + "ssl", value.isSsl() );
        value.setSsl( ssl );
    //String baseDn = registry.getString( prefix + "baseDn", value.getBaseDn() );

    List<String> baseDnList = registry.getList( prefix + "baseDn" );
    String baseDn = value.getBaseDn();
    if (baseDnList != null && !baseDnList.isEmpty() )
    {
        StringBuilder sb = new StringBuilder(  );
        for (int i = 0,size = baseDnList.size();i<size;i++)
        {
            sb.append( baseDnList.get( i ) );
            if (i<size - 1)
            {
                sb.append( ',' );
            }
        }
        baseDn = sb.toString();
    }

        value.setBaseDn( baseDn );
    //String baseGroupsDn = registry.getString( prefix + "baseGroupsDn", value.getBaseGroupsDn() );

    List<String> baseGroupsDnList = registry.getList( prefix + "baseGroupsDn" );
    String baseGroupsDn = value.getBaseGroupsDn();
    if (baseGroupsDnList != null && !baseGroupsDnList.isEmpty() )
    {
        StringBuilder sb = new StringBuilder(  );
        for (int i = 0,size = baseGroupsDnList.size();i<size;i++)
        {
            sb.append( baseGroupsDnList.get( i ) );
            if (i<size - 1)
            {
                sb.append( ',' );
            }
        }
        baseGroupsDn = sb.toString();
    }

        value.setBaseGroupsDn( baseGroupsDn );
    //String contextFactory = registry.getString( prefix + "contextFactory", value.getContextFactory() );

    List<String> contextFactoryList = registry.getList( prefix + "contextFactory" );
    String contextFactory = value.getContextFactory();
    if (contextFactoryList != null && !contextFactoryList.isEmpty() )
    {
        StringBuilder sb = new StringBuilder(  );
        for (int i = 0,size = contextFactoryList.size();i<size;i++)
        {
            sb.append( contextFactoryList.get( i ) );
            if (i<size - 1)
            {
                sb.append( ',' );
            }
        }
        contextFactory = sb.toString();
    }

        value.setContextFactory( contextFactory );
    //String bindDn = registry.getString( prefix + "bindDn", value.getBindDn() );

    List<String> bindDnList = registry.getList( prefix + "bindDn" );
    String bindDn = value.getBindDn();
    if (bindDnList != null && !bindDnList.isEmpty() )
    {
        StringBuilder sb = new StringBuilder(  );
        for (int i = 0,size = bindDnList.size();i<size;i++)
        {
            sb.append( bindDnList.get( i ) );
            if (i<size - 1)
            {
                sb.append( ',' );
            }
        }
        bindDn = sb.toString();
    }

        value.setBindDn( bindDn );
    //String password = registry.getString( prefix + "password", value.getPassword() );

    List<String> passwordList = registry.getList( prefix + "password" );
    String password = value.getPassword();
    if (passwordList != null && !passwordList.isEmpty() )
    {
        StringBuilder sb = new StringBuilder(  );
        for (int i = 0,size = passwordList.size();i<size;i++)
        {
            sb.append( passwordList.get( i ) );
            if (i<size - 1)
            {
                sb.append( ',' );
            }
        }
        password = sb.toString();
    }

        value.setPassword( password );
    //String authenticationMethod = registry.getString( prefix + "authenticationMethod", value.getAuthenticationMethod() );

    List<String> authenticationMethodList = registry.getList( prefix + "authenticationMethod" );
    String authenticationMethod = value.getAuthenticationMethod();
    if (authenticationMethodList != null && !authenticationMethodList.isEmpty() )
    {
        StringBuilder sb = new StringBuilder(  );
        for (int i = 0,size = authenticationMethodList.size();i<size;i++)
        {
            sb.append( authenticationMethodList.get( i ) );
            if (i<size - 1)
            {
                sb.append( ',' );
            }
        }
        authenticationMethod = sb.toString();
    }

        value.setAuthenticationMethod( authenticationMethod );
        boolean bindAuthenticatorEnabled = registry.getBoolean( prefix + "bindAuthenticatorEnabled", value.isBindAuthenticatorEnabled() );
        value.setBindAuthenticatorEnabled( bindAuthenticatorEnabled );
        boolean writable = registry.getBoolean( prefix + "writable", value.isWritable() );
        value.setWritable( writable );
        boolean useRoleNameAsGroup = registry.getBoolean( prefix + "useRoleNameAsGroup", value.isUseRoleNameAsGroup() );
        value.setUseRoleNameAsGroup( useRoleNameAsGroup );
        java.util.Map extraProperties = registry.getProperties( prefix + "extraProperties" );
        value.setExtraProperties( extraProperties );

        return value;
    }
View Full Code Here

Examples of org.apache.directory.server.ldap.LdapConfiguration

        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
View Full Code Here

Examples of org.wso2.carbon.apacheds.LDAPConfiguration

            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();

View Full Code Here

Examples of org.wso2.carbon.apacheds.LDAPConfiguration

     */
    private void buildLDAPConfigurations(OMElement embeddedLDAP) throws EmbeddingLDAPException {
        /*Read the properties of EmbeddedLDAP XML element.*/
        Map<String, String> propertyMap = getChildPropertyElements(embeddedLDAP);

        ldapConfiguration = new LDAPConfiguration();
        /*set connectionPassword*/
        buildConnectionPassword(propertyMap);
        String booleanString;

        if ((booleanString = propertyMap.get("accessControlEnabled")) != null) {
View Full Code Here

Examples of org.wso2.carbon.apacheds.LDAPConfiguration

    public void testBuildLDAPConfigurations()
            throws XMLStreamException, DirectoryServerException, EmbeddingLDAPException {

        assertEquals(this.configurationBuilder.getConnectionPassword(), "tweety");

        LDAPConfiguration configurations = this.configurationBuilder.getLdapConfiguration();

        assertEquals(configurations.getInstanceId(), "id1");
        assertEquals(configurations.getLdapPort(), 10389); //Should get the default value
        assertEquals(configurations.getSaslHostName(), "ldap.wso2.com");
        assertEquals(configurations.getSaslPrincipalName(), "ldap/localhost@WSO2.COM");
        assertEquals(configurations.getMaxPDUSize(), 5000000);
        assertEquals(configurations.getWorkingDirectory(), "/home/tweety");
        assertEquals(configurations.isAccessControlOn(), false);
        assertEquals(configurations.isAllowAnonymousAccess(), true);
        assertEquals(configurations.isDeNormalizedAttributesEnabled(), true);


    }
View Full Code Here

Examples of org.wso2.carbon.apacheds.LDAPConfiguration

        }

        public void run() {

            try {
                LDAPConfiguration config = new LDAPConfiguration();               
                config.setWorkingDirectory(temDirectory);
                ldapServer.init(config);
                ldapServer.start();
                this.started = true;
            } catch (Exception e) {
                e.printStackTrace();
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.