Examples of Systemsettings


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

    public void setSystemConfiguration(Subject subject, Properties properties, boolean skipValidation) throws Exception {
        Map<String, String> map = toMap(properties);

        transformToSystemSettingsFormat(map);

        SystemSettings settings = SystemSettings.fromMap(map);

        setAnySystemSettings(settings, skipValidation, false);
    }
View Full Code Here

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

        throws InvalidSystemConfigurationException {
        Map<String, String> map = toMap(properties);

        transformToSystemSettingsFormat(map);

        SystemSettings settings = SystemSettings.fromMap(map);
        for (Map.Entry<SystemSetting, String> e : settings.entrySet()) {
            SystemSetting prop = e.getKey();
            String value = e.getValue();

            verifyNewSystemConfigurationProperty(prop, value, settings);
        }
View Full Code Here

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

        }
    }

    @Override
    public boolean isLdapAuthorizationEnabled() {
        SystemSettings settings = getUnmaskedSystemSettings(true);

        String ldapAuthValue = settings.get(SystemSetting.LDAP_BASED_JAAS_PROVIDER);

        boolean ldapAuth = ldapAuthValue == null ? false : Boolean.valueOf(ldapAuthValue);

        String groupFilter = settings.get(SystemSetting.LDAP_GROUP_FILTER);
        String groupMember = settings.get(SystemSetting.LDAP_GROUP_MEMBER);

        return ldapAuth
            && (((groupFilter != null) && groupFilter.trim().length() > 0) || ((groupMember != null) && groupMember
                .trim().length() > 0));
    }
View Full Code Here

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

    private synchronized SystemSettings getCachedSettings() {
        if (cachedSystemSettings == null) {
            loadSystemConfigurationCache();
        }

        return new SystemSettings(cachedSystemSettings);
    }
View Full Code Here

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

    private synchronized SystemSettings getCachedObfuscatedSettings() {
        if (cachedSystemSettings == null) {
            loadSystemConfigurationCache();
        }

        return new SystemSettings(cachedObfuscatedSystemSettings);
    }
View Full Code Here

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

        return new SystemSettings(cachedObfuscatedSystemSettings);
    }

    private void fillCache(Collection<SystemConfiguration> configs) {
        SystemSettings settings = new SystemSettings();

        for (SystemConfiguration config : configs) {
            SystemSetting prop = SystemSetting.getByInternalName(config.getPropertyKey());
            if (prop == null) {
                LOG.warn("The database contains unknown system configuration setting [" + config.getPropertyKey()
                    + "].");
                continue;
            }

            if (config.getPropertyValue() == null) {
                // for some reason, the configuration is not found in the DB, so fallback to the persisted default.
                // if there isn't even a persisted default, just use an empty string.
                String defaultValue = config.getDefaultPropertyValue();
                defaultValue = transformSystemConfigurationPropertyFromDb(prop, defaultValue, true);
                settings.put(prop, defaultValue);
            } else {
                String value = config.getPropertyValue();
                value = transformSystemConfigurationPropertyFromDb(prop, value, true);
                settings.put(prop, value);
            }
        }

        settings.setDriftPlugins(getDriftServerPlugins());

        synchronized (this) {
            //only update the caches if the settings were actually changed
            if (cachedSystemSettings == null
                || !safeEquals(cachedSystemSettings.get(SystemSetting.LAST_SYSTEM_CONFIG_UPDATE_TIME),
                    settings.get(SystemSetting.LAST_SYSTEM_CONFIG_UPDATE_TIME))) {
                cachedSystemSettings = settings;

                cachedObfuscatedSystemSettings = new SystemSettings(settings);
                for (Map.Entry<SystemSetting, String> entry : cachedObfuscatedSystemSettings.entrySet()) {
                    String value = entry.getValue();
                    if (value != null && entry.getKey().getType() == PropertySimpleType.PASSWORD) {
                        entry.setValue(PicketBoxObfuscator.encode(value));
                    }
View Full Code Here

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

    }

    @Override
    @RequiredPermission(Permission.MANAGE_SETTINGS)
    public void setClusterSettings(Subject subject, StorageClusterSettings clusterSettings) {
        SystemSettings settings = new SystemSettings();
        settings.put(SystemSetting.STORAGE_CQL_PORT, Integer.toString(clusterSettings.getCqlPort()));
        settings.put(SystemSetting.STORAGE_GOSSIP_PORT, Integer.toString(clusterSettings.getGossipPort()));
        if (clusterSettings.getAutomaticDeployment() != null) {
            settings.put(SystemSetting.STORAGE_AUTOMATIC_DEPLOYMENT,
                Boolean.toString(clusterSettings.getAutomaticDeployment()));
        }
        if (clusterSettings.getUsername() != null) {
            settings.put(SystemSetting.STORAGE_USERNAME, clusterSettings.getUsername());
        }
        if (clusterSettings.getPasswordHash() != null) {
            this.updateStorageClusterCredentials(clusterSettings);
            settings.put(SystemSetting.STORAGE_PASSWORD, clusterSettings.getPasswordHash());
        }
        if (clusterSettings.getRegularSnapshots() != null) {
            RegularSnapshots rs = clusterSettings.getRegularSnapshots();
            settings.put(SystemSetting.STORAGE_REGULAR_SNAPSHOTS, Boolean.toString(rs.getEnabled()));
            settings.put(SystemSetting.STORAGE_REGULAR_SNAPSHOTS_SCHEDULE, rs.getSchedule());
            settings.put(SystemSetting.STORAGE_REGULAR_SNAPSHOTS_RETENTION, rs.getRetention());
            settings.put(SystemSetting.STORAGE_REGULAR_SNAPSHOTS_RETENTION_COUNT, Integer.toString(rs.getCount()));
            settings.put(SystemSetting.STORAGE_REGULAR_SNAPSHOTS_DELETION, rs.getDeletion());
            settings.put(SystemSetting.STORAGE_REGULAR_SNAPSHOTS_DELETION_LOCATION, rs.getLocation());
        }
        systemManager.setStorageClusterSettings(subject, settings);
        LookupUtil.getStorageNodeManager().scheduleSnapshotManagement(subject, clusterSettings);

    }
View Full Code Here

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

        LookupUtil.getStorageNodeManager().scheduleSnapshotManagement(subject, clusterSettings);

    }

    private void updateStorageClusterCredentials(StorageClusterSettings newClusterSettings) {
        SystemSettings currentSettings = systemManager.getUnmaskedSystemSettings(true);
        String currentPassword = currentSettings.get(SystemSetting.STORAGE_PASSWORD);

        if (!currentPassword.equals(newClusterSettings.getPasswordHash())) {
            StorageSession session = this.storageClienManager.getSession();
            session.execute(String.format(UPDATE_PASSWORD_QUERY, currentSettings.get(SystemSetting.STORAGE_USERNAME),
                newClusterSettings.getPasswordHash()));
        }
    }
View Full Code Here

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

        if (!initialized) {
            LOG.debug("Storage client subsystem not initialized. Skipping session refresh.");
            return false;
        }

        SystemSettings settings = systemManager.getObfuscatedSystemSettings(true);
        String username = settings.get(SystemSetting.STORAGE_USERNAME);
        String password = settings.get(SystemSetting.STORAGE_PASSWORD);

        if ((username != null && !username.equals(this.cachedStorageUsername))
            || (password != null && !password.equals(this.cachedStoragePassword))) {

            Session wrappedSession;
View Full Code Here

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

    private Session createSession() {
        // Always get the creds from the DB, system props may not be up to date at install time
        // the code assumes the passwords to be obfuscated, because they can also come that way from other sources
        // (like property files). So let's make our lives easy and always use obfuscated passwords.
        SystemSettings settings = systemManager.getObfuscatedSystemSettings(true);
        this.cachedStorageUsername = settings.get(SystemSetting.STORAGE_USERNAME);
        this.cachedStoragePassword = settings.get(SystemSetting.STORAGE_PASSWORD);

        List<StorageNode> storageNodes = new ArrayList<StorageNode>();
        for (StorageNode storageNode : storageNodeManager.getStorageNodes()) {
            // We only want clustered nodes here because we won't be able to connect to
            // node that is not part of the cluster. The filtering here on the operation
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.