Examples of ConfigurationVO


Examples of org.apache.cloudstack.framework.config.impl.ConfigurationVO

        Long clusterId = cmd.getClusterId();
        Long storagepoolId = cmd.getStoragepoolId();
        Long accountId = cmd.getAccountId();
        CallContext.current().setEventDetails(" Name: " + name + " New Value: " + (((name.toLowerCase()).contains("password")) ? "*****" : (((value == null) ? "" : value))));
        // check if config value exists
        ConfigurationVO config = _configDao.findByName(name);
        String catergory = null;

        // FIX ME - All configuration parameters are not moved from config.java to configKey
        if (config == null) {
            if (_configDepot.get(name) == null) {
                s_logger.warn("Probably the component manager where configuration variable " + name + " is defined needs to implement Configurable interface");
            throw new InvalidParameterValueException("Config parameter with name " + name + " doesn't exist");
        }
            catergory = _configDepot.get(name).category();
        } else {
            catergory = config.getCategory();
        }

        if (value == null) {
            return _configDao.findByName(name);
        }
View Full Code Here

Examples of org.apache.cloudstack.framework.config.impl.ConfigurationVO

        }
    }

    private String validateConfigurationValue(String name, String value, String scope) {

        ConfigurationVO cfg = _configDao.findByName(name);
        if (cfg == null) {
            s_logger.error("Missing configuration variable " + name + " in configuration table");
            return "Invalid configuration variable.";
        }

        String configScope = cfg.getScope();
        if (scope != null) {
            if (!configScope.contains(scope)) {
                s_logger.error("Invalid scope id provided for the parameter " + name);
                return "Invalid scope id provided for the parameter " + name;
            }
View Full Code Here

Examples of org.apache.cloudstack.framework.config.impl.ConfigurationVO

                    String instance = "DEFAULT";
                    String component = c.getComponent();
                    String value = c.getDefaultValue();
                    value = ("Hidden".equals(category) || "Secure".equals(category)) ? DBEncryptionUtil.encrypt(value) : value;
                    String description = c.getDescription();
                    ConfigurationVO configVO = new ConfigurationVO(category, instance, component, name, value, description);
                    _configDao.persist(configVO);
                }
            }

            _configDao.update(Config.UseSecondaryStorageVm.key(), Config.UseSecondaryStorageVm.getCategory(), "true");
View Full Code Here

Examples of org.apache.cloudstack.framework.config.impl.ConfigurationVO

                if (!keystoreFile.exists()) {
                    generateDefaultKeystore(keystorePath);
                    s_logger.info("Generated SSL keystore.");
                }
                String base64Keystore = getBase64Keystore(keystorePath);
                ConfigurationVO configVO =
                        new ConfigurationVO("Hidden", "DEFAULT", "management-server", "ssl.keystore", DBEncryptionUtil.encrypt(base64Keystore),
                                "SSL Keystore for the management servers");
                _configDao.persist(configVO);
                s_logger.info("Stored SSL keystore to database.");
            } else if (null != keystoreFile && keystoreFile.exists()) { // and dbExisted
                // Check if they are the same one, otherwise override with local keystore
View Full Code Here

Examples of org.apache.cloudstack.framework.config.impl.ConfigurationVO

        // Getting the list of parameters defined at the scope
        Set<ConfigKey<?>> configList = _configDepot.getConfigListByScope(scope);
        List<ConfigurationVO> configVOList = new ArrayList<ConfigurationVO>();
        for (ConfigKey<?> param : configList) {
            ConfigurationVO configVo = _configDao.findByName(param.toString());
            configVo.setValue(_configDepot.get(param.toString()).valueIn(resourceId).toString());
            configVOList.add(configVo);
        }
        return configVOList;
    }
View Full Code Here

Examples of org.apache.cloudstack.framework.config.impl.ConfigurationVO

        _depotAdmin._scopedStorages.add(_scopedStorage);
    }

    @Test
    public void testAutoPopulation() {
        ConfigurationVO dynamicIntCV = new ConfigurationVO("UnitTestComponent", DynamicIntCK);
        dynamicIntCV.setValue("100");
        ConfigurationVO staticIntCV = new ConfigurationVO("UnitTestComponent", StaticIntCK);
        dynamicIntCV.setValue("200");
       
        when(_configurable.getConfigComponentName()).thenReturn("UnitTestComponent");
        when(_configurable.getConfigKeys()).thenReturn(new ConfigKey<?>[] {DynamicIntCK, StaticIntCK});
        when(_configDao.findById(StaticIntCK.key())).thenReturn(null);
View Full Code Here

Examples of org.apache.cloudstack.framework.config.impl.ConfigurationVO

         * There is no query filter now. It is derived from ldap.user.object and ldap.search.group.principle
         */
//        ConfigurationVO cvo = _configDao.findByName(LDAPParams.queryfilter.toString());
//        _configDao.update(cvo.getName(),cvo.getCategory(),getQueryFilter());

        ConfigurationVO cvo = _configDao.findByName("ldap.basedn");
        _configDao.update(cvo.getName(), cvo.getCategory(), getSearchBase());

        /**
         * There is no ssl now. it is derived from the presence of trust store and password
         */
//        cvo = _configDao.findByName(LDAPParams.usessl.toString());
//        _configDao.update(cvo.getName(),cvo.getCategory(),getUseSSL().toString());

        cvo = _configDao.findByName("ldap.bind.principal");
        _configDao.update(cvo.getName(), cvo.getCategory(), getBindDN());

        cvo = _configDao.findByName("ldap.bind.password");
        _configDao.update(cvo.getName(), cvo.getCategory(), getBindPassword());

        cvo = _configDao.findByName("ldap.truststore");
        _configDao.update(cvo.getName(), cvo.getCategory(), getTrustStore());

        cvo = _configDao.findByName("ldap.truststore.password");
        _configDao.update(cvo.getName(), cvo.getCategory(), getTrustStorePassword());

        return true;
    }
View Full Code Here

Examples of org.apache.cloudstack.framework.config.impl.ConfigurationVO

        throw new CloudRuntimeException("Comparing ConfigKey to " + obj.toString());
    }

    public T value() {
        if (_value == null || isDynamic()) {
            ConfigurationVO vo = s_depot != null ? s_depot.global().findById(key()) : null;
            _value = valueOf(vo != null ? vo.getValue() : defaultValue());
        }

        return _value;
    }
View Full Code Here

Examples of org.apache.cloudstack.framework.config.impl.ConfigurationVO

    StoragePoolVO storage = null;

    @Before
    @DB
    public void setup() throws Exception {
        ConfigurationVO cfg = configDao.findByName(Config.VmAllocationAlgorithm.key());
        if (cfg == null) {
            ConfigurationVO configVO = new ConfigurationVO("test", "DEFAULT", "test", Config.VmAllocationAlgorithm.key(), "userdispersing", null);
            configDao.persist(configVO);
        }
        ComponentContext.initComponentsLifeCycle();

    }
View Full Code Here

Examples of org.apache.cloudstack.framework.config.impl.ConfigurationVO

        if (scope != null && !scope.isEmpty()) {
            // Populate values corresponding the resource id
            List<ConfigurationVO> configVOList = new ArrayList<ConfigurationVO>();
            for (ConfigurationVO param: result.first()){
                ConfigurationVO configVo = _configDao.findByName(param.getName());
                configVo.setValue(_configDepot.get(param.getName()).valueIn(id).toString());
                configVOList.add(configVo);
            }

            return new Pair<List<? extends Configuration>, Integer>(configVOList, configVOList.size());
        }
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.