Search in sources :

Example 1 with ClusterEditWarnings

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

the class GetClusterEditWarningsQuery method executeQueryCommand.

@Override
protected void executeQueryCommand() {
    final Cluster oldCluster = backend.runQuery(QueryType.GetClusterById, getParameters()).getReturnValue();
    Cluster newCluster = getParameters().getNewCluster();
    List<ClusterEditWarnings.Warning> hostWarnings = getProblematicEntities(oldCluster, newCluster, hostCheckers, cluster -> vdsDao.getAllForCluster(cluster.getId()));
    List<ClusterEditWarnings.Warning> vmWarnings = new ArrayList<>();
    if (oldCluster.supportsVirtService() && newCluster.supportsVirtService()) {
        vmWarnings = getProblematicEntities(oldCluster, newCluster, vmCheckers, cluster -> vmDao.getAllForCluster(cluster.getId()));
    }
    setReturnValue(new ClusterEditWarnings(hostWarnings, vmWarnings));
}
Also used : QueryType(org.ovirt.engine.core.common.queries.QueryType) BackendLocal(org.ovirt.engine.core.common.interfaces.BackendLocal) EngineContext(org.ovirt.engine.core.bll.context.EngineContext) VmDao(org.ovirt.engine.core.dao.VmDao) ArrayList(java.util.ArrayList) Inject(javax.inject.Inject) Collectors.toList(java.util.stream.Collectors.toList) List(java.util.List) VM(org.ovirt.engine.core.common.businessentities.VM) StreamSupport.stream(java.util.stream.StreamSupport.stream) Cluster(org.ovirt.engine.core.common.businessentities.Cluster) Nameable(org.ovirt.engine.core.common.businessentities.Nameable) VdsDao(org.ovirt.engine.core.dao.VdsDao) ClusterEditWarnings(org.ovirt.engine.core.common.businessentities.ClusterEditWarnings) Any(javax.enterprise.inject.Any) ClusterEditParameters(org.ovirt.engine.core.common.queries.ClusterEditParameters) VDS(org.ovirt.engine.core.common.businessentities.VDS) Instance(javax.enterprise.inject.Instance) ArrayList(java.util.ArrayList) Cluster(org.ovirt.engine.core.common.businessentities.Cluster) ClusterEditWarnings(org.ovirt.engine.core.common.businessentities.ClusterEditWarnings)

Aggregations

ArrayList (java.util.ArrayList)1 List (java.util.List)1 Collectors.toList (java.util.stream.Collectors.toList)1 StreamSupport.stream (java.util.stream.StreamSupport.stream)1 Any (javax.enterprise.inject.Any)1 Instance (javax.enterprise.inject.Instance)1 Inject (javax.inject.Inject)1 EngineContext (org.ovirt.engine.core.bll.context.EngineContext)1 Cluster (org.ovirt.engine.core.common.businessentities.Cluster)1 ClusterEditWarnings (org.ovirt.engine.core.common.businessentities.ClusterEditWarnings)1 Nameable (org.ovirt.engine.core.common.businessentities.Nameable)1 VDS (org.ovirt.engine.core.common.businessentities.VDS)1 VM (org.ovirt.engine.core.common.businessentities.VM)1 BackendLocal (org.ovirt.engine.core.common.interfaces.BackendLocal)1 ClusterEditParameters (org.ovirt.engine.core.common.queries.ClusterEditParameters)1 QueryType (org.ovirt.engine.core.common.queries.QueryType)1 VdsDao (org.ovirt.engine.core.dao.VdsDao)1 VmDao (org.ovirt.engine.core.dao.VmDao)1