/** * Audit. * * @param messageId the message id * @param consentDto the consent dto * @param registryResponse the registry response * @throws AuditException the audit exception */ private void audit( String messageId, SimpleConsentDto consentDto, RegistryResponse registryResponse) throws AuditException { Map<PredicateKey, String> predicateMap = auditService.createPredicateMap(); predicateMap.put(C2S_CONSENT_ID, consentDto.getConsentId()); predicateMap.put(C2S_PATIENT_ID, Long.toString(consentDto.getPatientId())); predicateMap.put(DOMAIN_ID, domainId); if (registryResponse != null) { predicateMap.put(RESPONSE_STATUS, registryResponse.getStatus()); try { predicateMap.put(RESPONSE_BODY, marshaller.marshal(registryResponse)); } catch (SimpleMarshallerException e) { throw new AuditException(e.getMessage(), e); } } predicateMap.put(XACML_POLICY_ID, consentDto.getXacmlPolicyId()); predicateMap.put(XACML_POLICY, consentDto.getConsent()); auditService.audit(this, messageId, XDS_ADD_CONSENT, consentDto.geteId(), predicateMap); }