public class MonitoredOperations extends Object implements SessionOperations
SessionOperations
instance with timing meta information, and
inserts that into an appropriate monitoring store. Uses a SessionMonitorType
to inform
the SessionMonitoringStore
under what collection to store its entries.Constructor and Description |
---|
MonitoredOperations(SessionOperations sessionOperations,
SessionMonitorType monitorType,
SessionMonitoringStore sessionMonitoringStore)
Sets up an appropriate
SessionOperations , linking it to its SessionMonitorType and
giving it a link to the singleton SessionMonitoringStore . |
Modifier and Type | Method and Description |
---|---|
void |
addSessionListener(Session session,
String url)
Add a session listener notification url.
|
boolean |
checkSessionExists(SessionID sessionId)
Check whether a session identified by {code sessionId} can be retrieved.
|
String |
deferenceRestrictedID(Session session,
SessionID restrictedID)
Given a restricted token, returns the SSOTokenID of the master token
can only be used if the requester is an app token
|
void |
destroy(Session requester,
Session session)
Destroys the Session by removing it and moving it to the DESTROY state.
|
boolean |
equals(Object obj) |
Collection<PartialSession> |
getMatchingSessions(CrestQuery crestQuery)
Returns partial sessions from the session service backend that matches the provided CREST query.
|
String |
getRestrictedTokenId(SessionID masterSid,
TokenRestriction restriction)
Gets the restricted token ID for a session.
|
SessionInfo |
getSessionInfo(SessionID sid,
boolean reset)
Get the Session Info Object from the Session ID.
|
SearchResults<SessionInfo> |
getValidSessions(Session session,
String pattern)
Returns all sessions which are accessible using the provided session for authorization, and which match the
provided filter.
|
void |
logout(Session session)
Performs the logout operation on the Session.
|
SessionInfo |
refresh(Session session,
boolean reset)
Performs a refresh of the Session and return a summary of the Session information.
|
Session |
resolveSession(SessionID sessionID)
Retrieves the Session from the Session ID.
|
void |
setExternalProperty(SSOToken clientToken,
SessionID sessionId,
String name,
String value)
Sets an external property in the session.
|
void |
setProperty(Session session,
String name,
String value)
Assigns the property to the Session.
|
String |
toString() |
public MonitoredOperations(SessionOperations sessionOperations, SessionMonitorType monitorType, SessionMonitoringStore sessionMonitoringStore)
SessionOperations
, linking it to its SessionMonitorType
and
giving it a link to the singleton SessionMonitoringStore
.sessionOperations
- The SessionOperations to wrapmonitorType
- Whether these SessionOperations are for LOCAL, REMOTE, etc.sessionMonitoringStore
- The store to use to write the data topublic SessionInfo refresh(Session session, boolean reset) throws SessionException
refresh
in interface SessionOperations
session
- Reference to the Session.reset
- If true, then update the last modified timestamp of the Session.SessionException
public void logout(Session session) throws SessionException
logout
in interface SessionOperations
session
- Session to logout.SessionException
public Session resolveSession(SessionID sessionID) throws SessionException
SessionOperations
resolveSession
in interface SessionOperations
sessionID
- the ID of the session to resolveSessionException
- if the session could not be accessed.public SearchResults<SessionInfo> getValidSessions(Session session, String pattern) throws SessionException
SessionOperations
getValidSessions
in interface SessionOperations
session
- The session to use for authorization.pattern
- The pattern to use to match the sessions.SessionException
- If the request fails.public Collection<PartialSession> getMatchingSessions(CrestQuery crestQuery) throws SessionException
SessionOperations
getMatchingSessions
in interface SessionOperations
crestQuery
- The CREST query based on which we should look for matching sessions.SessionException
- If the request fails.public void destroy(Session requester, Session session) throws SessionException
SessionOperations
destroy
in interface SessionOperations
requester
- The requester's non null session used to authorize the destroy operation.session
- The non null session to destroy.SessionException
- If there was an error while deleting the token.public void setProperty(Session session, String name, String value) throws SessionException
setProperty
in interface SessionOperations
session
- The session to perform the set on.name
- Non null name of the property.value
- Non null value.SessionException
- SessionException if the session reached its maximum
session time, or the session was destroyed, or there was an error during
communication with session service, or if the property name or value was null.public SessionInfo getSessionInfo(SessionID sid, boolean reset) throws SessionException
SessionOperations
getSessionInfo
in interface SessionOperations
sid
- the Session Id of the required Session Info.reset
- if true will cause the last access time on the session to be updated.SessionException
- if the session could not be accessed.public void addSessionListener(Session session, String url) throws SessionException
SessionOperations
addSessionListener
in interface SessionOperations
session
- the session to listen to.url
- the listener notification urlSessionException
- if the session could not be accessed.public boolean checkSessionExists(SessionID sessionId) throws SessionException
SessionOperations
checkSessionExists
in interface SessionOperations
sessionId
- the session ID to check.SessionException
- if the session could not be accessed.public String getRestrictedTokenId(SessionID masterSid, TokenRestriction restriction) throws SessionException
SessionOperations
getRestrictedTokenId
in interface SessionOperations
masterSid
- the master session id to get the restricted token id forrestriction
- the Token Restriction type to useSessionException
- if the session could not be accessed.public String deferenceRestrictedID(Session session, SessionID restrictedID) throws SessionException
SessionOperations
deferenceRestrictedID
in interface SessionOperations
session
- Must be an app tokenrestrictedID
- The SSOTokenID of the restricted tokenSessionException
- If the master token cannot be de-referencedpublic void setExternalProperty(SSOToken clientToken, SessionID sessionId, String name, String value) throws SessionException
SessionOperations
setExternalProperty
in interface SessionOperations
clientToken
- SSO Token of the client setting external property.sessionId
- The Id of the session to set the property onname
- the name of the propertyvalue
- the new value of the propertySessionException
- If the Session could not be accessed or the property is protected.Copyright © 2010–2025 Open Identity Platform Community. All rights reserved.