|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.nucleus.logging.VariableArgumentApplicationLoggingImpl atg.nucleus.GenericService atg.userprofiling.ProfileSessionFailService
public class ProfileSessionFailService
This service is used to preserve a user's active profile in the event of a session failover to another Dynamo server. This service backs up the user id of the profile for the session. The id is only saved if the user is not anonymous. If the profile is transient, then by default is nothing is backup.
To backup profile attributes of anonymous visitors, developers should subclass this
class. JavaBean properties should be added which expose and record the desired attribute.
The sessionRestored
method can be overrode to then update the final profile
with the desired saved attributes.
For example the subclass could have functionality similar to this:
protected byte [] mShoppingCart; public void setShoppingCart(byte [] pShoppingCart) { mShoppingCart = pShoppingCart; } public byte [] getShoppingCart() { if (getProfile() != null) return (byte [])getProfile().getPropertyValue("shoppingCart"); return null; } public void sessionRestored () { super.sessionRestored(); if ((mShoppingCart != null) && (mShoppingCart.length > 0) && (getProfile() != null)) { try { getProfileTools().updateProperty("shoppingCart", mShoppingCart, getProfile()); } catch (RepositoryException exc) { if (isLoggingError()) logError(exc); } }
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
protected boolean |
mSecurityStatusFailoverEnabled
The restored value of the profile id |
protected java.lang.String |
mUidForFailover
The restored value of the profile id |
Fields inherited from class atg.nucleus.GenericService |
---|
SERVICE_INFO_KEY |
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging |
---|
DEFAULT_LOG_TRACE_STATUS |
Fields inherited from interface atg.nucleus.logging.ApplicationLogging |
---|
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS |
Constructor Summary | |
---|---|
ProfileSessionFailService()
Constructs an instanceof ProfileSessionFailService |
Method Summary | |
---|---|
int |
getFailedOverSecurityStatus()
|
Profile |
getProfile()
Returns property Profile |
ProfileTools |
getProfileTools()
Returns property ProfileTools |
java.lang.String |
getUidForFailover()
Returns the user id of the profile. |
void |
sessionRestored()
This restoring method takes the mUidForFailover member variable and attempts to load the profile with the given id. |
void |
setFailedOverSecurityStatus(int pFailedOverSecurityStatus)
After a profile is failed over, the security status of the re-established profile will be set to this value. |
void |
setProfile(Profile pProfile)
Sets property Profile |
void |
setProfileTools(ProfileTools pProfileTools)
Sets property ProfileTools |
void |
setUidForFailover(java.lang.String pUidForFailover)
Stores the uidForFailover parameter in the member variable mUidForFailover |
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl |
---|
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String CLASS_VERSION
protected java.lang.String mUidForFailover
protected boolean mSecurityStatusFailoverEnabled
Constructor Detail |
---|
public ProfileSessionFailService()
Method Detail |
---|
public void setProfileTools(ProfileTools pProfileTools)
public ProfileTools getProfileTools()
public void setProfile(Profile pProfile)
public Profile getProfile()
public void setUidForFailover(java.lang.String pUidForFailover)
public java.lang.String getUidForFailover()
profile
property
is null, or the profile is anonymous then we return null to indicate
that this user does not exist in the persistent repository.
public void setFailedOverSecurityStatus(int pFailedOverSecurityStatus)
public int getFailedOverSecurityStatus()
public void sessionRestored()
sessionRestored
in interface atg.servlet.sessionsaver.Restoreable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |