use of org.ovirt.engine.ui.frontend.Frontend 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.ui.frontend.Frontend 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);
}
}));
}
Aggregations