use of org.ovirt.engine.api.model.DiskProfiles in project ovirt-engine by oVirt.
the class AbstractBackendDiskProfilesResource method mapCollection.
protected DiskProfiles mapCollection(List<org.ovirt.engine.core.common.businessentities.profiles.DiskProfile> entities) {
DiskProfiles collection = new DiskProfiles();
Map<Guid, Qos> qosMap = new HashMap<>();
for (org.ovirt.engine.core.common.businessentities.profiles.DiskProfile entity : entities) {
DiskProfile profile = populate(map(entity), entity);
collection.getDiskProfiles().add(profile);
if (entity.getQosId() != null) {
qosMap.put(entity.getQosId(), profile.getQos());
}
}
handleQosDataCenterLinks(qosMap);
for (DiskProfile diskProfile : collection.getDiskProfiles()) {
addLinks(diskProfile);
}
return collection;
}
use of org.ovirt.engine.api.model.DiskProfiles in project ovirt-engine by oVirt.
the class V3DiskProfilesInAdapter method adapt.
@Override
public DiskProfiles adapt(V3DiskProfiles from) {
DiskProfiles to = new DiskProfiles();
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.getDiskProfiles().addAll(adaptIn(from.getDiskProfiles()));
return to;
}
Aggregations