Class CaldavReadRest

java.lang.Object
org.exoplatform.caldav.rest.CaldavReadRest

@RestController public class CaldavReadRest extends Object
The read endpoints the page calls instead of downloading and parsing every iCalendar object itself.

One request replaces what used to be one REPORT per calendar issued from the browser, followed by parsing every object in the main thread with the user's password in the page.

  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.exoplatform.caldav.model.RemoteCalendarsRead
    The calendars of the connected account, and whether it could be asked.
    org.exoplatform.caldav.model.RemoteEventsRead
    events(String start, String end)
    The connected account's events over a window, and what of it could not be read.
    org.springframework.http.ResponseEntity<Long>
    When the connected account last finished synchronising.
    org.springframework.http.ResponseEntity<Void>
    Synchronises the connected account now, whatever the throttle says.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CaldavReadRest

      public CaldavReadRest()
  • Method Details

    • events

      @GetMapping("/events") @Secured("users") public org.exoplatform.caldav.model.RemoteEventsRead events(@RequestParam("start") String start, @RequestParam("end") String end)
      The connected account's events over a window, and what of it could not be read.

      Answers 200 with a partial reading rather than an error status, on purpose. A failure status would throw away the calendars that did answer to report the one that did not, which is a worse agenda than the one the failure caused; and an unreachable account is not a bad request, nor a fault of this platform, so neither 4xx nor 5xx describes it. What the body carries instead is the distinction the status code cannot express: whether the account was asked and answered nothing, or could not be asked.

      Parameters:
      start - beginning of the window, an ISO instant
      end - end of the window, an ISO instant
      Returns:
      the occurrences, each tagged with its calendar and colour, beside what could not be read
    • syncNow

      @PostMapping("/sync") @Secured("users") public org.springframework.http.ResponseEntity<Void> syncNow()
      Synchronises the connected account now, whatever the throttle says.

      Answers on the calendars, not on the copies. The outward work this starts — settling what eXo owes, seeding what was never given, reading the copies back — runs on a thread of its own and is not waited for, so a 204 means the calendars are in step and the copies are being seen to, not that they have been.

      Returns:
      an empty 204
    • lastSync

      @GetMapping("/sync/state") @Secured("users") public org.springframework.http.ResponseEntity<Long> lastSync()
      When the connected account last finished synchronising.

      Its own endpoint rather than a field on the settings: the settings are read on every page that shows a connector, and this walks the bindings. Only the screen that displays the state should pay for it.

      Returns:
      the instant in milliseconds, or 204 when nothing has synchronised yet
    • calendars

      @GetMapping("/calendars") @Secured("users") public org.exoplatform.caldav.model.RemoteCalendarsRead calendars()
      The calendars of the connected account, and whether it could be asked.
      Returns:
      the calendars, each with a usable colour, beside the flag that tells an account holding none from one that could not be listed