Search in sources :

Example 6 with VdsManager

use of org.ovirt.engine.core.vdsbroker.VdsManager in project ovirt-engine by oVirt.

the class CertificationValidityChecker method checkHostCertificateValidity.

private void checkHostCertificateValidity(VDS host) {
    VdsManager hostManager = resourceManager.getVdsManager(host.getId());
    List<Certificate> peerCertificates = hostManager.getVdsProxy().getPeerCertificates();
    if (peerCertificates == null || peerCertificates.isEmpty()) {
        log.error("Failed to retrieve peer certifications for host '{}'", host.getName());
    } else {
        checkCertificate((X509Certificate) peerCertificates.get(0), AuditLogType.HOST_CERTIFICATION_HAS_EXPIRED, AuditLogType.HOST_CERTIFICATION_IS_ABOUT_TO_EXPIRE_ALERT, AuditLogType.HOST_CERTIFICATION_IS_ABOUT_TO_EXPIRE, host);
    }
}
Also used : VdsManager(org.ovirt.engine.core.vdsbroker.VdsManager) X509Certificate(java.security.cert.X509Certificate) Certificate(java.security.cert.Certificate)

Aggregations

VdsManager (org.ovirt.engine.core.vdsbroker.VdsManager)6 Certificate (java.security.cert.Certificate)1 X509Certificate (java.security.cert.X509Certificate)1 HashMap (java.util.HashMap)1 FutureTask (java.util.concurrent.FutureTask)1 HttpClient (org.apache.commons.httpclient.HttpClient)1 ObjectMapper (org.codehaus.jackson.map.ObjectMapper)1 HostUpgradeManagerResult (org.ovirt.engine.core.common.HostUpgradeManagerResult)1 AsyncTaskCreationInfo (org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo)1 EngineException (org.ovirt.engine.core.common.errors.EngineException)1 Guid (org.ovirt.engine.core.compat.Guid)1 AuditLogable (org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable)1 AuditLogableImpl (org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl)1 ResourceManager (org.ovirt.engine.core.vdsbroker.ResourceManager)1 StatusOnlyReturn (org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn)1 VDSErrorException (org.ovirt.engine.core.vdsbroker.vdsbroker.VDSErrorException)1