Search in sources :

Example 1 with GetVmIconDefaultParameters

use of org.ovirt.engine.core.common.queries.GetVmIconDefaultParameters in project ovirt-engine by oVirt.

the class BackendOperatingSystemResource method get.

@Override
public OperatingSystemInfo get() {
    OsRepository repository = SimpleDependencyInjector.getInstance().get(OsRepository.class);
    OperatingSystemInfo model = new OperatingSystemInfo();
    model.setId(id);
    Integer key = Integer.valueOf(id);
    String uniqueName = repository.getUniqueOsNames().get(key);
    if (uniqueName == null) {
        return notFound();
    }
    model.setName(uniqueName);
    String name = repository.getOsNames().get(key);
    if (name != null) {
        model.setDescription(name);
    }
    final VmIconDefault vmIconDefault = getEntity(VmIconDefault.class, QueryType.GetVmIconDefault, new GetVmIconDefaultParameters(key), "VmIconDefault");
    if (vmIconDefault != null) {
        model.setSmallIcon(IconHelper.createIcon(vmIconDefault.getSmallIconId()));
        model.setLargeIcon(IconHelper.createIcon(vmIconDefault.getLargeIconId()));
    }
    return addLinks(model);
}
Also used : GetVmIconDefaultParameters(org.ovirt.engine.core.common.queries.GetVmIconDefaultParameters) OperatingSystemInfo(org.ovirt.engine.api.model.OperatingSystemInfo) OsRepository(org.ovirt.engine.core.common.osinfo.OsRepository) VmIconDefault(org.ovirt.engine.core.common.businessentities.VmIconDefault)

Aggregations

OperatingSystemInfo (org.ovirt.engine.api.model.OperatingSystemInfo)1 VmIconDefault (org.ovirt.engine.core.common.businessentities.VmIconDefault)1 OsRepository (org.ovirt.engine.core.common.osinfo.OsRepository)1 GetVmIconDefaultParameters (org.ovirt.engine.core.common.queries.GetVmIconDefaultParameters)1