Record Class SecurityEvent
java.lang.Object
java.lang.Record
com.irurueta.authserver.authorization.domain.mfa.SecurityEvent
- Record Components:
type- kind of event.userId- identifier of the user concerned, ornullwhen the event cannot be tied to an account.username- name that was presented, ornull.detail- short description of the circumstances, ornull.occurredAt- instant of the event.
public record SecurityEvent(SecurityEventType type, UUID userId, String username, String detail, Instant occurredAt)
extends Record
An authentication event kept for audit. It never carries a credential, a code or a token.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final StringThe field for thedetailrecord component.private final InstantThe field for theoccurredAtrecord component.private final SecurityEventTypeThe field for thetyperecord component.private final UUIDThe field for theuserIdrecord component.private final StringThe field for theusernamerecord component. -
Constructor Summary
ConstructorsConstructorDescriptionSecurityEvent(SecurityEventType type, UUID userId, String username, String detail, Instant occurredAt) Validates the event. -
Method Summary
Modifier and TypeMethodDescriptiondetail()Returns the value of thedetailrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theoccurredAtrecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.userId()Returns the value of theuserIdrecord component.username()Returns the value of theusernamerecord component.
-
Field Details
-
type
The field for thetyperecord component. -
userId
The field for theuserIdrecord component. -
username
The field for theusernamerecord component. -
detail
The field for thedetailrecord component. -
occurredAt
The field for theoccurredAtrecord component.
-
-
Constructor Details
-
SecurityEvent
public SecurityEvent(SecurityEventType type, UUID userId, String username, String detail, Instant occurredAt) Validates the event.- Throws:
IllegalArgumentException- if the type or the instant is missing, or an optional text is blank.
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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. All components in this record class are compared withObjects::equals(Object,Object). -
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
userId
Returns the value of theuserIdrecord component.- Returns:
- the value of the
userIdrecord component
-
username
Returns the value of theusernamerecord component.- Returns:
- the value of the
usernamerecord component
-
detail
Returns the value of thedetailrecord component.- Returns:
- the value of the
detailrecord component
-
occurredAt
Returns the value of theoccurredAtrecord component.- Returns:
- the value of the
occurredAtrecord component
-