Class CompositeAuditService
java.lang.Object
com.svenruppert.jsentinel.audit.CompositeAuditService
- All Implemented Interfaces:
JSentinelAuditService
JSentinelAuditService that fans every published event out to:
- a primary
RingBufferAuditSinkused as the query backend, and - zero or more additional
AuditSinks (logging, file, SIEM, …).
publish(...) to throw.
Queries always read from the ring buffer. Applications that need a different query backend can wrap this class.
-
Constructor Summary
ConstructorsConstructorDescriptionCompositeAuditService(RingBufferAuditSink ringBuffer, AuditSink... extraSinks) -
Method Summary
Modifier and TypeMethodDescriptionReturns an unmodifiable snapshot of the configured extra sinks.voidpublish(AuditEvent event) Records the given event.query(AuditQuery query) Returns retained events matchingquery, oldest first.Visible for application setup code that wants to consult the buffer directly.
-
Constructor Details
-
CompositeAuditService
- Parameters:
ringBuffer- query-backing in-memory buffer, nevernullextraSinks- additional write-only sinks; may be empty
-
-
Method Details
-
publish
Description copied from interface:JSentinelAuditServiceRecords the given event. Never throws.- Specified by:
publishin interfaceJSentinelAuditService- Parameters:
event- non-nulltyped audit event
-
query
Description copied from interface:JSentinelAuditServiceReturns retained events matchingquery, oldest first. Implementations that do not retain events return an empty list.- Specified by:
queryin interfaceJSentinelAuditService- Parameters:
query- filter, nevernull- Returns:
- retained matching events, never
null
-
ringBuffer
Visible for application setup code that wants to consult the buffer directly. -
extraSinks
-