Interface CustomerSegmentProvider<P extends CustomerSegment>
- All Known Implementing Classes:
ExternalCustomerSegmentProvider
public interface CustomerSegmentProvider<P extends CustomerSegment>
Provider for interfacing with operations directly involving customer segment related domain.
Typically utilizes
WebClient
to make requests to an external REST API.- Author:
- Julia Lopez-Pozas (jlopezpozas)
-
Method Summary
Modifier and TypeMethodDescriptionreadDynamicCustomerSegments
(com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Reads all customer segments that can be dynamically applied under the current context for the current user.resolveCustomerSegmentsForContext
(ResolveCustomerSegmentsRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Sends a request to the Customer provider to evaluate the request to determine whatCustomerSegments
match the context.
-
Method Details
-
readDynamicCustomerSegments
List<P> readDynamicCustomerSegments(@Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Reads all customer segments that can be dynamically applied under the current context for the current user.- Parameters:
context
- The context details- Returns:
- a List of rule-based dynamic customer segments
-
resolveCustomerSegmentsForContext
ResolveCustomerSegmentResponse resolveCustomerSegmentsForContext(ResolveCustomerSegmentsRequest request, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Sends a request to the Customer provider to evaluate the request to determine whatCustomerSegments
match the context. This relies on the provider to evaluate any rules against the context rather than doing them in the client. SeeCustomerSegment.isInternalEvaluationRequired()
.- Parameters:
request
- User details for evaluating rule-based customer segmentscontext
- The context details- Returns:
- The
ResolveCustomerSegmentResponse
with the matching segments.
-