use of org.ovirt.engine.core.common.queries.ConfigureConsoleOptionsParams in project ovirt-engine by oVirt.
the class VncConsoleModel method invokeConsole.
private void invokeConsole() {
final GraphicsInfo vncInfo = getEntity().getGraphicsInfos().get(GraphicsType.VNC);
if (vncInfo == null) {
// $NON-NLS-1$
throw new IllegalStateException("Trying to invoke VNC console but VM GraphicsInfo is null.");
}
vncImpl.getOptions().setVmId(getEntity().getId());
ConfigureConsoleOptionsParams parameters = new ConfigureConsoleOptionsParams(vncImpl.getOptions(), true);
parameters.setEngineBaseUrl(FrontendUrlUtils.getRootURL());
parameters.setConsoleClientResourcesUrl(dynamicMessages.consoleClientResourcesUrl());
Frontend.getInstance().runQuery(QueryType.ConfigureConsoleOptions, parameters, new ShowErrorAsyncQuery(returnValue -> {
ConsoleOptions configuredOptions = ((QueryReturnValue) returnValue).getReturnValue();
// overriding global server settings by frontend settings
configuredOptions.setRemapCtrlAltDelete(vncImpl.getOptions().isRemapCtrlAltDelete());
vncImpl.setOptions(configuredOptions);
vncImpl.getOptions().setTitle(getClientTitle());
vncImpl.getOptions().setVmName(getEntity().getName());
vncImpl.invokeClient();
}));
}
use of org.ovirt.engine.core.common.queries.ConfigureConsoleOptionsParams in project ovirt-engine by oVirt.
the class SpiceConsoleModel method invokeClient.
public void invokeClient() {
final GraphicsInfo spiceInfo = getEntity().getGraphicsInfos().get(GraphicsType.SPICE);
if (spiceInfo == null) {
// $NON-NLS-1$
throw new IllegalStateException("Trying to invoke SPICE console but VM GraphicsInfo is null.");
}
final ConsoleOptions options = getSpiceImpl().getOptions();
options.setVmId(getEntity().getId());
// configure options
ConfigureConsoleOptionsParams parameters = new ConfigureConsoleOptionsParams(options, true);
parameters.setEngineBaseUrl(FrontendUrlUtils.getRootURL());
parameters.setConsoleClientResourcesUrl(dynamicMessages.consoleClientResourcesUrl());
Frontend.getInstance().runQuery(QueryType.ConfigureConsoleOptions, parameters, new ShowErrorAsyncQuery(returnValue -> {
final ConsoleOptions configuredOptions = returnValue.getReturnValue();
// overriding global server settings by frontend settings
configuredOptions.setRemapCtrlAltDelete(options.isRemapCtrlAltDelete());
configuredOptions.setTitle(getClientTitle());
configuredOptions.setVmName(getEntity().getName());
configuredOptions.setFullScreen(options.isFullScreen());
configuredOptions.setSmartcardEnabledOverridden(options.isSmartcardEnabledOverridden());
if (!configuredOptions.isSpiceProxyEnabled()) {
// override spice proxy from backend
configuredOptions.setSpiceProxy(null);
}
try {
getSpiceImpl().setOptions(configuredOptions);
getSpiceImpl().invokeClient();
} catch (RuntimeException ex) {
// $NON-NLS-1$
getLogger().error("Exception on Spice connect", ex);
}
}));
}
use of org.ovirt.engine.core.common.queries.ConfigureConsoleOptionsParams 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()));
}
Aggregations