Examples of ConfigurationVO


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 (keystoreFile.exists()) { // and dbExisted
                // Check if they are the same one, otherwise override with local keystore
                String base64Keystore = getBase64Keystore(keystorePath);
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

    @Override
    @Before
    public void setUp() {
      ComponentContext.initComponentsLifeCycle();
     
        ConfigurationVO configVO = new ConfigurationVO("200", "200","200","200","200","200");
        Mockito.when(configDao.findByName(Mockito.anyString())).thenReturn(configVO);
       
        Mockito.when(offDao.persist(Mockito.any(NetworkOfferingVO.class))).thenReturn(new NetworkOfferingVO());
        Mockito.when(offDao.persist(Mockito.any(NetworkOfferingVO.class), Mockito.anyMap())).thenReturn(new NetworkOfferingVO());
        Mockito.when(mapDao.persist(Mockito.any(NetworkOfferingServiceMapVO.class))).thenReturn(new NetworkOfferingServiceMapVO());
View Full Code Here

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

        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.opencustomer.db.vo.system.ConfigurationVO

    private ConfigurationUtil() {
    }

    public static String getStringValue(ConfigurationKey key, List<ConfigurationVO> configurations) {
        ConfigurationVO vo = getConfiguration(key, configurations);
       
        if(vo.getValue() == null)
            if(key.getDefaultValue() == null)
                return null;
            else
                return (String)key.getDefaultValue();
        else
            return vo.getValue();
    }
View Full Code Here

Examples of org.opencustomer.db.vo.system.ConfigurationVO

        else
            return vo.getValue();
    }

    public static int getIntValue(ConfigurationKey key, List<ConfigurationVO> configurations) {
        ConfigurationVO vo = getConfiguration(key, configurations);
       
        if(vo.getValue() == null) {
            if(key.getDefaultValue() == null)
                return 0;
            else
                return (Integer)key.getDefaultValue();
        } else
            return Integer.parseInt(vo.getValue());
    }
View Full Code Here

Examples of org.opencustomer.db.vo.system.ConfigurationVO

        } else
            return Integer.parseInt(vo.getValue());
    }

    public static boolean getBooleanValue(ConfigurationKey key, List<ConfigurationVO> configurations) {
        ConfigurationVO vo = getConfiguration(key, configurations);
       
        if(vo.getValue() == null) {
            if(key.getDefaultValue() == null)
                return false;
            else
                return (Boolean)key.getDefaultValue();
        } else
            return Boolean.parseBoolean(vo.getValue());
    }
View Full Code Here

Examples of org.opencustomer.db.vo.system.ConfigurationVO

        } else
            return Boolean.parseBoolean(vo.getValue());
    }
   
    public static ConfigurationVO getConfiguration(ConfigurationKey key, List<ConfigurationVO> configurations) {
        ConfigurationVO configuration = null;
       
        for(ConfigurationVO vo : configurations) {
            if(key.toString().equals(vo.getKey())) {
                configuration = vo;
            }       
        }
       
        if(configuration == null) {
            configuration = new ConfigurationVO();
            configuration.setKey(key.toString());
            if(key.getDefaultValue() != null)
                configuration.setValue(String.valueOf(key.getDefaultValue()));
           
            configurations.add(configuration);
        }
       
        return configuration;
View Full Code Here

Examples of org.opencustomer.db.vo.system.ConfigurationVO

        try {
            HibernateContext.beginTransaction();
           
            ConfigurationDAO dao = new ConfigurationDAO();
            while(configurations.hasNext()) {
                ConfigurationVO configuration = configurations.next();
               
                if (configuration.getId() == null) {
                    if(configuration.getValue() != null) {
                        if (log.isDebugEnabled())
                            log.debug("create configuration");

                        dao.insert(configuration, user);
                    }
                } else {
                    if(configuration.getValue() != null) {
                        if (log.isDebugEnabled())
                            log.debug("save configuration (ID:" + configuration.getId() + ")");
                       
                        dao.update(configuration, user);
                    } else {
                        if (log.isDebugEnabled())
                            log.debug("delete configuration (ID:" + configuration.getId() + ")");
                       
                        dao.delete(configuration);
                        configurations.remove();
                    }
                }
View Full Code Here

Examples of org.opencustomer.db.vo.system.ConfigurationVO

    @Override
    public void readForm(PageLdapForm form, ActionMessages errors, HttpServletRequest request) {
        List<ConfigurationVO> configurations = (List<ConfigurationVO>)getPanel().getAttribute("configurations");

        ConfigurationVO authenticationEnabled = ConfigurationUtil.getConfiguration(SystemConfiguration.Key.LDAP_AUTHENTICATION_ENABLED, configurations);
        authenticationEnabled.setValue(String.valueOf(form.isAuthenticationEnabled()));
       
        ConfigurationVO addressExportEnabled = ConfigurationUtil.getConfiguration(SystemConfiguration.Key.LDAP_ADDRESS_EXPORT_ENABLED, configurations);
        addressExportEnabled.setValue(String.valueOf(form.isAddressExportEnabled()));
       
        ConfigurationVO addressInitalExport = ConfigurationUtil.getConfiguration(SystemConfiguration.Key.LDAP_ADDRESS_INITIAL_EXPORT, configurations);
        addressInitalExport.setValue(String.valueOf(form.isAddressInitialExport()));
       
        ConfigurationVO server = ConfigurationUtil.getConfiguration(SystemConfiguration.Key.LDAP_SERVER, configurations);
        server.setValue(form.getServer());
       
        ConfigurationVO port = ConfigurationUtil.getConfiguration(SystemConfiguration.Key.LDAP_PORT, configurations);
        port.setValue(form.getPort());
       
        ConfigurationVO adminUser = ConfigurationUtil.getConfiguration(SystemConfiguration.Key.LDAP_ADMIN_USER, configurations);
        adminUser.setValue(form.getAdminUser());

        ConfigurationVO adminPassword = ConfigurationUtil.getConfiguration(SystemConfiguration.Key.LDAP_ADMIN_PASSWORD, configurations);
        adminPassword.setValue(form.getAdminPassword());

        ConfigurationVO baseDn = ConfigurationUtil.getConfiguration(SystemConfiguration.Key.LDAP_BASE_DN, configurations);
        baseDn.setValue(form.getBaseDn());

        ConfigurationVO addressPrefix = ConfigurationUtil.getConfiguration(SystemConfiguration.Key.LDAP_ADDRESS_PREFIX, configurations);
        addressPrefix.setValue(form.getAddressPrefix());

        ConfigurationVO addressCompanyPrefix = ConfigurationUtil.getConfiguration(SystemConfiguration.Key.LDAP_ADDRESS_COMPANY_PREFIX, configurations);
        addressCompanyPrefix.setValue(form.getAddressCompanyPrefix());

        ConfigurationVO addressPersonPrefix = ConfigurationUtil.getConfiguration(SystemConfiguration.Key.LDAP_ADDRESS_PERSON_PREFIX, configurations);
        addressPersonPrefix.setValue(form.getAddressPersonPrefix());

        ConfigurationVO userPrefix = ConfigurationUtil.getConfiguration(SystemConfiguration.Key.LDAP_USER_PREFIX, configurations);
        userPrefix.setValue(form.getUserPrefix());

        ConfigurationVO groupPrefix = ConfigurationUtil.getConfiguration(SystemConfiguration.Key.LDAP_GROUP_PREFIX, configurations);
        groupPrefix.setValue(form.getGroupPrefix());

        ConfigurationVO systemUser = ConfigurationUtil.getConfiguration(SystemConfiguration.Key.LDAP_SYSTEM_USER, configurations);
        systemUser.setValue(form.getSystemUser());
    }
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.