use of org.ovirt.engine.core.common.businessentities.GraphicsInfo in project ovirt-engine by oVirt.
the class ConfigureConsoleOptionsQuery method determineHost.
private String determineHost() {
GraphicsInfo graphicsInfo = getCachedVm().getGraphicsInfos().get(getParameters().getOptions().getGraphicsType());
String result = graphicsInfo.getIp();
// if we don't have display ip, we try management network of host
if (StringUtils.isBlank(result) || "0".equals(result)) {
QueryReturnValue returnValue = backend.runInternalQuery(QueryType.GetManagementInterfaceAddressByVmId, new IdQueryParameters(getCachedVm().getId()));
result = returnValue.getReturnValue();
}
return result;
}
use of org.ovirt.engine.core.common.businessentities.GraphicsInfo in project ovirt-engine by oVirt.
the class BackendVmsResourceTest method setUpEntityExpectations.
static org.ovirt.engine.core.common.businessentities.VM setUpEntityExpectations(org.ovirt.engine.core.common.businessentities.VM entity, VmStatistics statistics, int index, Guid vmId) {
entity.setId(vmId);
entity.setClusterId(GUIDS[2]);
entity.setName(NAMES[index]);
entity.setVmDescription(DESCRIPTIONS[index]);
entity.setCpuPerSocket(4);
entity.setNumOfSockets(2);
entity.setUsageMemPercent(20);
entity.getGraphicsInfos().put(GraphicsType.VNC, new GraphicsInfo());
entity.setNumOfMonitors(2);
entity.setVmType(VmType.Server);
entity.setRunOnVdsName(NAMES[NAMES.length - 1]);
entity.setOrigin(index == 0 ? OriginType.HOSTED_ENGINE : OriginType.OVIRT);
entity.setBootSequence(null);
entity.getStaticData().setSmallIconId(GUIDS[2]);
entity.getStaticData().setLargeIconId(GUIDS[3]);
setUpStatisticalEntityExpectations(entity, statistics);
return entity;
}
use of org.ovirt.engine.core.common.businessentities.GraphicsInfo in project ovirt-engine by oVirt.
the class GetSignedWebsocketProxyTicketQuery method executeQueryCommandChecked.
private void executeQueryCommandChecked() throws IOException {
final GraphicsInfo graphicsInfo = getGraphicsInfo();
final Map<String, Object> ticketModel = createTicket(graphicsInfo);
final String jsonTicket = new ObjectMapper().writeValueAsString(ticketModel);
final String encodedTicket = URLEncoder.encode(jsonTicket, StandardCharsets.UTF_8.name());
final String signedTicket = Backend.getInstance().runInternalQuery(QueryType.SignString, new SignStringParameters(encodedTicket)).getReturnValue();
setReturnValue(signedTicket);
}
use of org.ovirt.engine.core.common.businessentities.GraphicsInfo in project ovirt-engine by oVirt.
the class VmDynamicDaoImpl method setGraphicsToEntity.
private static void setGraphicsToEntity(ResultSet rs, VmDynamic entity) throws SQLException {
GraphicsInfo graphicsInfo = new GraphicsInfo();
graphicsInfo.setIp(rs.getString("spice_ip"));
graphicsInfo.setPort((Integer) rs.getObject("spice_port"));
graphicsInfo.setTlsPort((Integer) rs.getObject("spice_tls_port"));
if (graphicsInfo.getPort() != null || graphicsInfo.getTlsPort() != null) {
entity.getGraphicsInfos().put(GraphicsType.SPICE, graphicsInfo);
}
graphicsInfo = new GraphicsInfo();
graphicsInfo.setIp(rs.getString("vnc_ip"));
graphicsInfo.setPort((Integer) rs.getObject("vnc_port"));
if (graphicsInfo.getPort() != null) {
entity.getGraphicsInfos().put(GraphicsType.VNC, graphicsInfo);
}
}
use of org.ovirt.engine.core.common.businessentities.GraphicsInfo in project ovirt-engine by oVirt.
the class VmMapperTest method getInverse.
@Override
protected org.ovirt.engine.core.common.businessentities.VM getInverse(VmStatic to) {
VmStatistics statistics = new VmStatistics();
statistics.setCpuUser(10.0);
statistics.setCpuSys(20.0);
VmDynamic dynamic = new VmDynamic();
dynamic.setStatus(VMStatus.Up);
dynamic.setBootSequence(to.getDefaultBootSequence());
dynamic.getGraphicsInfos().put(GraphicsType.SPICE, new GraphicsInfo());
org.ovirt.engine.core.common.businessentities.VM ret = new org.ovirt.engine.core.common.businessentities.VM(to, dynamic, statistics);
ret.setUsageMemPercent(50);
return ret;
}
Aggregations