Package org.apache.archiva.configuration

Examples of org.apache.archiva.configuration.LdapConfiguration


        userManagerImpls.addAll( registry.getList( prefix + "userManagerImpls.userManagerImpl" ) );
        value.setUserManagerImpls( userManagerImpls );
        java.util.List rbacManagerImpls = new java.util.ArrayList/*<String>*/();
        rbacManagerImpls.addAll( registry.getList( prefix + "rbacManagerImpls.rbacManagerImpl" ) );
        value.setRbacManagerImpls( rbacManagerImpls );
        LdapConfiguration ldapConfiguration = readLdapConfiguration( prefix + "ldapConfiguration.", registry );
        value.setLdapConfiguration( ldapConfiguration );
        java.util.List ldapGroupMappings = new java.util.ArrayList/*<LdapGroupMapping>*/();
        List ldapGroupMappingsSubsets = registry.getSubsetList( prefix + "ldapGroupMappings.ldapGroupMapping" );
        for ( Iterator i = ldapGroupMappingsSubsets.iterator(); i.hasNext(); )
        {
View Full Code Here


        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

        userManagerImpls.addAll( registry.getList( prefix + "userManagerImpls.userManagerImpl" ) );
        value.setUserManagerImpls( userManagerImpls );
        java.util.List rbacManagerImpls = new java.util.ArrayList/*<String>*/();
        rbacManagerImpls.addAll( registry.getList( prefix + "rbacManagerImpls.rbacManagerImpl" ) );
        value.setRbacManagerImpls( rbacManagerImpls );
        LdapConfiguration ldapConfiguration = readLdapConfiguration( prefix + "ldapConfiguration.", registry );
        value.setLdapConfiguration( ldapConfiguration );
        java.util.List ldapGroupMappings = new java.util.ArrayList/*<LdapGroupMapping>*/();
        List ldapGroupMappingsSubsets = registry.getSubsetList( prefix + "ldapGroupMappings.ldapGroupMapping" );
        for ( Iterator i = ldapGroupMappingsSubsets.iterator(); i.hasNext(); )
        {
View Full Code Here

        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

TOP

Related Classes of org.apache.archiva.configuration.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.