no.sesat.search.user.service
Class UserCookieUtil

java.lang.Object
  extended by no.sesat.search.user.service.UserCookieUtil

public final class UserCookieUtil
extends Object

Utility class for user cookie handling.

Version:
$Id: UserCookieUtil.java 23 2009-06-23 16:17:24Z ssmiweve $

Field Summary
static DateFormat TIMESTAMP_FORMATTER
           
static String USER_COOKIE_PATH
           
static String USER_LOGIN_COOKIE_KEY
           
static String USER_UPDATE_COOKIE_KEY
           
 
Method Summary
static String getCookieValue(HttpServletRequest request, String cookieName)
           
static String getLoginKeyDefaultValue()
          Return the default value for login key, meaning that the user is not logged in.
static String getUserLoginCookie(HttpServletRequest request)
          Look for and return the user login cookie value.
static Date getUserUpdateCookie(HttpServletRequest request)
          Look for and return the user update cookie timestamp.
static void setUserLoginCookie(HttpServletResponse response, String content)
          Set the user login cookie value.
static void setUserLoginCookieDefault(HttpServletResponse response)
          Set the default user login cookie, signals no login.
static void setUserUpdateCookie(HttpServletResponse response, Date timestamp)
          Set the user update cookie value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

USER_COOKIE_PATH

public static final String USER_COOKIE_PATH
See Also:
Constant Field Values

USER_LOGIN_COOKIE_KEY

public static final String USER_LOGIN_COOKIE_KEY
See Also:
Constant Field Values

USER_UPDATE_COOKIE_KEY

public static final String USER_UPDATE_COOKIE_KEY
See Also:
Constant Field Values

TIMESTAMP_FORMATTER

public static final DateFormat TIMESTAMP_FORMATTER
Method Detail

getUserLoginCookie

public static String getUserLoginCookie(HttpServletRequest request)
Look for and return the user login cookie value. Can return null.

Parameters:
request - the http servlet request
Returns:
the cookie value that is found, null if no cookie

setUserLoginCookie

public static void setUserLoginCookie(HttpServletResponse response,
                                      String content)
Set the user login cookie value.

Parameters:
response - the http servlet response
content - the content of the user cookie

setUserLoginCookieDefault

public static void setUserLoginCookieDefault(HttpServletResponse response)
Set the default user login cookie, signals no login.

Parameters:
response - the http servlet response

getUserUpdateCookie

public static Date getUserUpdateCookie(HttpServletRequest request)
Look for and return the user update cookie timestamp. Can return null.

Parameters:
request - the http servlet request
Returns:
the timestamp that is found, null if no cookie

setUserUpdateCookie

public static void setUserUpdateCookie(HttpServletResponse response,
                                       Date timestamp)
Set the user update cookie value.

Parameters:
response - the http servlet response
timestamp - the update timestamp

getLoginKeyDefaultValue

public static String getLoginKeyDefaultValue()
Return the default value for login key, meaning that the user is not logged in.

Returns:
the default value for login key

getCookieValue

public static String getCookieValue(HttpServletRequest request,
                                    String cookieName)


Copyright © 2009 Schibsted Søk AS. All Rights Reserved.