Package org.apache.archiva.admin.model.beans

Examples of org.apache.archiva.admin.model.beans.LdapConfiguration


                    }
                }

                // now ldap

                LdapConfiguration ldapConfiguration = redbackRuntimeConfiguration.getLdapConfiguration();
                if ( ldapConfiguration == null )
                {
                    ldapConfiguration = new LdapConfiguration();
                    redbackRuntimeConfiguration.setLdapConfiguration( ldapConfiguration );
                }

                ldapConfiguration.setHostName(
                    userConfiguration.getString( UserConfigurationKeys.LDAP_HOSTNAME, null ) );
                ldapConfiguration.setPort( userConfiguration.getInt( UserConfigurationKeys.LDAP_PORT, -1 ) );
                ldapConfiguration.setSsl( userConfiguration.getBoolean( UserConfigurationKeys.LDAP_SSL, false ) );
                ldapConfiguration.setBaseDn(
                    userConfiguration.getConcatenatedList( UserConfigurationKeys.LDAP_BASEDN, null ) );

                ldapConfiguration.setBaseGroupsDn(
                    userConfiguration.getConcatenatedList( UserConfigurationKeys.LDAP_GROUPS_BASEDN,
                                                           ldapConfiguration.getBaseDn() ) );

                ldapConfiguration.setContextFactory(
                    userConfiguration.getString( UserConfigurationKeys.LDAP_CONTEX_FACTORY,
                                                 isSunContextFactoryAvailable()
                                                     ? "com.sun.jndi.ldap.LdapCtxFactory"
                                                     : "" ) );
                ldapConfiguration.setBindDn(
                    userConfiguration.getConcatenatedList( UserConfigurationKeys.LDAP_BINDDN, null ) );
                ldapConfiguration.setPassword(
                    userConfiguration.getString( UserConfigurationKeys.LDAP_PASSWORD, null ) );
                ldapConfiguration.setAuthenticationMethod(
                    userConfiguration.getString( UserConfigurationKeys.LDAP_AUTHENTICATION_METHOD, null ) );

                ldapConfiguration.setWritable(
                    userConfiguration.getBoolean( UserConfigurationKeys.LDAP_WRITABLE, false ) );

                ldapConfiguration.setUseRoleNameAsGroup(
                    userConfiguration.getBoolean( UserConfigurationKeys.LDAP_GROUPS_USE_ROLENAME, false ) );

                boolean ldapBindAuthenticatorEnabled =
                    userConfiguration.getBoolean( UserConfigurationKeys.LDAP_BIND_AUTHENTICATOR_ENABLED, false );
                ldapConfiguration.setBindAuthenticatorEnabled( ldapBindAuthenticatorEnabled );

                // LDAP groups mapping reading !!
                // UserConfigurationKeys.LDAP_GROUPS_ROLE_START_KEY
                // userConfiguration.getKeys()
View Full Code Here


        }

        if ( redbackRuntimeConfiguration.getLdapConfiguration() == null )
        {
            // prevent NPE
            redbackRuntimeConfiguration.setLdapConfiguration( new LdapConfiguration() );
        }

        if ( redbackRuntimeConfiguration.getUsersCacheConfiguration() == null )
        {
            redbackRuntimeConfiguration.setUsersCacheConfiguration( new CacheConfiguration() );
View Full Code Here

            new BeanReplicator().replicateBean( archivaRuntimeConfiguration,
                                                org.apache.archiva.configuration.RedbackRuntimeConfiguration.class );

        if ( archivaRuntimeConfiguration.getLdapConfiguration() == null )
        {
            archivaRuntimeConfiguration.setLdapConfiguration( new LdapConfiguration() );
        }
        redbackRuntimeConfiguration.setLdapConfiguration(
            new BeanReplicator().replicateBean( archivaRuntimeConfiguration.getLdapConfiguration(),
                                                org.apache.archiva.configuration.LdapConfiguration.class ) );
View Full Code Here

    @PostConstruct
    public void initialize()
    {
        try
        {
            LdapConfiguration ldapConfiguration =
                redbackRuntimeConfigurationAdmin.getRedbackRuntimeConfiguration().getLdapConfiguration();
            ldapConnectionConfiguration = new LdapConnectionConfiguration();
            ldapConnectionConfiguration.setHostname( ldapConfiguration.getHostName() );
            ldapConnectionConfiguration.setPort( ldapConfiguration.getPort() );
            ldapConnectionConfiguration.setSsl( ldapConfiguration.isSsl() );
            ldapConnectionConfiguration.setBaseDn( ldapConfiguration.getBaseDn() );
            ldapConnectionConfiguration.setContextFactory( ldapConfiguration.getContextFactory() );
            ldapConnectionConfiguration.setBindDn( ldapConfiguration.getBindDn() );
            ldapConnectionConfiguration.setPassword( ldapConfiguration.getPassword() );
            ldapConnectionConfiguration.setAuthenticationMethod( ldapConfiguration.getAuthenticationMethod() );
            ldapConnectionConfiguration.setExtraProperties( toProperties( ldapConfiguration.getExtraProperties() ) );
        }
        catch ( InvalidNameException e )
        {
            throw new RuntimeException( "Error while initializing connection factory.", e );
        }
View Full Code Here

TOP

Related Classes of org.apache.archiva.admin.model.beans.LdapConfiguration

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.