Class CaldavPushRest
This layer moves bytes and maps failures onto statuses; every decision —
which identities are addressable, what the object looks like, whether the
write is conditional — lives in CaldavPushService. The failure
bodies carry the connector's own machine-readable codes unchanged, because
the browser stops building objects but keeps rendering the failures, and a
renamed code would degrade each of them into the generic message.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionList<org.exoplatform.caldav.model.CalendarSyncState> What each of this user's calendars is doing, for the ones worth telling them about.org.springframework.http.ResponseEntity<MirrorTarget> The calendar the copies are currently written into, if one is set.org.springframework.http.ResponseEntity<Void> Removes one event's object from the mirror calendar.org.springframework.http.ResponseEntity<Void> deleteRemoteCounterpart(long calendarId) Removes the remote collection an eXo calendar is mirrored as, before agenda removes the calendar itself.org.exoplatform.caldav.model.CalendarDeletionPlandeletionPlan(long calendarId) What deleting an eXo calendar would also do remotely.org.springframework.http.ResponseEntity<Void> excludeOccurrence(String icsUid, String occurrence) Removes one occurrence from a series, leaving the series in place.List<org.exoplatform.caldav.model.HiddenCalendar> org.springframework.http.ResponseEntity<Void> hideCalendar(HideCalendarRequest request) Hides a calendar shared with the caller.org.springframework.http.ResponseEntity<Void> keepRemoteCounterpart(long calendarId) Records that the user chose to keep the remote calendar while deleting the eXo one.mirror()org.springframework.http.ResponseEntity<String> onPushFailure(CaldavPushException failure) Maps a push failure onto a status, keeping its code in the body.longHow many calendar copies eXo still owes this user and has not written.org.springframework.http.ResponseEntity<org.exoplatform.caldav.model.ObjectSync> push(long eventId) Copies one agenda event into the connected user's mirror calendar.org.springframework.http.ResponseEntity<Void> showCalendarAgain(long pairId) Shows a hidden calendar again.
-
Constructor Details
-
CaldavPushRest
public CaldavPushRest()
-
-
Method Details
-
push
@PostMapping("/push/events/{eventId}") @Secured("users") public org.springframework.http.ResponseEntity<org.exoplatform.caldav.model.ObjectSync> push(@PathVariable("eventId") long eventId) Copies one agenda event into the connected user's mirror calendar.The request carries no link back into eXo. It used to, built by the page and passed as a query parameter, and that is exactly why the copy kept losing it: a value only the browser supplied was absent on every sweep and every repair. The link is derived from the event server-side now, so the page has nothing to say about it (EXO-89751).
- Parameters:
eventId- the agenda event to copy- Returns:
- the resulting mapping, or an empty 204 when the event's calendar has no collection to copy into
-
owedCopies
@GetMapping("/push/owed") @Secured("users") public long owedCopies()How many calendar copies eXo still owes this user and has not written.A number, not a list: what the user needs is to be able to tell "eXo is still working on it" from "eXo thinks it is done", and naming the meetings would cost a page of them and answer a question nobody asked.
- Returns:
- the count, zero on an account whose copies have all landed
-
delete
@DeleteMapping("/push/objects/{icsUid}") @Secured("users") public org.springframework.http.ResponseEntity<Void> delete(@PathVariable("icsUid") String icsUid) Removes one event's object from the mirror calendar.- Parameters:
icsUid- the iCalendar UID of the object to remove- Returns:
- an empty 204
-
excludeOccurrence
@DeleteMapping("/push/objects/{icsUid}/occurrences/{occurrence}") @Secured("users") public org.springframework.http.ResponseEntity<Void> excludeOccurrence(@PathVariable("icsUid") String icsUid, @PathVariable("occurrence") String occurrence) Removes one occurrence from a series, leaving the series in place.- Parameters:
icsUid- the iCalendar UID of the seriesoccurrence- the instance to exclude, an ISO instant- Returns:
- an empty 204
-
currentMirror
@GetMapping("/push/mirror") @Secured("users") public org.springframework.http.ResponseEntity<MirrorTarget> currentMirror()The calendar the copies are currently written into, if one is set.Its own endpoint because the listing that serves the Remote section deliberately hides this collection — it holds nothing but copies of events the agenda already shows. Resolving the destination's name through that listing therefore always came back empty, which the settings screen read as "no destination" and used to switch the copy setting back off in front of the user who had just chosen one.
- Returns:
- the destination and its current name, or 204 when none is set
-
mirror
-
deletionPlan
@GetMapping("/push/calendars/{calendarId}/deletion-plan") @Secured("users") public org.exoplatform.caldav.model.CalendarDeletionPlan deletionPlan(@PathVariable("calendarId") long calendarId) What deleting an eXo calendar would also do remotely.- Parameters:
calendarId- the eXo calendar in question- Returns:
- the plan, claiming nothing when no binding exists
-
deleteRemoteCounterpart
@DeleteMapping("/push/calendars/{calendarId}/remote") @Secured("users") public org.springframework.http.ResponseEntity<Void> deleteRemoteCounterpart(@PathVariable("calendarId") long calendarId) Removes the remote collection an eXo calendar is mirrored as, before agenda removes the calendar itself.- Parameters:
calendarId- the eXo calendar being deleted- Returns:
- an empty 204
-
keepRemoteCounterpart
@PostMapping("/push/calendars/{calendarId}/keep-remote") @Secured("users") public org.springframework.http.ResponseEntity<Void> keepRemoteCounterpart(@PathVariable("calendarId") long calendarId) Records that the user chose to keep the remote calendar while deleting the eXo one.- Parameters:
calendarId- the eXo calendar being deleted- Returns:
- an empty 204
-
calendarStates
@GetMapping("/calendar-states") @Secured("users") public List<org.exoplatform.caldav.model.CalendarSyncState> calendarStates()What each of this user's calendars is doing, for the ones worth telling them about.- Returns:
- the states, empty when every calendar is synchronising normally
-
hideCalendar
@PostMapping("/hidden-calendars") @Secured("users") public org.springframework.http.ResponseEntity<Void> hideCalendar(@RequestBody(required=false) HideCalendarRequest request) Hides a calendar shared with the caller.The body names the calendar as the calendar list answered it and nothing else; whose account it is hidden on comes from the conversation state. The service matches the id against the caller's own current listing and refuses anything that is not a share of theirs, so a caller can hide exactly what they can see — and nothing they cannot.
- Parameters:
request- the calendar to hide- Returns:
- an empty 204, also when the calendar was hidden already
-
showCalendarAgain
@DeleteMapping("/hidden-calendars/{pairId}") @Secured("users") public org.springframework.http.ResponseEntity<Void> showCalendarAgain(@PathVariable("pairId") long pairId) Shows a hidden calendar again.- Parameters:
pairId- the binding to lift- Returns:
- an empty 204
-
onPushFailure
@ExceptionHandler(CaldavPushException.class) public org.springframework.http.ResponseEntity<String> onPushFailure(CaldavPushException failure) Maps a push failure onto a status, keeping its code in the body.The codes are the contract: the browser matches on them to tell a user whose password changed from one whose meeting was edited elsewhere. The status is for anything that reads HTTP rather than our vocabulary.
- Parameters:
failure- what went wrong- Returns:
- the response the browser receives
-