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
public static String computeTenantAdministratorsGroup(String tenantId)
public static String getCurrentTenantId(Principal principal) throws ClientException
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().
ClientExceptionpublic static String getTenantId(String username) throws ClientException
username if any, null otherwise.ClientExceptionpublic static String getTenantDocumentPath(CoreSession session, String tenantId) throws ClientException
tenantId, or null if there is no document
matching.ClientExceptionpublic static String getOwningTenantId(DocumentModel doc) throws ClientException
doc - ClientExceptionCopyright © 2020 Nuxeo SA. All rights reserved.