Search in sources :

Example 6 with GetConfigurationValueParameters

use of org.ovirt.engine.core.common.queries.GetConfigurationValueParameters in project ovirt-engine by oVirt.

the class AsyncDataProvider method getNetworkConnectivityCheckTimeoutInSeconds.

public void getNetworkConnectivityCheckTimeoutInSeconds(AsyncQuery<Integer> aQuery) {
    aQuery.converterCallback = new DefaultValueConverter<>(120);
    getConfigFromCache(new GetConfigurationValueParameters(ConfigValues.NetworkConnectivityCheckTimeoutInSeconds, getDefaultConfigurationVersion()), aQuery);
}
Also used : GetConfigurationValueParameters(org.ovirt.engine.core.common.queries.GetConfigurationValueParameters)

Example 7 with GetConfigurationValueParameters

use of org.ovirt.engine.core.common.queries.GetConfigurationValueParameters in project ovirt-engine by oVirt.

the class AsyncDataProvider method getMaxNumOfVmCpus.

public void getMaxNumOfVmCpus(AsyncQuery<Integer> aQuery, String version) {
    aQuery.converterCallback = new DefaultValueConverter<>(1);
    GetConfigurationValueParameters tempVar = new GetConfigurationValueParameters(ConfigValues.MaxNumOfVmCpus);
    tempVar.setVersion(version);
    getConfigFromCache(tempVar, aQuery);
}
Also used : GetConfigurationValueParameters(org.ovirt.engine.core.common.queries.GetConfigurationValueParameters)

Example 8 with GetConfigurationValueParameters

use of org.ovirt.engine.core.common.queries.GetConfigurationValueParameters in project ovirt-engine by oVirt.

the class AsyncDataProvider method getMaxNumOfThreadsPerCpu.

public void getMaxNumOfThreadsPerCpu(AsyncQuery<Integer> aQuery, String version) {
    aQuery.converterCallback = new DefaultValueConverter<>(1);
    GetConfigurationValueParameters tempVar = new GetConfigurationValueParameters(ConfigValues.MaxNumOfThreadsPerCpu);
    tempVar.setVersion(version);
    getConfigFromCache(tempVar, aQuery);
}
Also used : GetConfigurationValueParameters(org.ovirt.engine.core.common.queries.GetConfigurationValueParameters)

Example 9 with GetConfigurationValueParameters

use of org.ovirt.engine.core.common.queries.GetConfigurationValueParameters in project ovirt-engine by oVirt.

the class AsyncDataProvider method getWANDisableEffects.

public void getWANDisableEffects(AsyncQuery<List<WanDisableEffects>> aQuery) {
    aQuery.converterCallback = source -> {
        if (source == null) {
            return new ArrayList<>();
        }
        List<WanDisableEffects> res = new ArrayList<>();
        String fromDb = (String) source;
        for (String value : fromDb.split(",")) {
            // $NON-NLS-1$
            if (value == null) {
                continue;
            }
            String trimmedValue = value.trim();
            if ("".equals(trimmedValue)) {
                continue;
            }
            res.add(WanDisableEffects.fromString(trimmedValue));
        }
        return res;
    };
    getConfigFromCache(new GetConfigurationValueParameters(ConfigValues.WANDisableEffects, getDefaultConfigurationVersion()), aQuery);
}
Also used : WanDisableEffects(org.ovirt.engine.core.common.console.ConsoleOptions.WanDisableEffects) GetConfigurationValueParameters(org.ovirt.engine.core.common.queries.GetConfigurationValueParameters) ArrayList(java.util.ArrayList)

Example 10 with GetConfigurationValueParameters

use of org.ovirt.engine.core.common.queries.GetConfigurationValueParameters in project ovirt-engine by oVirt.

the class HostGlusterStorageDevicesListModel method createBrick.

private void createBrick() {
    if (getWindow() != null) {
        return;
    }
    VDS host = getEntity();
    if (host == null) {
        return;
    }
    final CreateBrickModel lvModel = new CreateBrickModel();
    lvModel.setTitle(ConstantsManager.getInstance().getConstants().createBrick());
    lvModel.setHelpTag(HelpTag.create_brick);
    // $NON-NLS-1$
    lvModel.setHashName("create_brick");
    lvModel.startProgress(ConstantsManager.getInstance().getConstants().fetchingDataMessage());
    setWindow(lvModel);
    lvModel.getRaidTypeList().setSelectedItem(RaidType.RAID6);
    List<StorageDevice> selectedDevices = getSelectedItems();
    lvModel.getStorageDevices().setItems(selectedDevices);
    lvModel.setSelectedDevices(selectedDevices);
    AsyncQuery<String> asyncQueryForDefaultMountPoint = lvModel.asyncQuery(defaultMountPoint -> {
        lvModel.stopProgress();
        lvModel.getDefaultMountFolder().setEntity(defaultMountPoint);
    });
    AsyncDataProvider.getInstance().getConfigFromCache(new GetConfigurationValueParameters(ConfigValues.GlusterDefaultBrickMountPoint, AsyncDataProvider.getInstance().getDefaultConfigurationVersion()), asyncQueryForDefaultMountPoint);
    AsyncDataProvider.getInstance().getStorageDevices(new AsyncQuery<>(returnValue -> {
        if (returnValue != null) {
            List<StorageDevice> storageDeviceList = new ArrayList<>();
            // $NON-NLS-1$
            storageDeviceList.add(null);
            for (StorageDevice storagedevice : returnValue) {
                if (storagedevice.getCanCreateBrick() && !selectedDevices.contains(storagedevice)) {
                    storageDeviceList.add(storagedevice);
                }
            }
            lvModel.getCacheDevicePathTypeList().setItems(storageDeviceList);
        }
    }), host.getId());
    // $NON-NLS-1$
    UICommand okCommand = UICommand.createDefaultOkUiCommand("onCreateBrick", this);
    lvModel.getCommands().add(okCommand);
    // $NON-NLS-1$
    UICommand cancelCommand = UICommand.createCancelUiCommand("closeWindow", this);
    lvModel.getCommands().add(cancelCommand);
}
Also used : Linq(org.ovirt.engine.ui.uicommonweb.Linq) CreateBrickParameters(org.ovirt.engine.core.common.action.gluster.CreateBrickParameters) UICommand(org.ovirt.engine.ui.uicommonweb.UICommand) HelpTag(org.ovirt.engine.ui.uicommonweb.help.HelpTag) RaidType(org.ovirt.engine.core.common.businessentities.RaidType) ConfigValues(org.ovirt.engine.core.common.config.ConfigValues) SyncGlusterStorageDevicesParameter(org.ovirt.engine.core.common.action.gluster.SyncGlusterStorageDevicesParameter) ApplicationMode(org.ovirt.engine.core.common.mode.ApplicationMode) ActionReturnValue(org.ovirt.engine.core.common.action.ActionReturnValue) SearchableListModel(org.ovirt.engine.ui.uicommonweb.models.SearchableListModel) ArrayList(java.util.ArrayList) ActionType(org.ovirt.engine.core.common.action.ActionType) Frontend(org.ovirt.engine.ui.frontend.Frontend) List(java.util.List) VDSStatus(org.ovirt.engine.core.common.businessentities.VDSStatus) GetConfigurationValueParameters(org.ovirt.engine.core.common.queries.GetConfigurationValueParameters) StorageDevice(org.ovirt.engine.core.common.businessentities.gluster.StorageDevice) ConstantsManager(org.ovirt.engine.ui.uicompat.ConstantsManager) Collections(java.util.Collections) VDS(org.ovirt.engine.core.common.businessentities.VDS) AsyncDataProvider(org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider) PropertyChangedEventArgs(org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs) VDS(org.ovirt.engine.core.common.businessentities.VDS) StorageDevice(org.ovirt.engine.core.common.businessentities.gluster.StorageDevice) GetConfigurationValueParameters(org.ovirt.engine.core.common.queries.GetConfigurationValueParameters) ArrayList(java.util.ArrayList) List(java.util.List) UICommand(org.ovirt.engine.ui.uicommonweb.UICommand)

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