Class CleanupConstants

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

public class CleanupConstants extends Object
Single definition of the physical drive layout swept by cleanup campaigns (scan roots, drive-root depths) and of the cleanup-wide static constants.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Administrators group receiving cleanup campaign WebSocket notifications.
    static final String
    Logical sort key naming the RECLAIMABLE ordering of campaign items — the one and only name for it, shared by the REST sortable-field allowlist and by the Storage translating it into an ORDER BY on CleanupCampaignItemDAO#RECLAIMABLE_BYTES (the very column every reclaimable aggregate sums).
    static final List<String>
    Roots scanned (and watched) by cleanup campaigns.
    static final int
    Depth (JCR semantics: '/' = 0) of the space drive-root node /Groups/spaces/<space>/Documents: the empty-ancestors sweep of a deleted space file must stop at (and never remove) this node.
    static final String
    Root of the space drives in the collaboration workspace.
    static final List<String>
    Scan roots whose DIRECT CHILDREN are the parallel scan units — depth 1, and deliberately not deeper.
    static final String
     
    static final List<String>
    Scan roots taken WHOLE as a single unit, never partitioned: /Trash already has a dedicated trash cleaner on the platform, so splitting it buys nothing — it is scanned for the report only.
    static final String
    Name of the user drive-root folder holding private documents.
    static final String
    Name of the user drive-root folder holding public documents.
    static final String
    Root of the user drives in the collaboration workspace.
  • Method Summary

    Modifier and Type
    Method
    Description
    static int
    getDriveMinDepth(String deletedNodePath)
    Depth of the drive-root node the empty-ancestors sweep of a deleted file must stop at (the drive root itself is preserved, only deeper empty folders may be removed): space drive: /Groups/spaces/<space>/Documents, always at SPACE_DRIVE_MIN_DEPTH user drive: the user home's Private (or Public) folder.

    Methods inherited from class java.lang.Object

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

    • RECLAIMABLE_SORT_KEY

      public static final String RECLAIMABLE_SORT_KEY
      Logical sort key naming the RECLAIMABLE ordering of campaign items — the one and only name for it, shared by the REST sortable-field allowlist and by the Storage translating it into an ORDER BY on CleanupCampaignItemDAO#RECLAIMABLE_BYTES (the very column every reclaimable aggregate sums).

      Lives HERE, and not with the JPQL it ends up as, because it crosses layers: the REST layer must accept it without importing a DAO, the Storage must recognize it, and a second literal in either place would let the two drift apart silently. It happens to equal the entity's attribute name now that the figure is a persisted column — pinned by a test, since that equality is what lets the Storage translate this into an ordinary property sort instead of an unsafe one.

      See Also:
    • USERS_ROOT

      public static final String USERS_ROOT
      Root of the user drives in the collaboration workspace.
      See Also:
    • SPACES_ROOT

      public static final String SPACES_ROOT
      Root of the space drives in the collaboration workspace.
      See Also:
    • TRASH_ROOT

      public static final String TRASH_ROOT
      See Also:
    • SCAN_ROOTS

      public static final List<String> SCAN_ROOTS
      Roots scanned (and watched) by cleanup campaigns.
    • SPLIT_SCAN_ROOTS

      public static final List<String> SPLIT_SCAN_ROOTS
      Scan roots whose DIRECT CHILDREN are the parallel scan units — depth 1, and deliberately not deeper.

      NOTE what a direct child of /Users actually is: under eXo's READABLE data distribution (depth = 4, suffix ___) the children of /Users are FIRST-LETTER BUCKETS (/Users/r___), NOT user homes — a home sits at /Users/r___/ro___/roo___/root. So this yields ~26-40 units of very UNEQUAL size, and the largest bucket alone bounds the wall-clock of the whole scan.

      That imbalance is ACCEPTED, on purpose: enumeration stays a single one-level listing with no knowledge of the distribution's depth or suffix baked in, and the per-unit rows make the long tail measurable before anyone pays for a smarter split. Do NOT "improve" it by walking deeper.

    • UNSPLIT_SCAN_ROOTS

      public static final List<String> UNSPLIT_SCAN_ROOTS
      Scan roots taken WHOLE as a single unit, never partitioned: /Trash already has a dedicated trash cleaner on the platform, so splitting it buys nothing — it is scanned for the report only.
    • USER_PRIVATE_FOLDER

      public static final String USER_PRIVATE_FOLDER
      Name of the user drive-root folder holding private documents.
      See Also:
    • USER_PUBLIC_FOLDER

      public static final String USER_PUBLIC_FOLDER
      Name of the user drive-root folder holding public documents.
      See Also:
    • SPACE_DRIVE_MIN_DEPTH

      public static final int SPACE_DRIVE_MIN_DEPTH
      Depth (JCR semantics: '/' = 0) of the space drive-root node /Groups/spaces/<space>/Documents: the empty-ancestors sweep of a deleted space file must stop at (and never remove) this node.
      See Also:
    • ADMINISTRATORS_GROUP

      public static final String ADMINISTRATORS_GROUP
      Administrators group receiving cleanup campaign WebSocket notifications. Static by design decision — see the cleanup tech spec: this group is deliberately NOT configurable and NOT resolved through UserACL.
      See Also:
  • Method Details

    • getDriveMinDepth

      public static int getDriveMinDepth(String deletedNodePath)
      Depth of the drive-root node the empty-ancestors sweep of a deleted file must stop at (the drive root itself is preserved, only deeper empty folders may be removed):
      • space drive: /Groups/spaces/<space>/Documents, always at SPACE_DRIVE_MIN_DEPTH
      • user drive: the user home's Private (or Public) folder. User homes are nested at a VARIABLE depth under /Users (e.g. /Users/j___/jo___/joh___/john/Private), so no constant depth exists: it is computed from the deleted node path, as the depth of its first Private/Public segment
      Parameters:
      deletedNodePath - absolute path of the deleted file node
      Returns:
      the drive-root depth, or Integer.MAX_VALUE (sweep nothing) when the path matches no known drive layout