public interface AuditRecordService
AuditRecord
instances and persist those to the underlying data
store, e.g. AuditRecordRepository
.
Callers have the choice to persist just a String as the data to be audited or,
alternatively, callers can also provide a Map
whose elements will be serialized
to JSON using Jackson.Modifier and Type | Method and Description |
---|---|
org.springframework.data.domain.Page<AuditRecord> |
findAuditRecordByAuditOperationTypeAndAuditActionType(org.springframework.data.domain.Pageable pageable,
AuditActionType[] actions,
AuditOperationType[] operations)
Allows for querying of
AuditRecord s. |
AuditRecord |
findOne(Long id)
Find a single
AuditRecord by providing a mandatory id. |
AuditRecord |
populateAndSaveAuditRecord(AuditOperationType auditOperationType,
AuditActionType auditActionType,
String correlationId,
String data)
With a mandatory set of parameters, this method will create a
AuditRecord
instance and persist it to the underlying data store, e.g. |
AuditRecord |
populateAndSaveAuditRecordUsingMapData(AuditOperationType auditOperationType,
AuditActionType auditActionType,
String correlationId,
Map<String,Object> data)
Similar to
populateAndSaveAuditRecord(AuditOperationType, AuditActionType, String, String)
but instead of a String users can provide a Map as the Audit Data parameter,
which will be persisted as a JSON a structure. |
AuditRecord populateAndSaveAuditRecord(AuditOperationType auditOperationType, AuditActionType auditActionType, String correlationId, String data)
AuditRecord
instance and persist it to the underlying data store, e.g.
AuditRecordRepository
.auditOperationType
- Must not be nullauditActionType
- Must not be nullcorrelationId
- Id to identify the recorddata
- The data as String to be auditedAuditRecord populateAndSaveAuditRecordUsingMapData(AuditOperationType auditOperationType, AuditActionType auditActionType, String correlationId, Map<String,Object> data)
populateAndSaveAuditRecord(AuditOperationType, AuditActionType, String, String)
but instead of a String users can provide a Map
as the Audit Data parameter,
which will be persisted as a JSON a structure. Callers should therefore make sure that
the provided Map can indeed be serialized to JSON via Jackson.auditOperationType
- Must not be nullauditActionType
- Must not be nullcorrelationId
- Id to identify the recorddata
- The data as a Map to be auditedorg.springframework.data.domain.Page<AuditRecord> findAuditRecordByAuditOperationTypeAndAuditActionType(org.springframework.data.domain.Pageable pageable, AuditActionType[] actions, AuditOperationType[] operations)
AuditRecord
s.pageable
- Contains pagination information. If null, all AuditRecord
s will be returnedactions
- Can be null. For which AuditActionType
s shall AuditRecord
s be returnedoperations
- Can be null. For which AuditOperationType
s shall AuditRecord
s be returnedPage
of AuditRecord
sAuditRecord findOne(Long id)
AuditRecord
by providing a mandatory id.id
- Must not be null/Copyright © 2018 Pivotal Software, Inc.. All rights reserved.