use of org.ovirt.engine.api.model.GraphicsConsoles in project ovirt-engine by oVirt.
the class V3GraphicsConsolesInAdapter method adapt.
@Override
public GraphicsConsoles adapt(V3GraphicsConsoles from) {
GraphicsConsoles to = new GraphicsConsoles();
if (from.isSetActions()) {
to.setActions(adaptIn(from.getActions()));
}
if (from.isSetActive()) {
to.setActive(from.getActive());
}
if (from.isSetSize()) {
to.setSize(from.getSize());
}
if (from.isSetTotal()) {
to.setTotal(from.getTotal());
}
to.getGraphicsConsoles().addAll(adaptIn(from.getGraphicsConsoles()));
return to;
}
use of org.ovirt.engine.api.model.GraphicsConsoles in project ovirt-engine by oVirt.
the class BackendVmGraphicsConsolesResource method list.
@Override
public GraphicsConsoles list() {
GraphicsConsoles consoles = new GraphicsConsoles();
Map<GraphicsType, GraphicsInfo> graphicsTypeToGraphicsInfo;
VM entity = loadEntity();
boolean current = ParametersHelper.getBooleanParameter(httpHeaders, uriInfo, CURRENT, true, false);
if (current) {
// from entity dynamic (e.g. what is now present on the VM
graphicsTypeToGraphicsInfo = extractGraphicsInofs(entity);
} else {
// from devices (e.g. what is configured on the VM)
List<GraphicsType> graphicsTypes = DisplayHelper.getGraphicsTypesForEntity(this, guid, true);
graphicsTypeToGraphicsInfo = new EnumMap<>(GraphicsType.class);
for (GraphicsType type : graphicsTypes) {
graphicsTypeToGraphicsInfo.put(type, null);
}
}
for (Map.Entry<GraphicsType, GraphicsInfo> graphicsInfo : graphicsTypeToGraphicsInfo.entrySet()) {
consoles.getGraphicsConsoles().add(addLinks(populate(VmMapper.map(graphicsInfo, null), entity)));
}
return consoles;
}
use of org.ovirt.engine.api.model.GraphicsConsoles in project ovirt-engine by oVirt.
the class BackendTemplateGraphicsConsolesResource method list.
@Override
public GraphicsConsoles list() {
GraphicsConsoles consoles = new GraphicsConsoles();
VmTemplate entity = loadEntity();
BackendGraphicsConsoleHelper.list(this, guid).entrySet().forEach(graphicsInfo -> consoles.getGraphicsConsoles().add(addLinks(populate(VmMapper.map(graphicsInfo, null), entity))));
return consoles;
}
use of org.ovirt.engine.api.model.GraphicsConsoles in project ovirt-engine by oVirt.
the class BackendInstanceTypeGraphicsConsolesResource method list.
@Override
public GraphicsConsoles list() {
GraphicsConsoles consoles = new GraphicsConsoles();
InstanceType entity = loadEntity();
BackendGraphicsConsoleHelper.list(this, guid).entrySet().forEach(graphicsInfo -> consoles.getGraphicsConsoles().add(addLinks(populate(VmMapper.map(graphicsInfo, null), entity))));
return consoles;
}
Aggregations