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 |
addAdditionalClaimsToUserStoreManager(org.wso2.carbon.user.core.tenant.Tenant tenant) |
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 |
deleteTenant(String tenantDomain) |
static void |
deleteTenantDir(int tenantId)
Delete the tenant directory of a given tenant id
|
static void |
deleteTenantRegistryData(int tenantId) |
static void |
deleteTenantUMData(int tenantId) |
static void |
deleteWorkernodesTenant(int tenantId)
Broadcast TenantDeleteClusterMessage to all worker nodes
|
static int |
getDefaultItemsPerPage()
Get the Default Items per Page needed to display.
|
static int |
getMaximumItemPerPage()
Get the Maximum Item per Page need to display.
|
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 |
prepareStringToShowThemeMgtPage(int tenantId,
String resourceId)
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 |
triggerPreAddTenant(org.wso2.carbon.stratos.common.beans.TenantInfoBean tenantInfo)
Triggers pre tenant add listeners.
|
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 void prepareStringToShowThemeMgtPage(int tenantId, String resourceId) throws org.wso2.carbon.stratos.common.exception.TenantMgtException
tenantId
- tenant idorg.wso2.carbon.stratos.common.exception.TenantMgtException
- if failed.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.RegistryException
public 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.StratosException
public static void triggerPreAddTenant(org.wso2.carbon.stratos.common.beans.TenantInfoBean tenantInfo) throws org.wso2.carbon.stratos.common.exception.StratosException
tenantInfo
- tenantorg.wso2.carbon.stratos.common.exception.StratosException
public 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.StratosException
public 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.StratosException
public static void triggerTenantActivation(int tenantId) throws org.wso2.carbon.stratos.common.exception.StratosException
org.wso2.carbon.stratos.common.exception.StratosException
public static void triggerTenantDeactivation(int tenantId) throws org.wso2.carbon.stratos.common.exception.StratosException
org.wso2.carbon.stratos.common.exception.StratosException
public static void validateDomain(String domainName) throws Exception
domainName
- tenant domain name.Exception
- if invalid tenant domain name is given.public 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 void deleteTenant(String tenantDomain) throws Exception
tenantDomain
- domain name of the tenant.Exception
- if there is an exception during the tenant deletion.public 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 addAdditionalClaimsToUserStoreManager(org.wso2.carbon.user.core.tenant.Tenant tenant) throws Exception
Exception
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
- if tenant activation fails.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
- if tenant deactivation fails.public static void unloadTenantConfigurations(String tenantDomain, int tenantId)
tenantDomain
- tenant domaintenantId
- tenant Idpublic static void deleteTenantRegistryData(int tenantId) throws Exception
Exception
public static void deleteTenantUMData(int tenantId) throws Exception
Exception
public static void deleteWorkernodesTenant(int tenantId) throws Exception
tenantId
- Exception
public static void deleteProductSpecificTenantData(String dataSourceName, String tableName, int tenantId)
dataSourceName
- tableName
- tenantId
- public static void deleteTenantDir(int tenantId)
tenantId
- Id of the tenantpublic static boolean isTenantAdminCreationOperation()
public static void setTenantAdminCreationOperation(boolean isAdminCreationOperation)
public static void clearTenantAdminCreationOperation()
public static int getDefaultItemsPerPage()
public static int getMaximumItemPerPage()
Copyright © 2022 WSO2. All rights reserved.