Class StorageThresholdsConfiguration

java.lang.Object
fr.gouv.vitam.common.storage.StorageThresholdsConfiguration

public class StorageThresholdsConfiguration extends Object
Storage saturation thresholds (platform-wide and per-tenant). The sizeUnit applies to both platformCapacity and every per-tenant threshold (defaults to BinarySizePlatformThreshold.SizeUnit.GIGABYTE).
  • Constructor Details

    • StorageThresholdsConfiguration

      public StorageThresholdsConfiguration()
  • Method Details

    • getSizeUnit

    • setSizeUnit

    • getPlatformCapacity

      public long getPlatformCapacity()
      Returns:
      the configured platform capacity, expressed in sizeUnit
    • setPlatformCapacity

      public StorageThresholdsConfiguration setPlatformCapacity(long platformCapacity)
      Parameters:
      platformCapacity - the platform capacity, expressed in sizeUnit
      Returns:
      this
    • getPlatformCapacityBytes

      public long getPlatformCapacityBytes()
      Returns:
      the configured platform capacity resolved to bytes (0 when unset / saturation check disabled)
    • getPlatformThresholdPercent

      public long getPlatformThresholdPercent()
    • setPlatformThresholdPercent

      public StorageThresholdsConfiguration setPlatformThresholdPercent(long platformThresholdPercent)
    • getCacheRefreshIntervalSeconds

      public long getCacheRefreshIntervalSeconds()
    • setCacheRefreshIntervalSeconds

      public StorageThresholdsConfiguration setCacheRefreshIntervalSeconds(long cacheRefreshIntervalSeconds)
    • getDefaultTenantThreshold

      public long getDefaultTenantThreshold()
      Returns:
      the default per-tenant threshold, expressed in sizeUnit
    • setDefaultTenantThreshold

      public StorageThresholdsConfiguration setDefaultTenantThreshold(long defaultTenantThreshold)
    • getDefaultTenantThresholdBytes

      public long getDefaultTenantThresholdBytes()
      Returns:
      the default per-tenant threshold resolved to bytes (0 when unset / per-tenant default disabled)
    • getTenantThresholds

      public List<TenantThresholdConfiguration> getTenantThresholds()
      Returns:
      the explicit per-tenant overrides (expressed in sizeUnit), or null when none is configured
    • setTenantThresholds

      public StorageThresholdsConfiguration setTenantThresholds(List<TenantThresholdConfiguration> tenantThresholds)
    • toBytes

      public long toBytes(long size)
      Resolves a size expressed in the configured sizeUnit to bytes.
      Parameters:
      size - the size in sizeUnit
      Returns:
      the size resolved to bytes