Class StatelessSession
- java.lang.Object
-
- com.iplanet.dpro.session.Session
-
- org.forgerock.openam.sso.providers.stateless.StatelessSession
-
- All Implemented Interfaces:
Blacklistable,AMSession
public class StatelessSession extends Session
TheStatelessSessionclass represents a stateless session. It is a simple overridden version ofSessionwhich allows for the addition of extra methods, or overriding of inherited ones.
-
-
Field Summary
Fields Modifier and Type Field Description static StringRESTRICTED_TOKENS_UNSUPPORTEDstatic StringSSOTOKEN_LISTENERS_UNSUPPORTED-
Fields inherited from class com.iplanet.dpro.session.Session
CACHED_BASE_POLLING_PROPERTY, sessionProperties, sessionState
-
-
Constructor Summary
Constructors Constructor Description StatelessSession(SessionID sid, SessionInfo sessionInfo, StatelessSessionManager statelessSessionManager)Constructs the stateless session with the given ID, session state and session factory.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringdereferenceRestrictedTokenID(Session session, String restrictedId)Given a restricted token, returns the SSOTokenID of the master token can only be used if the requester is an app token This functionality is only available in server mode.SessionIDgetID()Returns the session ID.StringgetProperty(String name)Gets the property stored in this session.Set<String>getPropertyNames()SessionIDgetSessionID()StringgetStableStorageID()Returns a stable ID that can be used as a unique identifier when storing this session.SessionStategetState(boolean reset)Returns the state of the session.booleanmaxCachingTimeReached()Used to find out if the maximum caching time has reached or not.voidsetProperty(String name, String value)Sets a property for this session.protected voidsetRestriction(TokenRestriction restriction)Sets a token restriction on this session.-
Methods inherited from class com.iplanet.dpro.session.Session
addInternalSessionListener, addSessionListener, addSessionListener, destroySession, getBlacklistExpiryTime, getClientDomain, getClientID, getCookieStr, getCookieSupport, getIdleTime, getLatestRefreshTime, getMaxCachingTime, getMaxIdleTime, getMaxSessionTime, getPropertyWithoutValidation, getRemoved, getRestriction, getSession, getSessionServiceURL, getTimeLeft, getType, getValidSessions, invokeListeners, isRestricted, isTimedOut, logout, refresh, setContext, setCookieMode, setCookieStr, setID, setState, timeout, toString, update
-
-
-
-
Constructor Detail
-
StatelessSession
public StatelessSession(SessionID sid, SessionInfo sessionInfo, StatelessSessionManager statelessSessionManager) throws SessionException
Constructs the stateless session with the given ID, session state and session factory.- Parameters:
sid- the initial ID of the session.sessionInfo- the initial of the session.statelessSessionManager- the factory to use for regenerating the session ID when the state of the session changes.- Throws:
SessionException- if an exception occurs.
-
-
Method Detail
-
dereferenceRestrictedTokenID
public String dereferenceRestrictedTokenID(Session session, String restrictedId) throws SessionException
Description copied from class:SessionGiven a restricted token, returns the SSOTokenID of the master token can only be used if the requester is an app token This functionality is only available in server mode.- Overrides:
dereferenceRestrictedTokenIDin classSession- Parameters:
session- Must be an app tokenrestrictedId- The SSOTokenID of the restricted token- Returns:
- The SSOTokenID string of the master token
- Throws:
SessionException- If the master token cannot be dereferenced
-
setRestriction
protected void setRestriction(TokenRestriction restriction)
Description copied from class:SessionSets a token restriction on this session. Optional operation - specific sub-classes can throw an exception if not supported.- Overrides:
setRestrictionin classSession- Parameters:
restriction- the restriction to apply to this session.
-
getStableStorageID
public String getStableStorageID()
Description copied from class:SessionReturns a stable ID that can be used as a unique identifier when storing this session.- Specified by:
getStableStorageIDin interfaceBlacklistable- Overrides:
getStableStorageIDin classSession- Returns:
- a unique stable storage id.
-
maxCachingTimeReached
public boolean maxCachingTimeReached()
Description copied from class:SessionUsed to find out if the maximum caching time has reached or not.- Overrides:
maxCachingTimeReachedin classSession
-
getProperty
public String getProperty(String name) throws SessionException
Description copied from class:SessionGets the property stored in this session.- Overrides:
getPropertyin classSession- Parameters:
name- The property name.- Returns:
- The property value in String format.
- Throws:
SessionException- is thrown if the session reached its maximum session time, or the session was destroyed, or there was an error during communication with session service.
-
setProperty
public void setProperty(String name, String value) throws SessionException
Description copied from class:SessionSets a property for this session.- Overrides:
setPropertyin classSession- Parameters:
name- The property name.value- The property value.- Throws:
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.
-
getState
public SessionState getState(boolean reset) throws SessionException
Description copied from class:SessionReturns the state of the session.- Overrides:
getStatein classSession- Parameters:
reset- This parameter indicates that whether the Session Service needs to reset the latest access time on this session.- Returns:
- The state of the session. The session state is one of the
following:
INVALID, VALID, INACTIVE, and DESTROYED. - Throws:
SessionException- is thrown if the session reached its maximum session time, or the session was destroyed, or there was an error during communication with session service.
-
getSessionID
public SessionID getSessionID()
- Overrides:
getSessionIDin classSession
-
-