Search in sources :

Example 1 with InterfaceAndIdQueryParameters

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

the class BackendHostNicResource method getOldNetwork.

private org.ovirt.engine.core.common.businessentities.network.Network getOldNetwork(VdsNetworkInterface originalInter) {
    String oldNetworkName = originalInter.getNetworkName();
    if (!StringUtils.isEmpty(oldNetworkName)) {
        return lookupAtachedNetwork(originalInter.getNetworkName());
    } else {
        InterfaceAndIdQueryParameters params = new InterfaceAndIdQueryParameters(originalInter.getVdsId(), originalInter);
        List<VdsNetworkInterface> vlans = getBackendCollection(VdsNetworkInterface.class, QueryType.GetAllChildVlanInterfaces, params);
        if (vlans != null && !vlans.isEmpty()) {
            return lookupAtachedNetwork(vlans.get(0).getNetworkName());
        } else {
            return null;
        }
    }
}
Also used : InterfaceAndIdQueryParameters(org.ovirt.engine.core.common.queries.InterfaceAndIdQueryParameters) VdsNetworkInterface(org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface)

Aggregations

VdsNetworkInterface (org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface)1 InterfaceAndIdQueryParameters (org.ovirt.engine.core.common.queries.InterfaceAndIdQueryParameters)1