if (scope != null && !scope.isEmpty() && !ConfigKey.Scope.Global.toString().equalsIgnoreCase(scope)) { switch (ConfigKey.Scope.valueOf(scope)) { case Zone:
scope = ConfigKey.Scope.Zone.toString(); id = zoneId; paramCountCheck++; scope = ConfigKey.Scope.Cluster.toString(); id = clusterId; paramCountCheck++; scope = ConfigKey.Scope.Account.toString(); id = accountId; paramCountCheck++; scope = ConfigKey.Scope.Domain.toString(); id = domainId; paramCountCheck++; scope = ConfigKey.Scope.StoragePool.toString(); id = storagepoolId; paramCountCheck++; scope = ConfigKey.Scope.ImageStore.toString(); id = imageStoreId; paramCountCheck++;
scope = ConfigKey.Scope.Zone.toString(); id = zoneId; paramCountCheck++; scope = ConfigKey.Scope.Cluster.toString(); id = clusterId; paramCountCheck++; scope = ConfigKey.Scope.Account.toString(); id = accountId; paramCountCheck++; scope = ConfigKey.Scope.Domain.toString(); id = domainId; paramCountCheck++; scope = ConfigKey.Scope.StoragePool.toString(); id = storagepoolId; paramCountCheck++; scope = ConfigKey.Scope.ImageStore.toString(); id = imageStoreId; paramCountCheck++;
private void createOrupdateConfigObject(Date date, String componentName, ConfigKey<?> key, String value) { ConfigurationVO vo = _configDao.findById(key.key()); if (vo == null) { vo = new ConfigurationVO(componentName, key); vo.setUpdated(date); if (value != null) { vo.setValue(value); } _configDao.persist(vo); } else { if (vo.isDynamic() != key.isDynamic() || !ObjectUtils.equals(vo.getDescription(), key.description()) || !ObjectUtils.equals(vo.getDefaultValue(), key.defaultValue()) || !ObjectUtils.equals(vo.getScope(), key.scope().toString()) || !ObjectUtils.equals(vo.getComponent(), componentName)) { vo.setDynamic(key.isDynamic()); vo.setDescription(key.description()); vo.setDefaultValue(key.defaultValue()); vo.setScope(key.scope().toString()); vo.setComponent(componentName); vo.setUpdated(date); _configDao.persist(vo); } } }
public ConfigurationVO(String component, ConfigKey<?> key) { this(key.category(), "DEFAULT", component, key.key(), key.defaultValue(), key.description()); defaultValue = key.defaultValue(); dynamic = key.isDynamic(); scope = key.scope() != null ? key.scope().toString() : null; }
private Config(String category, Class<?> componentClass, Class<?> type, String name, String defaultValue, String description, String range) { _category = category; _componentClass = componentClass; _type = type; _name = name; _defaultValue = defaultValue; _description = description; _range = range; _scope = ConfigKey.Scope.Global.toString(); }