@RestController public class SegmentController extends PersonalizationAbstractController
  • Constructor Details

    • SegmentController

      @Autowired public SegmentController(SegmentFacade cxSegmentFacade, org.springframework.validation.Validator segmentValidator)
  • Method Details

    • getSegments

      @GetMapping("/v1/segments") public SegmentListWsDTO getSegments(@RequestParam Map<String,String> requestParams)
      Returns all segments from the system
      Returns:
      List with all segments in the system
    • createListDTO

      protected SegmentListWsDTO createListDTO(SearchPageData<SegmentData> segments)
    • createSegment

      @PostMapping(value="/v1/segments", consumes={"application/json","application/xml"}) @ResponseStatus(CREATED) public org.springframework.http.ResponseEntity<SegmentData> createSegment(@RequestBody SegmentData segment, org.springframework.web.util.UriComponentsBuilder builder)
      Creates segment
      Returns:
      created segment
      Throws:
      AlreadyExistsException - if segment with given code already exists
      WebserviceValidationException - if provided segment data is invalid
    • getSegment

      @GetMapping("/v1/segments/{segmentCode}") public SegmentData getSegment(@PathVariable String segmentCode)
      Returns segment with given code
      Returns:
      segmetn with given code
      Throws:
      NotFoundException - if segment with given code does not exists
    • updateSegment

      @PutMapping(value="/v1/segments/{segmentCode}", consumes={"application/json","application/xml"}) public SegmentData updateSegment(@PathVariable String segmentCode, @RequestBody SegmentData segment)
      Updates segment with given code
      Returns:
      updated segment
      Throws:
      WebserviceValidationException - if provided data is invalid
      NotFoundException - if segment with given code does not exists
    • deleteSegment

      @DeleteMapping("/v1/segments/{segmentCode}") @ResponseStatus(NO_CONTENT) public void deleteSegment(@PathVariable String segmentCode)
      Removes segment with given code
      Throws:
      NotFoundException - if segment with given code does not exists
    • validateSegment

      protected void validateSegment(SegmentData segment)