Enum Class CollectionOwnership

java.lang.Object
java.lang.Enum<CollectionOwnership>
org.exoplatform.caldav.service.CollectionOwnership
All Implemented Interfaces:
Serializable, Comparable<CollectionOwnership>, Constable

public enum CollectionOwnership extends Enum<CollectionOwnership>
Whose a listed calendar collection is, to the eXo user whose account listed it — the one answer the sweep, the calendar list and the event read-through all act on, so that they cannot disagree about a collection.

Two witnesses are heard, and the answer names which one spoke. The server says a collection is somebody else's by naming another owner or by granting no write (CalendarCollection#isSharedWith, EXO-90235). This deployment says so by recognising, in the slug eXo mints, the anchor of a calendar it exported for another of its users (CaldavOutboundService#ownershipOf, EXO-90234). The second witness exists because the first is silent on BlueMind: a calendar a colleague shared and the user subscribed to is listed under the user's own home, with the user named as owner and the full privilege set — indistinguishable from their own calendar by anything the server answers, and distinguishable by the one fact only eXo holds, which is whose calendar it pushed out under that slug.

A third witness speaks for the rest of what BlueMind lists that way (EXO-90275): the server's naming. A calendar the user subscribed to — a colleague's main or created calendar, a resource such as a pool vehicle — is listed under a container uid that carries its owner's uid (BlueMindContainerNaming), and a uid other than the account's own makes it SUBSCRIBED_PERSON or SUBSCRIBED_RESOURCE.

Before this existed the three paths asked three different questions of the same collection and answered three different ways: the sweep skipped a colleague's eXo calendar without a word, the list dropped it, and the read-through served its events — a calendar the user could see the events of but never the calendar itself (EXO-90234). The three now ask the one question below and act on the one answer: a share is never materialised, is listed read-only, and — being unbound — has its events served.

Deliberately services-local, unlike its siblings SyncOrigin and CalendarSyncStatus in the API module's model package: it is an answer computed from a listing and the pair table for the three services that consume it, persisted nowhere and exposed to no other addon, so it is kept out of the add-on's API surface until something outside this module needs it.

  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    Somebody else's, by this deployment's word: a collection eXo minted for a calendar of another user of this deployment, and none of the current user's own, wherever the server lists it and whatever it says about owner and privileges (EXO-90234).
    The user's own, as far as anybody can tell: the server named no other owner and withheld no write, and the slug names no calendar this deployment exported for anyone.
    The user's own eXo calendar, met again on the server: the slug carries the anchor of a calendar this user exported, or the path is one an EXO pair of theirs records, while the listing spelled it under a path no pair of theirs matched — BlueMind republishes eXo's collections under a parent other than the one they were created at.
    Somebody else's, by the server's word: another principal named as owner, or a privilege set that grants no write (EXO-90235).
    Another person's calendar the user subscribed to, by the server's naming (EXO-90275): a BlueMind container calendar:Default:<uid> or calendar:UserCreated:<uid>:… whose uid is not the account's (BlueMindContainerNaming).
    A resource's calendar the user subscribed to — a room, a pool vehicle — by the same naming: a BlueMind container calendar:<uid> whose uid is not the account's (EXO-90275).
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Whether the collection is somebody else's, whichever witness said so.
    boolean
    Whether the collection is a subscription the server's naming revealed — the only shares a sweep retires once it finds them materialised (EXO-90275).
    org.exoplatform.caldav.model.CalendarOwnerKind
    The kind of owner a shared collection has, as the calendar list says it.
    Returns the enum constant of this class with the specified name.
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • OWN

      public static final CollectionOwnership OWN
      The user's own, as far as anybody can tell: the server named no other owner and withheld no write, and the slug names no calendar this deployment exported for anyone. Materialised by the sweep as a personal calendar, and until then offered under Remote as writable when the server grants write and the slug is not eXo's. A collection another eXo deployment minted into the account answers this too — its anchor is known to nobody here, and it is an ordinary remote calendar to this deployment (EXO-90226) — but, wearing eXo's slug, it is neither listed nor left unmaterialised: the sweep adopts it on its next pass and the binding then keeps it out of the list.
    • OWN_EXO_CALENDAR

      public static final CollectionOwnership OWN_EXO_CALENDAR
      The user's own eXo calendar, met again on the server: the slug carries the anchor of a calendar this user exported, or the path is one an EXO pair of theirs records, while the listing spelled it under a path no pair of theirs matched — BlueMind republishes eXo's collections under a parent other than the one they were created at. Already in eXo, so neither materialised nor listed; nothing to say about it either, since it is exactly what the sweep put there.
    • SHARED

      public static final CollectionOwnership SHARED
      Somebody else's, by the server's word: another principal named as owner, or a privilege set that grants no write (EXO-90235). Never materialised, listed read-only, events served.
    • COLLEAGUES_EXO_CALENDAR

      public static final CollectionOwnership COLLEAGUES_EXO_CALENDAR
      Somebody else's, by this deployment's word: a collection eXo minted for a calendar of another user of this deployment, and none of the current user's own, wherever the server lists it and whatever it says about owner and privileges (EXO-90234). The colleague shared their eXo calendar on the server, and eXo already holds the original — so it is treated exactly as SHARED: never materialised, which would push the user's edits into the colleague's calendar; listed read-only; events served.
    • SUBSCRIBED_PERSON

      public static final CollectionOwnership SUBSCRIBED_PERSON
      Another person's calendar the user subscribed to, by the server's naming (EXO-90275): a BlueMind container calendar:Default:<uid> or calendar:UserCreated:<uid>:… whose uid is not the account's (BlueMindContainerNaming). The third witness, heard because the other two are silent there: BlueMind lists the subscription under the user's own home, names the user as its owner and grants the full privilege set. Treated exactly as SHARED — a subscription to a colleague's main calendar used to be materialised as the user's own and every one of her events imported.
    • SUBSCRIBED_RESOURCE

      public static final CollectionOwnership SUBSCRIBED_RESOURCE
      A resource's calendar the user subscribed to — a room, a pool vehicle — by the same naming: a BlueMind container calendar:<uid> whose uid is not the account's (EXO-90275). Treated exactly as SHARED, and told apart from a person's so the list can draw it as a resource.
  • Method Details

    • values

      public static CollectionOwnership[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static CollectionOwnership valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • isShared

      public boolean isShared()
      Whether the collection is somebody else's, whichever witness said so.

      The one test the three paths branch on: a shared collection is never bound, is offered read-only, and is served. Which witness spoke matters only to the line that explains the skip, and to the owner's kind.

      Returns:
      true for SHARED, COLLEAGUES_EXO_CALENDAR, SUBSCRIBED_PERSON and SUBSCRIBED_RESOURCE
    • isSubscription

      public boolean isSubscription()
      Whether the collection is a subscription the server's naming revealed — the only shares a sweep retires once it finds them materialised (EXO-90275).
      Returns:
      true for SUBSCRIBED_PERSON and SUBSCRIBED_RESOURCE
    • ownerKind

      public org.exoplatform.caldav.model.CalendarOwnerKind ownerKind()
      The kind of owner a shared collection has, as the calendar list says it.
      Returns:
      CalendarOwnerKind.RESOURCE for a resource subscription, CalendarOwnerKind.PERSON for every other share, null for a collection that is the user's own