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
AuditRecords. |
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)
AuditRecordServiceAuditRecord
instance and persist it to the underlying data store, e.g.
AuditRecordRepository.populateAndSaveAuditRecord in interface AuditRecordServiceauditOperationType - 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)
AuditRecordServiceAuditRecordService.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 AuditRecordServiceauditOperationType - 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)
AuditRecordServiceAuditRecords.findAuditRecordByAuditOperationTypeAndAuditActionType in interface AuditRecordServicepageable - Contains pagination information. If null, all AuditRecords will be returnedactions - Can be null. For which AuditActionTypes shall AuditRecords be returnedoperations - Can be null. For which AuditOperationTypes shall AuditRecords be returnedPage of AuditRecordspublic AuditRecord findOne(Long id)
AuditRecordServiceAuditRecord by providing a mandatory id.findOne in interface AuditRecordServiceid - Must not be null/Copyright © 2018 Pivotal Software, Inc.. All rights reserved.