Class Application

java.lang.Object
com.broadleafcommerce.tenant.domain.Application
All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.ContextStateAware, Serializable

public class Application extends Object implements com.broadleafcommerce.data.tracking.core.ContextStateAware, Serializable
Represents the tenant concept of a storefront structure. This structure ties together concepts of visible catalogs, as well as URI resolution.
Author:
Jeff Fischer
See Also:
  • Constructor Details

  • Method Details

    • getId

      public String getId()
      The context id, which is a separate identifier from the database primary key. This may be auto generated, or may be explicitly provided upon entity creation.
      Returns:
      Separate identifier from the database primary key
    • getName

      public String getName()
      The general name for the application
      Returns:
      The general name for the application
    • getToken

      public String getToken()
      The token used for API access to this application's data.
      Returns:
      the token used for API access to this application's data
    • getIdentifierType

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

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

      public String getCustomerContextId()

      The customer context id that is used to discriminate entities with TrackableBehavior.CUSTOMER_CONTEXT.

      If it is null on a newly created application, then the property TenantApplicationProperties.Customer.getContextMethod() is used to default it. If CustomerContextResolverMethod.APPLICATION uses the ID of the Application. If CustomerContextResolverMethod.TENANT, uses the ID of the Tenant.

      Returns:
      the customer context id
      See Also:
    • isDeactivated

      public boolean isDeactivated()
      Determines whether this application is active.
      Returns:
      Determines whether this application is active.
    • getDefaultLocale

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

      public List<Locale> getAllowedLocales()
      List of Locales that are available to be selected for this application. All Catalogs that are related to this application should be restricted to this locale set.
      Returns:
      List of Locales available for this application.
    • getDefaultCurrency

      public Currency getDefaultCurrency()
      The Currency that this application, 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 application.
    • getAllowedCurrencies

      public List<Currency> getAllowedCurrencies()
      List of Currencies that are available to be selected for use with this application. All Catalogs that are related to this application 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 application
    • getPortraitAsset

      public ApplicationAsset getPortraitAsset()
      The asset information for the application's portrait. If populated, this property will be used within the admin to display a portrait for this application within the application selector. If not populated, a generic fallback icon will be displayed instead.
      Returns:
      the portrait asset, or null
    • getLogoAsset

      public ApplicationAsset getLogoAsset()
      The asset information for the application's logo. If populated, this property will be used within the admin to display the logo for the application-level admin. If not populated, the admin will utilize the Tenant.getLogoAsset() if it exists.
      Returns:
      the logo asset, or null
    • getAttributes

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

      public List<ApplicationCatalogRef> getIsolatedCatalogs()
      Individual catalogs assigned to this application. ApplicationCatalogRefs provide additional control over the mutability and visibility of the entities of the catalogs assigned.
      Returns:
      Individual catalogs assigned to this application
      See Also:
    • isMarketplace

      public boolean isMarketplace()
      Whether or not the application is a marketplace application. Marketplace applications leverage MarketplaceApplicationCatalog relationships to catalogs, in addition to the explicit relationships declared in getIsolatedCatalogs().

      Generally, all relationships to vendor catalogs should be defined exclusively with MarketplaceApplicationCatalog, and any additional relationships to non-vendor catalogs would be in getIsolatedCatalogs(). Unless the ApplicationConfigurationProperties.isAllowVendorCatalogInApplicationIsolatedCatalogs() is enabled.

      See Also:
      • ApplicationConfigurationProperties
    • getContextState

      public com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState getContextState()
      A subset of Tracking information to expose the context state for this object.
      Specified by:
      getContextState in interface com.broadleafcommerce.data.tracking.core.ContextStateAware
      Returns:
      a subset of Tracking information to expose the context state for this object
    • getRobots

      public String getRobots()
      A robots.txt file contents tells search engine crawlers which pages or files the crawler can or can't request from your site. This is used mainly to avoid overloading your site with requests;
      Returns:
      a string of the contents of the robots.txt
    • setId

      public void setId(String id)
      The context id, which is a separate identifier from the database primary key. This may be auto generated, or may be explicitly provided upon entity creation.
      Parameters:
      id - Separate identifier from the database primary key
    • setName

      public void setName(String name)
      The general name for the application
      Parameters:
      name - The general name for the application
    • setToken

      public void setToken(String token)
      The token used for API access to this application's data.
      Parameters:
      token - the token used for API access to this application's data
    • setIdentifierType

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

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

      public void setCustomerContextId(String customerContextId)

      The customer context id that is used to discriminate entities with TrackableBehavior.CUSTOMER_CONTEXT.

      If it is null on a newly created application, then the property TenantApplicationProperties.Customer.getContextMethod() is used to default it. If CustomerContextResolverMethod.APPLICATION uses the ID of the Application. If CustomerContextResolverMethod.TENANT, uses the ID of the Tenant.

      Parameters:
      customerContextId - the customer context id
      See Also:
    • setDeactivated

      public void setDeactivated(boolean deactivated)
      Determines whether this application is active.
      Parameters:
      deactivated - Determines whether this application is active.
    • setDefaultLocale

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

      public void setAllowedLocales(List<Locale> allowedLocales)
      List of Locales that are available to be selected for this application. All Catalogs that are related to this application should be restricted to this locale set.
      Parameters:
      allowedLocales - List of Locales available for this application.
    • setDefaultCurrency

      public void setDefaultCurrency(Currency defaultCurrency)
      The Currency that this application, 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 application
    • setAllowedCurrencies

      public void setAllowedCurrencies(List<Currency> allowedCurrencies)
      List of Currencies that are available to be selected for use with this application. All Catalogs that are related to this application 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 application
    • setPortraitAsset

      public void setPortraitAsset(ApplicationAsset portraitAsset)
      The asset information for the application's portrait. If populated, this property will be used within the admin to display a portrait for this application within the application selector. If not populated, a generic fallback icon will be displayed instead.
      Parameters:
      portraitAsset - the next portrait asset
    • setLogoAsset

      public void setLogoAsset(ApplicationAsset logoAsset)
      The asset information for the application's logo. If populated, this property will be used within the admin to display the logo for the application-level admin. If not populated, the admin will utilize the Tenant.getLogoAsset() if it exists.
      Parameters:
      logoAsset - the next logo asset
    • setAttributes

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

      public void setIsolatedCatalogs(List<ApplicationCatalogRef> isolatedCatalogs)
      Individual catalogs assigned to this application. ApplicationCatalogRefs provide additional control over the mutability and visibility of the entities of the catalogs assigned.
      Parameters:
      isolatedCatalogs - Individual catalogs assigned to this application
      See Also:
    • setMarketplace

      public void setMarketplace(boolean isMarketplace)
      Whether or not the application is a marketplace application. Marketplace applications leverage MarketplaceApplicationCatalog relationships to catalogs, in addition to the explicit relationships declared in getIsolatedCatalogs().

      Generally, all relationships to vendor catalogs should be defined exclusively with MarketplaceApplicationCatalog, and any additional relationships to non-vendor catalogs would be in getIsolatedCatalogs(). Unless the ApplicationConfigurationProperties.isAllowVendorCatalogInApplicationIsolatedCatalogs() is enabled.

      See Also:
      • ApplicationConfigurationProperties
    • setContextState

      public void setContextState(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState)
      A subset of Tracking information to expose the context state for this object.
      Specified by:
      setContextState in interface com.broadleafcommerce.data.tracking.core.ContextStateAware
      Parameters:
      contextState - a subset of Tracking information to expose the context state for this object
    • setRobots

      public void setRobots(String robots)
      A robots.txt file contents tells search engine crawlers which pages or files the crawler can or can't request from your site. This is used mainly to avoid overloading your site with requests;
    • 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