Package org.wso2.carbon.user.api
Interface TenantManager
-
public interface TenantManager
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidactivateTenant(int tenantId)Activates a tenantintaddTenant(Tenant tenant)Adds a tenant to the systemvoiddeactivateTenant(int tenantId)De-activates a tenantvoiddeleteTenant(int tenantId)Deletes a tenant from the systemvoiddeleteTenant(int tenantId, boolean removeFromPersistentStorage)Deletes a tenant from the system which use to delete the cache in each worker nodes using clustered message and delete the persistence storage in management nodeTenant[]getAllTenants()Gets all tenants in the system.Tenant[]getAllTenantsForTenantDomainStr(String domain)Gets tenants in the system which matches the given domain String(which can be used for partial searches).StringgetDomain(int tenantId)Retrieves the domain given a tenant IdStringgetSuperTenantDomain()Checks whether the super tenant.TenantgetTenant(int tenantId)Gets a Tenant objectintgetTenantId(String domain)Retrieves the tenant Id given the domainbooleanisTenantActive(int tenantId)Checks whether a tenant is activevoidupdateTenant(Tenant tenant)Updates a tenant in the system
-
-
-
Method Detail
-
addTenant
int addTenant(Tenant tenant) throws UserStoreException
Adds a tenant to the system- Parameters:
tenant- The tenant to be added- Returns:
- The Id of the tenant
- Throws:
UserStoreException
-
updateTenant
void updateTenant(Tenant tenant) throws UserStoreException
Updates a tenant in the system- Parameters:
tenant- The tenant to be updated- Throws:
UserStoreException
-
getTenant
Tenant getTenant(int tenantId) throws UserStoreException
Gets a Tenant object- Parameters:
tenantId- The tenant Id of the tenant- Returns:
- The tenant object
- Throws:
UserStoreException
-
getAllTenants
Tenant[] getAllTenants() throws UserStoreException
Gets all tenants in the system.- Returns:
- An array of all tenants
- Throws:
UserStoreException
-
getAllTenantsForTenantDomainStr
Tenant[] getAllTenantsForTenantDomainStr(String domain) throws UserStoreException
Gets tenants in the system which matches the given domain String(which can be used for partial searches).- Returns:
- An array of tenants which matches the domain
- Throws:
UserStoreException
-
getDomain
String getDomain(int tenantId) throws UserStoreException
Retrieves the domain given a tenant Id- Parameters:
tenantId- The Id of the tenant- Returns:
- Throws:
UserStoreException
-
getTenantId
int getTenantId(String domain) throws UserStoreException
Retrieves the tenant Id given the domain- Parameters:
domain- The domain of the tenant- Returns:
- Throws:
UserStoreException
-
activateTenant
void activateTenant(int tenantId) throws UserStoreExceptionActivates a tenant- Parameters:
tenantId- The Id of the tenant- Throws:
UserStoreException
-
deactivateTenant
void deactivateTenant(int tenantId) throws UserStoreExceptionDe-activates a tenant- Parameters:
tenantId- The Id of the tenant- Throws:
UserStoreException
-
isTenantActive
boolean isTenantActive(int tenantId) throws UserStoreExceptionChecks whether a tenant is active- Parameters:
tenantId- The Id of the tenant- Returns:
- Throws:
UserStoreException
-
deleteTenant
void deleteTenant(int tenantId) throws UserStoreExceptionDeletes a tenant from the system- Parameters:
tenantId-- Throws:
UserStoreException
-
deleteTenant
void deleteTenant(int tenantId, boolean removeFromPersistentStorage) throws UserStoreExceptionDeletes a tenant from the system which use to delete the cache in each worker nodes using clustered message and delete the persistence storage in management node- Parameters:
tenantId-removeFromPersistentStorage-- Throws:
UserStoreException
-
getSuperTenantDomain
String getSuperTenantDomain() throws UserStoreException
Checks whether the super tenant.- Returns:
- Throws:
UserStoreException
-
-