Class AuditLog
java.lang.Object
com.serinity.accesscontrol.model.base.IdentifiableEntity
com.serinity.accesscontrol.model.AuditLog
Represents an audit log entry in the system. Used to record actions performed
by users,
along with metadata such as the IP address and timestamp of the action.
This entity extends IdentifiableEntity, which provides a unique
id for
each log entry.
The table audit_logs has the following indexes for performance
optimization:
idx_audit_created- Indexed oncreated_atto speed up time-based queries.
Fields include:
action- A description of the action performed.ipAddress- IP address of the user who performed the action.createdAt- Timestamp when the action was performed.user- TheUserwho performed the action.
Note: This class is declared final to prevent inheritance and ensure
session integrity.
- Since:
- 2026-02-03
- Version:
- 1.0
- Author:
- @ZouariOmar (zouariomar20@gmail.com)
- See Also:
-
Field Summary
Fields inherited from class IdentifiableEntity
id -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the action associated with this log entry.Returns the audit creation timestamp.Returns the hostname captured at creation time.Returns the location metadata captured at creation time.Returns the MAC address captured at creation time.Returns the operating system name captured at creation time.Returns the private IP address captured at creation time.Returns the linked authentication session.voidSets the action associated with this log entry.voidsetSession(AuthSession session) Sets the linked authentication session.Methods inherited from class IdentifiableEntity
getId
-
Constructor Details
-
AuditLog
public AuditLog()Creates an empty audit log entity.
-
-
Method Details
-
getAction
Returns the action associated with this log entry.- Returns:
- action value for this audit record
-
setAction
Sets the action associated with this log entry.- Parameters:
action- audit action value to persist
-
getOsName
Returns the operating system name captured at creation time.- Returns:
- operating system name
-
getHostname
-
getPrivateIpAddress
Returns the private IP address captured at creation time.- Returns:
- private IP address
-
getMacAddress
Returns the MAC address captured at creation time.- Returns:
- MAC address
-
getLocation
Returns the location metadata captured at creation time.- Returns:
- location metadata
-
getCreatedAt
-
getSession
Returns the linked authentication session.- Returns:
- linked authentication session
-
setSession
Sets the linked authentication session.- Parameters:
session- authentication session related to this audit entry
-