use of org.ovirt.engine.core.common.queries.GetConfigurationValueParameters in project ovirt-engine by oVirt.
the class GetConfigurationValueQuery method executeQueryCommand.
@Override
protected void executeQueryCommand() {
Object returnValue = null;
if (shouldReturnValue()) {
try {
final GetConfigurationValueParameters params = getParameters();
final ConfigValues value = params.getConfigValue();
String version = params.getVersion();
if (version == null) {
log.warn("calling {} ({}) with null version, using default {} for version", GetConfigurationValueQuery.class.getSimpleName(), value, ConfigCommon.defaultConfigurationVersion);
version = ConfigCommon.defaultConfigurationVersion;
}
returnValue = Config.getValue(value, version);
} catch (Exception e) {
log.error("Unable to return config parameter {}: {}", getParameters(), e.getMessage());
log.debug("Exception", e);
}
}
getQueryReturnValue().setReturnValue(returnValue);
}
use of org.ovirt.engine.core.common.queries.GetConfigurationValueParameters in project ovirt-engine by oVirt.
the class GetFenceConfigurationValueQuery method executeQueryCommand.
@Override
protected void executeQueryCommand() {
if (shouldReturnValue()) {
try {
final GetConfigurationValueParameters params = getParameters();
final ConfigValues value = params.getConfigValue();
String version = params.getVersion();
if (version == null) {
log.warn("calling {} ({}) with null version, using default {} for version", GetConfigurationValueQuery.class.getSimpleName(), ConfigCommon.defaultConfigurationVersion, value);
version = ConfigCommon.defaultConfigurationVersion;
}
getQueryReturnValue().setReturnValue(FenceConfigHelper.getFenceConfigurationValue(getParameters().getConfigValue().toString(), version));
} catch (Exception e) {
log.error("Unable to return config parameter {}: {}", getParameters(), e.getMessage());
log.debug("Exception", e);
}
}
}
use of org.ovirt.engine.core.common.queries.GetConfigurationValueParameters in project ovirt-engine by oVirt.
the class AsyncDataProvider method getMaxVmsInPool.
public void getMaxVmsInPool(AsyncQuery<Integer> aQuery) {
aQuery.converterCallback = new DefaultValueConverter<>(1000);
getConfigFromCache(new GetConfigurationValueParameters(ConfigValues.MaxVmsInPool, getDefaultConfigurationVersion()), aQuery);
}
use of org.ovirt.engine.core.common.queries.GetConfigurationValueParameters in project ovirt-engine by oVirt.
the class AsyncDataProvider method getDataCenterMaxNameLength.
public void getDataCenterMaxNameLength(AsyncQuery<Integer> aQuery) {
aQuery.converterCallback = new DefaultValueConverter<>(1);
getConfigFromCache(new GetConfigurationValueParameters(ConfigValues.StoragePoolNameSizeLimit, getDefaultConfigurationVersion()), aQuery);
}
use of org.ovirt.engine.core.common.queries.GetConfigurationValueParameters in project ovirt-engine by oVirt.
the class AsyncDataProvider method getMaxVmPriority.
public void getMaxVmPriority(AsyncQuery<Integer> aQuery) {
aQuery.converterCallback = new DefaultValueConverter<>(100);
getConfigFromCache(new GetConfigurationValueParameters(ConfigValues.VmPriorityMaxValue, getDefaultConfigurationVersion()), aQuery);
}
Aggregations