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

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


            return getRedbackRuntimeConfiguration().getUserManagerImpls().get( 0 );
        }

        if ( StringUtils.startsWith( key, UserConfigurationKeys.LDAP_GROUPS_ROLE_START_KEY ) )
        {
            RedbackRuntimeConfiguration redbackRuntimeConfiguration = getRedbackRuntimeConfiguration();
            int index = redbackRuntimeConfiguration.getLdapGroupMappings().indexOf( new LdapGroupMapping(
                StringUtils.substringAfter( key, UserConfigurationKeys.LDAP_GROUPS_ROLE_START_KEY ) ) );
            if ( index > -1 )
            {
                return StringUtils.join( redbackRuntimeConfiguration.getLdapGroupMappings().get( index ).getRoleNames(),
                                         ',' );
            }
        }

        RedbackRuntimeConfiguration conf = getRedbackRuntimeConfiguration();

        if ( conf.getConfigurationProperties().containsKey( key ) )
        {
            return conf.getConfigurationProperties().get( key );
        }

        String value = userConfiguration.getString( key );
        if ( value == null )
        {
            return null;
        }
        conf.getConfigurationProperties().put( key, value );

        try
        {
            updateRedbackRuntimeConfiguration( conf );
        }
View Full Code Here


        if ( UserConfigurationKeys.LDAP_AUTHENTICATION_METHOD.equals( key ) )
        {
            return getRedbackRuntimeConfiguration().getLdapConfiguration().getAuthenticationMethod();
        }

        RedbackRuntimeConfiguration conf = getRedbackRuntimeConfiguration();

        if ( conf.getConfigurationProperties().containsKey( key ) )
        {
            return conf.getConfigurationProperties().get( key );
        }

        String value = userConfiguration.getString( key, defaultValue );

        if ( value == null )
        {
            return null;
        }

        conf.getConfigurationProperties().put( key, value );
        try
        {
            updateRedbackRuntimeConfiguration( conf );
        }
        catch ( RepositoryAdminException e )
View Full Code Here

        return value;
    }

    public int getInt( String key )
    {
        RedbackRuntimeConfiguration conf = getRedbackRuntimeConfiguration();

        if ( conf.getConfigurationProperties().containsKey( key ) )
        {
            return Integer.valueOf( conf.getConfigurationProperties().get( key ) );
        }

        int value = userConfiguration.getInt( key );

        conf.getConfigurationProperties().put( key, Integer.toString( value ) );
        try
        {
            updateRedbackRuntimeConfiguration( conf );
        }
        catch ( RepositoryAdminException e )
View Full Code Here

        if ( UserConfigurationKeys.LDAP_PORT.equals( key ) )
        {
            return getRedbackRuntimeConfiguration().getLdapConfiguration().getPort();
        }

        RedbackRuntimeConfiguration conf = getRedbackRuntimeConfiguration();

        if ( conf.getConfigurationProperties().containsKey( key ) )
        {
            return Integer.valueOf( conf.getConfigurationProperties().get( key ) );
        }

        int value = userConfiguration.getInt( key, defaultValue );

        conf.getConfigurationProperties().put( key, Integer.toString( value ) );
        try
        {
            updateRedbackRuntimeConfiguration( conf );
        }
        catch ( RepositoryAdminException e )
View Full Code Here

        return value;
    }

    public boolean getBoolean( String key )
    {
        RedbackRuntimeConfiguration conf = getRedbackRuntimeConfiguration();

        if ( UserConfigurationKeys.LDAP_WRITABLE.equals( key ) )
        {
            return conf.getLdapConfiguration().isWritable();
        }

        if ( UserConfigurationKeys.LDAP_GROUPS_USE_ROLENAME.equals( key ) )
        {
            return conf.getLdapConfiguration().isUseRoleNameAsGroup();
        }

        if ( UserConfigurationKeys.LDAP_BIND_AUTHENTICATOR_ENABLED.equals( key ) )
        {
            return conf.getLdapConfiguration().isBindAuthenticatorEnabled();
        }

        if ( conf.getConfigurationProperties().containsKey( key ) )
        {
            return Boolean.valueOf( conf.getConfigurationProperties().get( key ) );
        }

        boolean value = userConfiguration.getBoolean( key );

        conf.getConfigurationProperties().put( key, Boolean.toString( value ) );
        try
        {
            updateRedbackRuntimeConfiguration( conf );
        }
        catch ( RepositoryAdminException e )
View Full Code Here

        if ( UserConfigurationKeys.LDAP_BIND_AUTHENTICATOR_ENABLED.equals( key ) )
        {
            return getRedbackRuntimeConfiguration().getLdapConfiguration().isBindAuthenticatorEnabled();
        }

        RedbackRuntimeConfiguration conf = getRedbackRuntimeConfiguration();

        if ( conf.getConfigurationProperties().containsKey( key ) )
        {
            return Boolean.valueOf( conf.getConfigurationProperties().get( key ) );
        }

        boolean value = userConfiguration.getBoolean( key, defaultValue );

        conf.getConfigurationProperties().put( key, Boolean.toString( value ) );
        try
        {
            updateRedbackRuntimeConfiguration( conf );
        }
        catch ( RepositoryAdminException e )
View Full Code Here

    public List<String> getList( String key )
    {
        List<String> value = userConfiguration.getList( key );

        RedbackRuntimeConfiguration conf = getRedbackRuntimeConfiguration();
        // TODO concat values
        conf.getConfigurationProperties().put( key, "" );
        try
        {
            updateRedbackRuntimeConfiguration( conf );
        }
        catch ( RepositoryAdminException e )
View Full Code Here

                                                     new Locale( StringUtils.isEmpty( locale ) ? "en" : locale ) );
        applicationRuntimeInfo.setTimestampStr( sfd.format( new Date( archivaRuntimeInfo.getTimestamp() ) ) );

        CookieInformation cookieInformation = new CookieInformation();

        RedbackRuntimeConfiguration redbackRuntimeConfiguration =
            redbackRuntimeConfigurationService.getRedbackRuntimeConfiguration();

        cookieInformation.setDomain(
            redbackRuntimeConfiguration.getConfigurationProperties().get( UserConfigurationKeys.REMEMBER_ME_DOMAIN ) );
        cookieInformation.setPath(
            redbackRuntimeConfiguration.getConfigurationProperties().get( UserConfigurationKeys.REMEMBER_ME_PATH ) );
        cookieInformation.setSecure(
            redbackRuntimeConfiguration.getConfigurationProperties().get( UserConfigurationKeys.REMEMBER_ME_SECURE ) );
        cookieInformation.setTimeout(
            redbackRuntimeConfiguration.getConfigurationProperties().get( UserConfigurationKeys.REMEMBER_ME_TIMEOUT ) );
        cookieInformation.setRememberMeEnabled( BooleanUtils.toBoolean(
            redbackRuntimeConfiguration.getConfigurationProperties().get(
                UserConfigurationKeys.REMEMBER_ME_ENABLED ) ) );

        applicationRuntimeInfo.setCookieInformation( cookieInformation );

        return applicationRuntimeInfo;
View Full Code Here

    {
        logger.debug( "addLdapMapping ldapGroup: {}, roles: {}", ldapGroup, roles );
        // TODO check if already exist first
        try
        {
            RedbackRuntimeConfiguration redbackRuntimeConfiguration =
                redbackRuntimeConfigurationAdmin.getRedbackRuntimeConfiguration();
            boolean added =
                redbackRuntimeConfiguration.getLdapGroupMappings().add( new LdapGroupMapping( ldapGroup, roles ) );
            logger.debug( "addLdapMapping ldapGroup: {}, roles: {}, added: {}", ldapGroup, roles, added );
            redbackRuntimeConfigurationAdmin.updateRedbackRuntimeConfiguration( redbackRuntimeConfiguration );
        }
        catch ( RepositoryAdminException e )
        {
View Full Code Here

        throws MappingException
    {

        try
        {
            RedbackRuntimeConfiguration redbackRuntimeConfiguration =
                redbackRuntimeConfigurationAdmin.getRedbackRuntimeConfiguration();
            LdapGroupMapping ldapGroupMapping = new LdapGroupMapping( ldapGroup );
            int idx = redbackRuntimeConfiguration.getLdapGroupMappings().indexOf( ldapGroupMapping );
            if ( idx > -1 )
            {
                logger.debug( "updateLdapMapping ldapGroup: {}, roles: {}", ldapGroup, roles );
                ldapGroupMapping = redbackRuntimeConfiguration.getLdapGroupMappings().get( idx );
                ldapGroupMapping.setRoleNames( roles );
            }
            redbackRuntimeConfigurationAdmin.updateRedbackRuntimeConfiguration( redbackRuntimeConfiguration );

        }
View Full Code Here

TOP

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

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.