use of org.ovirt.engine.core.bll.provider.ProviderProxy in project ovirt-engine by oVirt.
the class GetProviderCertificateChainQuery method executeQueryCommand.
@Override
protected void executeQueryCommand() {
Provider<?> provider = getProvider();
try {
ProviderProxy proxy = providerProxyFactory.create(provider);
List<? extends Certificate> chain = proxy.getCertificateChain();
List<CertificateInfo> results = new ArrayList<>();
if (CollectionUtils.isNotEmpty(chain)) {
for (Certificate cert : chain) {
if (cert instanceof X509Certificate) {
results.add(createCertificateInfo((X509Certificate) cert));
}
}
}
getQueryReturnValue().setReturnValue(results);
} catch (Exception e) {
log.error("Error in encoding certificate: {}", e.getMessage());
log.debug("Exception", e);
}
}
Aggregations