Enum Class AvailabilitySharing

java.lang.Object
java.lang.Enum<AvailabilitySharing>
org.exoplatform.agenda.constant.AvailabilitySharing
All Implemented Interfaces:
Serializable, Comparable<AvailabilitySharing>, Constable

public enum AvailabilitySharing extends Enum<AvailabilitySharing>
Whether a user lets the platform disclose when they are busy — time ranges and nothing else.

Two states, on purpose. An earlier draft had three, with an everyone above SHARED_SPACES. It is gone: on a gate that decides who reads whose calendar, every extra value is another branch to reason about and another boundary to pin, and the one it added is marginal on an intranet where colleagues share spaces. What is lost is real and worth saying: someone outside all of your spaces can no longer see your busy time. For a scheduling assistant that is the right boundary, and if the cross-department case ever arrives, putting everyone back is a widening — the safe direction — whereas withdrawing it later would take away a visibility people had already opted into.

Whatever the value, what is ever disclosed is the same: busy and free blocks. Never a title, a location, an attendee or a calendar name. This enum only widens or narrows who may ask, never what comes back, which is what makes counting events materialised from a connected account defensible: their content is never shown.

  • Enum Constant Details

    • SHARED_SPACES

      public static final AvailabilitySharing SHARED_SPACES
      The people who are members of at least one of the same spaces may see when this user is busy. This is the default, and the "on" side of the switch: it matches how the rest of the product decides who sees a user's activity, and defaulting to NOBODY would leave a setting nobody has a reason to open turning agent-assisted scheduling off for everybody.
    • NOBODY

      public static final AvailabilitySharing NOBODY
      Nobody may see when this user is busy. Their calendar remains readable by the rules that apply anyway — chiefly, by themselves.
  • Field Details

    • DEFAULT

      public static final AvailabilitySharing DEFAULT
      What a user gets when they have never touched the setting.
  • Method Details

    • values

      public static AvailabilitySharing[] 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 AvailabilitySharing 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
    • getValue

      public String getValue()
      Returns the token this constant is stored and exchanged as. It is the lower-case, hyphenated spelling rather than Enum.name() so that the stored value, the REST payload and the setting the user reads about are one and the same string.
      Returns:
      the stored token, never null
    • parse

      public static Optional<AvailabilitySharing> parse(String value)
      Resolves a stored or submitted token.

      An unrecognised token is deliberately not mapped onto DEFAULT: absence of a value means "this user never chose", which is what the default answers, whereas a value that exists but cannot be read is a broken store, and answering a broken store with the sharing default would widen a disclosure on the strength of a typo. The caller decides, and this method only says whether it knew the token.

      The retired everyone token falls under exactly that rule: a blob written while the third value existed is unknown here, and resolves to NOBODY at the one place that reads it. Retiring a value fails closed.

      Parameters:
      value - the token to resolve, may be null or blank
      Returns:
      the matching constant, or Optional.empty() when the token is missing or unknown