org.eclnt.jsfserver.util.useraccess

## Class DefaultTenantAccess

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

- All Implemented Interfaces:
    ITenantAccess

      public class DefaultTenantAccess
      extends java.lang.Object
      implements ITenantAccess

  Default implementation of `ITenantAccess`.
  The tenant that is currently active is either passed via `associateTenantWithCurrentSession(String)`. Internally this tenant information is stored in the http session.
  If there is no http session available then the tenant may also be passed by `associateTenantWithCurrentThread(String)`.

- - ### Field Summary

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

      `TENANT_UNDEFINED`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultTenantAccess()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `associateTenantWithCurrentSession(HttpServletRequest request, java.lang.String tenant)` Passes the tenant into the current session.
    `static void` | `associateTenantWithCurrentSession(java.lang.String tenant)` Passes the tenant into the current session.
    `static void` | `associateTenantWithCurrentThread(java.lang.String tenant)`
    `static void` | `clearTenantWithCurrentSession()`
    `static void` | `clearTenantWithCurrentThread()`
    `java.lang.String` | `getCurrentTenant()` Get tenant that is associated with the current context.
    `java.lang.String` | `getCurrentTenant(FacesContext context)`

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

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

- - ### Constructor Detail

    - #### DefaultTenantAccess

          public DefaultTenantAccess()

  - ### Method Detail

    - #### getCurrentTenant

          public java.lang.String getCurrentTenant(FacesContext context)

      Specified by:
        `getCurrentTenant` in interface `ITenantAccess`

    - #### getCurrentTenant

          public java.lang.String getCurrentTenant()

      Description copied from interface: `ITenantAccess`
      Get tenant that is associated with the current context.
      Specified by:
        `getCurrentTenant` in interface `ITenantAccess`

    - #### associateTenantWithCurrentSession

          public static void associateTenantWithCurrentSession(java.lang.String tenant)

      Passes the tenant into the current session.
      This method is the normal one to be used within your application processing (i.e. running within the CC-/JSF-context). If you want to pass the tenant from some servlet-filter processing use `#associateTenantWithSession(HttpServletRequest, String)`.

    - #### associateTenantWithCurrentSession

          public static void associateTenantWithCurrentSession(HttpServletRequest request,
                                                               java.lang.String tenant)

      Passes the tenant into the current session.
      Special implementation to be used from servlet-filters which are arranged in front of the CC filter processing (ThreadingFilter).

    - #### clearTenantWithCurrentSession

          public static void clearTenantWithCurrentSession()

    - #### associateTenantWithCurrentThread

          public static void associateTenantWithCurrentThread(java.lang.String tenant)

    - #### clearTenantWithCurrentThread

          public static void clearTenantWithCurrentThread()

Copyright © CaptainCasa Gmbh. All Rights Reserved.