Class CustomerSegmentEndpoint
java.lang.Object
com.broadleafcommerce.customer.web.endpoint.CustomerSegmentEndpoint
@FrameworkRestController
@FrameworkMapping("/segments")
@DataRouteByExample(CustomerSegment.class)
public class CustomerSegmentEndpoint
extends Object
Endpoint for managing customer segments. Includes standard CRUD operations as well as
adding/removing customers from segments.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCustomerSegmentEndpoint
(CustomerSegmentService<CustomerSegment> customerSegmentService, SegmentMemberService<SegmentMember, CustomerSegment> segmentMemberService, CustomerService<Customer> customerService, SegmentProcessingService segmentProcessingService, SegmentProcessHistoryService<SegmentProcessHistory> segmentProcessHistoryService, com.broadleafcommerce.common.extension.TypeFactory typeFactory) -
Method Summary
Modifier and TypeMethodDescriptionaddCustomerToSegment
(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, SegmentMember segmentMember, String segmentId) createCustomerSegment
(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, CustomerSegment customerSegment) void
deleteCustomerSegment
(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String segmentId) protected CustomerSegmentService<CustomerSegment>
protected CustomerService<Customer>
protected SegmentMemberService<SegmentMember,
CustomerSegment> protected SegmentProcessingService
protected com.broadleafcommerce.common.extension.TypeFactory
protected void
hydrateCustomers
(org.springframework.data.domain.Page<SegmentMember> segmentMemberPage, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) processRuleBasedSegment
(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String segmentId) readAllCustomerSegments
(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Sort sort) org.springframework.data.domain.Page<CustomerSegment>
readAllCustomerSegments
(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Sort sort, org.springframework.data.domain.Pageable page) org.springframework.data.domain.Page<SegmentProcessHistory>
readAllSegmentBulkProcess
(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, org.springframework.data.domain.Pageable pageable, String segmentId) readCustomerSegmentById
(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String segmentId) org.springframework.data.domain.Page<SegmentMember>
readCustomersInSegment
(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String segmentId, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page) com.broadleafcommerce.bulk.domain.BulkUpdate
readSegmentBulkProcess
(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String bulkUpdateId) void
removeCustomerFromSegment
(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String segmentId, String customerId) replaceCustomerSegment
(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String segmentId, CustomerSegment updatedSegment)
-
Field Details
-
BASE_URI
- See Also:
-
-
Constructor Details
-
CustomerSegmentEndpoint
public CustomerSegmentEndpoint(CustomerSegmentService<CustomerSegment> customerSegmentService, SegmentMemberService<SegmentMember, CustomerSegment> segmentMemberService, CustomerService<Customer> customerService, SegmentProcessingService segmentProcessingService, SegmentProcessHistoryService<SegmentProcessHistory> segmentProcessHistoryService, com.broadleafcommerce.common.extension.TypeFactory typeFactory)
-
-
Method Details
-
readCustomerSegmentById
@Policy(permissionRoots="CUSTOMER_SEGMENT") @FrameworkGetMapping("/{segmentId}") public CustomerSegment readCustomerSegmentById(@ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("segmentId") String segmentId) -
readAllCustomerSegments
@Policy(permissionRoots="CUSTOMER_SEGMENT") @FrameworkGetMapping(params="unpaged=true") public List<CustomerSegment> readAllCustomerSegments(@ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo context, cz.jirutka.rsql.parser.ast.Node filters, @SortDefault("priority") org.springframework.data.domain.Sort sort) -
readAllCustomerSegments
@Policy(permissionRoots="CUSTOMER_SEGMENT") @FrameworkGetMapping public org.springframework.data.domain.Page<CustomerSegment> readAllCustomerSegments(@ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo context, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Sort sort, org.springframework.data.domain.Pageable page) -
createCustomerSegment
@Policy(permissionRoots="CUSTOMER_SEGMENT") @FrameworkPostMapping(consumes="application/json") public CustomerSegment createCustomerSegment(@ContextOperation(CREATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @RequestBody CustomerSegment customerSegment) -
replaceCustomerSegment
@Policy(permissionRoots="CUSTOMER_SEGMENT") @FrameworkPutMapping(value="/{segmentId}", consumes="application/json") public CustomerSegment replaceCustomerSegment(@ContextOperation(UPDATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("segmentId") String segmentId, @RequestBody CustomerSegment updatedSegment) -
deleteCustomerSegment
@Policy(permissionRoots="CUSTOMER_SEGMENT") @FrameworkDeleteMapping("/{segmentId}") public void deleteCustomerSegment(@ContextOperation(DELETE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("segmentId") String segmentId) -
readCustomersInSegment
@Policy(permissionRoots="CUSTOMER_SEGMENT") @FrameworkGetMapping("/{segmentId}/customers") public org.springframework.data.domain.Page<SegmentMember> readCustomersInSegment(@ContextOperation(READ) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("segmentId") String segmentId, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page) -
addCustomerToSegment
@Policy(permissionRoots="CUSTOMER_SEGMENT") @FrameworkPostMapping("/{segmentId}/customers") public SegmentMember addCustomerToSegment(@ContextOperation(CREATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @RequestBody SegmentMember segmentMember, @PathVariable("segmentId") String segmentId) -
removeCustomerFromSegment
@Policy(permissionRoots="CUSTOMER_SEGMENT") @FrameworkDeleteMapping("/{segmentId}/customers/{customerId}") public void removeCustomerFromSegment(@ContextOperation(DELETE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("segmentId") String segmentId, @PathVariable("customerId") String customerId) -
processRuleBasedSegment
@Policy(permissionRoots="CUSTOMER_SEGMENT_PROCESS_HISTORY") @FrameworkPostMapping("/{segmentId}/process") public SegmentProcessHistory processRuleBasedSegment(@ContextOperation(CREATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("segmentId") String segmentId) -
readAllSegmentBulkProcess
@Policy(permissionRoots="CUSTOMER_SEGMENT_PROCESS_HISTORY") @FrameworkGetMapping("/{segmentId}/process") public org.springframework.data.domain.Page<SegmentProcessHistory> readAllSegmentBulkProcess(@ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PageableDefault(sort="created",direction=DESC) org.springframework.data.domain.Pageable pageable, @PathVariable("segmentId") String segmentId) throws com.fasterxml.jackson.core.JsonProcessingException - Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
readSegmentBulkProcess
@Policy(permissionRoots="CUSTOMER_SEGMENT_PROCESS_HISTORY") @FrameworkGetMapping("/{segmentId}/process/{id}") public com.broadleafcommerce.bulk.domain.BulkUpdate readSegmentBulkProcess(@ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("id") String bulkUpdateId) throws com.fasterxml.jackson.core.JsonProcessingException - Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
hydrateCustomers
protected void hydrateCustomers(org.springframework.data.domain.Page<SegmentMember> segmentMemberPage, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) -
getCustomerSegmentService
-
getSegmentMemberService
-
getCustomerService
-
getSegmentProcessingService
-
getSegmentProcessHistoryService
-
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
-