Search in sources :

Example 11 with NetworkClusterId

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

the class NetworkClusterHelper method setStatus.

public void setStatus(Guid clusterId, final Collection<Network> networks) {
    final RequiredNetworkClusterStatusUpdater requiredNetworkClusterStatusUpdater = new RequiredNetworkClusterStatusUpdater(clusterId);
    for (Network network : networks) {
        NetworkCluster networkCluster = networkClusterDao.get(new NetworkClusterId(clusterId, network.getId()));
        boolean doUpdateNetworkClusterStatus = networkCluster != null;
        if (doUpdateNetworkClusterStatus) {
            if (networkCluster.isRequired()) {
                requiredNetworkClusterStatusUpdater.update(networkCluster, network.getName());
            } else {
                updateNetworkClusterStatus(networkCluster, NetworkStatus.OPERATIONAL);
            }
        }
    }
}
Also used : Network(org.ovirt.engine.core.common.businessentities.network.Network) NetworkCluster(org.ovirt.engine.core.common.businessentities.network.NetworkCluster) NetworkClusterId(org.ovirt.engine.core.common.businessentities.network.NetworkClusterId)

Example 12 with NetworkClusterId

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

the class NetworkClusterHelper method getManagementNetworkCluster.

private NetworkCluster getManagementNetworkCluster(NetworkCluster networkCluster) {
    Guid clusterId = networkCluster.getClusterId();
    Network mgmt = managementNetworkUtil.getManagementNetwork(clusterId);
    return networkClusterDao.get(new NetworkClusterId(clusterId, mgmt.getId()));
}
Also used : Network(org.ovirt.engine.core.common.businessentities.network.Network) Guid(org.ovirt.engine.core.compat.Guid) NetworkClusterId(org.ovirt.engine.core.common.businessentities.network.NetworkClusterId)

Example 13 with NetworkClusterId

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

the class NetworkAttachmentValidator method getNetworkCluster.

private NetworkCluster getNetworkCluster() {
    if (networkCluster == null) {
        NetworkClusterId networkClusterId = new NetworkClusterId(host.getClusterId(), attachment.getNetworkId());
        networkCluster = networkClusterDao.get(networkClusterId);
    }
    return networkCluster;
}
Also used : NetworkClusterId(org.ovirt.engine.core.common.businessentities.network.NetworkClusterId)

Aggregations

NetworkClusterId (org.ovirt.engine.core.common.businessentities.network.NetworkClusterId)13 NetworkCluster (org.ovirt.engine.core.common.businessentities.network.NetworkCluster)7 Network (org.ovirt.engine.core.common.businessentities.network.Network)5 Test (org.junit.Test)2 Guid (org.ovirt.engine.core.compat.Guid)2 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 Before (org.junit.Before)1 ValidationResult (org.ovirt.engine.core.bll.ValidationResult)1 Cluster (org.ovirt.engine.core.common.businessentities.Cluster)1 LexoNumericComparator (org.ovirt.engine.core.common.businessentities.comparators.LexoNumericComparator)1 NetworkAttachment (org.ovirt.engine.core.common.businessentities.network.NetworkAttachment)1 ProviderNetwork (org.ovirt.engine.core.common.businessentities.network.ProviderNetwork)1 IdQueryParameters (org.ovirt.engine.core.common.queries.IdQueryParameters)1 PairQueryable (org.ovirt.engine.core.common.utils.PairQueryable)1 AsyncCallback (org.ovirt.engine.ui.frontend.AsyncCallback)1