public class TenantsServiceImpl extends Object implements TenantsService
TenantsService based on plugins. Following kinds of plugin supported: | Modifier and Type | Field and Description |
|---|---|
protected static Log |
LOG |
protected List<CurrentTenantLookup> |
lookups
List of registered
CurrentTenantLookup implementations. |
protected List<TenantStateObserver> |
observers
List of registered
TenantStateObserver implementations. |
| Constructor and Description |
|---|
TenantsServiceImpl()
Constructor without dependencies.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(TenantsStateListener listener)
Add listener for Tenant events in Multitenancy sub-system.
|
void |
addPlugin(ComponentPlugin plugin)
Register component plugin.
|
Tenant |
getCurrentTanant()
Return Current Tenant or throws an exception if Current Tenant not set in current thread.
|
boolean |
hasCurrentTanant()
Answers if Current Tenant is set in current thread.
|
void |
removeListener(TenantsStateListener listener)
Remove Tenant events listener from Multitenancy sub-system.
|
protected static final Log LOG
protected final List<CurrentTenantLookup> lookups
CurrentTenantLookup implementations.protected final List<TenantStateObserver> observers
TenantStateObserver implementations.public void addPlugin(ComponentPlugin plugin)
plugin - ComponentPluginpublic void addListener(TenantsStateListener listener)
TenantsService.removeListener(TenantsStateListener) method.addListener in interface TenantsServicelistener - TenantsStateListenerpublic void removeListener(TenantsStateListener listener)
removeListener in interface TenantsServicelistener - TenantsStateListenerpublic Tenant getCurrentTanant() throws CurrentTenantNotSetException
getCurrentTanant in interface TenantsServiceTenant Current Tenant descriptor.CurrentTenantNotSetException - if Current Tenant not found or not set.public boolean hasCurrentTanant()
#getCurrentTenant() for details.hasCurrentTanant in interface TenantsServicetrue if current tenant is set in current thread, false otherwise.#getCurrentTenant()Copyright © 2014 eXo Platform SAS. All Rights Reserved.