Class ExternalDatabaseReleaseAuditServiceImpl
java.lang.Object
ubic.gemma.persistence.service.common.description.ExternalDatabaseReleaseAuditServiceImpl
- All Implemented Interfaces:
ExternalDatabaseReleaseAuditService
@Service
public class ExternalDatabaseReleaseAuditServiceImpl
extends Object
implements ExternalDatabaseReleaseAuditService
Implementation of
ExternalDatabaseReleaseAuditService. The
Audited aspect intercepts recordReleaseDetailsUpdate(ExternalDatabase, String, ReleaseDetailsUpdatePayload)
on return, picks up the ReleaseDetailsUpdatePayload argument,
serialises it to JSON and writes it to AUDIT_EVENT.PAYLOAD
via addUpdateEventWithPayload. The note parameter is
forwarded into AUDIT_EVENT.NOTE via
messageSpel = "#note".
Default propagation (REQUIRED) so the audit row joins the caller's
surrounding transaction -- the callers (updateReleaseDetails
and updateReleaseLastUpdated on
ExternalDatabaseServiceImpl) are themselves @Transactional
and the audit event must mutate the same in-memory audit trail bag
so existing assertions on ed.getAuditTrail().getEvents() continue
to see the new row immediately. Contrast with
OutlierFlaggingAuditServiceImpl (which uses REQUIRES_NEW because
its caller runs with Propagation.NEVER).
Phase C bucket 2g (audit-residual inventory #9 + #10).
Replaces the legacy imperative 5-arg
auditTrailService.addUpdateEvent(ed, ReleaseDetailsUpdateEvent.class,
note, detail, lastUpdated) calls.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidrecordReleaseDetailsUpdate(ExternalDatabase ed, String note, ReleaseDetailsUpdatePayload payload) Emit aReleaseDetailsUpdateEventfor the given external database.
-
Constructor Details
-
ExternalDatabaseReleaseAuditServiceImpl
public ExternalDatabaseReleaseAuditServiceImpl()
-
-
Method Details
-
recordReleaseDetailsUpdate
@Transactional @Audited(value=ReleaseDetailsUpdateEvent.class, messageSpel="#note") public void recordReleaseDetailsUpdate(ExternalDatabase ed, @Nullable String note, ReleaseDetailsUpdatePayload payload) Description copied from interface:ExternalDatabaseReleaseAuditServiceEmit aReleaseDetailsUpdateEventfor the given external database. The aspect picks theExternalDatabaseas the audit target, serialisespayloadintoAUDIT_EVENT.PAYLOAD, and storesnoteinAUDIT_EVENT.NOTE.- Specified by:
recordReleaseDetailsUpdatein interfaceExternalDatabaseReleaseAuditService- Parameters:
ed- the auditable targetnote- short note (may benull-- e.g. background refreshes fromGeneMultifunctionalityPopulationServiceImplsupply a descriptive note; manual updates may omit it)payload- structured release context; carriesreleaseVersion,releaseUrl,lastUpdatedand the transitiondetail
-