public class TenantMgtUtil extends Object
| Constructor and Description |
|---|
TenantMgtUtil() |
| Modifier and Type | Method and Description |
|---|---|
static void |
activateTenant(String tenantDomain,
org.wso2.carbon.user.core.tenant.TenantManager tenantManager,
int tenantId)
Activate the given tenant, either at the time of tenant creation, or later by super admin.
|
static void |
activateTenantInitially(org.wso2.carbon.stratos.common.beans.TenantInfoBean tenantInfoBean,
int tenantId)
Activate a tenant during the time of the tenant creation.
|
static void |
addClaimsToUserStoreManager(org.wso2.carbon.user.core.tenant.Tenant tenant)
Adds claims to UserStoreManager
|
static void |
clearTenantAdminCreationOperation() |
static void |
deactivateTenant(String tenantDomain,
org.wso2.carbon.user.core.tenant.TenantManager tenantManager,
int tenantId)
Deactivate the given tenant, by super admin.
|
static void |
deleteProductSpecificTenantData(String dataSourceName,
String tableName,
int tenantId)
Delete tenant data specific to product from database.
|
static void |
deleteTenantRegistryData(int tenantId) |
static void |
deleteTenantUMData(int tenantId) |
static void |
deleteWorkernodesTenant(int tenantId)
Broadcast TenantDeleteClusterMessage to all worker nodes
|
static org.wso2.carbon.stratos.common.beans.TenantInfoBean |
getTenantInfoBeanfromTenant(int tenantId,
org.wso2.carbon.user.core.tenant.Tenant tenant)
initializes a TenantInfoBean object from the tenant
|
static org.wso2.carbon.user.core.UserStoreManager |
getUserStoreManager(org.wso2.carbon.user.core.tenant.Tenant tenant,
int tenantId)
gets the UserStoreManager for a tenant
|
static org.wso2.carbon.user.core.tenant.Tenant |
initializeTenant(org.wso2.carbon.stratos.common.beans.TenantInfoBean tenantInfoBean)
initializes tenant from the user input (tenant info bean)
|
static org.wso2.carbon.stratos.common.beans.TenantInfoBean |
initializeTenantInfoBean(int tenantId,
org.wso2.carbon.user.core.tenant.Tenant tenant)
Initializes a tenantInfoBean object for a given tenant.
|
static boolean |
isTenantAdminCreationOperation() |
static String |
prepareStringToShowThemeMgtPage(int tenantId)
Prepares string to show theme management page.
|
static void |
setTenantAdminCreationOperation(boolean isAdminCreationOperation) |
static void |
triggerAddTenant(org.wso2.carbon.stratos.common.beans.TenantInfoBean tenantInfo)
Triggers adding the tenant for TenantMgtListener
|
static void |
triggerPreTenantDelete(int tenantId)
Triggers pre tenant delete for TenantMgtListener
|
static void |
triggerTenantActivation(int tenantId) |
static void |
triggerTenantDeactivation(int tenantId) |
static void |
triggerTenantInitialActivation(org.wso2.carbon.stratos.common.beans.TenantInfoBean tenantInfoBean) |
static void |
triggerUpdateTenant(org.wso2.carbon.stratos.common.beans.TenantInfoBean tenantInfoBean)
Triggers an update for the tenant for TenantMgtListener
|
static void |
unloadTenantConfigurations(String tenantDomain,
int tenantId)
Unloading the deactivated tenant in order to avoid serving requests to the tenant.
|
static void |
validateDomain(String domainName)
Validate the tenant domain
|
public static String prepareStringToShowThemeMgtPage(int tenantId) throws org.wso2.carbon.registry.core.exceptions.RegistryException
tenantId - - tenant idRegistryException, - if failed.org.wso2.carbon.registry.core.exceptions.RegistryExceptionpublic static void triggerAddTenant(org.wso2.carbon.stratos.common.beans.TenantInfoBean tenantInfo)
throws org.wso2.carbon.stratos.common.exception.StratosException
tenantInfo - tenantStratosException, - trigger failedorg.wso2.carbon.stratos.common.exception.StratosExceptionpublic static void triggerPreTenantDelete(int tenantId)
throws org.wso2.carbon.stratos.common.exception.StratosException
tenantId - intorg.wso2.carbon.stratos.common.exception.StratosException - , trigger failedpublic static void triggerUpdateTenant(org.wso2.carbon.stratos.common.beans.TenantInfoBean tenantInfoBean)
throws org.wso2.carbon.stratos.common.exception.StratosException
tenantInfoBean - tenantInfoBeanorg.wso2.carbon.stratos.common.exception.StratosException, - if update failedorg.wso2.carbon.stratos.common.exception.StratosExceptionpublic static void triggerTenantInitialActivation(org.wso2.carbon.stratos.common.beans.TenantInfoBean tenantInfoBean)
throws org.wso2.carbon.stratos.common.exception.StratosException
org.wso2.carbon.stratos.common.exception.StratosExceptionpublic static void triggerTenantActivation(int tenantId)
throws org.wso2.carbon.stratos.common.exception.StratosException
org.wso2.carbon.stratos.common.exception.StratosExceptionpublic static void triggerTenantDeactivation(int tenantId)
throws org.wso2.carbon.stratos.common.exception.StratosException
org.wso2.carbon.stratos.common.exception.StratosExceptionpublic static void validateDomain(String domainName) throws Exception
domainName - tenant domainException - , if invalid tenant domain name is givenpublic static org.wso2.carbon.user.core.UserStoreManager getUserStoreManager(org.wso2.carbon.user.core.tenant.Tenant tenant,
int tenantId)
throws Exception
tenant - - a tenanttenantId - - tenant Id. To avoid the sequences where tenant.getId() may
produce the super tenant's tenant Id.Exception - UserStoreExceptionpublic static org.wso2.carbon.user.core.tenant.Tenant initializeTenant(org.wso2.carbon.stratos.common.beans.TenantInfoBean tenantInfoBean)
tenantInfoBean - inputpublic static org.wso2.carbon.stratos.common.beans.TenantInfoBean initializeTenantInfoBean(int tenantId,
org.wso2.carbon.user.core.tenant.Tenant tenant)
throws Exception
tenantId - tenant id.tenant - a tenant.Exception - , exception in getting the adminUserName from tenantIdpublic static org.wso2.carbon.stratos.common.beans.TenantInfoBean getTenantInfoBeanfromTenant(int tenantId,
org.wso2.carbon.user.core.tenant.Tenant tenant)
tenantId, - tenant idtenant, - tenantpublic static void addClaimsToUserStoreManager(org.wso2.carbon.user.core.tenant.Tenant tenant)
throws Exception
tenant - a tenantException - if error in adding claims to the user.public static void activateTenantInitially(org.wso2.carbon.stratos.common.beans.TenantInfoBean tenantInfoBean,
int tenantId)
throws Exception
tenantInfoBean - tenant informationtenantId - tenant IdException - UserStoreException.public static void activateTenant(String tenantDomain, org.wso2.carbon.user.core.tenant.TenantManager tenantManager, int tenantId) throws Exception
tenantDomain - tenant domaintenantManager - TenantManager objecttenantId - tenant IdException - UserStoreException.public static void deactivateTenant(String tenantDomain, org.wso2.carbon.user.core.tenant.TenantManager tenantManager, int tenantId) throws Exception
tenantDomain - tenant domaintenantManager - TenantManager objecttenantId - tenant IdException - UserStoreException.public static void unloadTenantConfigurations(String tenantDomain, int tenantId)
tenantDomain - tenant domaintenantId - tenant Idpublic static void deleteTenantRegistryData(int tenantId)
throws Exception
Exceptionpublic static void deleteTenantUMData(int tenantId)
throws Exception
Exceptionpublic static void deleteWorkernodesTenant(int tenantId)
throws Exception
tenantId - Exceptionpublic static void deleteProductSpecificTenantData(String dataSourceName, String tableName, int tenantId)
dataSourceName - tableName - tenantId - public static boolean isTenantAdminCreationOperation()
public static void setTenantAdminCreationOperation(boolean isAdminCreationOperation)
public static void clearTenantAdminCreationOperation()
Copyright © 2019 WSO2. All rights reserved.