Record Class MirrorRelocation

java.lang.Object
java.lang.Record
org.exoplatform.caldav.service.MirrorRelocation
Record Components:
destination - where the copies are now written, canonical — null when no destination could be established at all, which is the state an unreachable account, or one whose server names no default calendar, sits in until that changes
moved - how many copies were written into the destination and their mapping re-pointed
refused - how many old copies the server would not remove, and which therefore stay where they were
failed - how many copies could not be written into the destination
unmovable - how many mapping rows eXo can no longer render an object for, and which are therefore left exactly where they are

public record MirrorRelocation(String destination, int moved, int refused, int failed, int unmovable) extends Record
What one relocation pass did to the copies already on the server, and whether the destination change may be recorded as applied.

Counted rather than merely logged, because the two failures this can meet are not the same and the caller acts differently on each. A copy the server refused to remove leaves a duplicate the user can see, and the change is not finished; a copy eXo can no longer render leaves nothing to move and never will, whatever is retried.

  • Constructor Summary

    Constructors
    Constructor
    Description
    MirrorRelocation(String destination, int moved, int refused, int failed, int unmovable)
    Creates an instance of a MirrorRelocation record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Whether a destination was established at all.
    boolean
    Whether the destination change may be stamped as applied.
    The answer when no destination could be established — the account cannot be reached, or the registration asks for a default calendar the account names none of.
    Returns the value of the destination record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    int
    Returns the value of the failed record component.
    final int
    Returns a hash code value for this object.
    int
    Returns the value of the moved record component.
    int
    Returns the value of the refused record component.
    final String
    Returns a string representation of this record class.
    int
    Returns the value of the unmovable record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • MirrorRelocation

      public MirrorRelocation(String destination, int moved, int refused, int failed, int unmovable)
      Creates an instance of a MirrorRelocation record class.
      Parameters:
      destination - the value for the destination record component
      moved - the value for the moved record component
      refused - the value for the refused record component
      failed - the value for the failed record component
      unmovable - the value for the unmovable record component
  • Method Details

    • deferred

      public static MirrorRelocation deferred()
      The answer when no destination could be established — the account cannot be reached, or the registration asks for a default calendar the account names none of.
      Returns:
      a relocation that did nothing and applied nothing
    • applicable

      public boolean applicable()
      Whether a destination was established at all.

      The caller's gate on doing any settings work this pass: comparing the contents of copies against a render is wasted when eXo does not yet know which collection they belong in.

      Returns:
      true when the copies have a destination
    • complete

      public boolean complete()
      Whether the destination change may be stamped as applied.

      A refused removal and a failed write both mean the next pass has work left to do, and the stamp is what would stop it looking. An unmovable row does not block: it is a permanent property of a mapping that stands for no event eXo can render, it will answer the same on every retry, and letting it hold the stamp open would put every account holding one into a full-content comparison round for ever — which is the cost this whole mechanism exists to pay only once.

      Returns:
      true when nothing this pass tried to do failed
    • 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.
    • destination

      public String destination()
      Returns the value of the destination record component.
      Returns:
      the value of the destination record component
    • moved

      public int moved()
      Returns the value of the moved record component.
      Returns:
      the value of the moved record component
    • refused

      public int refused()
      Returns the value of the refused record component.
      Returns:
      the value of the refused record component
    • failed

      public int failed()
      Returns the value of the failed record component.
      Returns:
      the value of the failed record component
    • unmovable

      public int unmovable()
      Returns the value of the unmovable record component.
      Returns:
      the value of the unmovable record component