Package org.rhq.core.domain.common.composite

Examples of org.rhq.core.domain.common.composite.SystemSettings


    public static boolean usingLDAPAuthentication(ServletContext context) throws Exception {
        String provider = (String) context.getAttribute(Constants.JAAS_PROVIDER_CTX_ATTR);

        if (provider == null) {
            SystemSettings systemSettings = LookupUtil.getSystemManager().getUnmaskedSystemSettings(true);
            provider = systemSettings.get(SystemSetting.LDAP_BASED_JAAS_PROVIDER);
            context.setAttribute(Constants.JAAS_PROVIDER_CTX_ATTR, provider);
        }

        return (provider != null) ? Boolean.valueOf(provider) : false;
    }
View Full Code Here


        //in the new style settings and the the old style
        //settings (and consequently database).
        //These two still co-exist together in the codebase
        //so let's make sure the values correspond to each other.

        SystemSettings settings = systemManager.getUnmaskedSystemSettings(false);
        Properties config = systemManager.getSystemConfiguration(overlord);

        SystemSettings origSettings = new SystemSettings(settings);

        try {
            //let's make sure the values are the same
            checkFormats(settings, config);
View Full Code Here

            systemManager.setAnySystemSettings(origSettings, false, true);
        }
    }

    public void testPasswordFieldsObfuscation() {
        SystemSettings masked = systemManager.getSystemSettings(overlord);
        SystemSettings unmasked = systemManager.getUnmaskedSystemSettings(true);
        SystemSettings obfuscated = systemManager.getObfuscatedSystemSettings(true);

        for (SystemSetting setting : SystemSetting.values()) {
            if (setting.getType() == PropertySimpleType.PASSWORD) {
                if (masked.containsKey(setting) && masked.get(setting) != null) {
                    assertEquals("Unexpected unmasked value", PropertySimple.MASKED_VALUE, masked.get(setting));
                    assertEquals("Unmasked and obfuscated values don't correspond", obfuscated.get(setting),
                        PicketBoxObfuscator.encode(unmasked.get(setting)));
                }
            }
        }
View Full Code Here

        assertEquals(unmasked, obfuscated);
    }

    public void testPasswordMaskingDoesNotPersistBack() throws Exception {
        SystemSettings settings = systemManager.getSystemSettings(overlord);
        SystemSettings copy = (SystemSettings) settings.clone();

        systemManager.setAnySystemSettings(settings, false, true);

        settings = systemManager.getSystemSettings(overlord);
View Full Code Here

        assertEquals("Password masking should not modify the database", copy, settings);
    }

    public void testPersistingDeobfuscatedSettingsDoesNotChangeTheValues() throws Exception {
        SystemSettings settings = systemManager.getObfuscatedSystemSettings(true);
        SystemSettings copy = (SystemSettings) settings.clone();

        systemManager.deobfuscate(settings);
        systemManager.setAnySystemSettings(settings, false, true);

        settings = systemManager.getObfuscatedSystemSettings(true);
View Full Code Here

TOP

Related Classes of org.rhq.core.domain.common.composite.SystemSettings

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.