Interface TenantManager


public interface TenantManager
  • Method Details

    • 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 UserStoreException
      Activates a tenant
      Parameters:
      tenantId - The Id of the tenant
      Throws:
      UserStoreException
    • deactivateTenant

      void deactivateTenant(int tenantId) throws UserStoreException
      De-activates a tenant
      Parameters:
      tenantId - The Id of the tenant
      Throws:
      UserStoreException
    • isTenantActive

      boolean isTenantActive(int tenantId) throws UserStoreException
      Checks whether a tenant is active
      Parameters:
      tenantId - The Id of the tenant
      Returns:
      Throws:
      UserStoreException
    • deleteTenant

      void deleteTenant(int tenantId) throws UserStoreException
      Deletes a tenant from the system
      Parameters:
      tenantId -
      Throws:
      UserStoreException
    • deleteTenant

      void deleteTenant(int tenantId, boolean removeFromPersistentStorage) throws UserStoreException
      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

      String getSuperTenantDomain() throws UserStoreException
      Checks whether the super tenant.
      Returns:
      Throws:
      UserStoreException
    • getTenantByDomain

      default Tenant getTenantByDomain(String tenantDomain) throws UserStoreException
      Gets a Tenant object by tenant domain.
      Parameters:
      tenantDomain - tenant domain.
      Returns:
      Tenant.
      Throws:
      UserStoreException - if there is an error in tenant retrieval.