use of org.zalando.nakadi.view.ShiftedCursor in project nakadi by zalando.
the class CursorOperationsController method moveCursors.
@RequestMapping(path = "/event-types/{eventTypeName}/shifted-cursors", method = RequestMethod.POST)
public ResponseEntity<?> moveCursors(@PathVariable("eventTypeName") final String eventTypeName, @Valid @RequestBody final ValidListWrapper<ShiftedCursor> cursors) throws InternalNakadiException, NoSuchEventTypeException {
final EventType eventType = eventTypeRepository.findByName(eventTypeName);
authorizationValidator.authorizeStreamRead(eventType);
final List<ShiftedNakadiCursor> domainCursor = cursors.getList().stream().map(this.toShiftedNakadiCursor(eventTypeName)).collect(Collectors.toList());
final List<NakadiCursor> domainResultCursors = cursorOperationsService.unshiftCursors(domainCursor);
final List<Cursor> viewResult = domainResultCursors.stream().map(cursorConverter::convert).collect(Collectors.toList());
return status(OK).body(viewResult);
}
Aggregations