org.eclnt.jsfserver.util.useraccess

## Class DefaultUserAccess

- java.lang.Object
- - org.eclnt.jsfserver.util.useraccess.DefaultUserAccess

- All Implemented Interfaces:
    IUserAccess

      public class DefaultUserAccess
      extends java.lang.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.

- - ### Field Summary

    - ### Fields inherited from interface org.eclnt.jsfserver.util.useraccess.IUserAccess

      `USER_UNDEFINED`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultUserAccess()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `associateUserWithCurrentSession(HttpServletRequest request, java.lang.String userName)` Pass the current user into the current session.
    `static void` | `associateUserWithCurrentSession(java.lang.String userName)` Pass the current user into the current session.
    `static void` | `associateUserWithCurrentThread(java.lang.String user)`
    `static void` | `clearUserWithCurrentSession()`
    `static void` | `clearUserWithCurrentThread()`
    `java.lang.String` | `getCurrentUser()` Get user that is associated with the current context.
    `java.lang.String` | `getCurrentUser(FacesContext context)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DefaultUserAccess

          public DefaultUserAccess()

  - ### Method Detail

    - #### getCurrentUser

          public java.lang.String getCurrentUser()

      Description copied from interface: `IUserAccess`
      Get user that is associated with the current context.
      Specified by:
        `getCurrentUser` in interface `IUserAccess`

    - #### getCurrentUser

          public java.lang.String getCurrentUser(FacesContext context)

      Specified by:
        `getCurrentUser` in interface `IUserAccess`

    - #### associateUserWithCurrentSession

          public static void associateUserWithCurrentSession(java.lang.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(HttpServletRequest request,
                                                             java.lang.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(java.lang.String user)

    - #### clearUserWithCurrentThread

          public static void clearUserWithCurrentThread()

Copyright © CaptainCasa Gmbh. All Rights Reserved.