2121
2222public interface SessionDAO extends ActivatableEntityDAO <Session , Session > {
2323
24+ /** Creates a new Session for a specified group
25+ *
26+ * @param groupUUID The group UUID
27+ * @param uuid The Session UUID that is used to identify the new session
28+ * @param userSessionName The username for the session
29+ * @param clientIP The client IP of the new session
30+ * @param clientMachineName The client machine name for the new session
31+ * @param clientOSName The client OS name for the new session
32+ * @param clientVersion The client version of the new session
33+ * @param imageFormat The image format of the new session
34+ * @return Result refer to the new created session or to an error when happened*/
2435 Result <Session > createNew (
2536 String groupUUID ,
2637 String uuid ,
@@ -31,29 +42,97 @@ Result<Session> createNew(
3142 String clientVersion ,
3243 ImageFormat imageFormat );
3344
45+ /** Get a collection of all session uuid that are actually active for a given group.
46+ *
47+ * @param groupId The group id (PK)
48+ * @return Result refer to the resulting collection or to an error if happened */
3449 Result <Collection <String >> allLiveSessionUUIDsByGroupId (Long groupId );
3550
51+ /** Get a collection of all session uuid for a given group.
52+ *
53+ * @param groupId The group id (PK)
54+ * @return Result refer to the resulting collection or to an error if happened */
3655 Result <Collection <String >> allSessionUUIDsByGroupId (Long groupId );
3756
57+ /** Get a count of all active live session of a given group.
58+ *
59+ * @param groupId The group id (PK)
60+ * @return Result refer to the count or to an error when happened */
3861 Result <Long > allLiveSessionCount (Long groupId );
3962
63+ /** Get a count of all session of a given group.
64+ *
65+ * @param groupId The group id (PK)
66+ * @return Result refer to the count or to an error when happened */
4067 Result <Long > allSessionCount (Long groupId );
4168
69+ /** Close a given session.
70+ *
71+ * @param sessionUUID The session UUID to close.
72+ * @return Result refer to the UUID of the closed session or to an error when happened */
4273 Result <String > closeSession (String sessionUUID );
4374
75+ /** Close all open sessions within a given group.
76+ *
77+ * @param groupPK The group id (PK)
78+ * @return Result refer to a collection of EntityKey of all sessions that has been closed, or to an error when happened*/
4479 Result <Collection <EntityKey >> closeAllSessionsForGroup (Long groupPK );
4580
81+ /** Deletes all Session for a given list of groups
82+ *
83+ * @param groupPKs List of group PKs to delete all sessions for
84+ * @return Result refer to a collection of EntityKey of all deleted session, or to an error when happened*/
4685 Result <Collection <EntityKey >> deleteAllForGroups (final List <Long > groupPKs );
4786
87+ /** Get the number of screenshots for a given session filtered by screenshot metadata.
88+ * Filter criteria are of type API.ScreenshotMetadataType and are AND combined.
89+ *
90+ * @param uuid The session UUID
91+ * @param filterMap filter map containing filter criteria to apply to before count
92+ * @return the number of filtered screenshots for a given session */
4893 Long getNumberOfScreenshots (String uuid , FilterMap filterMap );
4994
95+ /** Indicates if there are any session data for a given list of groups.
96+ *
97+ * @param groupIds Collection of group ids (PK) to check for.
98+ * @return Result refer to the indicator or to an error when happened.*/
5099 Result <Boolean > hasAnySessionData (Collection <Long > groupIds );
51100
101+ /** Get a list of dates for which screenshot data exists for a given filter criteria.
102+ * This is used in multiple step searches where first a list of dates is presented where screenshot data exists
103+ * and only if one is interested in screenshot data of a specific date, the search is applied to get the data for
104+ * only this date, to improve performance.
105+ * <p>
106+ * Filter criteria:
107+ * <pre>
108+ * active = filterMap.getBooleanObject(API.ACTIVE_FILTER);
109+ * fromTime = filterMap.getLong(API.PARAM_FROM_TIME);
110+ * toTime = filterMap.getLong(API.PARAM_TO_TIME);
111+ * groupPKs = filterMap.getString(Domain.SESSION.ATTR_GROUP_ID);
112+ * sessionUUID = filterMap.contains(API.PARAM_SESSION_ID)
113+ * </pre>
114+ * @param filterMap The map containing the filter criteria
115+ * @return Result refer to a list of dates where screenshots exists or to an error when happened.*/
52116 Result <List <Date >> queryMatchingDaysForSessionSearch (final FilterMap filterMap );
53117
118+ /** This is only for distributed setups where we can get all session UUIDs of a given group that
119+ * are out of sync on its cached instances. This checks the update_time timestamps of cached instances with the once
120+ * on the database and gives all Session UUID that has different update_time and where updated by another SPS service.
121+ * @param groupId The group id (PK)
122+ * @param updateTimes List of update_time timestamps of all cached sessions.
123+ * @return Result refer to the list of session UUIDs that needs update, ot to an error when happened*/
54124 Result <List <String >> allTokensThatNeedsUpdate (Long groupId , Set <Long > updateTimes );
55-
125+
126+ /** Get the encryption key of the session used to encrypt/decrypt client side stored screenshot data.
127+ *
128+ * @param uuid The UUID of the session
129+ * @return Result refer to the encryption key of the session or to an error when happened */
56130 Result <String > getEncryptionKey (String uuid );
57131
132+ /** This us used to close a given open session at a given time.
133+ *
134+ * @param sessionUUID The UUID of the session to close at given time
135+ * @param termination_time The timestamp on which to close the session (unix timestamp im milliseconds)
136+ * @return Result refer to the close timestamp or to an error when happened.*/
58137 Result <Long > closeAt (String sessionUUID , Long termination_time );
59138}
0 commit comments