| java.lang.Object es.udc.mypersonalizer.portal.controller.session.SessionIdentifierCookieManagerSingleton
All known Subclasses: es.udc.mypersonalizer.portal.controller.session.DefaultSessionIdentifierCookieManagerSingleton,
SessionIdentifierCookieManagerSingleton | abstract public class SessionIdentifierCookieManagerSingleton (Code) | | This singleton class processes the session cookies that are stored
in the user's browser and which enables the system to auto-sign in the
users when they ask it by remembering their passwords and to reconstruct
the users' sessions when they expire without annoying the users by making
them sign in again.
This singleton class has no fixed implementation: it must be extended
to establish the way in which cookies should be managed for each application.
The specific implementation that has to be used must be specified in the
configuration, which this class takes from
SessionCookieManagerConfig .
author: Daniel Fernandez since: 1.0 |
Method Summary | |
abstract public void | addCookie(HttpServletRequest request, HttpServletResponse response, String loginName, String storedPassword, Long workspaceIdentifier, boolean rememberPassword) | public static SessionIdentifierCookieManagerSingleton | getInstance() | abstract public void | removeCookie(HttpServletRequest request, HttpServletResponse response) | abstract public void | setCookieDomain(String cookieDomain) Sets the domain for the session cookie. | abstract public void | setCookiePath(String cookiePath) Sets the path for the session cookie. | abstract public void | setPersistentCookieMaxAgeDays(int maxAgeDays) Sets the maximum age for the persistent session cookies. | abstract public void | updateCookiePassword(HttpServletRequest request, HttpServletResponse response, String loginName, String storedPassword) Re-creates the session cookie when the password contained in it changes. | abstract public void | updateCookieWorkspace(HttpServletRequest request, HttpServletResponse response, String loginName, Long workspaceIdentifier) Re-creates the session cookie when the workspace identifier contained
in it changes. | abstract public SignInResult | validateAndLogin(HttpServletRequest request) |
addCookie | abstract public void addCookie(HttpServletRequest request, HttpServletResponse response, String loginName, String storedPassword, Long workspaceIdentifier, boolean rememberPassword)(Code) | | Adds to the request the cookie containing the session info needed by the
system, usualy the user's login name and password
Parameters: request - the request Parameters: response - the response Parameters: loginName - the user's login name, which will be stored in the cookie Parameters: storedPassword - the user's stored and encrypted password, whichwill also be stored in the cookie Parameters: workspaceIdentifier - the identifier of the workspace the useris currently in. Parameters: rememberPassword - whether the cookie must be configured as"persistent" or not |
removeCookie | abstract public void removeCookie(HttpServletRequest request, HttpServletResponse response)(Code) | | Removes the session cookie from the browser
Parameters: request - the request Parameters: response - the response |
setCookieDomain | abstract public void setCookieDomain(String cookieDomain)(Code) | | Sets the domain for the session cookie.
Parameters: cookieDomain - the new domain. |
setCookiePath | abstract public void setCookiePath(String cookiePath)(Code) | | Sets the path for the session cookie.
Parameters: cookiePath - the new path. |
setPersistentCookieMaxAgeDays | abstract public void setPersistentCookieMaxAgeDays(int maxAgeDays)(Code) | | Sets the maximum age for the persistent session cookies.
Parameters: maxAgeDays - the new maximum age. |
updateCookiePassword | abstract public void updateCookiePassword(HttpServletRequest request, HttpServletResponse response, String loginName, String storedPassword)(Code) | | Re-creates the session cookie when the password contained in it changes.
Parameters: request - the request Parameters: response - the response Parameters: loginName - the user's login name Parameters: storedPassword - the user's encrypted password |
updateCookieWorkspace | abstract public void updateCookieWorkspace(HttpServletRequest request, HttpServletResponse response, String loginName, Long workspaceIdentifier)(Code) | | Re-creates the session cookie when the workspace identifier contained
in it changes.
Parameters: request - the request Parameters: response - the response Parameters: loginName - the user's login name Parameters: workspaceIdentifier - the new workspace identifier |
validateAndLogin | abstract public SignInResult validateAndLogin(HttpServletRequest request) throws InternalErrorException(Code) | | Checks the correctness of the information stored in the session cookie:
it retrieves users login info from it and if they are correct
the user becomes automatically logged in.
If everything is correct, this method returns a SignInResult
a SignInResult if everything is correct, null if not. Parameters: request - the request throws: InternalErrorException - if a fatal error ocurrs. |
|
|