Search in sources :

Example 1 with VmWatchdogType

use of org.ovirt.engine.core.common.businessentities.VmWatchdogType in project ovirt-engine by oVirt.

the class InstanceTypeListModel method setVmWatchdogToParams.

private void setVmWatchdogToParams(final UnitVmModel model, VmTemplateManagementParameters updateVmParams) {
    VmWatchdogType wdModel = model.getWatchdogModel().getSelectedItem();
    updateVmParams.setUpdateWatchdog(true);
    if (wdModel != null) {
        VmWatchdog vmWatchdog = new VmWatchdog();
        vmWatchdog.setAction(model.getWatchdogAction().getSelectedItem());
        vmWatchdog.setModel(wdModel);
        updateVmParams.setWatchdog(vmWatchdog);
    }
}
Also used : VmWatchdogType(org.ovirt.engine.core.common.businessentities.VmWatchdogType) VmWatchdog(org.ovirt.engine.core.common.businessentities.VmWatchdog)

Example 2 with VmWatchdogType

use of org.ovirt.engine.core.common.businessentities.VmWatchdogType in project ovirt-engine by oVirt.

the class TemplateListModel method setVmWatchdogToParams.

private void setVmWatchdogToParams(final UnitVmModel model, UpdateVmTemplateParameters updateVmParams) {
    VmWatchdogType wdModel = model.getWatchdogModel().getSelectedItem();
    updateVmParams.setUpdateWatchdog(true);
    if (wdModel != null) {
        VmWatchdog vmWatchdog = new VmWatchdog();
        vmWatchdog.setAction(model.getWatchdogAction().getSelectedItem());
        vmWatchdog.setModel(wdModel);
        updateVmParams.setWatchdog(vmWatchdog);
    }
}
Also used : VmWatchdogType(org.ovirt.engine.core.common.businessentities.VmWatchdogType) VmWatchdog(org.ovirt.engine.core.common.businessentities.VmWatchdog)

Example 3 with VmWatchdogType

use of org.ovirt.engine.core.common.businessentities.VmWatchdogType in project ovirt-engine by oVirt.

the class WatchdogMapperTest method mapModel.

@Test
public void mapModel() {
    for (WatchdogModel model : WatchdogModel.values()) {
        VmWatchdogType backendModel = WatchdogMapper.map(model);
        assertNotNull(backendModel);
        assertEquals(backendModel.name().toLowerCase(), model.name().toLowerCase());
    }
}
Also used : WatchdogModel(org.ovirt.engine.api.model.WatchdogModel) VmWatchdogType(org.ovirt.engine.core.common.businessentities.VmWatchdogType) Test(org.junit.Test)

Example 4 with VmWatchdogType

use of org.ovirt.engine.core.common.businessentities.VmWatchdogType in project ovirt-engine by oVirt.

the class VmBaseListModel method setVmWatchdogToParams.

protected void setVmWatchdogToParams(final UnitVmModel model, VmManagementParametersBase updateVmParams) {
    VmWatchdogType wdModel = model.getWatchdogModel().getSelectedItem();
    updateVmParams.setUpdateWatchdog(true);
    if (wdModel != null) {
        VmWatchdog vmWatchdog = new VmWatchdog();
        vmWatchdog.setAction(model.getWatchdogAction().getSelectedItem());
        vmWatchdog.setModel(wdModel);
        updateVmParams.setWatchdog(vmWatchdog);
    }
}
Also used : VmWatchdogType(org.ovirt.engine.core.common.businessentities.VmWatchdogType) VmWatchdog(org.ovirt.engine.core.common.businessentities.VmWatchdog)

Example 5 with VmWatchdogType

use of org.ovirt.engine.core.common.businessentities.VmWatchdogType in project ovirt-engine by oVirt.

the class WatchdogMapperTest method mapBackendModel.

@Test
public void mapBackendModel() {
    for (VmWatchdogType type : VmWatchdogType.values()) {
        WatchdogModel model = WatchdogMapper.map(type);
        assertNotNull(model);
        assertEquals(model.name().toLowerCase(), type.name().toLowerCase());
    }
}
Also used : WatchdogModel(org.ovirt.engine.api.model.WatchdogModel) VmWatchdogType(org.ovirt.engine.core.common.businessentities.VmWatchdogType) Test(org.junit.Test)

Aggregations

VmWatchdogType (org.ovirt.engine.core.common.businessentities.VmWatchdogType)6 VmWatchdog (org.ovirt.engine.core.common.businessentities.VmWatchdog)3 Test (org.junit.Test)2 WatchdogModel (org.ovirt.engine.api.model.WatchdogModel)2 ArrayList (java.util.ArrayList)1