Search in sources :

Example 1 with AttestThread

use of org.ovirt.engine.core.bll.attestationbroker.AttestThread in project ovirt-engine by oVirt.

the class Backend method initAttestation.

private void initAttestation() {
    List<Cluster> clusters = clusterDao.getTrustedClusters();
    List<VDS> trustedVdsList = new ArrayList<>();
    List<String> trustedVdsNames = new ArrayList<>();
    if (clusters == null || clusters.size() == 0) {
        return;
    }
    for (Cluster cluster : clusters) {
        List<VDS> hostsInCluster = vdsDao.getAllForClusterWithStatus(cluster.getId(), VDSStatus.Up);
        if (hostsInCluster != null) {
            trustedVdsList.addAll(hostsInCluster);
        }
    }
    for (VDS vds : trustedVdsList) {
        trustedVdsNames.add(vds.getHostName());
        setNonOperational(NonOperationalReason.UNINITIALIZED, vds);
    }
    try {
        AttestThread attestThread = new AttestThread(trustedVdsNames);
        // start a thread to attest the hosts
        attestThread.start();
    } catch (Exception e) {
        log.error("Failed to initialize attestation cache", e);
    }
}
Also used : VDS(org.ovirt.engine.core.common.businessentities.VDS) ArrayList(java.util.ArrayList) MacPoolPerCluster(org.ovirt.engine.core.bll.network.macpool.MacPoolPerCluster) Cluster(org.ovirt.engine.core.common.businessentities.Cluster) AttestThread(org.ovirt.engine.core.bll.attestationbroker.AttestThread)

Aggregations

ArrayList (java.util.ArrayList)1 AttestThread (org.ovirt.engine.core.bll.attestationbroker.AttestThread)1 MacPoolPerCluster (org.ovirt.engine.core.bll.network.macpool.MacPoolPerCluster)1 Cluster (org.ovirt.engine.core.common.businessentities.Cluster)1 VDS (org.ovirt.engine.core.common.businessentities.VDS)1