Class BlueMindShareChannel
- All Implemented Interfaces:
CalendarShareChannel
POST CS:share over DAV, every change confirmed
by reading the container's access list back through BlueMind's REST API
(BlueMindAclClient), and the colleague subscribed to the calendar
once a grant is confirmed.
Recognised by two independent facts that must both hold: the
collection advertises calendarserver-sharing in the DAV
header of its PROPFIND answers (PropFindProtocol.java:125, captured
in bluemind-principal.captured.xml), and it has the path BlueMind's
DAV server gives every calendar,
/dav/calendars/__uids__/<owner uid>/<container uid>/
(ResType.VSTUFF_CONTAINER). Apple's CalendarServer uses the same
__uids__ layout without the /dav root, and Nextcloud and
iCloud use other paths; those stay not offered. The share service confirms
the recognition before any change: BlueMind's REST API must accept the
owner's login (acceptsCredentials(org.exoplatform.caldav.client.CalDavEndpoint)), which no other server
answers.
Around the protocol, because it cannot be trusted alone: the server answers 200 whatever happened, so every change is confirmed by reading the container's access list back; and the server rewrites or removes every entry of the sharee, so a sharee holding anything but a grant eXo writes is refused rather than downgraded.
A @Service, like any contribution from another add-on, so that the
host collects it by type through the Kernel/Spring bridge and never names
it. It logs under the share service's category, where the audit lines of
every other sharing mechanism are, so that what an operator filters on does
not depend on which server a calendar lives on.
-
Constructor Summary
ConstructorsConstructorDescriptionBlueMindShareChannel(BlueMindAclClient blueMindAclClient, CalDavClient calDavClient) The channel over BlueMind's access-list client and the DAV client theCS:shareis posted through. -
Method Summary
Modifier and TypeMethodDescriptionbooleanacceptsCredentials(CalDavEndpoint endpoint) Whether the owner's configured credentials can open whatever session this channel reads the access list back through; the menu offers no "Share" otherwise.booleanapplies(DavOptions options, String collectionHref, SharingMechanism selected) Takes over a collection the host selects Apple sharing for, when it advertises "calendarserver-sharing" and has BlueMind's path.org.exoplatform.caldav.model.CalendarSharesgrant(SharedCalendar target, ShareRecipient sharee, String ownerPrincipal, org.exoplatform.caldav.model.CalendarShares.ShareAccess access, ShareHost host) Gives a colleague access at the level asked for, confirmed by reading it back.static booleanisBlueMindCollection(String collectionHref) Whether a path is a calendar collection as BlueMind's DAV server names one.booleanBlueMind's path rule: a REST session per calendar per menu refresh would be too much, and the access list is checked when the drawer reads the sharees and before any change.The mechanism this channel carries, as the host reports it in its logs and answers.voidrequireManager(SharedCalendar target, ShareHost host) Refuses an imported calendar BlueMind gives the caller no right to manage.org.exoplatform.caldav.model.CalendarSharesrevoke(SharedCalendar target, ShareRecipient sharee, String ownerPrincipal, ShareHost host) Takes a colleague's access away, confirmed by reading it back.org.exoplatform.caldav.model.CalendarSharesshares(SharedCalendar target, ShareHost host) The container's access list, the caller's right to manage it checked, as sharees.
-
Constructor Details
-
BlueMindShareChannel
@Autowired public BlueMindShareChannel(BlueMindAclClient blueMindAclClient, CalDavClient calDavClient) The channel over BlueMind's access-list client and the DAV client theCS:shareis posted through.- Parameters:
blueMindAclClient- reads a BlueMind calendar's access list backcalDavClient- posts the share and reads a sharee's addresses, as the owner
-
-
Method Details
-
mechanism
The mechanism this channel carries, as the host reports it in its logs and answers.- Specified by:
mechanismin interfaceCalendarShareChannel- Returns:
- an offered mechanism other than
SharingMechanism.WEBDAV_ACL, which is the host's own, never null; a channel answering anything else is ignored, and so is a second channel for a mechanism an earlier one carries
-
applies
Takes over a collection the host selects Apple sharing for, when it advertises "calendarserver-sharing" and has BlueMind's path.- Specified by:
appliesin interfaceCalendarShareChannel- Parameters:
options- what the collection answeredcollectionHref- the collection's path, may be nullselected- what the host selects from the options alone- Returns:
- true for a BlueMind calendar collection
-
acceptsCredentials
Whether the owner's configured credentials can open whatever session this channel reads the access list back through; the menu offers no "Share" otherwise.- Specified by:
acceptsCredentialsin interfaceCalendarShareChannel- Parameters:
endpoint- the owner's endpoint- Returns:
- true when they can
-
mayOwn
BlueMind's path rule: a REST session per calendar per menu refresh would be too much, and the access list is checked when the drawer reads the sharees and before any change.- Specified by:
mayOwnin interfaceCalendarShareChannel- Parameters:
canonicalHref- the canonical collection hrefprincipal- the caller's recorded principal- Returns:
- true when the name does not rule out the caller owning it
-
isBlueMindCollection
Whether a path is a calendar collection as BlueMind's DAV server names one.- Parameters:
collectionHref- the collection's path, may be null- Returns:
- true for
/dav/calendars/__uids__/<uid>/<container>/
-