Dekoh platform API

com.pramati.bfly.das.helper
Class SessionUtil

java.lang.Object
  extended by com.pramati.bfly.das.helper.SessionUtil

public class SessionUtil
extends Object

Helper to get loggedin user information.

Since:
Oct 6, 2006

Constructor Summary
SessionUtil()
           
 
Method Summary
static HttpSession getDesktopSession(HttpServletRequest request)
          To create or get a Desktop Portal session for the given request.
static HttpSession getDesktopSession(HttpServletRequest request, boolean createNew)
           
static HttpSession getDesktopSession(String sid, boolean createNew)
          To get a Desktop Portal session for the given request.
static String getLoggedInAccountId(HttpServletRequest request)
          Same as invoking getLoggedInDesktopUser(request).getAccountId() on an authenticated session request.
static DesktopUser getLoggedInDesktopUser(HttpServletRequest request)
          To get LoggedIn Desktop user in this session.
static String getLoggedInUser(HttpServletRequest request)
          Same as invoking getLoggedInDesktopUser(request).getUsername() on an authenticated session request.
static String getPublicViewLink(HttpServletRequest request, String localPath)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SessionUtil

public SessionUtil()
Method Detail

getLoggedInUser

public static String getLoggedInUser(HttpServletRequest request)
Same as invoking getLoggedInDesktopUser(request).getUsername() on an authenticated session request.

Parameters:
request - current httpServletRequest.
Returns:
Loggedin user name, if this request is a part of a authenticated session. otherwise would return null.

getLoggedInAccountId

public static String getLoggedInAccountId(HttpServletRequest request)
Same as invoking getLoggedInDesktopUser(request).getAccountId() on an authenticated session request.

Parameters:
request - current httpServletRequest.
Returns:
Loggedin user's accountId, if this request is a part of a authenticated session. otherwise would return null.

getLoggedInDesktopUser

public static DesktopUser getLoggedInDesktopUser(HttpServletRequest request)
To get LoggedIn Desktop user in this session.

Parameters:
request - current httpServletRequest.
Returns:
LoggedIn Desktop User if this request is a part of an authenticated session. otherwise would return null.

getDesktopSession

public static HttpSession getDesktopSession(HttpServletRequest request)
To create or get a Desktop Portal session for the given request. Invoking this api is same as invoking SessionUtil.getDesktopSession(String,boolean), except that this api assumes that dekohportal application is deployed, and failing fetch or create a dekoh portal session would throw a IllegalArgumentException.

Parameters:
request - HttpServletRequest which needs the dekohportal session.
Returns:
Dekoh portal httpsession, if this request joins an existing session. else would create a new session.

getDesktopSession

public static HttpSession getDesktopSession(HttpServletRequest request,
                                            boolean createNew)

getDesktopSession

public static HttpSession getDesktopSession(String sid,
                                            boolean createNew)
To get a Desktop Portal session for the given request. This portal session is used for storing information which is needed across application. LoginManager stores the loggedIn user information in this session.

Parameters:
sid - SessionId for the needed session instance.
createNew - if true, will try creating a new Desktop portal session if no session exists.
Returns:
HttpSession, if able to create or find a Desktop Portal session for given sessionId. else will null.

getPublicViewLink

public static String getPublicViewLink(HttpServletRequest request,
                                       String localPath)

Dekoh platform API

© 2009 Pramati Technologies - Dekoh - Portal for Developers