Interface CategoryDetailsContextContributor
- All Superinterfaces:
org.springframework.core.Ordered
- All Known Implementing Classes:
RelatedCategoryAssetsCategoryContextContributor
,RelatedProductAssetsCategoryContextContributor
,RelatedProductsCategoryContextContributor
,RelatedProductTagsCategoryContextContributor
,RelatedVariantsCategoryContextContributor
public interface CategoryDetailsContextContributor
extends org.springframework.core.Ordered
Services implementing this interface are responsible for contributing a specific subset of
information to a
CategoryDetailsContext
based on a CategoryDetailsRequest
in
order to retrieve all related entities in bulk operations rather than piece-meal for performance
reasons. It is desirable for implementations of this class to be as narrow as possible in the
breadth of their contributions to improve extensibility, reusability, testability, and
readability.
Contributors should handle all the DB queries necessary for gathering all the related entities
while consolidation (such as merging product assets onto related products) should be handled by
CategoryDetailsContextConsolidators
as consolidators
will run after all contributors.
- Author:
- Nathan Moore (nathandmoore)
-
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Method Summary
Modifier and TypeMethodDescriptioncontribute
(CategoryDetailsContext categoryDetailsContext, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Contributes to the suppliedCategoryDetailsContext
.Methods inherited from interface org.springframework.core.Ordered
getOrder
-
Method Details
-
contribute
CategoryDetailsContext contribute(CategoryDetailsContext categoryDetailsContext, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Contributes to the suppliedCategoryDetailsContext
. This should not mutate the inputted context, but return a new one with the new contributions.- Parameters:
categoryDetailsContext
- The context to which to contributecontextInfo
- context information surrounding sandboxing/multitenant state- Returns:
- A version of the supplied
CategoryDetailsContext
with the new contributions.
-