Search in sources :

Example 6 with ConsoleOptions

use of org.ovirt.engine.core.common.console.ConsoleOptions in project ovirt-engine by oVirt.

the class ConfigureConsoleOptionsQuery method executeCommandQueryUnchecked.

private void executeCommandQueryUnchecked() {
    ConsoleOptions options = getParameters().getOptions();
    fillCommonPart(options);
    // fill additional SPICE data
    if (options.getGraphicsType() == GraphicsType.SPICE) {
        fillSpice(options);
    }
    if (getQueryReturnValue().getSucceeded()) {
        setReturnValue(options);
    }
}
Also used : ConsoleOptions(org.ovirt.engine.core.common.console.ConsoleOptions)

Example 7 with ConsoleOptions

use of org.ovirt.engine.core.common.console.ConsoleOptions in project ovirt-engine by oVirt.

the class BackendVmGraphicsConsoleResource method generateDescriptorResponse.

private QueryReturnValue generateDescriptorResponse() throws Exception {
    org.ovirt.engine.core.common.businessentities.GraphicsType graphicsType = BackendGraphicsConsoleHelper.asGraphicsType(consoleId);
    ConsoleOptions consoleOptions = new ConsoleOptions(graphicsType);
    consoleOptions.setVmId(guid);
    QueryReturnValue configuredOptionsReturnValue = runQuery(QueryType.ConfigureConsoleOptions, new ConfigureConsoleOptionsParams(consoleOptions, true));
    if (!configuredOptionsReturnValue.getSucceeded()) {
        throw new Exception(configuredOptionsReturnValue.getExceptionString());
    }
    return runQuery(QueryType.GetConsoleDescriptorFile, new ConsoleOptionsParams(configuredOptionsReturnValue.getReturnValue()));
}
Also used : QueryReturnValue(org.ovirt.engine.core.common.queries.QueryReturnValue) ConfigureConsoleOptionsParams(org.ovirt.engine.core.common.queries.ConfigureConsoleOptionsParams) ConsoleOptionsParams(org.ovirt.engine.core.common.queries.ConsoleOptionsParams) ConfigureConsoleOptionsParams(org.ovirt.engine.core.common.queries.ConfigureConsoleOptionsParams) ConsoleOptions(org.ovirt.engine.core.common.console.ConsoleOptions)

Example 8 with ConsoleOptions

use of org.ovirt.engine.core.common.console.ConsoleOptions in project ovirt-engine by oVirt.

the class ConfigureConsoleOptionsQueryTest method shouldFailtWhenNoId.

@Test
public void shouldFailtWhenNoId() {
    when(getQueryParameters().getOptions()).thenReturn(new ConsoleOptions(GraphicsType.SPICE));
    assertFalse(getQuery().validateInputs());
}
Also used : ConsoleOptions(org.ovirt.engine.core.common.console.ConsoleOptions) Test(org.junit.Test)

Example 9 with ConsoleOptions

use of org.ovirt.engine.core.common.console.ConsoleOptions in project ovirt-engine by oVirt.

the class GetConsoleDescriptorFileQueryTest method shouldFailWhenGraphicsTypeNull.

@Test
public void shouldFailWhenGraphicsTypeNull() throws Exception {
    ConsoleOptions options = new ConsoleOptions();
    options.setVmId(Guid.Empty);
    when(getQueryParameters().getOptions()).thenReturn(options);
    assertFalse(getQuery().validateInputs());
}
Also used : ConsoleOptions(org.ovirt.engine.core.common.console.ConsoleOptions) Test(org.junit.Test)

Example 10 with ConsoleOptions

use of org.ovirt.engine.core.common.console.ConsoleOptions in project ovirt-engine by oVirt.

the class GetConsoleDescriptorFileQueryTest method shouldPass.

@Test
public void shouldPass() throws Exception {
    ConsoleOptions options = new ConsoleOptions(GraphicsType.SPICE);
    options.setVmId(Guid.Empty);
    when(getQueryParameters().getOptions()).thenReturn(options);
    assertTrue(getQuery().validateInputs());
}
Also used : ConsoleOptions(org.ovirt.engine.core.common.console.ConsoleOptions) Test(org.junit.Test)

Aggregations

ConsoleOptions (org.ovirt.engine.core.common.console.ConsoleOptions)11 Test (org.junit.Test)5 ConfigureConsoleOptionsParams (org.ovirt.engine.core.common.queries.ConfigureConsoleOptionsParams)3 GraphicsInfo (org.ovirt.engine.core.common.businessentities.GraphicsInfo)2 GraphicsType (org.ovirt.engine.core.common.businessentities.GraphicsType)2 VM (org.ovirt.engine.core.common.businessentities.VM)2 QueryReturnValue (org.ovirt.engine.core.common.queries.QueryReturnValue)2 QueryType (org.ovirt.engine.core.common.queries.QueryType)2 Frontend (org.ovirt.engine.ui.frontend.Frontend)2 FrontendUrlUtils (org.ovirt.engine.ui.frontend.utils.FrontendUrlUtils)2 BaseCommandTarget (org.ovirt.engine.ui.uicommonweb.BaseCommandTarget)2 ConsoleUtils (org.ovirt.engine.ui.uicommonweb.ConsoleUtils)2 DynamicMessages (org.ovirt.engine.ui.uicommonweb.DynamicMessages)2 ShowErrorAsyncQuery (org.ovirt.engine.ui.uicommonweb.ShowErrorAsyncQuery)2 TypeResolver (org.ovirt.engine.ui.uicommonweb.TypeResolver)2 UICommand (org.ovirt.engine.ui.uicommonweb.UICommand)2 AsyncDataProvider (org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider)2 Model (org.ovirt.engine.ui.uicommonweb.models.Model)2 ConstantsManager (org.ovirt.engine.ui.uicompat.ConstantsManager)2 ActionReturnValue (org.ovirt.engine.core.common.action.ActionReturnValue)1