Record Class CalendarSyncState

java.lang.Object
java.lang.Record
org.exoplatform.caldav.model.CalendarSyncState
Record Components:
id - the binding, which is what an action refers to
calendarId - the eXo calendar this is about, so the calendar list can mark the row itself rather than leaving the notice on a settings page nobody in trouble thinks to open. Zero when there is no eXo calendar — a collection the server refused to create has none
name - what the calendar is called, read from the server so a rename in the user's own client shows here
status - the engine's own state for this binding
lastSyncEnd - when it last finished, in epoch milliseconds, or null when it never has

public record CalendarSyncState(long id, long calendarId, String name, CalendarSyncStatus status, Long lastSyncEnd) extends Record
What one calendar's synchronisation is doing, in the terms a user can act on.

The engine knows this per binding and has always kept it in the database and the logs. A user seeing their agenda has no way to tell a calendar that is synchronising from one whose server refused it — both simply sit there — so the states that call for an action are surfaced and the rest is not.

  • Constructor Details

    • CalendarSyncState

      public CalendarSyncState(long id, long calendarId, String name, CalendarSyncStatus status, Long lastSyncEnd)
      Creates an instance of a CalendarSyncState record class.
      Parameters:
      id - the value for the id record component
      calendarId - the value for the calendarId record component
      name - the value for the name record component
      status - the value for the status record component
      lastSyncEnd - the value for the lastSyncEnd record component
  • Method Details

    • worthTelling

      public boolean worthTelling()
      Whether this state is one the user should be told about.

      A calendar that is synchronising is not news, and a tombstone has its own row — the hidden-calendars one, which offers to bring it back rather than to worry about it; so does a hidden share (CalendarSyncStatus.HIDDEN_SHARE, EXO-90239), which is a choice the user made and not a state to warn them about. What is left is the states where something the user might do would change the outcome — a retired subscription among them (CalendarSyncStatus.RETIRED_SUBSCRIPTION, EXO-90275): its calendar no longer synchronises, and only the user can delete it.

      Returns:
      true when this belongs on screen
    • 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.
    • id

      public long id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • calendarId

      public long calendarId()
      Returns the value of the calendarId record component.
      Returns:
      the value of the calendarId record component
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • status

      public CalendarSyncStatus status()
      Returns the value of the status record component.
      Returns:
      the value of the status record component
    • lastSyncEnd

      public Long lastSyncEnd()
      Returns the value of the lastSyncEnd record component.
      Returns:
      the value of the lastSyncEnd record component