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 public class AuditServiceImpl extends BaseComponent implements AuditService
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.

  • Constructor Details

    • AuditServiceImpl

      public AuditServiceImpl()
  • Method Details

    • saveEntry

      public void saveEntry(AuditEntry auditEntry)
      Persist the provided audit entry in MongoDB.
      Specified by:
      saveEntry in interface AuditService
      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 interface AuditService
      Parameters:
      type - optional entry type to filter by
      from - 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