Class Tenant

java.lang.Object
com.broadleafcommerce.tenant.domain.Tenant
All Implemented Interfaces:
Serializable

public class Tenant extends Object implements Serializable
Represents the distinct, completely independent operators within these services. Tenants share the same infrastructure, but should never share data.

For example, two companies might each have a tenant in one hosted Broadleaf instance, but their business is entirely isolated from each other.

See Also:
  • Constructor Details

  • Method Details

    • getId

      public String getId()
      The tenant identifier, which might be the same as the database primary key.
      Returns:
      Identifier for the tenant
    • getName

      public String getName()
      The general name for the tenant
      Returns:
      The general name for the tenant
    • getIdentifierType

      public String getIdentifierType()
      Defines the type of the tenant resolution identifier: Whether a domain or a domain prefix.
      Returns:
      the type of the tenant resolution identifier: Whether a domain or a domain prefix.
      See Also:
      • ResolutionIdentifierType
    • getIdentifierValue

      public String getIdentifierValue()
      Determines how tenants are resolved using all or part of their domains or hostnames. Values could be the mytenant.mycompany.com in https://mytenant.mycompany.com/ or the mytenant in https://mytenant.mycompany.com/ depending on identifierType.
      Returns:
      the domain (a.k.a., hostname) or domain segment identifying this tenant.
      See Also:
      • identifierType
    • getDefaultLocale

      public Locale getDefaultLocale()
      The Locale that this tenant, by default, assumes all data is within and can drive the default Locale selection as a result.
      Returns:
      The default Locale as a string.
    • getAllowedLocales

      public List<Locale> getAllowedLocales()
      List of Locales that are available to be selected for this tenant.
      Returns:
      List of Locales available for this tenant.
    • getDefaultCurrency

      public Currency getDefaultCurrency()
      The Currency that this tenant, by default, assumes all data is within and can drive the default currency selection on a frontend. If not set, the system will use the default currency for defaultLocale in response to API requests.
      Returns:
      The Currency that this tenant.
    • getAllowedCurrencies

      public List<Currency> getAllowedCurrencies()
      List of Currencies that are available to be selected for use with this tenant. All Catalogs that are related to this tenant should be restricted to this currency set. However, note that this can be empty, in which case, APIs will respond to requests with a list of currencies that the system determines to be the defaults for each locale in allowedLocales.
      Returns:
      List of Currencies that are available to be selected for use with this tenant
    • getLogoAsset

      public TenantAsset getLogoAsset()
      The asset information for the tenant's logo. If populated, this property will be used within the admin to display the logo for the tenant-level admin and any applications without a Application.getLogoAsset().
      Returns:
      the logo asset, or null
    • getAttributes

      public Map<String,Object> getAttributes()
      Arbitrary attributes associated with this tenant. May include soft references to related entities, custom fields, or other data.
      Returns:
      Map of attributes for this tenant
    • setId

      public void setId(String id)
      The tenant identifier, which might be the same as the database primary key.
      Parameters:
      id - Identifier for the tenant
    • setName

      public void setName(String name)
      The general name for the tenant
      Parameters:
      name - The general name for the tenant
    • setIdentifierType

      public void setIdentifierType(String identifierType)
      Defines the type of the tenant resolution identifier: Whether a domain or a domain prefix.
      Parameters:
      identifierType - the type of the tenant resolution identifier: Whether a domain or a domain prefix.
      See Also:
      • ResolutionIdentifierType
    • setIdentifierValue

      public void setIdentifierValue(String identifierValue)
      Determines how tenants are resolved using all or part of their domains or hostnames. Values could be the mytenant.mycompany.com in https://mytenant.mycompany.com/ or the mytenant in https://mytenant.mycompany.com/ depending on identifierType.
      Parameters:
      identifierValue - the domain (a.k.a., hostname) or domain segment identifying this tenant.
      See Also:
      • identifierType
    • setDefaultLocale

      public void setDefaultLocale(Locale defaultLocale)
      The Locale that this tenant, by default, assumes all data is within and can drive the default Locale selection as a result.
      Parameters:
      defaultLocale - The default Locale as a string.
    • setAllowedLocales

      public void setAllowedLocales(List<Locale> allowedLocales)
      List of Locales that are available to be selected for this tenant.
      Parameters:
      allowedLocales - List of Locales available for this tenant.
    • setDefaultCurrency

      public void setDefaultCurrency(Currency defaultCurrency)
      The Currency that this tenant, by default, assumes all data is within and can drive the default currency selection on a frontend. If not set, the system will use the default currency for defaultLocale in response to API requests.
      Parameters:
      defaultCurrency - The Currency that this tenant
    • setAllowedCurrencies

      public void setAllowedCurrencies(List<Currency> allowedCurrencies)
      List of Currencies that are available to be selected for use with this tenant. All Catalogs that are related to this tenant should be restricted to this currency set. However, note that this can be empty, in which case, APIs will respond to requests with a list of currencies that the system determines to be the defaults for each locale in allowedLocales.
      Parameters:
      allowedCurrencies - List of Currencies that are available to be selected for use with this tenant
    • setLogoAsset

      public void setLogoAsset(TenantAsset logoAsset)
      The asset information for the tenant's logo. If populated, this property will be used within the admin to display the logo for the tenant-level admin and any applications without a Application.getLogoAsset().
      Parameters:
      logoAsset - the next logo asset
    • setAttributes

      public void setAttributes(Map<String,Object> attributes)
      Arbitrary attributes associated with this tenant. May include soft references to related entities, custom fields, or other data.
      Parameters:
      attributes - Map of attributes for this tenant
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object