Search in sources :

Example 1 with IsRoleNetworkIpConfigurationValid

use of org.ovirt.engine.core.bll.validator.IsRoleNetworkIpConfigurationValid in project ovirt-engine by oVirt.

the class NetworkClusterValidatorBase method findMissingIpNic.

private VdsNetworkInterface findMissingIpNic(final String networkName) {
    IsRoleNetworkIpConfigurationValid isRoleNetworkIpConfigurationValid = new IsRoleNetworkIpConfigurationValid(networkCluster);
    final List<VdsNetworkInterface> interfacesByClusterId = interfaceDao.getAllInterfacesByClusterId(networkCluster.getClusterId());
    final VdsNetworkInterface missingIpNic = interfacesByClusterId.stream().filter(nic -> networkName.equals(nic.getNetworkName())).filter(isRoleNetworkIpConfigurationValid::isIpAddressMissingForRole).findFirst().orElse(null);
    return missingIpNic;
}
Also used : EngineMessage(org.ovirt.engine.core.common.errors.EngineMessage) NetworkDao(org.ovirt.engine.core.dao.network.NetworkDao) IsRoleNetworkIpConfigurationValid(org.ovirt.engine.core.bll.validator.IsRoleNetworkIpConfigurationValid) NetworkUtils(org.ovirt.engine.core.utils.NetworkUtils) VdsNetworkInterface(org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface) Objects(java.util.Objects) List(java.util.List) Cluster(org.ovirt.engine.core.common.businessentities.Cluster) VdsDao(org.ovirt.engine.core.dao.VdsDao) ValidationResult(org.ovirt.engine.core.bll.ValidationResult) NetworkCluster(org.ovirt.engine.core.common.businessentities.network.NetworkCluster) Network(org.ovirt.engine.core.common.businessentities.network.Network) InterfaceDao(org.ovirt.engine.core.dao.network.InterfaceDao) IsRoleNetworkIpConfigurationValid(org.ovirt.engine.core.bll.validator.IsRoleNetworkIpConfigurationValid) VdsNetworkInterface(org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface)

Aggregations

List (java.util.List)1 Objects (java.util.Objects)1 ValidationResult (org.ovirt.engine.core.bll.ValidationResult)1 IsRoleNetworkIpConfigurationValid (org.ovirt.engine.core.bll.validator.IsRoleNetworkIpConfigurationValid)1 Cluster (org.ovirt.engine.core.common.businessentities.Cluster)1 Network (org.ovirt.engine.core.common.businessentities.network.Network)1 NetworkCluster (org.ovirt.engine.core.common.businessentities.network.NetworkCluster)1 VdsNetworkInterface (org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface)1 EngineMessage (org.ovirt.engine.core.common.errors.EngineMessage)1 VdsDao (org.ovirt.engine.core.dao.VdsDao)1 InterfaceDao (org.ovirt.engine.core.dao.network.InterfaceDao)1 NetworkDao (org.ovirt.engine.core.dao.network.NetworkDao)1 NetworkUtils (org.ovirt.engine.core.utils.NetworkUtils)1