Search in sources :

Example 1 with NamedValue

use of de.trustable.ca3s.core.service.dto.NamedValue in project ca3sCore by kuehne-trustable-de.

the class CSRAdministration method updateARAttributes.

private void updateARAttributes(CSRAdministrationData adminData, CSR csr) {
    for (CsrAttribute csrAttr : csr.getCsrAttributes()) {
        if (csrAttr.getName().startsWith(CsrAttribute.ARA_PREFIX)) {
            for (NamedValue nv : adminData.getArAttributeArr()) {
                if (csrAttr.getName().equals(CsrAttribute.ARA_PREFIX + nv.getName())) {
                    if (!csrAttr.getValue().equals(nv.getValue())) {
                        auditService.saveAuditTrace(auditService.createAuditTraceCsrAttribute(csrAttr.getName(), csrAttr.getValue(), nv.getValue(), csr));
                        csrAttr.setValue(nv.getValue());
                        LOG.debug("CSR attribute {} updated to {}", csrAttr.getName(), csrAttr.getValue());
                    }
                }
            }
        }
    }
    csrAttributeRepository.saveAll(csr.getCsrAttributes());
}
Also used : CsrAttribute(de.trustable.ca3s.core.domain.CsrAttribute) NamedValue(de.trustable.ca3s.core.service.dto.NamedValue)

Example 2 with NamedValue

use of de.trustable.ca3s.core.service.dto.NamedValue in project ca3sCore by kuehne-trustable-de.

the class CertificateAdministration method updateARAttributes.

private void updateARAttributes(CertificateAdministrationData adminData, Certificate cert) {
    for (CertificateAttribute certAttr : cert.getCertificateAttributes()) {
        if (certAttr.getName().startsWith(CsrAttribute.ARA_PREFIX)) {
            for (NamedValue nv : adminData.getArAttributeArr()) {
                if (certAttr.getName().equals(CsrAttribute.ARA_PREFIX + nv.getName())) {
                    if (!certAttr.getValue().equals(nv.getValue())) {
                        auditService.saveAuditTrace(auditService.createAuditTraceCertificateAttribute(certAttr.getName(), certAttr.getValue(), nv.getValue(), cert));
                        certAttr.setValue(nv.getValue());
                        LOG.debug("certificate attribute {} updated to {}", certAttr.getName(), certAttr.getValue());
                    }
                }
            }
        }
    }
    certificateAttributeRepository.saveAll(cert.getCertificateAttributes());
}
Also used : NamedValue(de.trustable.ca3s.core.service.dto.NamedValue)

Aggregations

NamedValue (de.trustable.ca3s.core.service.dto.NamedValue)2 CsrAttribute (de.trustable.ca3s.core.domain.CsrAttribute)1