Class HttpCalDavClient
- All Implemented Interfaces:
CalDavClient
HttpCardDavClient — the hand-written client that
already works against the same BlueMind that defeated the browser — with
the disciplines the relay established carried over:
- registry-only targets — endpoints are minted from the server
registry alone (
endpoint(Long, String)), hrefs resolve against that endpoint's authority, and a foreign-host href is refused; - no redirects — a declared server must not be able to bounce this client's credentialed requests to another host, so the transport never follows a 3xx (which also rules the well-known discovery flow out by design: discovery starts at the registered base path instead);
- explicit timeouts and a bounded body read, both deployment-tunable;
- no auth material anywhere near a log or an exception — every message names the method and the URI, never a header.
-
Constructor Summary
ConstructorsConstructorDescriptionHttpCalDavClient(CaldavServerService caldavServerService, CaldavCredentialsResolver caldavCredentialsResolver) The client Spring builds. -
Method Summary
Modifier and TypeMethodDescriptioncalendarQuery(CalDavEndpoint endpoint, String collectionHref, Instant start, Instant end) Runs a calendar-query REPORT for the VEVENTs of a time window — the tier-3 floor for servers whose listings carry no usable ETags, and the ranged read the events endpoint will serve from.capabilities(CalDavEndpoint endpoint, String href) One OPTIONS, and one depth-0 PROPFIND of the same resource when that OPTIONS carries noDAVheader.intdeleteCollection(CalDavEndpoint endpoint, org.exoplatform.caldav.model.CalendarSync pair) Removes a whole collection, and everything in it.intdeleteObject(CalDavEndpoint endpoint, String href, String ifMatch) Deletes one object, conditionally when a version is given.discoverCalendarHome(CalDavEndpoint endpoint) The home half ofdiscoverHome(org.exoplatform.caldav.client.CalDavEndpoint), kept for the callers that need where the calendars are and never compare owners — the outbound binding, the mirror lookup, the deletion path.discoverDefaultCalendar(CalDavEndpoint endpoint) Asks the account which of its calendars it treats as the default one — the collection a scheduling client files an invitation into when nobody says otherwise.discoverHome(CalDavEndpoint endpoint) The same two hops asdiscoverCalendarHome(org.exoplatform.caldav.client.CalDavEndpoint), keeping the principal the first one answered instead of throwing it away — the walk the sync and the read-through run, so that the owner of each listed collection can be compared against the account's own principal without a third PROPFIND (EXO-90235).discoverPrincipal(CalDavEndpoint endpoint) Who the server says is speaking, as a path on this endpoint - the first hop of every discovery, its own method because two of them start there, and on the interface because the push service compares its last segment with the name of a listed calendar (EXO-90225).Mints the one kind of target this client will talk to: the account base of a declared server, resolved exclusively from the server registry — the row the account references, else the seed row, else the legacy deployment property — with the{username}placeholder replaced by the account's DAV username, percent-encoded for its path position.fetchObject(CalDavEndpoint endpoint, String href) Reads one object's current data and version in a single GET — what a conflict re-read asks, so the three-way runs against the object as the server holds it NOW rather than as the last sync remembers it.getCtag(CalDavEndpoint endpoint, String href) Reads the collection's current ctag, the cheap tier-2 question asked first on every run.listCalendars(CalDavEndpoint endpoint, String homeHref) Lists the calendar collections of a home with every property the sync engine binds on: display name, resource type, ctag, sync token, supported reports, the user's privileges, the collection's owner, and the calendar colour.listResourceEtags(CalDavEndpoint endpoint, String collectionHref) Lists every object in the collection with its version — thelistResourceEtagspattern the plan reuses verbatim from email-connector, and what tells the engine who is new, who changed and who is gone.mkCalendar(CalDavEndpoint endpoint, String href, String displayName, String color) Asks the server to create a calendar collection, display name and optional colour set atomically.multiget(CalDavEndpoint endpoint, String collectionHref, List<String> hrefs) Fetches the calendar data of the given objects in one calendar-multiget REPORT — why a changed collection costs one round trip per batch rather than one per event.multigetEtags(CalDavEndpoint endpoint, String collectionHref, List<String> hrefs) Asks, in one calendar-multiget REPORT, which of the given objects the server holds and under which version — the presence question the BlueMind import door asks about one object before and after each write (EXO-90307), asked without the calendar data aCalDavClient.multiget(org.exoplatform.caldav.client.CalDavEndpoint, java.lang.String, java.util.List<java.lang.String>)would make the server render.overwriteObject(CalDavEndpoint endpoint, String href, String icsData) Writes one object over whatever is there, with no precondition at all.intpostCalendarServerShare(CalDavEndpoint endpoint, org.exoplatform.caldav.model.CalendarSync pair, String address, boolean remove, boolean write) OnePOST CS:shareto the pair's collection, asshareTarget(org.exoplatform.caldav.model.CalendarSync)admits it.probeCapabilities(CalDavEndpoint endpoint, String collectionHref) Probes which report tiers a collection's server can serve, in one Depth:0 PROPFIND.putObject(CalDavEndpoint endpoint, String href, String icsData) Creates one object — always underIf-None-Match: *, with no unconditional variant on purpose: the server itself then guarantees the PUT can only CREATE, and an object already at that path answers 412 instead of being overwritten, whatever race led there.readAcl(CalDavEndpoint endpoint, String href) One PROPFIND of depth 0, every entry parsed or the whole list declared not understood.readCalendar(CalDavEndpoint endpoint, String href) Reads one collection's properties at Depth:0 — what a bound pair re-reads on each run without paying a full home listing.readCalendarUserAddresses(CalDavEndpoint endpoint, String principalHref) One PROPFIND of depth 0, every href of a grantedcalendar-user-address-set.readDisplayName(CalDavEndpoint endpoint, String href) One PROPFIND of depth 0 for the one property, throughpropfind(org.exoplatform.caldav.client.CalDavEndpoint, java.lang.String, java.lang.String, java.lang.String)and so throughtarget(org.exoplatform.caldav.client.CalDavEndpoint, java.lang.String): a principal path naming another authority is refused before a socket is opened, exactly as any other href would be.readEtag(CalDavEndpoint endpoint, String href) Reads one object's version in aDepth: 0PROPFIND ofgetetagon its own href — the single-object read of the listing channel, the one whose value the verification pass adopts into the row when the server publishes the same value at both depths (EXO-90307).setDisplayName(CalDavEndpoint endpoint, String href, String displayName) Asks the server to change the display name of an existing collection — a PROPPATCH ofDAV:displayname, the one property eXo propagates after creation.syncCollection(CalDavEndpoint endpoint, String collectionHref, String syncToken) Runs an RFC 6578 sync-collection REPORT with a stored token — tier 1, one round trip for everything changed or deleted since that token.updateObject(CalDavEndpoint endpoint, String href, String icsData, String ifMatch) writeAcl(CalDavEndpoint endpoint, org.exoplatform.caldav.model.CalendarSync pair, List<AccessControlEntry> entries) OneACLrequest carrying the complete list, addressed only through the pair's authorised collection.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.exoplatform.caldav.client.CalDavClient
postCalendarServerShare
-
Constructor Details
-
HttpCalDavClient
@Autowired public HttpCalDavClient(CaldavServerService caldavServerService, CaldavCredentialsResolver caldavCredentialsResolver) The client Spring builds. Redirects are NEVER followed: the target host comes from the registry, and a compromised or misconfigured registered server must not be able to bounce credentialed requests anywhere else.- Parameters:
caldavServerService- the registry every endpoint is resolved fromcaldavCredentialsResolver- the addon's seam onto the shared credentials contract — this client resolves, it never assembles
-
-
Method Details
-
endpoint
Description copied from interface:CalDavClientMints the one kind of target this client will talk to: the account base of a declared server, resolved exclusively from the server registry — the row the account references, else the seed row, else the legacy deployment property — with the{username}placeholder replaced by the account's DAV username, percent-encoded for its path position.The caller names an eXo user, never a DAV account: the account segment of the URL comes from the credentials provider the server is configured with. Which matters as soon as a provider authenticates as one identity and addresses another — a technical account acting for a user. The account the URL names and the credentials the header carries are then two halves of one answer, and asking the provider for both is what keeps them from drifting into a valid session pointed at somebody else's calendar.
- Specified by:
endpointin interfaceCalDavClient- Parameters:
serverId- registry row the user's account references, or null for the seed-row / legacy-property resolutionexoLogin- the eXo login of the user this conversation is for- Returns:
- the endpoint every other method addresses
-
discoverCalendarHome
The home half ofdiscoverHome(org.exoplatform.caldav.client.CalDavEndpoint), kept for the callers that need where the calendars are and never compare owners — the outbound binding, the mirror lookup, the deletion path. One walk, two views of its answer.- Specified by:
discoverCalendarHomein interfaceCalDavClient- Parameters:
endpoint- the declared server to discover on- Returns:
- the calendar home's server-absolute raw path
- Throws:
CalDavAuthenticationException- when the credentials are refusedCalDavException- when the server cannot be reached or answers no principal or no home
-
discoverHome
The same two hops asdiscoverCalendarHome(org.exoplatform.caldav.client.CalDavEndpoint), keeping the principal the first one answered instead of throwing it away — the walk the sync and the read-through run, so that the owner of each listed collection can be compared against the account's own principal without a third PROPFIND (EXO-90235).- Specified by:
discoverHomein interfaceCalDavClient- Parameters:
endpoint- the declared server to discover on- Returns:
- the principal and the home, both as server-absolute raw paths
- Throws:
CalDavAuthenticationException- when the credentials are refusedCalDavException- when the server cannot be reached or answers no principal or no home
-
discoverPrincipal
Who the server says is speaking, as a path on this endpoint - the first hop of every discovery, its own method because two of them start there, and on the interface because the push service compares its last segment with the name of a listed calendar (EXO-90225).- Specified by:
discoverPrincipalin interfaceCalDavClient- Parameters:
endpoint- the account's endpoint- Returns:
- the principal's path
- Throws:
CalDavException- when the server names no current user
-
discoverDefaultCalendar
Description copied from interface:CalDavClientAsks the account which of its calendars it treats as the default one — the collection a scheduling client files an invitation into when nobody says otherwise.Two hops, both of them questions rather than guesses: the principal names its scheduling inbox (
schedule-inbox-URL), and the inbox names the default calendar (schedule-default-calendar-URL) — the RFC 6638 property that exists precisely so a client does not have to invent one. Guessing from the home listing instead (the first collection, the one called "Calendar", the one whose path ends in the username) is what this method exists not to do: each of those is right on one server and wrong on the next, and being wrong means writing somebody's meetings into a calendar nobody was looking at.A server naming none is an answer, not a fault. Scheduling is an extension, and plenty of CalDAV servers implement none of it; that is a null here rather than an exception, and the caller decides what to do with a destination it cannot establish. Credentials being refused, or the server being unreachable, still raise — those are not "there is no default calendar".
The path it answers is a claim, in the sense
CalDavClient.mkCalendar(org.exoplatform.caldav.client.CalDavEndpoint, java.lang.String, java.lang.String, java.lang.String)documents: the collection is only real once the caller has seen it in a listing of the account's own home.- Specified by:
discoverDefaultCalendarin interfaceCalDavClient- Parameters:
endpoint- the declared server- Returns:
- the default calendar's server-absolute raw path, or null when the account names none
-
listCalendars
Description copied from interface:CalDavClientLists the calendar collections of a home with every property the sync engine binds on: display name, resource type, ctag, sync token, supported reports, the user's privileges, the collection's owner, and the calendar colour.- Specified by:
listCalendarsin interfaceCalDavClient- Parameters:
endpoint- the declared serverhomeHref- the calendar home's server-absolute path- Returns:
- the calendar collections, never null — non-calendar members of the home (the home itself included) are filtered out here by resource type, never guessed from the path
-
readCalendar
Description copied from interface:CalDavClientReads one collection's properties at Depth:0 — what a bound pair re-reads on each run without paying a full home listing.- Specified by:
readCalendarin interfaceCalDavClient- Parameters:
endpoint- the declared serverhref- the collection's server-absolute path- Returns:
- the collection, or null when the resource exists but is not a calendar collection
-
readDisplayName
One PROPFIND of depth 0 for the one property, throughpropfind(org.exoplatform.caldav.client.CalDavEndpoint, java.lang.String, java.lang.String, java.lang.String)and so throughtarget(org.exoplatform.caldav.client.CalDavEndpoint, java.lang.String): a principal path naming another authority is refused before a socket is opened, exactly as any other href would be. Read from a granted propstat only, like every property this client answers — a server that does not know the resource answers the name in a 404 propstat, and that is no name.- Specified by:
readDisplayNamein interfaceCalDavClient- Parameters:
endpoint- the account's endpointhref- the resource's server-absolute path- Returns:
- the display name, or null when the server states none
-
getCtag
Description copied from interface:CalDavClientReads the collection's current ctag, the cheap tier-2 question asked first on every run.- Specified by:
getCtagin interfaceCalDavClient- Parameters:
endpoint- the declared serverhref- the collection's server-absolute path- Returns:
- the current ctag, or null when the server does not implement it
-
listResourceEtags
Description copied from interface:CalDavClientLists every object in the collection with its version — thelistResourceEtagspattern the plan reuses verbatim from email-connector, and what tells the engine who is new, who changed and who is gone. Also the mirror-verification listing of the metadata design.- Specified by:
listResourceEtagsin interfaceCalDavClient- Parameters:
endpoint- the declared servercollectionHref- the collection's server-absolute path- Returns:
- object path to object version, insertion-ordered, never null — the collection itself and any member without an ETag are skipped by that one rule, never by guessing from the path
-
calendarQuery
public List<CalendarObject> calendarQuery(CalDavEndpoint endpoint, String collectionHref, Instant start, Instant end) Description copied from interface:CalDavClientRuns a calendar-query REPORT for the VEVENTs of a time window — the tier-3 floor for servers whose listings carry no usable ETags, and the ranged read the events endpoint will serve from.- Specified by:
calendarQueryin interfaceCalDavClient- Parameters:
endpoint- the declared servercollectionHref- the collection's server-absolute pathstart- window start, inclusive, or null for an unbounded startend- window end, exclusive, or null for an unbounded end- Returns:
- the matching objects with their calendar data, never null
-
multiget
public List<CalendarObject> multiget(CalDavEndpoint endpoint, String collectionHref, List<String> hrefs) Description copied from interface:CalDavClientFetches the calendar data of the given objects in one calendar-multiget REPORT — why a changed collection costs one round trip per batch rather than one per event.- Specified by:
multigetin interfaceCalDavClient- Parameters:
endpoint- the declared servercollectionHref- the collection's server-absolute pathhrefs- the object paths to fetch- Returns:
- the objects the server returned, never null; an href it did not return is simply absent, which the caller must tolerate
-
multigetEtags
public Map<String,String> multigetEtags(CalDavEndpoint endpoint, String collectionHref, List<String> hrefs) Description copied from interface:CalDavClientAsks, in one calendar-multiget REPORT, which of the given objects the server holds and under which version — the presence question the BlueMind import door asks about one object before and after each write (EXO-90307), asked without the calendar data aCalDavClient.multiget(org.exoplatform.caldav.client.CalDavEndpoint, java.lang.String, java.util.List<java.lang.String>)would make the server render.The version answered is the REPORT channel's, which on BlueMind is not the collection listing's (
CalendarMultigetExecutor.java:123rendersSyncTokens.getEtag, quoted base64, where the listing renders the raw token); a caller that records versions must read them from the listing's channel and use this answer for presence only.- Specified by:
multigetEtagsin interfaceCalDavClient- Parameters:
endpoint- the declared servercollectionHref- the collection's server-absolute pathhrefs- the object paths to ask about- Returns:
- object path to object version for the objects the server
answered a granted
getetagfor, insertion-ordered, never null; an href the server did not answer is simply absent — which on BlueMind is also what a failed lookup answers (CalendarMultigetExecutor.java:83-86), so absence here is a reason to ask the listing, never a fact on its own. Both shapes captured on the rig, 2026-09-16 (bluemind-report-multiget-one-href-getetag.captured.xml,bluemind-report-multiget-missing-href.captured.xml)
-
readEtag
Description copied from interface:CalDavClientReads one object's version in aDepth: 0PROPFIND ofgetetagon its own href — the single-object read of the listing channel, the one whose value the verification pass adopts into the row when the server publishes the same value at both depths (EXO-90307).What this read does not answer is existence: BlueMind's DAV router assumes an
.icsnode exists whenever its path is well formed (MethodRouter.java:162-175,DavStore.java:474-502: thedefaultbranch "assume yes") and mints a token from the path (GetTag.java:46-56), so a missing object is answered 207 with a version there — captured on the rig on 2026-09-16 (bluemind-propfind-missing-object-depth0.captured.xml) — and 404 only on a server that checks. A caller that needs existence establishes it elsewhere first.- Specified by:
readEtagin interfaceCalDavClient- Parameters:
endpoint- the declared serverhref- the object's server-absolute path- Returns:
- the granted
getetagof the response for that href, verbatim — quotes and all, as everywhere in this client — or null when the server answered 404/410, answered no response for the href, or granted nogetetag
-
syncCollection
public SyncCollectionResult syncCollection(CalDavEndpoint endpoint, String collectionHref, String syncToken) Description copied from interface:CalDavClientRuns an RFC 6578 sync-collection REPORT with a stored token — tier 1, one round trip for everything changed or deleted since that token.- Specified by:
syncCollectionin interfaceCalDavClient- Parameters:
endpoint- the declared servercollectionHref- the collection's server-absolute pathsyncToken- the stored token, or null/blank for the initial sync that establishes one- Returns:
- the changes and the token to store — or the invalid-token result when the server rejected the presented token, which the caller answers by falling through to the listing tier for this run
-
probeCapabilities
Description copied from interface:CalDavClientProbes which report tiers a collection's server can serve, in one Depth:0 PROPFIND. Stateless: the answer is bind-time information whose caching belongs to the caller's pair state, not to this client.- Specified by:
probeCapabilitiesin interfaceCalDavClient- Parameters:
endpoint- the declared servercollectionHref- the collection's server-absolute path- Returns:
- the capability answer, never null
-
fetchObject
Description copied from interface:CalDavClientReads one object's current data and version in a single GET — what a conflict re-read asks, so the three-way runs against the object as the server holds it NOW rather than as the last sync remembers it.- Specified by:
fetchObjectin interfaceCalDavClient- Parameters:
endpoint- the declared serverhref- the object's server-absolute path- Returns:
- the object as the server returned it, or null when the server
says there is no such object — including BlueMind's way of
saying it, a 500 for an .ics that is simply not there;
reporting "absent" on a server error is safe rather than
optimistic because every creating write keeps its
If-None-Match: *, so the worst case is a refused write, never a silently overwritten one
-
putObject
Description copied from interface:CalDavClientCreates one object — always underIf-None-Match: *, with no unconditional variant on purpose: the server itself then guarantees the PUT can only CREATE, and an object already at that path answers 412 instead of being overwritten, whatever race led there.- Specified by:
putObjectin interfaceCalDavClient- Parameters:
endpoint- the declared serverhref- the object's server-absolute path to create aticsData- the iCalendar text to store- Returns:
- the status and, when the server sent them, the stored version and the object's real location; a 412 is answered, not thrown
-
overwriteObject
Description copied from interface:CalDavClientWrites one object over whatever is there, with no precondition at all.The deliberate exception to the conditional-write doctrine every other method here follows, and the only one.
CalDavClient.putObject(org.exoplatform.caldav.client.CalDavEndpoint, java.lang.String, java.lang.String)sendsIf-None-Match: *and so refuses an object that exists;CalDavClient.updateObject(org.exoplatform.caldav.client.CalDavEndpoint, java.lang.String, java.lang.String, java.lang.String)sendsIf-Matchand so refuses an object that has moved on. A repair needs to write in exactly the case both of them refuse — the copy is there and it has drifted — so neither can carry it, and the guard has to come off.What makes that safe is not this method but its caller: a repair is only reached after both copies have been read and compared and the eXo one judged authoritative. Called anywhere that comparison has not happened, this silently destroys somebody's change. There is no way for the client to check that, which is why the name says overwrite.
- Specified by:
overwriteObjectin interfaceCalDavClient- Parameters:
endpoint- the account's endpointhref- the object's pathicsData- the iCalendar object to write- Returns:
- the result, which cannot be a precondition failure
-
updateObject
- Specified by:
updateObjectin interfaceCalDavClient
-
deleteObject
Description copied from interface:CalDavClientDeletes one object, conditionally when a version is given.- Specified by:
deleteObjectin interfaceCalDavClient- Parameters:
endpoint- the declared serverhref- the object's server-absolute pathifMatch- theIf-Matchvalue to guard the delete with, or null to delete unconditionally — tolerated here (unlikeCalDavClient.updateObject(org.exoplatform.caldav.client.CalDavEndpoint, java.lang.String, java.lang.String, java.lang.String)) because a delete of an already-diverged object is recoverable where an overwrite is not, and some flows legitimately hold no version- Returns:
- the status the server answered: 200/204 deleted, 404/410 already gone — a fact, not a fault — and 412 a refused precondition
-
mkCalendar
public MkCalendarResult mkCalendar(CalDavEndpoint endpoint, String href, String displayName, String color) Description copied from interface:CalDavClientAsks the server to create a calendar collection, display name and optional colour set atomically. The request always declaressupported-calendar-component-setwithVEVENT: BlueMind derives the created collection's kind from it, and without it answers 201 while creating nothing (proven live 2026-08-20). The answer is a claim, never a fact — seeMkCalendarResultfor why the one statement of success a caller may trust is the collection's presence in its own fresh listing.- Specified by:
mkCalendarin interfaceCalDavClient- Parameters:
endpoint- the declared serverhref- the collection's server-absolute path to create atdisplayName- the display name to create withcolor- the Apple calendar-color to set, or null to set none- Returns:
- the raw outcome, refusals included — a server declining MKCALENDAR gives an answer the caller maps to its degraded states, not an error
-
setDisplayName
Description copied from interface:CalDavClientAsks the server to change the display name of an existing collection — a PROPPATCH ofDAV:displayname, the one property eXo propagates after creation. The name travels as data and never as identity: the collection stays where its path put it, and only what the user reads in their own client changes.As with
CalDavClient.mkCalendar(org.exoplatform.caldav.client.CalDavEndpoint, java.lang.String, java.lang.String, java.lang.String), the answer is a claim. The one statement of success a caller may trust is the name read back from the collection afterwards, throughCalDavClient.readCalendar(org.exoplatform.caldav.client.CalDavEndpoint, java.lang.String); seePropPatchResult.- Specified by:
setDisplayNamein interfaceCalDavClient- Parameters:
endpoint- the declared serverhref- the collection's server-absolute pathdisplayName- the name to set- Returns:
- the raw outcome, refusals included — a server declining PROPPATCH gives an answer the caller logs and lives with, not an error
-
capabilities
One OPTIONS, and one depth-0 PROPFIND of the same resource when that OPTIONS carries noDAVheader. Both go through the read-verb status policy: they change nothing, and on BlueMind a 403 to a read is a credential refusal. TheAllowmethods are taken from the OPTIONS alone.- Specified by:
capabilitiesin interfaceCalDavClient- Parameters:
endpoint- the account's endpointhref- the resource's server-absolute path- Returns:
- the normalised DAV classes and Allow methods
-
readAcl
One PROPFIND of depth 0, every entry parsed or the whole list declared not understood. Read from a granted propstat only, like every property here: Stalwart answers an owner's list as a granted, possibly emptyDAV:acl, and a server that withholds it answers it in a 403 or 404 propstat, which is no list.- Specified by:
readAclin interfaceCalDavClient- Parameters:
endpoint- the account's endpointhref- the collection's server-absolute path- Returns:
- the list as answered
-
writeAcl
public AclWriteResult writeAcl(CalDavEndpoint endpoint, org.exoplatform.caldav.model.CalendarSync pair, List<AccessControlEntry> entries) OneACLrequest carrying the complete list, addressed only through the pair's authorised collection.Credentials are classified on 401 and 407 only: a 403 to this write verb is the server declining the change —
need-privileges,allowed-principal— with credentials that are fine, and pausing the account over it would be wrong. A gateway status means nothing was reached. Every other status is answered, with what its body names.- Specified by:
writeAclin interfaceCalDavClient- Parameters:
endpoint- the account's endpointpair- the binding whose collection is addressedentries- the complete list of modifiable entries- Returns:
- the raw outcome
-
readCalendarUserAddresses
One PROPFIND of depth 0, every href of a grantedcalendar-user-address-set.- Specified by:
readCalendarUserAddressesin interfaceCalDavClient- Parameters:
endpoint- the endpoint asked throughprincipalHref- the principal's path- Returns:
- the hrefs, in order
-
deleteCollection
public int deleteCollection(CalDavEndpoint endpoint, org.exoplatform.caldav.model.CalendarSync pair) Description copied from interface:CalDavClientRemoves a whole collection, and everything in it.The only irreversible outward-facing call in this client, and the one that deletes data eXo may not have authored — a user's own events, added from their phone, live in the collection too and go with it.
It takes the pair rather than an href on purpose. An href parameter would let any caller name any collection, and the guard would then live in whoever remembered to write it. Taking the binding means the invariant is checked where the request is built: the collection must belong to an
SyncOrigin.EXOpair, and its last path segment must be the one eXo derives from that pair's own calendar anchor. A collection eXo did not create cannot be addressed by this method at all.- Specified by:
deleteCollectionin interfaceCalDavClient- Parameters:
endpoint- the declared serverpair- the binding whose collection is to be removed- Returns:
- the HTTP status; 404 and 410 mean it was already gone
-