Interface CustomerSegmentService<P extends CustomerSegment>

Type Parameters:
P - CustomerSegment or a subclass
All Superinterfaces:
com.broadleafcommerce.data.tracking.core.service.CrudEntityService<P>, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<P>
All Known Implementing Classes:
DefaultCustomerSegmentService

public interface CustomerSegmentService<P extends CustomerSegment> extends com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<P>
Service for delegation of CRUD based operations on CustomerSegments
Author:
Chris Schneider (cschneider), Nathan Moore (nathandmoore)
  • Method Details

    • resolveCustomerSegmentsForRequest

      ResolveCustomerSegmentResponse resolveCustomerSegmentsForRequest(ResolveCustomerSegmentsRequest request, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Resolves CustomerSegments that apply to a given request.
      Parameters:
      request - Request with user details for customer segments to target and be evaluated against.
      context - Additional multitenant and sandbox info.
      Returns:
      The list of matching segments if any.
    • readAllRuleBasedCustomerSegmentsByRuleEvaluationType

      List<P> readAllRuleBasedCustomerSegmentsByRuleEvaluationType(String evaluationType, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Parameters:
      evaluationType - The type of rule evaluation. See DefaultCustomerSegmentRuleEvaluationType.
      context - Additional sandbox and multitenant info.
      Returns:
      The matching CustomerSegments.
    • canManuallyAddCustomerToSegment

      boolean canManuallyAddCustomerToSegment(String segmentId, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Evaluates whether the customer segment with the given ID allows manually adding customers.

      As an example, using the default customer segment types, CUSTOMER_SET and RULE_BASED, only sets support manually adding customers, as rule based segments are derived.

      Parameters:
      segmentId - The ID of the segment to evaluate
      context - Context information regarding sandboxing and multitenant state
      Returns:
      true if customers may be manually added to this segment, else false