public class DefaultAuditRecordService extends Object implements AuditRecordService
AuditRecordService
.Constructor and Description |
---|
DefaultAuditRecordService(AuditRecordRepository auditRecordRepository) |
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
AuditRecordService.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. |
public DefaultAuditRecordService(AuditRecordRepository auditRecordRepository)
public AuditRecord populateAndSaveAuditRecord(AuditOperationType auditOperationType, AuditActionType auditActionType, String correlationId, String data)
AuditRecordService
AuditRecord
instance and persist it to the underlying data store, e.g.
AuditRecordRepository
.populateAndSaveAuditRecord
in interface AuditRecordService
auditOperationType
- Must not be nullauditActionType
- Must not be nullcorrelationId
- Id to identify the recorddata
- The data as String to be auditedpublic AuditRecord populateAndSaveAuditRecordUsingMapData(AuditOperationType auditOperationType, AuditActionType auditActionType, String correlationId, Map<String,Object> data)
AuditRecordService
AuditRecordService.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.populateAndSaveAuditRecordUsingMapData
in interface AuditRecordService
auditOperationType
- Must not be nullauditActionType
- Must not be nullcorrelationId
- Id to identify the recorddata
- The data as a Map to be auditedpublic org.springframework.data.domain.Page<AuditRecord> findAuditRecordByAuditOperationTypeAndAuditActionType(org.springframework.data.domain.Pageable pageable, AuditActionType[] actions, AuditOperationType[] operations)
AuditRecordService
AuditRecord
s.findAuditRecordByAuditOperationTypeAndAuditActionType
in interface AuditRecordService
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
spublic AuditRecord findOne(Long id)
AuditRecordService
AuditRecord
by providing a mandatory id.findOne
in interface AuditRecordService
id
- Must not be null/Copyright © 2018 Pivotal Software, Inc.. All rights reserved.