Package com.iplanet.dpro.session.service
Class SessionService
- java.lang.Object
-
- com.iplanet.dpro.session.service.SessionService
-
@Singleton public class SessionService extends Object
This class represents a Session Service.
-
-
Field Summary
Fields Modifier and Type Field Description static StringSESSION_SERVICEService name for NotificationSets.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSessionListener(Session session, String url)Adds listener to a Internal Sessions.booleancheckSessionExists(SessionID sessionId)Check whether a session identified by {code sessionId} can be retrieved.voiddestroyAuthenticationSession(SessionID sessionID)Destroy a Internal Session, whose session id has been specified.voiddestroySession(Session requester, SessionID sessionToDestroy)Destroy a Internal Session, depending on the value of the user's permissions.static StringgetAMServerID()Gets the AM Server ID.Collection<PartialSession>getMatchingSessions(Session caller, CrestQuery crestQuery)Returns partial (stateful) sessions matching the provided CREST query.StringgetRestrictedTokenId(String masterSid, TokenRestriction restriction)Returns the restricted tokenSessionInfogetSessionInfo(SessionID sid, boolean reset)Returns the Session information.SearchResults<SessionInfo>getValidSessions(Session s, String pattern)Gets all valid Internal Sessions, depending on the value of the user's preferences.booleanisSuperUser(String uuid)Returns true if the user is super uservoidlogout(Session session)Logout the user.InternalSessionnewInternalSession(String domain, boolean stateless)InternalSessionnewInternalSession(String domain, boolean stateless, boolean checkCts)voidsetExternalProperty(SSOToken clientToken, SessionID sessionId, String name, String value)Sets external property in the Internal Session as long as it is not protected
-
-
-
Field Detail
-
SESSION_SERVICE
public static final String SESSION_SERVICE
Service name for NotificationSets.- See Also:
- Constant Field Values
-
-
Method Detail
-
getRestrictedTokenId
public String getRestrictedTokenId(String masterSid, TokenRestriction restriction) throws SessionException
Returns the restricted token- Parameters:
masterSid- master session idrestriction- TokenRestriction Object- Returns:
- restricted token id
- Throws:
SessionException
-
newInternalSession
public InternalSession newInternalSession(String domain, boolean stateless)
-
newInternalSession
public InternalSession newInternalSession(String domain, boolean stateless, boolean checkCts)
-
destroySession
public void destroySession(Session requester, SessionID sessionToDestroy) throws SessionException
Destroy a Internal Session, depending on the value of the user's permissions. Performs no action if the sessionID cannot be matched.- Parameters:
requester- The requesting Session.sessionToDestroy- The session to destroy.- Throws:
SessionException- If the user has insufficient permissions.
-
destroyAuthenticationSession
public void destroyAuthenticationSession(SessionID sessionID)
Destroy a Internal Session, whose session id has been specified.- Parameters:
sessionID-
-
checkSessionExists
public boolean checkSessionExists(SessionID sessionId) throws SessionException
Check whether a session identified by {code sessionId} can be retrieved.- Parameters:
sessionId- the session ID to check.- Returns:
- returns true if the session is local
- Throws:
SessionException- if the session could not be accessed.
-
getSessionInfo
public SessionInfo getSessionInfo(SessionID sid, boolean reset) throws SessionException
Returns the Session information.- Parameters:
sid-reset-- Throws:
SessionException
-
getValidSessions
public SearchResults<SessionInfo> getValidSessions(Session s, String pattern) throws SessionException
Gets all valid Internal Sessions, depending on the value of the user's preferences.- Parameters:
s-- Throws:
SessionException
-
getMatchingSessions
public Collection<PartialSession> getMatchingSessions(Session caller, CrestQuery crestQuery) throws SessionException
Returns partial (stateful) sessions matching the provided CREST query. The resultset size is limited by the "iplanet-am-session-max-session-list-size" attribute. The returned sessions are only "partial" sessions, meaning that they do not represent the full session state.- 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. May not be null.- Returns:
- The collection of matching partial sessions.
- Throws:
SessionException- If the request fails.- See Also:
SessionOperations.getMatchingSessions(CrestQuery)
-
logout
public void logout(Session session) throws SessionException
Logout the user.- Parameters:
session-- Throws:
SessionException
-
addSessionListener
public void addSessionListener(Session session, String url) throws SessionException
Adds listener to a Internal Sessions.- Parameters:
session- Sessionurl-- Throws:
SessionException- Session is null OR the Session is invalid
-
setExternalProperty
public void setExternalProperty(SSOToken clientToken, SessionID sessionId, String name, String value) throws SessionException
Sets external property in the Internal Session as long as it is not protected- Parameters:
clientToken- - Token of the client setting external property.sessionId-name-value-- Throws:
SessionException
-
isSuperUser
public boolean isSuperUser(String uuid)
Returns true if the user is super user- Parameters:
uuid- the uuid of the login user
-
getAMServerID
public static String getAMServerID()
Gets the AM Server ID.- Returns:
- the AM Server Id or null if WebtopNaming was unable to detmin the ID of this server.
-
-