Class CleanupRevalidationUtil

java.lang.Object
org.exoplatform.addons.documents.cleanup.util.CleanupRevalidationUtil

public class CleanupRevalidationUtil extends Object
Single definition of the revalidation-outcome to item-state mapping, shared by the freshness refresh (observation glue) and the execution-time revalidation so both stay strictly identical.
  • Method Details

    • applyRevalidation

      public static boolean applyRevalidation(CleanupCampaignItem item, CleanupRevalidation revalidation)
      Applies a revalidation outcome to a campaign item:
      • outcome unknown (transient JCR read failure): the item is left UNTOUCHED — never spared, never gone, never deleted on doubt; callers needing a distinct handling (e.g. the execution skipping the item) check CleanupRevalidation.isUnknown() first
      • node gone: CleanupItemState.GONE
      • node exempted: CleanupItemState.EXEMPTED
      • node no longer a candidate: CleanupItemState.SPARED_BY_MODIFICATION
      • node still a candidate: refreshes the item's path, action, fileSize, versionsSize, candidacy dates (last-modified and created) and computedAt
      The item is mutated, never persisted here.
      Parameters:
      item - campaign item to update
      revalidation - revalidation outcome
      Returns:
      true when the node is still a candidate (the item's action was refreshed), false when the item left the candidate state or the outcome is unknown