Search in sources :

Example 11 with GetConfigurationValueParameters

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);
}
Also used : GetConfigurationValueParameters(org.ovirt.engine.core.common.queries.GetConfigurationValueParameters) ConfigValues(org.ovirt.engine.core.common.config.ConfigValues)

Example 12 with GetConfigurationValueParameters

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);
        }
    }
}
Also used : GetConfigurationValueParameters(org.ovirt.engine.core.common.queries.GetConfigurationValueParameters) ConfigValues(org.ovirt.engine.core.common.config.ConfigValues)

Example 13 with GetConfigurationValueParameters

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);
}
Also used : GetConfigurationValueParameters(org.ovirt.engine.core.common.queries.GetConfigurationValueParameters)

Example 14 with GetConfigurationValueParameters

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);
}
Also used : GetConfigurationValueParameters(org.ovirt.engine.core.common.queries.GetConfigurationValueParameters)

Example 15 with GetConfigurationValueParameters

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);
}
Also used : GetConfigurationValueParameters(org.ovirt.engine.core.common.queries.GetConfigurationValueParameters)

Aggregations

GetConfigurationValueParameters (org.ovirt.engine.core.common.queries.GetConfigurationValueParameters)25 ArrayList (java.util.ArrayList)4 ConfigValues (org.ovirt.engine.core.common.config.ConfigValues)3 ServletException (javax.servlet.ServletException)2 QueryReturnValue (org.ovirt.engine.core.common.queries.QueryReturnValue)2 IOException (java.io.IOException)1 MalformedURLException (java.net.MalformedURLException)1 Collections (java.util.Collections)1 Iterator (java.util.Iterator)1 List (java.util.List)1 Locale (java.util.Locale)1 RequestDispatcher (javax.servlet.RequestDispatcher)1 ActionReturnValue (org.ovirt.engine.core.common.action.ActionReturnValue)1 ActionType (org.ovirt.engine.core.common.action.ActionType)1 CreateBrickParameters (org.ovirt.engine.core.common.action.gluster.CreateBrickParameters)1 SyncGlusterStorageDevicesParameter (org.ovirt.engine.core.common.action.gluster.SyncGlusterStorageDevicesParameter)1 RaidType (org.ovirt.engine.core.common.businessentities.RaidType)1 VDS (org.ovirt.engine.core.common.businessentities.VDS)1 VDSStatus (org.ovirt.engine.core.common.businessentities.VDSStatus)1 StorageDevice (org.ovirt.engine.core.common.businessentities.gluster.StorageDevice)1