Class DelegatingAuditEventRepository
java.lang.Object
se.swedenconnect.spring.saml.idp.audit.repository.DelegatingAuditEventRepository
- All Implemented Interfaces:
org.springframework.boot.actuate.audit.AuditEventRepository
public class DelegatingAuditEventRepository
extends Object
implements org.springframework.boot.actuate.audit.AuditEventRepository
A delegating
AuditEventRepository
that can be used to support multiple AuditEventRepository
instances.
Note that when invoking find(String, Instant, String)
, the first installed repository will be tried, and if
that repository returns an empty list, the next repository will be tried.
- Author:
- Martin Lindström
-
Constructor Summary
ConstructorDescriptionDelegatingAuditEventRepository
(List<org.springframework.boot.actuate.audit.AuditEventRepository> repositories) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(org.springframework.boot.actuate.audit.AuditEvent event) Adds the event to all installed repositories.List
<org.springframework.boot.actuate.audit.AuditEvent> The first installed repository will be tried, and if that repository returns an empty list, the next repository will be tried, and so on.
-
Constructor Details
-
DelegatingAuditEventRepository
public DelegatingAuditEventRepository(List<org.springframework.boot.actuate.audit.AuditEventRepository> repositories) Constructor.- Parameters:
repositories
- the underlyingAuditEventRepository
instances.
-
-
Method Details
-
add
public void add(org.springframework.boot.actuate.audit.AuditEvent event) Adds the event to all installed repositories.- Specified by:
add
in interfaceorg.springframework.boot.actuate.audit.AuditEventRepository
-
find
public List<org.springframework.boot.actuate.audit.AuditEvent> find(String principal, Instant after, String type) The first installed repository will be tried, and if that repository returns an empty list, the next repository will be tried, and so on.- Specified by:
find
in interfaceorg.springframework.boot.actuate.audit.AuditEventRepository
-