Record Class SyncCollectionResult

java.lang.Object
java.lang.Record
org.exoplatform.caldav.client.SyncCollectionResult
Record Components:
tokenValid - false when the server rejected the presented token (a 507, or a 403 carrying the valid-sync-token precondition) — everything else in the result is then empty and the caller must run a full listing instead
syncToken - the new token to store, null when the token was rejected
changed - the objects the server reported changed or new since the token, versions included, calendar data never (fetching is the multiget's job)
deleted - the server-absolute raw paths reported gone — the responses the REPORT answers with a direct 404 status

public record SyncCollectionResult(boolean tokenValid, String syncToken, List<CalendarObject> changed, List<String> deleted) extends Record
What an RFC 6578 sync-collection REPORT answered: the hrefs that changed, the hrefs that are gone, and the token to store for the next run. Token invalidation is a result, not an exception, because the plan's tiering treats it as a routine downgrade: the run falls through to the ctag/ETag tier and comes back with the fresh token this result carries next time.
  • Constructor Details

    • SyncCollectionResult

      public SyncCollectionResult(boolean tokenValid, String syncToken, List<CalendarObject> changed, List<String> deleted)
      Creates an instance of a SyncCollectionResult record class.
      Parameters:
      tokenValid - the value for the tokenValid record component
      syncToken - the value for the syncToken record component
      changed - the value for the changed record component
      deleted - the value for the deleted record component
  • Method Details

    • invalidToken

      public static SyncCollectionResult invalidToken()
      The one invalid-token result: the caller falls back to a listing.
      Returns:
      a result whose token is rejected and whose lists are empty
    • 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.
    • tokenValid

      public boolean tokenValid()
      Returns the value of the tokenValid record component.
      Returns:
      the value of the tokenValid record component
    • syncToken

      public String syncToken()
      Returns the value of the syncToken record component.
      Returns:
      the value of the syncToken record component
    • changed

      public List<CalendarObject> changed()
      Returns the value of the changed record component.
      Returns:
      the value of the changed record component
    • deleted

      public List<String> deleted()
      Returns the value of the deleted record component.
      Returns:
      the value of the deleted record component