Search in sources :

Example 1 with OpenStackNetworks

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

the class BackendOpenStackNetworksResource method mapCollection.

private OpenStackNetworks mapCollection(Map<Network, Set<Guid>> entities) {
    OpenStackNetworks collection = new OpenStackNetworks();
    if (entities != null) {
        for (Map.Entry<Network, Set<Guid>> entry : entities.entrySet()) {
            Network network = entry.getKey();
            collection.getOpenStackNetworks().add(addLinks(populate(map(network), network)));
        }
    }
    return collection;
}
Also used : OpenStackNetworks(org.ovirt.engine.api.model.OpenStackNetworks) Set(java.util.Set) OpenStackNetwork(org.ovirt.engine.api.model.OpenStackNetwork) Network(org.ovirt.engine.core.common.businessentities.network.Network) Map(java.util.Map)

Example 2 with OpenStackNetworks

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

the class V3OpenStackNetworksInAdapter method adapt.

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

Aggregations

OpenStackNetworks (org.ovirt.engine.api.model.OpenStackNetworks)2 Map (java.util.Map)1 Set (java.util.Set)1 OpenStackNetwork (org.ovirt.engine.api.model.OpenStackNetwork)1 V3OpenStackNetworks (org.ovirt.engine.api.v3.types.V3OpenStackNetworks)1 Network (org.ovirt.engine.core.common.businessentities.network.Network)1