Examples of Systemsettings


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

    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

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

            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

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

    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

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

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

    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

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

                }

                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

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

        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

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

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

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

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

            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
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.