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);
}
}
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()));
}
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());
}
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());
}
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());
}
Aggregations