Interface LoginHistory
- All Known Implementing Classes:
LoginHistoryProvider
Interface to manage login history.
-
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteUserLogin(int userId) Deletes all login entries associated with the specified user ID.booleanexistsLogin(UUID loginId) Checks if a login record exists with the specified login ID.getClientVersion(UUID loginId) Retrieves the client version associated with the given login ID.getFirstLoginTimeByIP(String ipAddress) Retrieves the first login timestamp associated with a specific IP address.getFirstLoginTimeByUser(int userId, String ipAddress) Retrieves the earliest login time for a specified user associated with a specific IP address.getIPAddress(UUID loginId) Retrieves the IP address associated with a specific login session.getLastLoginId(int userId) Retrieves the most recent login ID for a specified user from their login history.getLastLoginTimeByIP(String ipAddress) Retrieves the last login time associated with the specified IP address.getLastLoginTimeByUser(int userId, String ipAddress) Retrieves the most recent login time for a user based on their user ID and IP address.getLastQuit(int userId) Retrieves the timestamp of the most recent logout event for the specified user.getLogins(int userId) Retrieves a list of login IDs (UUIDs) associated with a specific user.getLoginTime(UUID loginId) Retrieves the login time for a specific login ID.getLogoutDate(UUID loginId) Retrieves the formatted logout date associated with the given login ID.getLogoutTime(UUID loginId) Retrieves the logout time associated with a specific login session.getProtocolVersion(UUID loginId) Retrieves the protocol version associated with a specific login ID.getSortedLogins(int userId) Retrieves a list of login IDs associated with a specific user, sorted in descending order of login time, with a maximum limit.intRetrieves the user ID associated with the given login ID.getUserIdsByIP(String ipAddress) Retrieves a list of user IDs associated with a specified IP address.
-
Method Details
-
existsLogin
Checks if a login record exists with the specified login ID.- Parameters:
loginId- The unique identifier of the login record to check.- Returns:
- true if a login record exists with the specified login ID, false otherwise.
-
deleteUserLogin
void deleteUserLogin(int userId) Deletes all login entries associated with the specified user ID.- Parameters:
userId- The unique identifier of the user whose login history should be deleted.
-
getLogins
Retrieves a list of login IDs (UUIDs) associated with a specific user.- Parameters:
userId- The unique identifier of the user whose login records are being retrieved- Returns:
- A list of UUIDs representing the login records for the specified user
-
getSortedLogins
Retrieves a list of login IDs associated with a specific user, sorted in descending order of login time, with a maximum limit.- Parameters:
userId- The unique identifier of the user whose sorted login records are to be retrieved- Returns:
- A list of UUIDs representing the login records, sorted by login time
-
getLastLoginId
Retrieves the most recent login ID for a specified user from their login history.- Parameters:
userId- The unique identifier of the user whose last login ID is to be retrieved.- Returns:
- The UUID representing the most recent login ID for the specified user,
or
nullif no login history exists for the user.
-
getLastQuit
Retrieves the timestamp of the most recent logout event for the specified user.- Parameters:
userId- The unique identifier of the user whose last quit time is to be retrieved.- Returns:
- A
Timestampobject representing the time of the user's last quit, ornullif no quit record exists for the specified user.
-
getUserIdsByIP
Retrieves a list of user IDs associated with a specified IP address.- Parameters:
ipAddress- The IP address for which the associated user IDs are to be retrieved.- Returns:
- A list of integers representing the user IDs associated with the given IP address.
-
getUserId
Retrieves the user ID associated with the given login ID.- Parameters:
loginId- The unique identifier of the login session- Returns:
- The user ID linked to the specified login ID, or a negative value if not found
-
getIPAddress
Retrieves the IP address associated with a specific login session.- Parameters:
loginId- The unique identifier of the login session- Returns:
- The IP address as a string, or null if the login session does not exist or has no associated IP address
-
getFirstLoginTimeByUser
Retrieves the earliest login time for a specified user associated with a specific IP address.- Parameters:
userId- The ID of the user whose first login time is to be retrieved.ipAddress- The IP address associated with the user's login.- Returns:
- A Timestamp object representing the first login time for the user with the specified IP address, or null if no record is found.
-
getFirstLoginTimeByIP
Retrieves the first login timestamp associated with a specific IP address.- Parameters:
ipAddress- The IP address for which the first login timestamp is to be retrieved- Returns:
- The timestamp of the first login associated with the specified IP address,
or
nullif no login records exist for the given IP address
-
getLastLoginTimeByUser
Retrieves the most recent login time for a user based on their user ID and IP address.- Parameters:
userId- The unique identifier of the user whose last login time is to be retrieved.ipAddress- The IP address associated with the user's login.- Returns:
- A
Timestampobject representing the time of the user's last login from the specified IP address, ornullif no login information is found.
-
getLastLoginTimeByIP
Retrieves the last login time associated with the specified IP address.- Parameters:
ipAddress- The IP address for which the last login time is to be retrieved.- Returns:
- A
Timestamprepresenting the last login time for the specified IP address, or null if no such login record exists.
-
getLoginTime
Retrieves the login time for a specific login ID.- Parameters:
loginId- The unique identifier associated with the login.- Returns:
- The timestamp indicating the login time, or null if no record is found.
-
getLogoutTime
Retrieves the logout time associated with a specific login session.- Parameters:
loginId- The unique identifier of the login session- Returns:
- The timestamp when the user logged out, or null if the logout time is not set
-
getLogoutDate
Retrieves the formatted logout date associated with the given login ID. If no logout time is available, the method will return "never."- Parameters:
loginId- The unique identifier of the login session.- Returns:
- A string representing the logout date in a formatted style, or "never" if the logout time is not available.
-
getClientVersion
Retrieves the client version associated with the given login ID.- Parameters:
loginId- The unique identifier of the login session- Returns:
- The client version string if found, or null if no client version is associated with the given login ID
-
getProtocolVersion
Retrieves the protocol version associated with a specific login ID.- Parameters:
loginId- The unique identifier of the login session.- Returns:
- The protocol version as a string, or null if not found.
-