Examples of Systemsettings


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

                exportData.close();
            }

            //now check that everything got imported according to the changed configuration
            SystemManagerLocal systemManager = LookupUtil.getSystemManager();
            SystemSettings settings = systemManager.getUnmaskedSystemSettings(false);

            assertEquals(settings.get(SystemSetting.BASE_URL), "http://testing.domain:7080");

            MeasurementDefinitionManagerLocal measurementDefinitionManager = LookupUtil
                .getMeasurementDefinitionManager();
            MeasurementDefinitionCriteria crit = new MeasurementDefinitionCriteria();
            crit.addFilterResourceTypeName(RESOURCE_TYPE_NAME);
View Full Code Here

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

        setup(true);

        try {
            //let's read the original values from the database, so that we know what to compare against
            SystemManagerLocal systemManager = LookupUtil.getSystemManager();
            SystemSettings settings = systemManager.getUnmaskedSystemSettings(false);

            String originalBaseUrl = settings.get(SystemSetting.BASE_URL);

            MeasurementDefinitionManagerLocal measurementDefinitionManager = LookupUtil
                .getMeasurementDefinitionManager();
            MeasurementDefinitionCriteria crit = new MeasurementDefinitionCriteria();
            crit.addFilterResourceTypeName(RESOURCE_TYPE_NAME);
            crit.addFilterName(METRIC_NAME);
            MeasurementDefinition distroNameDef = measurementDefinitionManager.findMeasurementDefinitionsByCriteria(
                freshUser(), crit).get(0);

            long originalInterval = distroNameDef.getDefaultInterval();

            //now modify the default configuration in the export file
            String exportXML = getExportData();

            exportXML = updateSystemSettingsImportConfiguration(exportXML);
            exportXML = updateMetricTemplatesImportConfiguration(exportXML);

            InputStream exportData = createCompressedStream(exportXML);

            //let's just use the default configs so that we don't apply the changes suggested in
            //the changed default configs created above
            ImportConfiguration systemSettingsConfiguration = new ImportConfiguration(
                SystemSettingsSynchronizer.class.getName(), new SystemSettingsSynchronizer().getImporter()
                    .getImportConfigurationDefinition().getDefaultTemplate().createConfiguration());
            ImportConfiguration metricTemplatesConfiguration = new ImportConfiguration(
                MetricTemplateSynchronizer.class.getName(), new MetricTemplateSynchronizer().getImporter()
                    .getImportConfigurationDefinition().getDefaultTemplate().createConfiguration());

            try {
                synchronizationManager.importAllSubsystems(freshUser(), exportData,
                    Arrays.asList(systemSettingsConfiguration, metricTemplatesConfiguration));
            } finally {
                exportData.close();
            }

            //now check that we import using the manually create configurations, not the inlined ones
            settings = systemManager.getUnmaskedSystemSettings(false);

            assertEquals(settings.get(SystemSetting.BASE_URL), originalBaseUrl);

            measurementDefinitionManager = LookupUtil.getMeasurementDefinitionManager();
            distroNameDef = measurementDefinitionManager.findMeasurementDefinitionsByCriteria(freshUser(), crit).get(0);

            //the definition should have been updated by the data from the export file
View Full Code Here

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

    /**
     * Returns true if LDAP authentication is enabled, or false otherwise.
     */
    public Boolean checkLdapConfiguredStatus() throws RuntimeException {
        try {
            SystemSettings systemSettings = systemManager.getUnmaskedSystemSettings(true);
            String value = systemSettings.get(SystemSetting.LDAP_BASED_JAAS_PROVIDER);
            boolean result = (value != null) ? Boolean.valueOf(value) : false;
            return result;
        } catch (Throwable t) {
            throw getExceptionToThrowToClient(t);
        }
View Full Code Here

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

    }

    @Override
    public String getSessionTimeout() throws RuntimeException {
        try {
            SystemSettings systemSettings = systemManager.getUnmaskedSystemSettings(true);
            String sessionTimeout = systemSettings.get(SystemSetting.RHQ_SESSION_TIMEOUT);
            return sessionTimeout;
        } catch (Throwable t) {
            throw getExceptionToThrowToClient(t);
        }
    }
View Full Code Here

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

    @Deprecated
    @RequiredPermission(Permission.MANAGE_SETTINGS)
    public Properties getSystemConfiguration(Subject subject) {
        Properties copy = new Properties();

        SystemSettings settings = getUnmaskedSystemSettings(true);
        for (Map.Entry<SystemSetting, String> e : settings.entrySet()) {
            //transform the value back to the database format, because that's
            //what this method always returned.
            //Leave the password fields as they are though, because now (as of 4.10)
            //the passwords are stored obfuscated, but are kept clear in memory.
            //The legacy behavior was to store the values in clear text, too,
View Full Code Here

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

    }

    @Override
    @RequiredPermission(Permission.MANAGE_SETTINGS)
    public SystemSettings getSystemSettings(Subject subject) {
        SystemSettings ret = new SystemSettings();
        SystemSettings unmasked = getUnmaskedSystemSettings(true);

        for (Map.Entry<SystemSetting, String> entry : unmasked.entrySet()) {
            if (entry.getKey().isPublic()) {
                if (entry.getKey().getType() == PropertySimpleType.PASSWORD) {
                    entry.setValue(PropertySimple.MASKED_VALUE);
                }
View Full Code Here

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

        return ret;
    }

    @Override
    public SystemSettings getUnmaskedSystemSettings(boolean includePrivateSettings) {
        SystemSettings ret = getCachedSettings();

        return includePrivateSettings ? ret : removePrivateSettings(ret);
    }
View Full Code Here

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

        }
    }

    @Override
    public SystemSettings getObfuscatedSystemSettings(boolean includePrivateSettings) {
        SystemSettings ret = getCachedObfuscatedSettings();

        return includePrivateSettings ? ret : removePrivateSettings(ret);
    }
View Full Code Here

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

    public void setAnySystemSetting(SystemSetting setting, String value) {
        if (SystemSetting.LAST_SYSTEM_CONFIG_UPDATE_TIME == setting) {
            return;
        }

        SystemSettings settings = getUnmaskedSystemSettings(true);
        settings.put(setting, value);
        setAnySystemSettings(settings, true, true);
    }
View Full Code Here

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

        settings.put(setting, value);
        setAnySystemSettings(settings, true, true);
    }

    private SystemSettings removePrivateSettings(SystemSettings settings) {
        SystemSettings cleansed = new SystemSettings(settings);
        for (SystemSetting s : SystemSetting.values()) {
            if (!s.isPublic()) {
                cleansed.remove(s);
            }
        }
        return cleansed;
    }
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.