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 boolean
canEqual(Object other)
List<Currency>
computeAllowedCurrencies()
Utility method to retrieve allowed currencies.Currency
computeDefaultCurrency()
Utility method to retrieve the default currency.boolean
equals(Object o)
List<Currency>
getAllowedCurrencies()
List ofCurrencies
that are available to be selected for use with this application.List<Locale>
getAllowedLocales()
List ofLocale
s that are available to be selected for this application.ContextState
getContextState()
A subset ofTracking
information to expose the context state for this object.String
getCustomerContextId()
The customer context id that is used to discriminate entities withTrackableBehavior.CUSTOMER_CONTEXT
.Currency
getDefaultCurrency()
TheCurrency
that this application, by default, assumes all data is within and can drive the default currency selection on a frontend.Locale
getDefaultLocale()
String
getId()
The context id, which is a separate identifier from the database primary key.String
getIdentifierType()
Defines the type of the application identifier: Whether a domain or a domain prefix.String
getIdentifierValue()
Determines how applications are distinguished from each other using all or part of their domains or hostnames.InheritanceLines
getInheritanceLines()
Context list of the contextIds for the deep catalog tree parenting theisolatedCatalogs
.List<ApplicationCatalogRef>
getIsolatedCatalogs()
Individual catalogs assigned to this application.String
getName()
The general name for the applicationString
getTenantId()
The tenant to which this application belongsint
hashCode()
boolean
isDeactivated()
Determines whether this application is active.boolean
isMarketplace()
Whether or not the application is a marketplace application.String
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
setId(String id)
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
setName(String name)
The general name for the applicationvoid
setTenantId(String tenantId)
The tenant to which this application belongsString
toString()
-
-
-
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. 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
public List<Currency> 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
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.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
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()
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
public List<Locale> 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
public Currency 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
public List<Currency> 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
public List<ApplicationCatalogRef> 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:
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 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
public ContextState 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
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.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
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)
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
public void setAllowedLocales(List<Locale> allowedLocales)
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
public 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. If not set, the system will use the default currency fordefaultLocale
in response to API requests.- Parameters:
defaultCurrency
- TheCurrency
that this application
-
setAllowedCurrencies
public void setAllowedCurrencies(List<Currency> allowedCurrencies)
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
public void setIsolatedCatalogs(List<ApplicationCatalogRef> isolatedCatalogs)
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:
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 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
public void setContextState(ContextState contextState)
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
-
canEqual
protected boolean canEqual(Object other)
-
-