Search in sources :

Example 6 with Certificate

use of org.ovirt.engine.api.model.Certificate in project ovirt-engine by oVirt.

the class BackendVmResource method setCertificateInfo.

public void setCertificateInfo(Vm model) {
    QueryReturnValue result = runQuery(QueryType.GetVdsCertificateSubjectByVmId, new IdQueryParameters(asGuid(model.getId())));
    if (result != null && result.getSucceeded() && result.getReturnValue() != null) {
        if (!model.isSetDisplay()) {
            model.setDisplay(new Display());
        }
        model.getDisplay().setCertificate(new Certificate());
        model.getDisplay().getCertificate().setSubject(result.getReturnValue().toString());
    }
}
Also used : QueryReturnValue(org.ovirt.engine.core.common.queries.QueryReturnValue) IdQueryParameters(org.ovirt.engine.core.common.queries.IdQueryParameters) Display(org.ovirt.engine.api.model.Display) Certificate(org.ovirt.engine.api.model.Certificate)

Example 7 with Certificate

use of org.ovirt.engine.api.model.Certificate in project ovirt-engine by oVirt.

the class CertificateMapper method map.

@Mapping(from = CertificateInfo.class, to = Certificate.class)
public static Certificate map(CertificateInfo entity, Certificate template) {
    Certificate model = template != null ? template : new Certificate();
    model.setContent(entity.getPayload());
    model.setSubject(entity.getSubject());
    return model;
}
Also used : Certificate(org.ovirt.engine.api.model.Certificate)

Aggregations

Certificate (org.ovirt.engine.api.model.Certificate)7 Display (org.ovirt.engine.api.model.Display)3 Certificates (org.ovirt.engine.api.model.Certificates)2 CertificateInfo (org.ovirt.engine.core.common.businessentities.CertificateInfo)2 Provider (org.ovirt.engine.core.common.businessentities.Provider)2 IdQueryParameters (org.ovirt.engine.core.common.queries.IdQueryParameters)2 QueryReturnValue (org.ovirt.engine.core.common.queries.QueryReturnValue)2 BigDecimal (java.math.BigDecimal)1 Cluster (org.ovirt.engine.api.model.Cluster)1 Cpu (org.ovirt.engine.api.model.Cpu)1 CpuTopology (org.ovirt.engine.api.model.CpuTopology)1 ExternalHostProvider (org.ovirt.engine.api.model.ExternalHostProvider)1 ExternalProvider (org.ovirt.engine.api.model.ExternalProvider)1 ExternalStatus (org.ovirt.engine.api.model.ExternalStatus)1 HardwareInformation (org.ovirt.engine.api.model.HardwareInformation)1 Host (org.ovirt.engine.api.model.Host)1 HostDevicePassthrough (org.ovirt.engine.api.model.HostDevicePassthrough)1 HostStatus (org.ovirt.engine.api.model.HostStatus)1 HostType (org.ovirt.engine.api.model.HostType)1 IscsiDetails (org.ovirt.engine.api.model.IscsiDetails)1