Search in sources :

Example 1 with VnicProfiles

use of org.ovirt.engine.api.model.VnicProfiles in project ovirt-engine by oVirt.

the class AbstractBackendVnicProfilesResource method mapCollection.

protected VnicProfiles mapCollection(List<org.ovirt.engine.core.common.businessentities.network.VnicProfile> entities) {
    VnicProfiles collection = new VnicProfiles();
    Map<Guid, Qos> qosMap = new HashMap<>();
    for (org.ovirt.engine.core.common.businessentities.network.VnicProfile entity : entities) {
        VnicProfile profile = populate(map(entity), entity);
        collection.getVnicProfiles().add(profile);
        if (entity.getNetworkQosId() != null) {
            qosMap.put(entity.getNetworkQosId(), profile.getQos());
        }
    }
    handleQosDataCenterLinks(qosMap);
    for (VnicProfile vnicProfile : collection.getVnicProfiles()) {
        addLinks(vnicProfile);
    }
    return collection;
}
Also used : Qos(org.ovirt.engine.api.model.Qos) HashMap(java.util.HashMap) VnicProfile(org.ovirt.engine.api.model.VnicProfile) VnicProfiles(org.ovirt.engine.api.model.VnicProfiles) Guid(org.ovirt.engine.core.compat.Guid)

Example 2 with VnicProfiles

use of org.ovirt.engine.api.model.VnicProfiles in project ovirt-engine by oVirt.

the class V3VnicProfilesInAdapter method adapt.

@Override
public VnicProfiles adapt(V3VnicProfiles from) {
    VnicProfiles to = new VnicProfiles();
    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.getVnicProfiles().addAll(adaptIn(from.getVnicProfiles()));
    return to;
}
Also used : VnicProfiles(org.ovirt.engine.api.model.VnicProfiles) V3VnicProfiles(org.ovirt.engine.api.v3.types.V3VnicProfiles)

Aggregations

VnicProfiles (org.ovirt.engine.api.model.VnicProfiles)2 HashMap (java.util.HashMap)1 Qos (org.ovirt.engine.api.model.Qos)1 VnicProfile (org.ovirt.engine.api.model.VnicProfile)1 V3VnicProfiles (org.ovirt.engine.api.v3.types.V3VnicProfiles)1 Guid (org.ovirt.engine.core.compat.Guid)1