public class DefaultTrackableBehaviorUtil extends Object implements TrackableBehaviorUtil
Constructor and Description |
---|
DefaultTrackableBehaviorUtil() |
Modifier and Type | Method and Description |
---|---|
boolean |
currentRouteSupportsCatalog()
Reports whether the currently active data route supports common
Catalog
functionality. |
boolean |
currentRouteSupportsMarketplace()
Reports whether the currently active data route supports common marketplace (ex:
MarketplaceApplicationCatalog ) functionality. |
protected TrackableBehaviorPackage |
determineTrackableBehaviorPackage(@NonNull Class<?> domainClass)
Determines the
TrackableBehaviors if no extensions are found for
the domain class. |
protected Optional<TrackableBehaviorPackage> |
getBehaviorFromExtension(@NonNull Class<?> domainClass)
Looks for an extension with which to determine the
TrackableBehaviors for a domain class. |
protected org.springframework.core.env.Environment |
getEnvironment() |
TrackableBehaviorPackage |
getInheritedBehavior(@NonNull TrackableBehaviorInheritable domainInstance)
Retrieve a pojo that describes the inherited
TrackableBehavior attributes of a domain
object |
protected List<TrackableBehaviorOverride> |
getOverrides() |
protected com.broadleafcommerce.common.extension.data.DataRouteReference |
getReference() |
TrackableBehaviorPackage |
getTrackableBehavior(@NonNull Class<?> domainClass)
Retrieve a pojo that describes the
TrackableBehavior attributes of a domain class |
TrackableBehaviorPackage |
getTrackableBehavior(@NonNull Object domainInstance)
Retrieve a pojo that describes the
TrackableBehavior attributes of a domain object |
boolean |
isSandboxPropagationEnabled()
Whether or not sandbox propagation is enabled in the system.
|
boolean |
isSandboxRecord(@NonNull Trackable domainInstance)
Determines whether the given
Trackable is a record in a sandbox. |
void |
setDataRouteReference(com.broadleafcommerce.common.extension.data.DataRouteReference reference) |
void |
setEnvironment(org.springframework.core.env.Environment environment) |
void |
setOverrides(List<TrackableBehaviorOverride> overrides) |
void |
setSandboxPropagationProperties(SandboxPropagationProperties properties) |
@Autowired public void setOverrides(@Nullable List<TrackableBehaviorOverride> overrides)
@Autowired public void setSandboxPropagationProperties(@Nullable SandboxPropagationProperties properties)
@Autowired public void setDataRouteReference(@Nullable com.broadleafcommerce.common.extension.data.DataRouteReference reference)
@Autowired public void setEnvironment(@Nullable org.springframework.core.env.Environment environment)
public boolean isSandboxPropagationEnabled()
TrackableBehaviorUtil
SandboxPropagationProperties
. Default is false.isSandboxPropagationEnabled
in interface TrackableBehaviorUtil
@NonNull public TrackableBehaviorPackage getTrackableBehavior(@NonNull @NonNull @NonNull Class<?> domainClass)
TrackableBehaviorUtil
TrackableBehavior
attributes of a domain classgetTrackableBehavior
in interface TrackableBehaviorUtil
domainClass
- The domain class to review for TrackableBehavior
TrackableBehavior
attributes of a domain
classpublic boolean isSandboxRecord(@NonNull @NonNull @NonNull Trackable domainInstance)
TrackableBehaviorUtil
Trackable
is a record in a sandbox. This takes into
account whether domainInstance
is even sandboxable before checking the tracking level
to determine if it's in a sandbox.isSandboxRecord
in interface TrackableBehaviorUtil
domainInstance
- The Trackable
that could be a sandbox recordTrackable
is a record in a sandbox@NonNull public TrackableBehaviorPackage getTrackableBehavior(@NonNull @NonNull @NonNull Object domainInstance)
TrackableBehaviorUtil
TrackableBehavior
attributes of a domain objectgetTrackableBehavior
in interface TrackableBehaviorUtil
domainInstance
- The domain object to review for TrackableBehavior
TrackableBehavior
attributes of a domain
object@NonNull public TrackableBehaviorPackage getInheritedBehavior(@NonNull @NonNull @NonNull TrackableBehaviorInheritable domainInstance)
TrackableBehaviorUtil
TrackableBehavior
attributes of a domain
objectgetInheritedBehavior
in interface TrackableBehaviorUtil
domainInstance
- The domain object to review for inherited TrackableBehavior
TrackableBehavior
attributes of
a domain objectprotected Optional<TrackableBehaviorPackage> getBehaviorFromExtension(@NonNull @NonNull @NonNull Class<?> domainClass)
TrackableBehaviors
for a domain class. Extensions may be provided via registering
TrackableBehaviorOverride Beans
or annotating classes with
TrackableExtension
.domainClass
- The class for which to determine the TrackableBehaviors
domainClass
.TrackableBehaviorUtil for more details on extensions
,
TrackableBehaviorOverride
,
TrackableExtension
protected TrackableBehaviorPackage determineTrackableBehaviorPackage(@NonNull @NonNull @NonNull Class<?> domainClass)
TrackableBehaviors
if no extensions are found for
the domain class. This will determine behaviors based on the implemented Trackable
interfaces of domainClass
.domainClass
- The class for which to determine the TrackableBehaviors
TrackableBehaviors
particular to domainClass
.FullTrackable
,
CatalogTrackable
,
ApplicationTrackable
,
CustomerContextTrackable
,
SandboxTrackable
,
TenantTrackable
,
Trackable
public boolean currentRouteSupportsCatalog()
TrackableBehaviorUtil
Catalog
functionality.
In the event that data routing is disabled or the current data route is not
CatalogDataRouteSupporting
, the value of
NarrowingSupportFallbackProperties.isSupportsCatalog()
should be used as a fallback.
This can be useful to ensure certain behavior (ex: narrowing) will only apply if the current configuration has the requisite support for it.
Default returns true.
currentRouteSupportsCatalog
in interface TrackableBehaviorUtil
Catalog
functionality, or false
otherwiseCatalogDataRouteSupporting
,
NarrowingSupportFallbackProperties.isSupportsCatalog()
public boolean currentRouteSupportsMarketplace()
TrackableBehaviorUtil
MarketplaceApplicationCatalog
) functionality.
In the event that data routing is disabled or the current data route is not
MarketplaceDataRouteSupporting
, the value of
NarrowingSupportFallbackProperties.isSupportsMarketplace()
will be used as a
fallback.
This can be useful to ensure certain behavior (ex: narrowing) will only apply if the current configuration has the requisite support for it.
Default returns true.
currentRouteSupportsMarketplace
in interface TrackableBehaviorUtil
MarketplaceDataRouteSupporting
,
NarrowingSupportFallbackProperties.isSupportsMarketplace()
@NonNull protected List<TrackableBehaviorOverride> getOverrides()
@Nullable protected com.broadleafcommerce.common.extension.data.DataRouteReference getReference()
@Nullable protected org.springframework.core.env.Environment getEnvironment()
Copyright © 2021. All rights reserved.