Class CustomerSegmentEndpoint
- java.lang.Object
 - 
- com.broadleafcommerce.customer.web.endpoint.CustomerSegmentEndpoint
 
 
- 
@FrameworkRestController @FrameworkMapping("/segments") @DataRouteByExample(CustomerSegment.class) public class CustomerSegmentEndpoint extends ObjectEndpoint for managing customer segments. Includes standard CRUD operations as well as adding/removing customers from segments. 
- 
- 
Constructor Summary
Constructors Constructor Description CustomerSegmentEndpoint(CustomerSegmentService<CustomerSegment> customerSegmentService, SegmentMemberService<SegmentMember,CustomerSegment> segmentMemberService, CustomerService<Customer> customerService, SegmentProcessingService segmentProcessingService, SegmentProcessHistoryService<SegmentProcessHistory> segmentProcessHistoryService, com.broadleafcommerce.common.extension.TypeFactory typeFactory) 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SegmentMemberaddCustomerToSegment(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, SegmentMember segmentMember, String segmentId)CustomerSegmentcreateCustomerSegment(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, CustomerSegment customerSegment)voiddeleteCustomerSegment(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String segmentId)protected CustomerSegmentService<CustomerSegment>getCustomerSegmentService()protected CustomerService<Customer>getCustomerService()protected SegmentMemberService<SegmentMember,CustomerSegment>getSegmentMemberService()protected SegmentProcessHistoryService<SegmentProcessHistory>getSegmentProcessHistoryService()protected SegmentProcessingServicegetSegmentProcessingService()protected com.broadleafcommerce.common.extension.TypeFactorygetTypeFactory()protected voidhydrateCustomers(org.springframework.data.domain.Page<SegmentMember> segmentMemberPage, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)SegmentProcessHistoryprocessRuleBasedSegment(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String segmentId)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)CustomerSegmentreadCustomerSegmentById(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.BulkUpdatereadSegmentBulkProcess(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String bulkUpdateId)voidremoveCustomerFromSegment(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String segmentId, String customerId)CustomerSegmentreplaceCustomerSegment(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String segmentId, CustomerSegment updatedSegment) 
 - 
 
- 
- 
Field Detail
- 
BASE_URI
public static final String BASE_URI
- See Also:
 - Constant Field Values
 
 
 - 
 
- 
Constructor Detail
- 
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 Detail
- 
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 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
protected CustomerSegmentService<CustomerSegment> getCustomerSegmentService()
 
- 
getSegmentMemberService
protected SegmentMemberService<SegmentMember,CustomerSegment> getSegmentMemberService()
 
- 
getCustomerService
protected CustomerService<Customer> getCustomerService()
 
- 
getSegmentProcessingService
protected SegmentProcessingService getSegmentProcessingService()
 
- 
getSegmentProcessHistoryService
protected SegmentProcessHistoryService<SegmentProcessHistory> getSegmentProcessHistoryService()
 
- 
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
 
 - 
 
 -