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
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
Utility method to retrieve allowed currencies.Utility method to retrieve the default currency.boolean
List ofCurrencies
that are available to be selected for use with this application.List ofLocale
s that are available to be selected for this application.A subset ofTracking
information to expose the context state for this object.The customer context id that is used to discriminate entities withTrackableBehavior.CUSTOMER_CONTEXT
.TheCurrency
that 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 belongsint
hashCode()
boolean
Determines whether this application is active.boolean
Whether 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.void
setAllowedCurrencies
(List<Currency> allowedCurrencies) List ofCurrencies
that are available to be selected for use with this application.void
setAllowedLocales
(List<Locale> allowedLocales) List ofLocale
s that are available to be selected for this application.void
setContextState
(ContextState contextState) A subset ofTracking
information to expose the context state for this object.void
setCustomerContextId
(String customerContextId) The customer context id that is used to discriminate entities withTrackableBehavior.CUSTOMER_CONTEXT
.void
setDeactivated
(boolean deactivated) Determines whether this application is active.void
setDefaultCurrency
(Currency defaultCurrency) TheCurrency
that this application, by default, assumes all data is within and can drive the default currency selection on a frontend.void
setDefaultLocale
(Locale defaultLocale) void
The context id, which is a separate identifier from the database primary key.void
setIdentifierType
(String identifierType) Defines the type of the application identifier: Whether a domain or a domain prefix.void
setIdentifierValue
(String identifierValue) Determines how applications are distinguished from each other using all or part of their domains or hostnames.void
setInheritanceLines
(InheritanceLines inheritanceLines) Context list of the contextIds for the deep catalog tree parenting theisolatedCatalogs
.void
setIsolatedCatalogs
(List<ApplicationCatalogRef> isolatedCatalogs) Individual catalogs assigned to this application.void
setMarketplace
(boolean isMarketplace) Whether or not the application is a marketplace application.void
The general name for the applicationvoid
setTenantId
(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. IfdefaultCurrency
is 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. IfallowedCurrencies
is empty, this will compute them from the default currencies (Currency.getInstance(Locale)
) for each of theallowed locales
. Otherwise, this will return a copy ofallowedCurrencies
to 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.com
inhttps://myapplication.mycompany.com/
or themyapplication
inhttps://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
TheLocale
that this application, by default, assumes all data is within and can drive the defaultLocale
selection as a result.- Returns:
- The default
Locale
as a string.
-
getAllowedLocales
List ofLocale
s that are available to be selected for this application. AllCatalog
s within that are related to this application's should be restricted to this locale set.- Returns:
- List of
Locale
s available for this application.
-
getDefaultCurrency
TheCurrency
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 fordefaultLocale
in response to API requests.- Returns:
- The
Currency
that this application.
-
getAllowedCurrencies
List ofCurrencies
that are available to be selected for use with this application. AllCatalogs
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 inallowedLocales
.- Returns:
- List of
Currencies
that are available to be selected for use with this application
-
getIsolatedCatalogs
Individual catalogs assigned to this application.ApplicationCatalogRefs
provide 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 leverageMarketplaceApplicationCatalog
relationships 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 ofTracking
information to expose the context state for this object.- Specified by:
getContextState
in interfaceContextStateAware
- Returns:
- a subset of
Tracking
information 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.com
inhttps://myapplication.mycompany.com/
or themyapplication
inhttps://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
TheLocale
that this application, by default, assumes all data is within and can drive the defaultLocale
selection as a result.- Parameters:
defaultLocale
- The defaultLocale
as a string.
-
setAllowedLocales
List ofLocale
s that are available to be selected for this application. AllCatalog
s within that are related to this application's should be restricted to this locale set.- Parameters:
allowedLocales
- List ofLocale
s available for this application.
-
setDefaultCurrency
TheCurrency
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 fordefaultLocale
in response to API requests.- Parameters:
defaultCurrency
- TheCurrency
that this application
-
setAllowedCurrencies
List ofCurrencies
that are available to be selected for use with this application. AllCatalogs
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 inallowedLocales
.- Parameters:
allowedCurrencies
- List ofCurrencies
that are available to be selected for use with this application
-
setIsolatedCatalogs
Individual catalogs assigned to this application.ApplicationCatalogRefs
provide 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 leverageMarketplaceApplicationCatalog
relationships 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 ofTracking
information to expose the context state for this object.- Specified by:
setContextState
in interfaceContextStateAware
- Parameters:
contextState
- a subset ofTracking
information to expose the context state for this object
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-