Class Application
java.lang.Object
com.broadleafcommerce.data.tracking.core.tenant.domain.Application
- All Implemented Interfaces:
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanUtility method to retrieve allowed currencies.Utility method to retrieve the default currency.booleanList ofCurrenciesthat are available to be selected for use with this application.List ofLocales that are available to be selected for this application.A subset ofTrackinginformation to expose the context state for this object.The customer context id that is used to discriminate entities withTrackableBehavior.CUSTOMER_CONTEXT.TheCurrencythat this application, by default, assumes all data is within and can drive the default currency selection on a frontend.getId()The context id, which is a separate identifier from the database primary key.Defines the type of the application identifier: Whether a domain or a domain prefix.Determines how applications are distinguished from each other using all or part of their domains or hostnames.Context list of the contextIds for the deep catalog tree parenting theisolatedCatalogs.Individual catalogs assigned to this application.getName()The general name for the applicationThe tenant to which this application belongsinthashCode()booleanDetermines whether this application is active.booleanWhether or not the application is a marketplace application.mutability(Catalog catalog) Given a catalog, determine the mutability of that catalog from the viewpoint of this application.voidsetAllowedCurrencies(List<Currency> allowedCurrencies) List ofCurrenciesthat are available to be selected for use with this application.voidsetAllowedLocales(List<Locale> allowedLocales) List ofLocales that are available to be selected for this application.voidsetContextState(ContextState contextState) A subset ofTrackinginformation to expose the context state for this object.voidsetCustomerContextId(String customerContextId) The customer context id that is used to discriminate entities withTrackableBehavior.CUSTOMER_CONTEXT.voidsetDeactivated(boolean deactivated) Determines whether this application is active.voidsetDefaultCurrency(Currency defaultCurrency) TheCurrencythat this application, by default, assumes all data is within and can drive the default currency selection on a frontend.voidsetDefaultLocale(Locale defaultLocale) voidThe context id, which is a separate identifier from the database primary key.voidsetIdentifierType(String identifierType) Defines the type of the application identifier: Whether a domain or a domain prefix.voidsetIdentifierValue(String identifierValue) Determines how applications are distinguished from each other using all or part of their domains or hostnames.voidsetInheritanceLines(InheritanceLines inheritanceLines) Context list of the contextIds for the deep catalog tree parenting theisolatedCatalogs.voidsetIsolatedCatalogs(List<ApplicationCatalogRef> isolatedCatalogs) Individual catalogs assigned to this application.voidsetMarketplace(boolean isMarketplace) Whether or not the application is a marketplace application.voidThe general name for the applicationvoidsetTenantId(String tenantId) The tenant to which this application belongstoString()
-
Constructor Details
-
Application
-
Application
public Application()
-
-
Method Details
-
mutability
Given a catalog, determine the mutability of that catalog from the viewpoint of this application.- Parameters:
catalog- the catalog instance to check- Returns:
- the string representation of the mutability if available, else
MutabilityType.CUSTOMIZABLE
-
computeDefaultCurrency
Utility method to retrieve the default currency. IfdefaultCurrencyis null, this will compute it from the default currency (Currency.getInstance(Locale)) ofdefaultLocale.- Returns:
- The computed default currency for this application
- See Also:
-
defaultCurrency
-
computeAllowedCurrencies
Utility method to retrieve allowed currencies. IfallowedCurrenciesis empty, this will compute them from the default currencies (Currency.getInstance(Locale)) for each of theallowed locales. Otherwise, this will return a copy ofallowedCurrenciesto prevent accidental mutation.- Returns:
- Computed list of allowed currencies for this application
- See Also:
-
allowedCurrencies
-
getId
The context id, which is a separate identifier from the database primary key. This may be auto generated, or may be explicity provided upon entity creation.- Returns:
- Separate identifier from the database primary key
-
getName
The general name for the application- Returns:
- The general name for the application
-
getTenantId
The tenant to which this application belongs- Returns:
- The tenant to which this application belongs
-
getIdentifierType
Defines the type of the application identifier: Whether a domain or a domain prefix.- Returns:
- the type of the application identifier: Whether a domain or a domain prefix.
- See Also:
-
getIdentifierValue
Determines how applications are distinguished from each other using all or part of their domains or hostnames. Values could be themyapplication.mycompany.cominhttps://myapplication.mycompany.com/or themyapplicationinhttps://myapplication.mycompany.com/depending onidentifierType.- Returns:
- the domain (a.k.a., hostname) or domain segment identifying this application.
- See Also:
-
identifierType
-
getCustomerContextId
The customer context id that is used to discriminate entities withTrackableBehavior.CUSTOMER_CONTEXT. -
isDeactivated
public boolean isDeactivated()Determines whether this application is active.- Returns:
- Determines whether this application is active.
-
getDefaultLocale
TheLocalethat this application, by default, assumes all data is within and can drive the defaultLocaleselection as a result.- Returns:
- The default
Localeas a string.
-
getAllowedLocales
List ofLocales that are available to be selected for this application. AllCatalogs within that are related to this application's should be restricted to this locale set.- Returns:
- List of
Locales available for this application.
-
getDefaultCurrency
TheCurrencythat 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 fordefaultLocalein response to API requests.- Returns:
- The
Currencythat this application.
-
getAllowedCurrencies
List ofCurrenciesthat are available to be selected for use with this application. AllCatalogsthat 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 inallowedLocales.- Returns:
- List of
Currenciesthat are available to be selected for use with this application
-
getIsolatedCatalogs
Individual catalogs assigned to this application.ApplicationCatalogRefsprovide additional control over the mutability and visibility of the contents of the catalogs assigned.- Returns:
- Individual catalogs assigned to this application
- See Also:
-
getInheritanceLines
Context list of the contextIds for the deep catalog tree parenting theisolatedCatalogs. These values are generally not included in reported Json, but instead are calculated and leveraged internally during catalog visibility and mutability determinations.- Returns:
- Context list of the contextIds for the deep catalog tree parenting the
isolatedCatalogs
-
isMarketplace
public boolean isMarketplace()Whether or not the application is a marketplace application. Marketplace applications leverageMarketplaceApplicationCatalogrelationships to catalogs, in addition to the explicit relationships declared ingetIsolatedCatalogs().Generally, all relationships to vendor catalogs should be defined exclusively with
MarketplaceApplicationCatalog, and any additional relationships to non-vendor catalogs would be ingetIsolatedCatalogs().- Returns:
- Whether or not the application is a marketplace
-
getContextState
A subset ofTrackinginformation to expose the context state for this object.- Specified by:
getContextStatein interfaceContextStateAware- Returns:
- a subset of
Trackinginformation to expose the context state for this object
-
setId
The context id, which is a separate identifier from the database primary key. This may be auto generated, or may be explicity provided upon entity creation.- Parameters:
id- Separate identifier from the database primary key
-
setName
The general name for the application- Parameters:
name- The general name for the application
-
setTenantId
The tenant to which this application belongs- Parameters:
tenantId- The tenant to which this application belongs
-
setIdentifierType
Defines the type of the application identifier: Whether a domain or a domain prefix.- Parameters:
identifierType- the type of the application identifier: Whether a domain or a domain prefix.- See Also:
-
setIdentifierValue
Determines how applications are distinguished from each other using all or part of their domains or hostnames. Values could be themyapplication.mycompany.cominhttps://myapplication.mycompany.com/or themyapplicationinhttps://myapplication.mycompany.com/depending onidentifierType.- Parameters:
identifierValue- the domain (a.k.a., hostname) or domain segment identifying this application.- See Also:
-
identifierType
-
setCustomerContextId
The customer context id that is used to discriminate entities withTrackableBehavior.CUSTOMER_CONTEXT. -
setDeactivated
public void setDeactivated(boolean deactivated) Determines whether this application is active.- Parameters:
deactivated- Determines whether this application is active.
-
setDefaultLocale
TheLocalethat this application, by default, assumes all data is within and can drive the defaultLocaleselection as a result.- Parameters:
defaultLocale- The defaultLocaleas a string.
-
setAllowedLocales
List ofLocales that are available to be selected for this application. AllCatalogs within that are related to this application's should be restricted to this locale set.- Parameters:
allowedLocales- List ofLocales available for this application.
-
setDefaultCurrency
TheCurrencythat 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 fordefaultLocalein response to API requests.- Parameters:
defaultCurrency- TheCurrencythat this application
-
setAllowedCurrencies
List ofCurrenciesthat are available to be selected for use with this application. AllCatalogsthat 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 inallowedLocales.- Parameters:
allowedCurrencies- List ofCurrenciesthat are available to be selected for use with this application
-
setIsolatedCatalogs
Individual catalogs assigned to this application.ApplicationCatalogRefsprovide additional control over the mutability and visibility of the contents of the catalogs assigned.- Parameters:
isolatedCatalogs- Individual catalogs assigned to this application- See Also:
-
setInheritanceLines
Context list of the contextIds for the deep catalog tree parenting theisolatedCatalogs. These values are generally not included in reported Json, but instead are calculated and leveraged internally during catalog visibility and mutability determinations.- Parameters:
Context- list of the contextIds for the deep catalog tree parenting theisolatedCatalogs
-
setMarketplace
public void setMarketplace(boolean isMarketplace) Whether or not the application is a marketplace application. Marketplace applications leverageMarketplaceApplicationCatalogrelationships to catalogs, in addition to the explicit relationships declared ingetIsolatedCatalogs().Generally, all relationships to vendor catalogs should be defined exclusively with
MarketplaceApplicationCatalog, and any additional relationships to non-vendor catalogs would be ingetIsolatedCatalogs().- Parameters:
isMarketplace- Whether or not the application is a marketplace
-
setContextState
A subset ofTrackinginformation to expose the context state for this object.- Specified by:
setContextStatein interfaceContextStateAware- Parameters:
contextState- a subset ofTrackinginformation to expose the context state for this object
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-