Interface CalendarShareChannel

All Known Implementing Classes:
BlueMindShareChannel

public interface CalendarShareChannel
A server-specific way of sharing a calendar collection with a colleague, for a server on which the host's built-in mechanism — RFC 3744's ACL method — is not how the server's own users share, and whose every change the contribution can confirm by reading it back.

How it is found. CalendarShareChannelRegistry collects every bean implementing this interface, across web applications: a contributor is a Spring @Service, never final. The mechanism a collection gets is the one the host selects from what it advertises (SharingMechanism.of(DavOptions)), unless a channel applies(org.exoplatform.caldav.client.DavOptions, java.lang.String, org.exoplatform.caldav.client.SharingMechanism) to it, in which case it is that channel's mechanism(); every operation on such a collection is then the channel's. The host keeps every check that is not the server's: the calendar, its owner, the pair, the sharee, the capability probe.

What happens without one. The host's own selection stands: a BlueMind collection, which advertises Apple's sharing, selects SharingMechanism.CALENDARSERVER_SHARE, which eXo does not offer, so "Share" is not offered and every share operation is refused with caldav.share.notSupported — never attempted through a mechanism whose changes nobody reads back.

  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Whether the owner's configured credentials can open whatever session this channel reads the access list back through; the menu offers no "Share" otherwise.
    boolean
    applies(DavOptions options, String collectionHref, SharingMechanism selected)
    Whether this channel is how a collection is shared, given what it advertises and what the host would select from that alone.
    org.exoplatform.caldav.model.CalendarShares
    grant(SharedCalendar calendar, 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.
    boolean
    mayOwn(String canonicalHref, String principal)
    Whether a collection's path does not rule out the caller owning it — the cheap check a listing affords, before the access list is read.
    The mechanism this channel carries, as the host reports it in its logs and answers.
    void
    Refuses an imported calendar the caller may not decide the access of on the server; an eXo-created one passes untouched.
    org.exoplatform.caldav.model.CalendarShares
    revoke(SharedCalendar calendar, ShareRecipient sharee, String ownerPrincipal, ShareHost host)
    Takes a colleague's access away, confirmed by reading it back.
    org.exoplatform.caldav.model.CalendarShares
    shares(SharedCalendar calendar, ShareHost host)
    Who the calendar is shared with, read from the server now.
  • Method Details

    • mechanism

      SharingMechanism mechanism()
      The mechanism this channel carries, as the host reports it in its logs and answers.
      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

      boolean applies(DavOptions options, String collectionHref, SharingMechanism selected)
      Whether this channel is how a collection is shared, given what it advertises and what the host would select from that alone.
      Parameters:
      options - what the collection answered, never null
      collectionHref - the collection's path, may be null
      selected - what the host selects from the options alone
      Returns:
      true when this channel takes the collection over
    • acceptsCredentials

      boolean acceptsCredentials(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.
      Parameters:
      endpoint - the owner's endpoint
      Returns:
      true when they can
    • mayOwn

      boolean mayOwn(String canonicalHref, String principal)
      Whether a collection's path does not rule out the caller owning it — the cheap check a listing affords, before the access list is read.
      Parameters:
      canonicalHref - the canonical collection href
      principal - the caller's recorded principal, never null
      Returns:
      true when the path may be the caller's own calendar
    • shares

      org.exoplatform.caldav.model.CalendarShares shares(SharedCalendar calendar, ShareHost host)
      Who the calendar is shared with, read from the server now.
      Parameters:
      calendar - the calendar, checked by the host
      host - what the host lends the operation
      Returns:
      the sharees
    • requireManager

      void requireManager(SharedCalendar calendar, ShareHost host)
      Refuses an imported calendar the caller may not decide the access of on the server; an eXo-created one passes untouched.
      Parameters:
      calendar - the calendar, checked by the host
      host - what the host lends the operation
    • grant

      org.exoplatform.caldav.model.CalendarShares grant(SharedCalendar calendar, 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.
      Parameters:
      calendar - the calendar, checked by the host
      sharee - the colleague, checked by the host
      ownerPrincipal - the caller's canonical principal, distinct from the sharee's
      access - CalendarShares.ShareAccess.READ or CalendarShares.ShareAccess.WRITE
      host - what the host lends the operation
      Returns:
      the sharees as read back
    • revoke

      org.exoplatform.caldav.model.CalendarShares revoke(SharedCalendar calendar, ShareRecipient sharee, String ownerPrincipal, ShareHost host)
      Takes a colleague's access away, confirmed by reading it back.
      Parameters:
      calendar - the calendar, checked by the host
      sharee - the colleague, checked by the host
      ownerPrincipal - the caller's canonical principal, distinct from the sharee's
      host - what the host lends the operation
      Returns:
      the sharees as read back