Class SessionClusterService

java.lang.Object
sk.iway.iwcm.stat.SessionClusterService

public class SessionClusterService extends Object
Handles session data across cluster nodes, storing and retrieving session information from the database to facilitate session management in a clustered environment.
  • Constructor Details

    • SessionClusterService

      public SessionClusterService()
  • Method Details

    • main

      public static void main(String[] args)
      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

      public static List<SessionDetails> getSessionsForUsers(Set<Integer> userIds)
      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

      public static String getSessionInfo(String currentSessionId, int userId)
      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