com.dyuproject.openid.manager
Class CookieBasedUserManager

java.lang.Object
  extended by com.dyuproject.openid.manager.CookieBasedUserManager
All Implemented Interfaces:
OpenIdUserManager

public final class CookieBasedUserManager
extends Object
implements OpenIdUserManager

The OpenIdUser is serialized and persisted in an http cookie.

Author:
David Yu
Date created:
Jan 5, 2009

Constructor Summary
CookieBasedUserManager()
           
CookieBasedUserManager(String cookieName, String secretKey)
           
CookieBasedUserManager(String cookieName, String secretKey, boolean encrypted)
           
 
Method Summary
 StandardJSON getJSON()
           
 OpenIdUser getUser(HttpServletRequest request)
          Gets/reads the user associated with the given request.
 void init(Properties properties)
          Initialize this object via user-configured properties.
 boolean invalidate(HttpServletRequest request, HttpServletResponse response)
          Invalidates/removes/deletes the user associated with the given request.
 boolean saveUser(OpenIdUser user, HttpServletRequest request, HttpServletResponse response)
          Saves/persists the user associated with the given request.
 void setCookieDomain(String cookieDomain)
           
 void setCookieName(String cookieName)
           
 void setCookiePath(String cookiePath)
           
 void setEncrypted(boolean encrypted)
           
 void setLoginTimeout(int loginTimeout)
           
 void setMaxAge(int maxAge)
           
 void setSecretKey(String secretKey)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CookieBasedUserManager

public CookieBasedUserManager()

CookieBasedUserManager

public CookieBasedUserManager(String cookieName,
                              String secretKey)

CookieBasedUserManager

public CookieBasedUserManager(String cookieName,
                              String secretKey,
                              boolean encrypted)
Method Detail

getJSON

public StandardJSON getJSON()

init

public void init(Properties properties)
Description copied from interface: OpenIdUserManager
Initialize this object via user-configured properties.

Specified by:
init in interface OpenIdUserManager

setSecretKey

public void setSecretKey(String secretKey)

setCookieName

public void setCookieName(String cookieName)

setCookiePath

public void setCookiePath(String cookiePath)

setCookieDomain

public void setCookieDomain(String cookieDomain)

setMaxAge

public void setMaxAge(int maxAge)

setLoginTimeout

public void setLoginTimeout(int loginTimeout)

setEncrypted

public void setEncrypted(boolean encrypted)

getUser

public OpenIdUser getUser(HttpServletRequest request)
                   throws IOException
Description copied from interface: OpenIdUserManager
Gets/reads the user associated with the given request.

Specified by:
getUser in interface OpenIdUserManager
Throws:
IOException

saveUser

public boolean saveUser(OpenIdUser user,
                        HttpServletRequest request,
                        HttpServletResponse response)
                 throws IOException
Description copied from interface: OpenIdUserManager
Saves/persists the user associated with the given request.

Specified by:
saveUser in interface OpenIdUserManager
Throws:
IOException

invalidate

public boolean invalidate(HttpServletRequest request,
                          HttpServletResponse response)
                   throws IOException
Description copied from interface: OpenIdUserManager
Invalidates/removes/deletes the user associated with the given request.

Specified by:
invalidate in interface OpenIdUserManager
Throws:
IOException


Copyright © 2008-2013. All Rights Reserved.