Package sk.iway.iwcm.stat
Class SessionClusterService
java.lang.Object
sk.iway.iwcm.stat.SessionClusterService
Handles session data across cluster nodes, storing and retrieving session information
from the database to facilitate session management in a clustered environment.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetSessionInfo(String currentSessionId, int userId) Returns session information for the given user in JSON format, used in dashboard appstatic List<SessionDetails>getSessionsForUsers(Set<Integer> userIds) Reads sessions for an already authorized set of users in one cluster query.static com.fasterxml.jackson.databind.node.ArrayNodegetUserSessionsAllNodes(int userId) Read session data in database and deserialize to JSON nodesstatic voidYou can schedule this method to run periodically using CRONstatic voidUpdate session data in the database for the current node
-
Constructor Details
-
SessionClusterService
public SessionClusterService()
-
-
Method Details
-
main
You can schedule this method to run periodically using CRON- Parameters:
args-
-
getUserSessionsAllNodes
public static com.fasterxml.jackson.databind.node.ArrayNode getUserSessionsAllNodes(int userId) Read session data in database and deserialize to JSON nodes- Parameters:
userId-- Returns:
-
getSessionsForUsers
Reads sessions for an already authorized set of users in one cluster query. Callers must enforce permission and domain scope before supplying user IDs.- Parameters:
userIds- authorized user IDs to include- Returns:
- active session records without expanding the supplied user set
-
getSessionInfo
Returns session information for the given user in JSON format, used in dashboard app- Parameters:
currentSessionId-userId-- Returns:
-
updateSessionData
public static void updateSessionData()Update session data in the database for the current node
-