Class CleanupPurgeResult

java.lang.Object
org.exoplatform.addons.documents.cleanup.model.CleanupPurgeResult

public class CleanupPurgeResult extends Object
Outcome of a purge operation (hard delete or versions purge) on one item.
  • Constructor Details

    • CleanupPurgeResult

      public CleanupPurgeResult()
  • Method Details

    • purged

      public static CleanupPurgeResult purged(long reclaimedBytes)
    • gone

      public static CleanupPurgeResult gone()
    • skipped

      public static CleanupPurgeResult skipped(String failureReason)
      A skip with NO exception behind it — a deterministic refusal such as cleanup.notVersionable, whose message code already says everything there is to say. Kept as an overload precisely so those call sites are not forced to pass a null detail.
      Parameters:
      failureReason - bare message code of the failure
      Returns:
      a SKIPPED result with zero reclaimed bytes and no detail
    • skipped

      public static CleanupPurgeResult skipped(String failureReason, String failureDetail)
      A skip that reclaimed nothing at all.
      Parameters:
      failureReason - bare message code of the failure
      failureDetail - compact diagnostic of the exception behind it
      Returns:
      a SKIPPED result with zero reclaimed bytes
    • skipped

      public static CleanupPurgeResult skipped(String failureReason, String failureDetail, long reclaimedBytes)
      A PARTIAL purge: the item stays SKIPPED and keeps its failure reason (an administrator must still see that the file needs attention), but the bytes really reclaimed before the failure are CARRIED, so the campaign's reclaimed total reports the work actually done instead of silently under-reporting it.
      Parameters:
      failureReason - bare message code of the failure that interrupted the purge
      failureDetail - compact diagnostic of the exception behind it
      reclaimedBytes - bytes effectively reclaimed before that failure
      Returns:
      a SKIPPED result carrying the bytes already reclaimed