Enum Class CaldavSyncService.OutboundPhase

java.lang.Object
java.lang.Enum<CaldavSyncService.OutboundPhase>
org.exoplatform.caldav.service.CaldavSyncService.OutboundPhase
All Implemented Interfaces:
Serializable, Comparable<CaldavSyncService.OutboundPhase>, Constable
Enclosing class:
CaldavSyncService

public static enum CaldavSyncService.OutboundPhase extends Enum<CaldavSyncService.OutboundPhase>
The pieces of outward work a pass may do once the calendars themselves are in step — each named, and each governed on its own.

Why an enumerated set and not a boolean. These three used to sit behind one parameter called verifyMirror, and a name describing one of them governed all three. Connecting asked for no verification, which is right — the check lists whole collections and was measured at 30 seconds — and silently lost the two cheap ones with it, so an event a user had created before connecting was copied by nothing until a sweep came round a quarter of an hour later (EXO-89804). Nobody decided that; adjacency did.

A second boolean beside the first would have reproduced the defect one notch along: the fourth piece of outward work would arrive as a third boolean, every call site would grow another unlabelled false, and sync(id, login, true, false, true) says nothing at all about what the pass will do. A set names each piece where the call is written — EnumSet.of(SETTLE_OWED_COPIES, SEED_UPCOMING_COPIES) reads as the decision it is — and a phase added tomorrow changes no existing signature and no existing call: it is absent from every set that does not name it, which is the only safe default for work that talks to somebody's server.

The order they are declared in is the order they are done in (CaldavSyncService.runOutboundPhases(long, String, Set) walks values()), so the ordering is stated once and cannot drift between a sweep and a connection.

  • Enum Constant Details

    • SETTLE_OWED_COPIES

      public static final CaldavSyncService.OutboundPhase SETTLE_OWED_COPIES
      Writes the copies eXo already knows it owes and has not managed to make. Cheap on a converged account: one index lookup answering no rows.
    • SEED_UPCOMING_COPIES

      public static final CaldavSyncService.OutboundPhase SEED_UPCOMING_COPIES
      Copies the upcoming events the account has never been given — the backfill a freshly connected account needs, and the only thing that carries an event created before the account existed.
    • VERIFY_MIRROR

      public static final CaldavSyncService.OutboundPhase VERIFY_MIRROR
      Reads back every copy eXo has written and repairs what has drifted. Lists whole collections, measured at a full 30-second request timeout against one real account: the sweep's alone, never a user's.
  • Method Details

    • values

      public static CaldavSyncService.OutboundPhase[] 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 CaldavSyncService.OutboundPhase 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