Class DefaultTrackableBehaviorUtil
- All Implemented Interfaces:
TrackableBehaviorUtil
- Author:
- Jeff Fischer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanallowTransitionPersistenceMessage(Trackable domainInstance) Whether a persistence message will be dropped for sandbox transitions.booleanReports whether the currently active data route supports commonCatalogfunctionality.booleanReports whether the currently active data route supports common marketplace (ex:MarketplaceApplicationCatalog) functionality.protected TrackableBehaviorPackagedetermineTrackableBehaviorPackage(@NonNull Class<?> domainClass) Determines theTrackableBehaviorsif no extensions are found for the domain class.protected Optional<TrackableBehaviorPackage>getBehaviorFromExtension(@NonNull Class<?> domainClass) Looks for an extension with which to determine theTrackableBehaviorsfor a domain class.protected org.springframework.core.env.EnvironmentgetInheritedBehavior(@NonNull TrackableBehaviorInheritable domainInstance) Retrieve a pojo that describes the inheritedTrackableBehaviorattributes of a domain objectprotected List<TrackableBehaviorOverride>protected com.broadleafcommerce.common.extension.data.DataRouteReferencegetTrackableBehavior(@NonNull Class<?> domainClass) Retrieve a pojo that describes theTrackableBehaviorattributes of a domain classgetTrackableBehavior(@NonNull Object domainInstance) Retrieve a pojo that describes theTrackableBehaviorattributes of a domain objectbooleanWhether or not sandbox propagation is enabled in the system.booleanisSandboxRecord(@NonNull Trackable domainInstance) Determines whether the givenTrackableis a record in a sandbox.voidsetDataRouteReference(com.broadleafcommerce.common.extension.data.DataRouteReference reference) voidsetEnvironment(org.springframework.core.env.Environment environment) voidsetOverrides(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:TrackableBehaviorUtilWhether or not sandbox propagation is enabled in the system. SeeSandboxPropagationProperties. Default is false.- Specified by:
isSandboxPropagationEnabledin 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:TrackableBehaviorUtilRetrieve a pojo that describes theTrackableBehaviorattributes of a domain class- Specified by:
getTrackableBehaviorin interfaceTrackableBehaviorUtil- Parameters:
domainClass- The domain class to review forTrackableBehavior- Returns:
- Retrieve a pojo that describes the
TrackableBehaviorattributes of a domain class
-
isSandboxRecord
Description copied from interface:TrackableBehaviorUtilDetermines whether the givenTrackableis a record in a sandbox. This takes into account whetherdomainInstanceis even sandboxable before checking the tracking level to determine if it's in a sandbox.- Specified by:
isSandboxRecordin interfaceTrackableBehaviorUtil- Parameters:
domainInstance- TheTrackablethat could be a sandbox record- Returns:
- Whether the given
Trackableis a record in a sandbox
-
allowTransitionPersistenceMessage
Description copied from interface:TrackableBehaviorUtilWhether a persistence message will be dropped for sandbox transitions. This does not include deployments, which are always allowed. Default is false.- Specified by:
allowTransitionPersistenceMessagein interfaceTrackableBehaviorUtil
-
getTrackableBehavior
@NonNull public TrackableBehaviorPackage getTrackableBehavior(@NonNull @NonNull @NonNull Object domainInstance) Description copied from interface:TrackableBehaviorUtilRetrieve a pojo that describes theTrackableBehaviorattributes of a domain object- Specified by:
getTrackableBehaviorin interfaceTrackableBehaviorUtil- Parameters:
domainInstance- The domain object to review forTrackableBehavior- Returns:
- Retrieve a pojo that describes the
TrackableBehaviorattributes of a domain object
-
getInheritedBehavior
@NonNull public TrackableBehaviorPackage getInheritedBehavior(@NonNull @NonNull @NonNull TrackableBehaviorInheritable domainInstance) Description copied from interface:TrackableBehaviorUtilRetrieve a pojo that describes the inheritedTrackableBehaviorattributes of a domain object- Specified by:
getInheritedBehaviorin interfaceTrackableBehaviorUtil- Parameters:
domainInstance- The domain object to review for inheritedTrackableBehavior- Returns:
- Retrieve a pojo that describes the inherited
TrackableBehaviorattributes of a domain object
-
getBehaviorFromExtension
protected Optional<TrackableBehaviorPackage> getBehaviorFromExtension(@NonNull @NonNull @NonNull Class<?> domainClass) Looks for an extension with which to determine theTrackableBehaviorsfor a domain class. Extensions may be provided via registeringTrackableBehaviorOverride Beansor 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 theTrackableBehaviorsif no extensions are found for the domain class. This will determine behaviors based on the implementedTrackableinterfaces ofdomainClass.- Parameters:
domainClass- The class for which to determine theTrackableBehaviors- Returns:
- the
TrackableBehaviorsparticular todomainClass. - See Also:
-
currentRouteSupportsCatalog
public boolean currentRouteSupportsCatalog()Description copied from interface:TrackableBehaviorUtilReports whether the currently active data route supports commonCatalogfunctionality.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:
currentRouteSupportsCatalogin interfaceTrackableBehaviorUtil- Returns:
- true if the current route supports common
Catalogfunctionality, or false otherwise - See Also:
-
currentRouteSupportsMarketplace
public boolean currentRouteSupportsMarketplace()Description copied from interface:TrackableBehaviorUtilReports 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:
currentRouteSupportsMarketplacein 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()
-