Class SessionQueryManager
- java.lang.Object
-
- org.forgerock.openam.session.service.access.SessionQueryManager
-
public class SessionQueryManager extends Object
Class responsible for allowing searches over groups of sessions. Does not return complete session objects, but objects which capture some of the information within.
-
-
Constructor Summary
Constructors Constructor Description SessionQueryManager(Debug debug, SessionPersistenceStore sessionPersistenceStore, SessionChangeAuthorizer sessionChangeAuthorizer, SessionServiceConfig serviceConfig, DNWrapper dnWrapper)Creates a session query manager.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,Long>getAllSessionsByUUID(String uuid)Returns the expiration information of all sessions belonging to a user (uuid).Collection<PartialSession>getMatchingValidSessions(Session caller, CrestQuery crestQuery)Return partial sessions matching the provided CREST query filter from the CTS servers.SearchResults<SessionInfo>getValidSessions(Session actingSession, String pattern)Gets all valid Internal Sessions, depending on the value of the user's preferences.
-
-
-
Constructor Detail
-
SessionQueryManager
@Inject public SessionQueryManager(@Named("amSession") Debug debug, SessionPersistenceStore sessionPersistenceStore, SessionChangeAuthorizer sessionChangeAuthorizer, SessionServiceConfig serviceConfig, DNWrapper dnWrapper)Creates a session query manager.- Parameters:
debug- The debug object.sessionPersistenceStore- The store which is being used for queries.sessionChangeAuthorizer- The authorizer used to check what the caller may see.serviceConfig- The session service configuration.dnWrapper- Used to convert the realm DNs held by sessions and identities into realm paths.
-
-
Method Detail
-
getMatchingValidSessions
public Collection<PartialSession> getMatchingValidSessions(Session caller, CrestQuery crestQuery) throws SessionException
Return partial sessions matching the provided CREST query filter from the CTS servers.The realm named in the query filter is authorized against the caller before the query is run: the caller must either hold the top level admin role, or the realm must be the caller's own realm or one of its sub realms, or the realm must be listed in the caller's iplanet-am-session-get-valid-sessions attribute. The query filter is the only place the realm is taken from, so without this check any caller reaching this method is able to list the sessions of every realm of the deployment.
- Parameters:
caller- The session that initiated the query request. May not be null.crestQuery- The CREST query based on which we should look for matching sessions.- Returns:
- The collection of matching partial sessions.
- Throws:
SessionException- If the request fails, or if the caller may not list the sessions of the realm named in the query filter.
-
getAllSessionsByUUID
public Map<String,Long> getAllSessionsByUUID(String uuid) throws SessionException
Returns the expiration information of all sessions belonging to a user (uuid). The returned value will be a Map (sid->expiration_time).- Parameters:
uuid- User's universal unique ID.- Returns:
- user Sessions
- Throws:
SessionException- if there is any problem with accessing the session repository.
-
getValidSessions
public SearchResults<SessionInfo> getValidSessions(Session actingSession, String pattern) throws SessionException
Gets all valid Internal Sessions, depending on the value of the user's preferences.- Parameters:
actingSession- the session on whose behalf valid sessions are retrieved- Throws:
SessionException- if the valid sessions cannot be retrieved
-
-