Class Application
- java.lang.Object
-
- com.broadleafcommerce.data.tracking.core.tenant.domain.Application
-
- All Implemented Interfaces:
ContextStateAware,Serializable
public class Application extends Object implements 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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Application()Application(String id)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancanEqual(Object other)List<Currency>computeAllowedCurrencies()Utility method to retrieve allowed currencies.CurrencycomputeDefaultCurrency()Utility method to retrieve the default currency.booleanequals(Object o)List<Currency>getAllowedCurrencies()List ofCurrenciesthat are available to be selected for use with this application.List<Locale>getAllowedLocales()List ofLocales that are available to be selected for this application.ContextStategetContextState()A subset ofTrackinginformation to expose the context state for this object.StringgetCustomerContextId()The customer context id that is used to discriminate entities withTrackableBehavior.CUSTOMER_CONTEXT.CurrencygetDefaultCurrency()TheCurrencythat this application, by default, assumes all data is within and can drive the default currency selection on a frontend.LocalegetDefaultLocale()StringgetId()The context id, which is a separate identifier from the database primary key.StringgetIdentifierType()Defines the type of the application identifier: Whether a domain or a domain prefix.StringgetIdentifierValue()Determines how applications are distinguished from each other using all or part of their domains or hostnames.InheritanceLinesgetInheritanceLines()Context list of the contextIds for the deep catalog tree parenting theisolatedCatalogs.List<ApplicationCatalogRef>getIsolatedCatalogs()Individual catalogs assigned to this application.StringgetName()The general name for the applicationStringgetTenantId()The tenant to which this application belongsinthashCode()booleanisDeactivated()Determines whether this application is active.booleanisMarketplace()Whether or not the application is a marketplace application.Stringmutability(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)voidsetId(String id)The 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.voidsetName(String name)The general name for the applicationvoidsetTenantId(String tenantId)The tenant to which this application belongsStringtoString()
-
-
-
Constructor Detail
-
Application
public Application(String id)
-
Application
public Application()
-
-
Method Detail
-
mutability
@Nullable public String mutability(@NonNull Catalog catalog)
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
public Currency 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
public List<Currency> 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
public String 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
public String getName()
The general name for the application- Returns:
- The general name for the application
-
getTenantId
public String getTenantId()
The tenant to which this application belongs- Returns:
- The tenant to which this application belongs
-
getIdentifierType
public String 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:
ResolutionIdentifierType
-
getIdentifierValue
public String 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
public String 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
public Locale 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
public List<Locale> 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
public Currency 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
public List<Currency> 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
public List<ApplicationCatalogRef> 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:
ApplicationCatalogRef
-
getInheritanceLines
public InheritanceLines 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
public ContextState 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
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 explicity 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
-
setTenantId
public void setTenantId(String tenantId)
The tenant to which this application belongs- Parameters:
tenantId- The tenant to which this application belongs
-
setIdentifierType
public void setIdentifierType(String identifierType)
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:
ResolutionIdentifierType
-
setIdentifierValue
public void setIdentifierValue(String identifierValue)
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
public void setCustomerContextId(String customerContextId)
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
public void setDefaultLocale(Locale defaultLocale)
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
public void setAllowedLocales(List<Locale> allowedLocales)
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
public void setDefaultCurrency(Currency defaultCurrency)
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
public void setAllowedCurrencies(List<Currency> allowedCurrencies)
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
public void setIsolatedCatalogs(List<ApplicationCatalogRef> isolatedCatalogs)
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:
ApplicationCatalogRef
-
setInheritanceLines
public void setInheritanceLines(InheritanceLines inheritanceLines)
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
public void setContextState(ContextState contextState)
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
-
canEqual
protected boolean canEqual(Object other)
-
-