Class PreviewCustomerSegmentEndpoint
java.lang.Object
com.broadleafcommerce.customersegment.web.endpoint.PreviewCustomerSegmentEndpoint
@RestController
@RequestMapping(value="/preview-segments/json",
produces={"application/json","application/xml"})
@ConditionalOnBroadleafModule(ENTERPRISE)
@ConditionalOnProperty("preview.customer.segments.rest")
public class PreviewCustomerSegmentEndpoint
extends Object
This is a secondary endpoint that should be used when working with previewing segments for a stateless API.
This is disabled from getting scanned by default and can be enabled by setting the property "preview.customer.segments.rest" to true.
- Author:
- Nick Crum ncrum
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.broadleafcommerce.common.crossapp.service.CrossAppAuthServiceprotected final CustomerSegmentServiceprotected static final Stringprotected final org.broadleafcommerce.common.security.service.ExploitProtectionServicestatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected PreviewCustomerSegmentResponsebuildResponse(Collection<CustomerSegment> segments, Collection<CustomerSegment> previewSegments) voidsetCrossAppAuthService(org.broadleafcommerce.common.crossapp.service.CrossAppAuthService crossAppAuthService) voidviewPreviewSegments(jakarta.servlet.http.HttpServletRequest request, String filter, Integer limit)
-
Field Details
-
PREVIEW_SEGMENT_ENDPOINT_BASE_PATH
- See Also:
-
DEFAULT_LIMIT_PARAM_VALUE
- See Also:
-
customerSegmentService
-
exploitProtectionService
protected final org.broadleafcommerce.common.security.service.ExploitProtectionService exploitProtectionService -
crossAppAuthService
protected org.broadleafcommerce.common.crossapp.service.CrossAppAuthService crossAppAuthService
-
-
Constructor Details
-
PreviewCustomerSegmentEndpoint
public PreviewCustomerSegmentEndpoint()
-
-
Method Details
-
setCrossAppAuthService
@Autowired(required=false) public void setCrossAppAuthService(org.broadleafcommerce.common.crossapp.service.CrossAppAuthService crossAppAuthService) -
viewPreviewSegments
@RequestMapping(value="", produces={"application/json","application/xml"}) public PreviewCustomerSegmentResponse viewPreviewSegments(jakarta.servlet.http.HttpServletRequest request, @RequestParam(value="filter",required=false) String filter, @RequestParam(value="limit",required=false,defaultValue="10") Integer limit) throws org.broadleafcommerce.common.exception.ServiceException - Throws:
org.broadleafcommerce.common.exception.ServiceException
-
buildResponse
protected PreviewCustomerSegmentResponse buildResponse(Collection<CustomerSegment> segments, Collection<CustomerSegment> previewSegments) -
userNotAuthenticated
@ResponseStatus(value=UNAUTHORIZED, reason="Not authorized") @ExceptionHandler(java.lang.SecurityException.class) public void userNotAuthenticated()
-