Record Class CaldavManagedMode

java.lang.Object
java.lang.Record
org.exoplatform.caldav.model.CaldavManagedMode
Record Components:
serverId - the registration the instance chose, null when managed mode is off
serverName - that registration's display name, null when managed mode is off — the screens name the server rather than print its id
managedForMe - whether the caller is governed by that choice, so their connect and disconnect affordances must not be offered

public record CaldavManagedMode(Long serverId, String serverName, boolean managedForMe) extends Record
Whether this deployment chooses the CalDAV server on its users' behalf, and which one.

Two answers in one payload, and they are deliberately not the same question. serverId and serverName say what the instance decided — the administration screen renders them, and they are the same for everybody. managedForMe says whether the decision applies to the caller, which is what the browser acts on when it takes the connect and disconnect affordances away.

Today the two cannot disagree: managed mode is on or off for the whole instance. They are separate anyway because the next step is group exclusions, and when an excluded group may still connect an account of its own, the per-viewer verdict is the only one a component may read. Answering it here costs one service method; discovering later that every front-end component read the global flag would cost a component each.

  • Constructor Details

    • CaldavManagedMode

      public CaldavManagedMode(Long serverId, String serverName, boolean managedForMe)
      Creates an instance of a CaldavManagedMode record class.
      Parameters:
      serverId - the value for the serverId record component
      serverName - the value for the serverName record component
      managedForMe - the value for the managedForMe record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • serverId

      public Long serverId()
      Returns the value of the serverId record component.
      Returns:
      the value of the serverId record component
    • serverName

      public String serverName()
      Returns the value of the serverName record component.
      Returns:
      the value of the serverName record component
    • managedForMe

      public boolean managedForMe()
      Returns the value of the managedForMe record component.
      Returns:
      the value of the managedForMe record component