Package fr.gouv.vitam.workspace.common
Class WorkspaceStorageThresholdManager
java.lang.Object
fr.gouv.vitam.workspace.common.WorkspaceStorageThresholdManager
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 Summary
ConstructorsConstructorDescriptionWorkspaceStorageThresholdManager(StorageThresholdsConfiguration configuration, List<Integer> tenantIds) -
Method Summary
-
Constructor Details
-
WorkspaceStorageThresholdManager
public WorkspaceStorageThresholdManager(StorageThresholdsConfiguration configuration, List<Integer> tenantIds)
-
-
Method Details
-
getPlatformCapacityBytes
public long getPlatformCapacityBytes()- Returns:
- the platform capacity resolved to bytes (
0when the platform-wide check is disabled)
-
getPlatformThresholdPercent
public long getPlatformThresholdPercent()- Returns:
- the platform-wide saturation threshold, as a percentage of the platform capacity
-
getTenantThresholdBytes
- Parameters:
tenantId- the tenant id- Returns:
- the resolved per-tenant threshold in bytes, or
nullwhen no threshold applies to the tenant
-
getTenantThresholdBytes
- Returns:
- the resolved per-tenant thresholds (in bytes), keyed by tenant id
-