public final class CarbonContextDataHolder extends Object
Modifier and Type | Field and Description |
---|---|
protected org.wso2.carbon.registry.api.Registry |
configSystemRegistry
The name of the property that stores a reference to the configuration registry instance of
the current tenant, as visible to the system.
|
protected org.wso2.carbon.registry.api.Registry |
configUserRegistry
The name of the property that stores a reference to the configuration registry instance of
the current tenant, as visible to a user.
|
protected org.wso2.carbon.registry.api.Registry |
governanceSystemRegistry
The name of the property that stores a reference to the governance registry instance of the
current tenant, as visible to the system.
|
protected org.wso2.carbon.registry.api.Registry |
governanceUserRegistry
The name of the property that stores a reference to the governance registry instance of the
current tenant, as visible to a user.
|
protected org.wso2.carbon.registry.api.Registry |
localRepository
The name of the property that stores a reference to the local repository instance of the
current tenant.
|
protected org.wso2.carbon.user.api.UserRealm |
userRealm
The name of the property that stores a reference to the UserRealm instance of the current
tenant, as visible to a user.
|
Constructor and Description |
---|
CarbonContextDataHolder(CarbonContextDataHolder carbonContextHolder)
Constructor that can be used to create clones.
|
Modifier and Type | Method and Description |
---|---|
static void |
destroyCurrentCarbonContextHolder()
This method will destroy the current CarbonContext holder.
|
void |
endTenantFlow()
This will end the tenant flow and restore the previous CarbonContext.
|
String |
getApplicationName() |
org.wso2.carbon.registry.api.Registry |
getConfigSystemRegistry() |
org.wso2.carbon.registry.api.Registry |
getConfigUserRegistry() |
static CarbonContextDataHolder |
getCurrentCarbonContextHolderBase()
Method to obtain the current carbon context holder's base.
|
static org.wso2.carbon.base.DiscoveryService |
getDiscoveryServiceProvider()
Method to obtain an instance to the Discovery Service.
|
org.wso2.carbon.registry.api.Registry |
getGovernanceSystemRegistry() |
org.wso2.carbon.registry.api.Registry |
getGovernanceUserRegistry() |
org.wso2.carbon.registry.api.Registry |
getLocalRepository() |
Object |
getProperty(String name)
Method to obtain a property on this CarbonContext instance.
|
String |
getTenantDomain()
Method to obtain the tenant domain on this CarbonContext instance.
|
int |
getTenantId()
Method to obtain the tenant id on this CarbonContext instance.
|
static CarbonContextDataHolder |
getThreadLocalCarbonContextHolder()
This method will always attempt to obtain an instance of the current CarbonContext from the
thread-local copy.
|
String |
getUsername()
Method to obtain the username on this CarbonContext instance.
|
org.wso2.carbon.user.api.UserRealm |
getUserRealm() |
static void |
registerUnloadTenantTask(org.wso2.carbon.base.UnloadTenantTask unloadTenantTask)
Method to register a task that will be executed when a tenant is
unloaded.
|
void |
removeQueueManager()
This method will remove the current multi-tenant queue manager instance.
|
void |
setApplicationName(String applicationName) |
void |
setConfigSystemRegistry(org.wso2.carbon.registry.api.Registry configSystemRegistry) |
void |
setConfigUserRegistry(org.wso2.carbon.registry.api.Registry configUserRegistry) |
static void |
setDiscoveryServiceProvider(org.wso2.carbon.base.DiscoveryService discoveryServiceProvider)
Method to define the instance of the Discovery Service.
|
void |
setGovernanceSystemRegistry(org.wso2.carbon.registry.api.Registry governanceSystemRegistry) |
void |
setGovernanceUserRegistry(org.wso2.carbon.registry.api.Registry governanceUserRegistry) |
void |
setLocalRepository(org.wso2.carbon.registry.api.Registry localRepository) |
void |
setProperty(String name,
Object value)
Method to set a property on this CarbonContext instance.
|
void |
setQueueManager(MultitenantCarbonQueueManager queueManager)
This method will set the current multi-tenant queue manager instance.
|
void |
setTenantDomain(String domain)
Method to set the tenant domain on this CarbonContext instance.
|
void |
setTenantId(int tenantId)
Method to set the tenant id on this CarbonContext instance.
|
void |
setUsername(String username)
Method to set the username on this CarbonContext instance.
|
void |
setUserRealm(org.wso2.carbon.user.api.UserRealm userRealm) |
void |
startTenantFlow()
Starts a tenant flow.
|
void |
unloadTenant()
Method to be called when this tenant is unloaded.
|
static void |
unloadTenant(int tenantId)
Method that will be called when a tenant is unloaded.
|
protected org.wso2.carbon.registry.api.Registry localRepository
protected org.wso2.carbon.registry.api.Registry configSystemRegistry
protected org.wso2.carbon.registry.api.Registry governanceSystemRegistry
protected org.wso2.carbon.registry.api.Registry configUserRegistry
protected org.wso2.carbon.registry.api.Registry governanceUserRegistry
protected org.wso2.carbon.user.api.UserRealm userRealm
public CarbonContextDataHolder(CarbonContextDataHolder carbonContextHolder)
carbonContextHolder
- the CarbonContext holder instance of which the clone will be
created from.public org.wso2.carbon.registry.api.Registry getLocalRepository()
public void setLocalRepository(org.wso2.carbon.registry.api.Registry localRepository)
public org.wso2.carbon.registry.api.Registry getConfigSystemRegistry()
public void setConfigSystemRegistry(org.wso2.carbon.registry.api.Registry configSystemRegistry)
public org.wso2.carbon.registry.api.Registry getGovernanceSystemRegistry()
public void setGovernanceSystemRegistry(org.wso2.carbon.registry.api.Registry governanceSystemRegistry)
public org.wso2.carbon.registry.api.Registry getConfigUserRegistry()
public void setConfigUserRegistry(org.wso2.carbon.registry.api.Registry configUserRegistry)
public org.wso2.carbon.registry.api.Registry getGovernanceUserRegistry()
public void setGovernanceUserRegistry(org.wso2.carbon.registry.api.Registry governanceUserRegistry)
public org.wso2.carbon.user.api.UserRealm getUserRealm()
public void setUserRealm(org.wso2.carbon.user.api.UserRealm userRealm)
public String getApplicationName()
public void setApplicationName(String applicationName)
public void unloadTenant()
public static CarbonContextDataHolder getThreadLocalCarbonContextHolder()
public void setQueueManager(MultitenantCarbonQueueManager queueManager) throws org.wso2.carbon.queuing.QueuingException
queueManager
- the multi-tenant queue manager.org.wso2.carbon.queuing.QueuingException
- if the operation failed.public void removeQueueManager() throws org.wso2.carbon.queuing.QueuingException
org.wso2.carbon.queuing.QueuingException
- if the operation failed.public static org.wso2.carbon.base.DiscoveryService getDiscoveryServiceProvider()
public static void setDiscoveryServiceProvider(org.wso2.carbon.base.DiscoveryService discoveryServiceProvider)
discoveryServiceProvider
- the Discovery Service instance.public static CarbonContextDataHolder getCurrentCarbonContextHolderBase()
public static void registerUnloadTenantTask(org.wso2.carbon.base.UnloadTenantTask unloadTenantTask)
unloadTenantTask
- the task to run.UnloadTenantTask
public static void unloadTenant(int tenantId)
tenantId
- the tenant's identifier.public void startTenantFlow()
public void endTenantFlow()
public int getTenantId()
public void setTenantId(int tenantId)
tenantId
- the tenant id.public String getUsername()
public void setUsername(String username)
username
- the username.public String getTenantDomain()
public void setTenantDomain(String domain)
domain
- the tenant domain.public Object getProperty(String name)
name
- the property name.public void setProperty(String name, Object value)
name
- the property name.value
- the value to be set to the property by the given name.public static void destroyCurrentCarbonContextHolder()
Copyright © 2016 WSO2 Inc. All rights reserved.