use of org.ovirt.engine.api.model.Certificates in project ovirt-engine by oVirt.
the class AbstractBackendExternalProviderResource method importCertificates.
@Override
public Response importCertificates(Action action) {
Provider provider = BackendExternalProviderHelper.getProvider(this, id);
validateParameters(action, "certificates.content");
String content = null;
Certificates certificates = action.getCertificates();
if (certificates != null) {
List<Certificate> list = certificates.getCertificates();
if (!CollectionUtils.isEmpty(list)) {
content = list.get(0).getContent();
}
}
return performAction(ActionType.ImportProviderCertificate, new ImportProviderCertificateParameters(provider, content));
}
use of org.ovirt.engine.api.model.Certificates in project ovirt-engine by oVirt.
the class BackendExternalProviderCertificatesResource method mapCollection.
protected Certificates mapCollection(List<CertificateInfo> entities) {
Certificates collection = new Certificates();
if (entities != null) {
for (int i = 0; i < entities.size(); i++) {
CertificateInfo entity = entities.get(i);
Certificate model = populate(map(entity), entity);
model.setId(String.valueOf(i));
collection.getCertificates().add(model);
}
}
return collection;
}
use of org.ovirt.engine.api.model.Certificates in project ovirt-engine by oVirt.
the class V3CertificatesInAdapter method adapt.
@Override
public Certificates adapt(V3Certificates from) {
Certificates to = new Certificates();
if (from.isSetActions()) {
to.setActions(adaptIn(from.getActions()));
}
if (from.isSetActive()) {
to.setActive(from.getActive());
}
if (from.isSetSize()) {
to.setSize(from.getSize());
}
if (from.isSetTotal()) {
to.setTotal(from.getTotal());
}
to.getCertificates().addAll(adaptIn(from.getCertificates()));
return to;
}
Aggregations