Package org.saidone.service.audit
Class AuditServiceImpl
java.lang.Object
org.saidone.component.BaseComponent
org.saidone.service.audit.AuditServiceImpl
- All Implemented Interfaces:
AuditService
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
Service for persisting and retrieving
AuditEntry
instances.
Audit entries are stored in MongoDB via the configured MongoTemplate
and can be queried by type and timestamp range.
-
Field Summary
Fields inherited from interface org.saidone.service.audit.AuditService
AUDIT_COLLECTION_NAME
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfindEntries
(String type, Instant from, Instant to, org.springframework.data.domain.Pageable pageable) Retrieve audit entries filtered by type and timestamp.void
saveEntry
(AuditEntry auditEntry) Persist the provided audit entry in MongoDB.Methods inherited from class org.saidone.component.BaseComponent
init, setApplicationContext, shutDown, stop
-
Constructor Details
-
AuditServiceImpl
public AuditServiceImpl()
-
-
Method Details
-
saveEntry
Persist the provided audit entry in MongoDB.- Specified by:
saveEntry
in interfaceAuditService
- Parameters:
auditEntry
- the entry to store
-
findEntries
public List<AuditEntry> findEntries(String type, Instant from, Instant to, org.springframework.data.domain.Pageable pageable) Retrieve audit entries filtered by type and timestamp.- Specified by:
findEntries
in interfaceAuditService
- Parameters:
type
- optional entry type to filter byfrom
- lower bound of the timestamp range (inclusive)to
- upper bound of the timestamp range (inclusive)pageable
- pagination information such as page number and size- Returns:
- list of matching audit entries ordered by timestamp descending
-