Search in sources :

Example 1 with UnmanagedNetwork

use of org.ovirt.engine.core.common.businessentities.UnmanagedNetwork in project ovirt-engine by oVirt.

the class UnmanagedNetworksHelper method getUnmanagedNetworks.

public List<UnmanagedNetwork> getUnmanagedNetworks(Guid hostId) {
    List<UnmanagedNetwork> unmanagedNetworks = new ArrayList<>();
    VDS host = vdsDao.get(hostId);
    if (host != null) {
        List<VdsNetworkInterface> hostNetworkInterfaces = interfaceDao.getAllInterfacesForVds(hostId);
        BusinessEntityMap<Network> clusterNetworkMap = new BusinessEntityMap<>(getClusterNetworks(host));
        for (VdsNetworkInterface vdsNetworkInterface : hostNetworkInterfaces) {
            String networkName = vdsNetworkInterface.getNetworkName();
            if (networkName != null && !clusterNetworkMap.containsKey(networkName)) {
                unmanagedNetworks.add(createUnmanagedNetworkEntity(vdsNetworkInterface, networkName));
            }
        }
    }
    return unmanagedNetworks;
}
Also used : BusinessEntityMap(org.ovirt.engine.core.common.businessentities.BusinessEntityMap) VDS(org.ovirt.engine.core.common.businessentities.VDS) UnmanagedNetwork(org.ovirt.engine.core.common.businessentities.UnmanagedNetwork) Network(org.ovirt.engine.core.common.businessentities.network.Network) ArrayList(java.util.ArrayList) VdsNetworkInterface(org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface) UnmanagedNetwork(org.ovirt.engine.core.common.businessentities.UnmanagedNetwork)

Example 2 with UnmanagedNetwork

use of org.ovirt.engine.core.common.businessentities.UnmanagedNetwork in project ovirt-engine by oVirt.

the class GetAllUnmanagedNetworksByHostIdQuery method executeQueryCommand.

@Override
protected void executeQueryCommand() {
    Guid hostId = getParameters().getId();
    List<UnmanagedNetwork> unmanagedNetworks = unmanagedNetworksHelper.getUnmanagedNetworks(hostId);
    getQueryReturnValue().setReturnValue(unmanagedNetworks);
}
Also used : Guid(org.ovirt.engine.core.compat.Guid) UnmanagedNetwork(org.ovirt.engine.core.common.businessentities.UnmanagedNetwork)

Example 3 with UnmanagedNetwork

use of org.ovirt.engine.core.common.businessentities.UnmanagedNetwork in project ovirt-engine by oVirt.

the class GetUnmanagedNetworkByHostIdAndNameQuery method executeQueryCommand.

@Override
protected void executeQueryCommand() {
    Guid hostId = getParameters().getHostId();
    String networkName = getParameters().getNetworkName();
    UnmanagedNetwork unmanagedNetwork = unmanagedNetworksHelper.getUnmanagedNetwork(hostId, networkName);
    getQueryReturnValue().setReturnValue(unmanagedNetwork);
}
Also used : Guid(org.ovirt.engine.core.compat.Guid) UnmanagedNetwork(org.ovirt.engine.core.common.businessentities.UnmanagedNetwork)

Aggregations

UnmanagedNetwork (org.ovirt.engine.core.common.businessentities.UnmanagedNetwork)3 Guid (org.ovirt.engine.core.compat.Guid)2 ArrayList (java.util.ArrayList)1 BusinessEntityMap (org.ovirt.engine.core.common.businessentities.BusinessEntityMap)1 VDS (org.ovirt.engine.core.common.businessentities.VDS)1 Network (org.ovirt.engine.core.common.businessentities.network.Network)1 VdsNetworkInterface (org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface)1