Class SessionPropertyUpgrader
- java.lang.Object
-
- org.forgerock.openam.authentication.service.SessionPropertyUpgrader
-
- Direct Known Subclasses:
DefaultSessionPropertyUpgrader
@SupportedAll public abstract class SessionPropertyUpgrader extends Object
This class is used in case of session upgrade for copying session properties from the old session into the new one. Subclasses should implementshouldCopy(java.lang.String)
in order to control which properties are needed to copy into the new session. In case you want to modify the copyable session property you are encouraged to overrideupdateProperty(com.iplanet.dpro.session.service.SessionBuilder, java.lang.String, java.lang.String)
method.
-
-
Constructor Summary
Constructors Constructor Description SessionPropertyUpgrader()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static SessionPropertyUpgrader
loadPropertyUpgrader()
Attempts to load the configured session property upgrader class.void
populateProperties(org.forgerock.openam.session.Session oldSession, com.iplanet.dpro.session.service.SessionBuilder newSession, boolean forceAuth)
Entry point for LoginState.abstract boolean
shouldCopy(String key)
This method decides whether a given session property should be copied to the new session.void
updateProperty(com.iplanet.dpro.session.service.SessionBuilder session, String property, String value)
This method updates a session property in the session with the given value.
-
-
-
Method Detail
-
loadPropertyUpgrader
public static SessionPropertyUpgrader loadPropertyUpgrader()
Attempts to load the configured session property upgrader class.
-
populateProperties
public final void populateProperties(org.forgerock.openam.session.Session oldSession, com.iplanet.dpro.session.service.SessionBuilder newSession, boolean forceAuth) throws com.iplanet.dpro.session.SessionException
Entry point for LoginState. This method is called during session upgrade in order to copy session attributes from one session to another.- Parameters:
oldSession
- The previous sessionnewSession
- The new sessions builderforceAuth
- Whether the authentication was forced- Throws:
com.iplanet.dpro.session.SessionException
- If there was an error whilst retrieving the old session's properties.
-
updateProperty
public void updateProperty(com.iplanet.dpro.session.service.SessionBuilder session, String property, String value)
This method updates a session property in the session with the given value. Override this method if you want to change some properties during the upgrade process. NOTE: If you override this, you SHOULD call super.updateProperty(..) at the end of your implementation with the updated values.- Parameters:
session
- Session builder where the property should be setproperty
- Name of the property to setvalue
- Value of the given session property
-
shouldCopy
public abstract boolean shouldCopy(String key)
This method decides whether a given session property should be copied to the new session.- Parameters:
key
- The name of the session property which we want to decide to copy- Returns:
true
if the property with the given key should be copied into the new session
-
-