Package org.wso2.carbon.user.api
Interface TenantManager
public interface TenantManager
-
Method Summary
Modifier and TypeMethodDescriptionvoidactivateTenant(int tenantId) Activates a tenantintAdds 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[]Gets all tenants in the system.Tenant[]Gets tenants in the system which matches the given domain String(which can be used for partial searches).getDomain(int tenantId) Retrieves the domain given a tenant IdChecks whether the super tenant.getTenant(int tenantId) Gets a Tenant objectdefault TenantgetTenantByDomain(String tenantDomain) Gets a Tenant object by tenant domain.intgetTenantId(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 Details
-
addTenant
Adds a tenant to the system- Parameters:
tenant- The tenant to be added- Returns:
- The Id of the tenant
- Throws:
UserStoreException
-
updateTenant
Updates a tenant in the system- Parameters:
tenant- The tenant to be updated- Throws:
UserStoreException
-
getTenant
Gets a Tenant object- Parameters:
tenantId- The tenant Id of the tenant- Returns:
- The tenant object
- Throws:
UserStoreException
-
getAllTenants
Gets all tenants in the system.- Returns:
- An array of all tenants
- Throws:
UserStoreException
-
getAllTenantsForTenantDomainStr
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
Retrieves the domain given a tenant Id- Parameters:
tenantId- The Id of the tenant- Returns:
- Throws:
UserStoreException
-
getTenantId
Retrieves the tenant Id given the domain- Parameters:
domain- The domain of the tenant- Returns:
- Throws:
UserStoreException
-
activateTenant
Activates a tenant- Parameters:
tenantId- The Id of the tenant- Throws:
UserStoreException
-
deactivateTenant
De-activates a tenant- Parameters:
tenantId- The Id of the tenant- Throws:
UserStoreException
-
isTenantActive
Checks whether a tenant is active- Parameters:
tenantId- The Id of the tenant- Returns:
- Throws:
UserStoreException
-
deleteTenant
Deletes a tenant from the system- Parameters:
tenantId-- Throws:
UserStoreException
-
deleteTenant
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 node- Parameters:
tenantId-removeFromPersistentStorage-- Throws:
UserStoreException
-
getSuperTenantDomain
Checks whether the super tenant.- Returns:
- Throws:
UserStoreException
-
getTenantByDomain
Gets a Tenant object by tenant domain.- Parameters:
tenantDomain- tenant domain.- Returns:
- Tenant.
- Throws:
UserStoreException- if there is an error in tenant retrieval.
-