Class DefaultUserAccess

java.lang.Object
org.eclnt.jsfserver.util.useraccess.DefaultUserAccess
All Implemented Interfaces:
IUserAccess

public class DefaultUserAccess extends Object implements IUserAccess
Default implementation of IUserAccess.


You can either associate a user with the current session by calling associateUserWithCurrentSession(String).

Or you may associate a user with the current thread by calling associateUserWithCurrentThread(String).

If no user is associated with the current session/thread then IUserAccess.USER_UNDEFINED is returned as current user.
  • Constructor Details

    • DefaultUserAccess

      public DefaultUserAccess()
  • Method Details

    • getCurrentUser

      public String getCurrentUser()
      Description copied from interface: IUserAccess
      Get user that is associated with the current context.
      Specified by:
      getCurrentUser in interface IUserAccess
    • getCurrentUser

      public String getCurrentUser(javax.faces.context.FacesContext context)
    • associateUserWithCurrentSession

      public static void associateUserWithCurrentSession(String userName)
      Pass the current user into the current session.

      This method expects to be run as part of the CC-/JSF-Roundtrip processing. This method will fail if you call it from some Servlet-Filter-processing which is processed in front of the CC-/JSF-Roundtrip processing. Use method associateUserWithCurrentSession(HttpServletRequest, String) in this case.
    • associateUserWithCurrentSession

      public static void associateUserWithCurrentSession(javax.servlet.http.HttpServletRequest request, String userName)
      Pass the current user into the current session.

      Special implementation which is used in case you want to pass the information from some filter processing, which is arranged in front of the CC-filter processing.
    • clearUserWithCurrentSession

      public static void clearUserWithCurrentSession()
    • associateUserWithCurrentThread

      public static void associateUserWithCurrentThread(String user)
    • clearUserWithCurrentThread

      public static void clearUserWithCurrentThread()