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

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


        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

    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

    private StorageClientManager storageClienManager;

    @Override
    @RequiredPermission(Permission.MANAGE_SETTINGS)
    public StorageClusterSettings getClusterSettings(Subject subject) {
        SystemSettings settings = systemManager.getUnmaskedSystemSettings(true);
        StorageClusterSettings clusterSettings = new StorageClusterSettings();

        if (!settings.containsKey(SystemSetting.STORAGE_CQL_PORT)) {
            return null;
        } else {
            clusterSettings.setCqlPort(Integer.parseInt(settings.get(
                SystemSetting.STORAGE_CQL_PORT)));
        }

        if (!settings.containsKey(SystemSetting.STORAGE_GOSSIP_PORT)) {
            return null;
        } else {
            clusterSettings.setGossipPort(Integer.parseInt(settings.get(
                SystemSetting.STORAGE_GOSSIP_PORT)));
        }
       
        if (!settings.containsKey(SystemSetting.STORAGE_AUTOMATIC_DEPLOYMENT)) {
            return null;
        } else {
            clusterSettings.setAutomaticDeployment(Boolean.parseBoolean(settings
                .get(SystemSetting.STORAGE_AUTOMATIC_DEPLOYMENT)));
        }
       
        if (!settings.containsKey(SystemSetting.STORAGE_USERNAME)) {
            return null;
        } else {
            clusterSettings.setUsername(settings.get(SystemSetting.STORAGE_USERNAME));
        }
       
        if (!settings.containsKey(SystemSetting.STORAGE_PASSWORD)) {
            return null;
        } else {
            clusterSettings.setPasswordHash(settings.get(SystemSetting.STORAGE_PASSWORD));
        }

        if (!settings.containsKey(SystemSetting.STORAGE_REGULAR_SNAPSHOTS)) {
            return null; // why?
        } else {
            RegularSnapshots rs = new RegularSnapshots();
            clusterSettings.setRegularSnapshots(rs);
            rs.setEnabled(Boolean.parseBoolean(settings.get(SystemSetting.STORAGE_REGULAR_SNAPSHOTS)));
            rs.setSchedule(settings.get(SystemSetting.STORAGE_REGULAR_SNAPSHOTS_SCHEDULE));
            rs.setRetention(settings.get(SystemSetting.STORAGE_REGULAR_SNAPSHOTS_RETENTION));
            rs.setCount(Integer.parseInt(settings.get(SystemSetting.STORAGE_REGULAR_SNAPSHOTS_RETENTION_COUNT)));
            rs.setDeletion(settings.get(SystemSetting.STORAGE_REGULAR_SNAPSHOTS_DELETION));
            rs.setLocation(settings.get(SystemSetting.STORAGE_REGULAR_SNAPSHOTS_DELETION_LOCATION));
        }
        return clusterSettings;
    }
View Full Code Here

            result.put("AS*", "Not able to get AS props due to " + e.getMessage());
        } finally {
            MCCHelper.safeClose(mcc);
        }

        SystemSettings systemSettings=systemManager.getSystemSettings(caller);
        Map<String,String> settingsMap = systemSettings.toMap();
        // Don't use putAll(), as we need to filter out passwords
        for (Map.Entry<String,String> detail : settingsMap.entrySet()) {
            String key = detail.getKey();
            if (key.equals(SystemSetting.LDAP_BIND_PW.getInternalName())
                || key.toLowerCase().contains("passw")
View Full Code Here

    private SSHInstallUtility getSSHConnection(RemoteAccessInfo remoteAccessInfo) {
        if (remoteAccessInfo.getHost() == null) {
            throw new RuntimeException("Enter a host");
        }

        SystemSettings settings = systemSettingsManager.getUnmaskedSystemSettings(false);
        String username = settings.get(SystemSetting.REMOTE_SSH_USERNAME_DEFAULT);
        String password = settings.get(SystemSetting.REMOTE_SSH_PASSWORD_DEFAULT);
        SSHInstallUtility.Credentials creds = null;
        if ((username != null && username.length() > 0) || (password != null && password.length() > 0)) {
            creds = new SSHInstallUtility.Credentials(username, password);
        }
View Full Code Here

     */
    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

    private final Log log = LogFactory.getLog(this.getClass());

    public void initialize(Configuration configuration) throws Exception {
        SystemManagerLocal systemManager = LookupUtil.getSystemManager();
        Subject overlord = LookupUtil.getSubjectManager().getOverlord();
        SystemSettings settings = systemManager.getSystemSettings(overlord);
        url = safeGetConfigurationProperty("url", configuration);

        if (url == null) {
            throw new IllegalArgumentException("url cannot be null");
        }

        PropertySimple activeProperty = configuration.getSimple("active");
        if (activeProperty != null)
            active = activeProperty.getBooleanValue();

        username = safeGetConfigurationProperty("username", configuration);
        password = safeGetConfigurationProperty("password", configuration);
        proxyUrl = safeGetConfigurationProperty("proxyUrl", configuration);
        proxyUsername = safeGetConfigurationProperty("proxyUsername", configuration);
        proxyPassword = safeGetConfigurationProperty("proxyPassword", configuration);

        String sProxyPort = safeGetConfigurationProperty("proxyPort", configuration);
        if (sProxyPort != null) {
            proxyPort = Integer.parseInt(sProxyPort);
        }

        // default to global HTTP Proxy settings
        if (proxyUrl == null) {
            proxyUrl = settings.get(SystemSetting.HTTP_PROXY_SERVER_HOST);
        }
        if (proxyUsername == null) {
            proxyUsername = settings.get(SystemSetting.HTTP_PROXY_SERVER_USERNAME);
        }
        if (proxyPassword == null) {
            proxyPassword = settings.get(SystemSetting.HTTP_PROXY_SERVER_PASSWORD);
        }
        if (sProxyPort == null) {
            sProxyPort = settings.get(SystemSetting.HTTP_PROXY_SERVER_PORT);
            if (sProxyPort != null) {
                proxyPort = Integer.parseInt(sProxyPort);
            }
        }
    }
View Full Code Here

                }

                props.put(simple.getName(), value);
            }

            SystemSettings settings = SystemSettings.fromMap(props);

            GWTServiceLookup.getSystemService().setSystemSettings(settings, new AsyncCallback<Void>() {
                @Override
                public void onSuccess(Void result) {
                    CoreGUI.getMessageCenter().notify(
View Full Code Here

        return;
    }

    private int getDownloadLimit() {
        // if the server cloud was configured to disallow updates, return 0
        SystemSettings systemConfig = LookupUtil.getSystemManager().getUnmaskedSystemSettings(true);
        if (!Boolean.parseBoolean(systemConfig.get(SystemSetting.AGENT_AUTO_UPDATE_ENABLED))) {
            return 0;
        }

        String limitStr = System.getProperty(SYSPROP_AGENT_DOWNLOADS_LIMIT);
        int limit;
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.