Record Class AuditQuery
java.lang.Object
java.lang.Record
com.svenruppert.jsentinel.audit.AuditQuery
- Record Components:
types- restrict to theseAuditEventsubtypes, or empty to allow every typesubjectId- restrict to events whosesubjectIdequals this value, ornullto ignore the subjectfrom- restrict to events withtimestamp≥from, ornullfor no lower boundto- restrict to events withtimestamp≤to, ornullfor no upper boundlimit- maximum number of results, or0for unlimited
public record AuditQuery(Set<Class<? extends AuditEvent>> types, String subjectId, Instant from, Instant to, int limit)
extends Record
Filter passed to
JSentinelAuditService.query(...). All fields are
optional — a all() query returns every retained event.
Filters compose with AND semantics: an event must match every non-empty predicate to be included.
-
Constructor Summary
ConstructorsConstructorDescriptionAuditQuery(Set<Class<? extends AuditEvent>> types, String subjectId, Instant from, Instant to, int limit) Creates an instance of aAuditQueryrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic AuditQueryall()A query that returns every retained event.final booleanIndicates whether some other object is "equal to" this one.static AuditQueryforSubject(String subjectId) A query restricted to a single subject.from()Returns the value of thefromrecord component.final inthashCode()Returns a hash code value for this object.intlimit()Returns the value of thelimitrecord component.booleanmatches(AuditEvent event) static AuditQueryofType(Class<? extends AuditEvent> type) A query restricted to a single event type.Returns the value of thesubjectIdrecord component.to()Returns the value of thetorecord component.final StringtoString()Returns a string representation of this record class.Set<Class<? extends AuditEvent>> types()Returns the value of thetypesrecord component.
-
Constructor Details
-
AuditQuery
-
-
Method Details
-
all
A query that returns every retained event. -
ofType
A query restricted to a single event type.- Parameters:
type- theAuditEventsubtype to filter on- Returns:
- query matching only events of
type
-
forSubject
A query restricted to a single subject.- Parameters:
subjectId- the subject id to filter on- Returns:
- query matching only events carrying
subjectId
-
matches
- Parameters:
event- the event to test against this query's predicates- Returns:
trueif the event matches every active predicate
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
types
-
subjectId
-
from
-
to
-
limit
-