Class WorkspaceStorageThresholdManager

java.lang.Object
fr.gouv.vitam.workspace.common.WorkspaceStorageThresholdManager

public class WorkspaceStorageThresholdManager extends Object
Resolves, once at server startup, the workspace storage saturation thresholds from the StorageThresholdsConfiguration and the list of configured tenants.

The defaultTenantThreshold is expanded over every configured tenant, then the explicit per-tenant overrides take precedence. All sizes are resolved to bytes here so consumers only deal with byte values. This mirrors the ElasticsearchMetadataIndexManager pattern: the configuration stays a plain data holder, the per-tenant population is performed once in this manager.

  • Constructor Details

  • Method Details

    • getPlatformCapacityBytes

      public long getPlatformCapacityBytes()
      Returns:
      the platform capacity resolved to bytes (0 when the platform-wide check is disabled)
    • getPlatformThresholdPercent

      public long getPlatformThresholdPercent()
      Returns:
      the platform-wide saturation threshold, as a percentage of the platform capacity
    • getTenantThresholdBytes

      public Long getTenantThresholdBytes(int tenantId)
      Parameters:
      tenantId - the tenant id
      Returns:
      the resolved per-tenant threshold in bytes, or null when no threshold applies to the tenant
    • getTenantThresholdBytes

      public Map<Integer,Long> getTenantThresholdBytes()
      Returns:
      the resolved per-tenant thresholds (in bytes), keyed by tenant id