public class MultiTenantHelper extends Object
| Modifier and Type | Class and Description | 
|---|---|
protected static class  | 
MultiTenantHelper.TenantIdFinder  | 
| Modifier and Type | Field and Description | 
|---|---|
protected static Integer | 
CACHE_CONCURRENCY_LEVEL  | 
protected static Integer | 
CACHE_MAXIMUM_SIZE  | 
protected static Integer | 
CACHE_TIMEOUT  | 
protected static String | 
NO_TENANT  | 
protected static com.google.common.cache.Cache<String,String> | 
pathCache  | 
protected static com.google.common.cache.Cache<String,String> | 
tenantBinding  | 
| Modifier and Type | Method and Description | 
|---|---|
static String | 
computeTenantAdministratorsGroup(String tenantId)  | 
static String | 
computeTenantMembersGroup(String tenantId)  | 
static String | 
getCurrentTenantId(Principal principal)
Returns the current tenantId for the given  
principal, or from the principal stored in the login stack. | 
static String | 
getOwningTenantId(DocumentModel doc)
Return the Tenant containing the provided DocumentModel if any 
 | 
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. | 
static String | 
getTenantId(String username)
Returns the tenantId for the given  
username if any, null otherwise. | 
protected static final Integer CACHE_CONCURRENCY_LEVEL
protected static final Integer CACHE_MAXIMUM_SIZE
protected static final Integer CACHE_TIMEOUT
protected static final String NO_TENANT
protected static final com.google.common.cache.Cache<String,String> tenantBinding
public static String computeTenantAdministratorsGroup(String tenantId)
public static String computeTenantMembersGroup(String tenantId)
public static String getCurrentTenantId(Principal principal)
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().
public static String getTenantId(String username)
username if any, null otherwise.public static String getTenantDocumentPath(CoreSession session, String tenantId)
tenantId, or null if there is no document
 matching.public static String getOwningTenantId(DocumentModel doc)
doc - Copyright © 2019 Nuxeo. All rights reserved.