Class DefaultTrackableBehaviorUtil
- All Implemented Interfaces:
TrackableBehaviorUtil
- Author:
- Jeff Fischer
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Reports whether the currently active data route supports commonCatalog
functionality.boolean
Reports whether the currently active data route supports common marketplace (ex:MarketplaceApplicationCatalog
) functionality.protected TrackableBehaviorPackage
determineTrackableBehaviorPackage
(@NonNull Class<?> domainClass) Determines theTrackableBehaviors
if no extensions are found for the domain class.protected Optional<TrackableBehaviorPackage>
getBehaviorFromExtension
(@NonNull Class<?> domainClass) Looks for an extension with which to determine theTrackableBehaviors
for a domain class.protected org.springframework.core.env.Environment
getInheritedBehavior
(@NonNull TrackableBehaviorInheritable domainInstance) Retrieve a pojo that describes the inheritedTrackableBehavior
attributes of a domain objectprotected List<TrackableBehaviorOverride>
protected com.broadleafcommerce.common.extension.data.DataRouteReference
getTrackableBehavior
(@NonNull Class<?> domainClass) Retrieve a pojo that describes theTrackableBehavior
attributes of a domain classgetTrackableBehavior
(@NonNull Object domainInstance) Retrieve a pojo that describes theTrackableBehavior
attributes of a domain objectboolean
Whether or not sandbox propagation is enabled in the system.boolean
isSandboxRecord
(@NonNull Trackable domainInstance) Determines whether the givenTrackable
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
-
Constructor Details
-
DefaultTrackableBehaviorUtil
public DefaultTrackableBehaviorUtil()
-
-
Method Details
-
setOverrides
-
setSandboxPropagationProperties
@Autowired public void setSandboxPropagationProperties(@Nullable SandboxPropagationProperties properties) -
setDataRouteReference
@Autowired public void setDataRouteReference(@Nullable com.broadleafcommerce.common.extension.data.DataRouteReference reference) -
setEnvironment
@Autowired public void setEnvironment(@Nullable org.springframework.core.env.Environment environment) -
isSandboxPropagationEnabled
public boolean isSandboxPropagationEnabled()Description copied from interface:TrackableBehaviorUtil
Whether or not sandbox propagation is enabled in the system. SeeSandboxPropagationProperties
. Default is false.- Specified by:
isSandboxPropagationEnabled
in interfaceTrackableBehaviorUtil
- Returns:
- Whether or not sandbox propagation is enabled in the system
-
getTrackableBehavior
@NonNull public TrackableBehaviorPackage getTrackableBehavior(@NonNull @NonNull @NonNull Class<?> domainClass) Description copied from interface:TrackableBehaviorUtil
Retrieve a pojo that describes theTrackableBehavior
attributes of a domain class- Specified by:
getTrackableBehavior
in interfaceTrackableBehaviorUtil
- Parameters:
domainClass
- The domain class to review forTrackableBehavior
- Returns:
- Retrieve a pojo that describes the
TrackableBehavior
attributes of a domain class
-
isSandboxRecord
Description copied from interface:TrackableBehaviorUtil
Determines whether the givenTrackable
is a record in a sandbox. This takes into account whetherdomainInstance
is even sandboxable before checking the tracking level to determine if it's in a sandbox.- Specified by:
isSandboxRecord
in interfaceTrackableBehaviorUtil
- Parameters:
domainInstance
- TheTrackable
that could be a sandbox record- Returns:
- Whether the given
Trackable
is a record in a sandbox
-
getTrackableBehavior
@NonNull public TrackableBehaviorPackage getTrackableBehavior(@NonNull @NonNull @NonNull Object domainInstance) Description copied from interface:TrackableBehaviorUtil
Retrieve a pojo that describes theTrackableBehavior
attributes of a domain object- Specified by:
getTrackableBehavior
in interfaceTrackableBehaviorUtil
- Parameters:
domainInstance
- The domain object to review forTrackableBehavior
- Returns:
- Retrieve a pojo that describes the
TrackableBehavior
attributes of a domain object
-
getInheritedBehavior
@NonNull public TrackableBehaviorPackage getInheritedBehavior(@NonNull @NonNull @NonNull TrackableBehaviorInheritable domainInstance) Description copied from interface:TrackableBehaviorUtil
Retrieve a pojo that describes the inheritedTrackableBehavior
attributes of a domain object- Specified by:
getInheritedBehavior
in interfaceTrackableBehaviorUtil
- Parameters:
domainInstance
- The domain object to review for inheritedTrackableBehavior
- Returns:
- Retrieve a pojo that describes the inherited
TrackableBehavior
attributes of a domain object
-
getBehaviorFromExtension
protected Optional<TrackableBehaviorPackage> getBehaviorFromExtension(@NonNull @NonNull @NonNull Class<?> domainClass) Looks for an extension with which to determine theTrackableBehaviors
for a domain class. Extensions may be provided via registeringTrackableBehaviorOverride Beans
or annotating classes withTrackableExtension
.- Parameters:
domainClass
- The class for which to determine theTrackableBehaviors
- Returns:
- The behaviors from the extension or empty if no extension particular to
domainClass
. - See Also:
-
determineTrackableBehaviorPackage
protected TrackableBehaviorPackage determineTrackableBehaviorPackage(@NonNull @NonNull @NonNull Class<?> domainClass) Determines theTrackableBehaviors
if no extensions are found for the domain class. This will determine behaviors based on the implementedTrackable
interfaces ofdomainClass
.- Parameters:
domainClass
- The class for which to determine theTrackableBehaviors
- Returns:
- the
TrackableBehaviors
particular todomainClass
. - See Also:
-
currentRouteSupportsCatalog
public boolean currentRouteSupportsCatalog()Description copied from interface:TrackableBehaviorUtil
Reports whether the currently active data route supports commonCatalog
functionality.In the event that data routing is disabled or the current data route is not
CatalogDataRouteSupporting
, the value ofNarrowingSupportFallbackProperties.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.
- Specified by:
currentRouteSupportsCatalog
in interfaceTrackableBehaviorUtil
- Returns:
- true if the current route supports common
Catalog
functionality, or false otherwise - See Also:
-
currentRouteSupportsMarketplace
public boolean currentRouteSupportsMarketplace()Description copied from interface:TrackableBehaviorUtil
Reports whether the currently active data route supports common marketplace (ex:MarketplaceApplicationCatalog
) functionality.In the event that data routing is disabled or the current data route is not
MarketplaceDataRouteSupporting
, the value ofNarrowingSupportFallbackProperties.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.
- Specified by:
currentRouteSupportsMarketplace
in interfaceTrackableBehaviorUtil
- Returns:
- true if the currently route supports common marketplace functionality, or false otherwise
- See Also:
-
getOverrides
-
getReference
@Nullable protected com.broadleafcommerce.common.extension.data.DataRouteReference getReference() -
getEnvironment
@Nullable protected org.springframework.core.env.Environment getEnvironment()
-