Class CaldavMirrorReportService

java.lang.Object
org.exoplatform.caldav.service.CaldavMirrorReportService

@Service public class CaldavMirrorReportService extends Object

The last pass over each user's copies, kept so somebody can look.

What it is for. An administrator changing where meeting copies are written (EXO-89762) has, until this exists, exactly one way of finding out whether the change took effect: read the platform log. That makes the add-on's own advice — move to the account's main calendar only once copies synchronise cleanly on this server — an instruction nobody outside operations can follow. One tally per user, on the screen where the synchronisation is already tuned, is what makes it checkable.

In memory, and bounded. Beside the verification pass's own repair counts and the relocation service's reported set, for the reason they give: this records what is happening right now, not a fact about an account worth a table and a migration. A restart loses it, and the next synchronisation of each account puts it back. The cap exists so that a deployment with tens of thousands of connected accounts cannot turn an observability aid into a heap problem — past it the oldest report goes, which is also the one least worth reading.

It records, it never judges. Nothing here decides anything: no pass reads these reports, no stamp depends on them, and losing every one of them changes no behaviour at all. That is deliberate — an observability store that something depends on stops being safe to drop.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected static final int
    How many users' reports are kept.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    forget(long userIdentityId)
    Forgets what is known about one user's copies.
    The last pass of every user that has had one, newest first, each carrying the identity of the user it is about.
    void
    record(long userIdentityId, org.exoplatform.caldav.model.MirrorVerification verification, MirrorRelocation relocation)
    Records what one pass found and moved for one user, replacing whatever that user's previous pass left.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • MAX_REPORTS

      protected static final int MAX_REPORTS
      How many users' reports are kept.

      A screen nobody scrolls past the first dozen rows of, and a number small enough that resolving every identity when it is opened is a handful of lookups rather than a query storm.

      See Also:
  • Constructor Details

    • CaldavMirrorReportService

      public CaldavMirrorReportService()
  • Method Details

    • record

      public void record(long userIdentityId, org.exoplatform.caldav.model.MirrorVerification verification, MirrorRelocation relocation)
      Records what one pass found and moved for one user, replacing whatever that user's previous pass left.

      The last pass and only the last: a history would answer a question nobody asked ("what was it like an hour ago") at the cost of the one that is asked, which is whether things are right now.

      Parameters:
      userIdentityId - identity of the user the pass ran for
      verification - what the comparison found, never null
      relocation - what the move did, never null
    • forget

      public void forget(long userIdentityId)
      Forgets what is known about one user's copies.

      For the account that disconnects: a tally naming a user who no longer has a connected account is not a stale number, it is a wrong one.

      Parameters:
      userIdentityId - identity of the user
    • getReports

      public List<MirrorPassReport> getReports()
      The last pass of every user that has had one, newest first, each carrying the identity of the user it is about.

      The identities are resolved here rather than when the report was recorded, because recording happens on every synchronisation of every account and reading happens when somebody opens a drawer. A user whose identity cannot be resolved keeps their report and loses only their name — the tally is still true, and dropping the row would hide a problem rather than show one.

      Returns:
      the reports, newest first, never null