Class MultiTenantHelper

java.lang.Object
org.nuxeo.ecm.multi.tenant.MultiTenantHelper

public class MultiTenantHelper extends Object
Since:
5.6
Author:
Thomas Roger
  • Field Details

    • CACHE_CONCURRENCY_LEVEL

      protected static final Integer CACHE_CONCURRENCY_LEVEL
    • CACHE_MAXIMUM_SIZE

      protected static final Integer CACHE_MAXIMUM_SIZE
    • CACHE_TIMEOUT

      protected static final Integer CACHE_TIMEOUT
    • NO_TENANT

      protected static final String NO_TENANT
      See Also:
    • pathCache

      protected static final com.google.common.cache.Cache<String,String> pathCache
    • tenantBinding

      protected static final com.google.common.cache.Cache<String,String> tenantBinding
  • Method Details

    • computeTenantAdministratorsGroup

      public static String computeTenantAdministratorsGroup(String tenantId)
    • computeTenantMembersGroup

      public static String computeTenantMembersGroup(String tenantId)
    • getCurrentTenantId

      public static String getCurrentTenantId(Principal principal)
      Returns the current tenantId for the given principal, or from the principal stored in the login stack.

      The principal is used if it is a SystemPrincipal, then the tenantId is retrieved from the Principal matching the SystemPrincipal.getOriginatingUser().

    • getTenantId

      public static String getTenantId(String username)
      Returns the tenantId for the given username if any, null otherwise.
    • getTenantDocumentPath

      public static String getTenantDocumentPath(CoreSession session, String tenantId)
      Returns the path of the tenant document matching the tenantId, or null if there is no document matching.
    • getOwningTenantId

      public static String getOwningTenantId(DocumentModel doc)
      Return the Tenant containing the provided DocumentModel if any
      Returns:
      DocumentModel corresponding to the Tenant container, null otherwise