Class BlueMindShareChannel
- All Implemented Interfaces:
org.exoplatform.caldav.plugin.CalendarShareChannel,org.springframework.core.Ordered
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; named "blueMindAddonShareChannel" and ordered
BlueMindCalendarPrecedence.ORDER, since the host keeps the first
channel that applies to a collection and still ships its own for BlueMind.
It logs under the host's 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, nor on which add-on shares
it.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe bean name, distinct from the host's own channel's.Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
ConstructorsConstructorDescriptionBlueMindShareChannel(BlueMindAclClient blueMindAclClient, org.exoplatform.caldav.client.CalDavClient calDavClient) The channel over BlueMind's access-list client and the DAV client theCS:shareis posted through. -
Method Summary
Modifier and TypeMethodDescriptionbooleanacceptsCredentials(org.exoplatform.caldav.client.CalDavEndpoint endpoint) booleanapplies(org.exoplatform.caldav.client.DavOptions options, String collectionHref, org.exoplatform.caldav.client.SharingMechanism selected) Takes over a collection the host selects Apple sharing for, when it advertises "calendarserver-sharing" and has BlueMind's path.intgetOrder()Ahead of the host's own BlueMind channel.org.exoplatform.caldav.model.CalendarSharesgrant(org.exoplatform.caldav.plugin.SharedCalendar target, org.exoplatform.caldav.plugin.ShareRecipient sharee, String ownerPrincipal, org.exoplatform.caldav.model.CalendarShares.ShareAccess access, org.exoplatform.caldav.plugin.ShareHost host) 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.org.exoplatform.caldav.client.SharingMechanismvoidrequireManager(org.exoplatform.caldav.plugin.SharedCalendar target, org.exoplatform.caldav.plugin.ShareHost host) Refuses an imported calendar BlueMind gives the caller no right to manage.org.exoplatform.caldav.model.CalendarSharesrevoke(org.exoplatform.caldav.plugin.SharedCalendar target, org.exoplatform.caldav.plugin.ShareRecipient sharee, String ownerPrincipal, org.exoplatform.caldav.plugin.ShareHost host) org.exoplatform.caldav.model.CalendarSharesshares(org.exoplatform.caldav.plugin.SharedCalendar target, org.exoplatform.caldav.plugin.ShareHost host) The container's access list, the caller's right to manage it checked, as sharees.
-
Field Details
-
BEAN_NAME
The bean name, distinct from the host's own channel's.- See Also:
-
-
Constructor Details
-
BlueMindShareChannel
@Autowired public BlueMindShareChannel(BlueMindAclClient blueMindAclClient, org.exoplatform.caldav.client.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
public org.exoplatform.caldav.client.SharingMechanism mechanism()- Specified by:
mechanismin interfaceorg.exoplatform.caldav.plugin.CalendarShareChannel
-
applies
public boolean applies(org.exoplatform.caldav.client.DavOptions options, String collectionHref, org.exoplatform.caldav.client.SharingMechanism selected) Takes over a collection the host selects Apple sharing for, when it advertises "calendarserver-sharing" and has BlueMind's path.- Specified by:
appliesin interfaceorg.exoplatform.caldav.plugin.CalendarShareChannel- 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
public boolean acceptsCredentials(org.exoplatform.caldav.client.CalDavEndpoint endpoint) - Specified by:
acceptsCredentialsin interfaceorg.exoplatform.caldav.plugin.CalendarShareChannel
-
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 interfaceorg.exoplatform.caldav.plugin.CalendarShareChannel- Parameters:
canonicalHref- the canonical collection hrefprincipal- the caller's recorded principal- Returns:
- true when the name does not rule out the caller owning it
-
getOrder
public int getOrder()Ahead of the host's own BlueMind channel.- Specified by:
getOrderin interfaceorg.springframework.core.Ordered- Returns:
BlueMindCalendarPrecedence.ORDER
-
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>/
-