Class StateCacheProperties.StateCachePropertiesBuilder

java.lang.Object
swiss.trustbroker.config.dto.StateCacheProperties.StateCachePropertiesBuilder
Enclosing class:
StateCacheProperties

public static class StateCacheProperties.StateCachePropertiesBuilder extends Object
  • Method Details

    • targetMaxEntries

      public StateCacheProperties.StateCachePropertiesBuilder targetMaxEntries(int targetMaxEntries)
      If the session DB runs full (more than targetMaxEntries), XTB starts garbage collecting sessions, that might expire anyway soon to make room for new sessions and prevent storage issues.
      Returns:
      this.
    • minSessionLifetimeSec

      public StateCacheProperties.StateCachePropertiesBuilder minSessionLifetimeSec(int minSessionLifetimeSec)
      Prevents collecting sessions related to a pending login.
      Returns:
      this.
    • reapSchedule

      public StateCacheProperties.StateCachePropertiesBuilder reapSchedule(String reapSchedule)
      Use by scheduled job checking for expired sessions and delete them from the session DB StateCache. When multiple pods are running the reapMaxDelaySec is used to randomly delay the reaping to reduce concurrent work on the same data.
      Cron expression, default is '30 * * * * *' which means run every 60sec at HH:MM:30
      Returns:
      this.
    • reapMaxDelaySec

      public StateCacheProperties.StateCachePropertiesBuilder reapMaxDelaySec(int reapMaxDelaySec)
      Delay at most 25 sec randomly to allow multiple reapers on the same session DB.
      Returns:
      this.
    • reapWarnThresholdMs

      public StateCacheProperties.StateCachePropertiesBuilder reapWarnThresholdMs(int reapWarnThresholdMs)
      Expected reap cycle execution in milliseconds before we start to WARN about bad performance.
      Default: 10000
      Returns:
      this.
    • txCommitDelay

      public StateCacheProperties.StateCachePropertiesBuilder txCommitDelay(int txCommitDelay)
      Delay before transaction commit in milliseconds. For testing race conditions only, do not set in production environments!
      Default: 0
      Returns:
      this.
    • txRetryDelayMs

      public StateCacheProperties.StateCachePropertiesBuilder txRetryDelayMs(int txRetryDelayMs)
      Delay before transaction retry in milliseconds (negative values indicate no retry).
      Default: -1
      Returns:
      this.
      Since:
      1.9.0
    • txRetryCount

      public StateCacheProperties.StateCachePropertiesBuilder txRetryCount(int txRetryCount)
      Number of retries doubling the txRetryDelayMs on every try.
      Default: 0
      Returns:
      this.
      Since:
      1.10.0
    • schemaMigration

      public StateCacheProperties.StateCachePropertiesBuilder schemaMigration(boolean schemaMigration)
      State cache schema migration. Currently unused.
      Default: true
      Returns:
      this.
    • build

      public StateCacheProperties build()
    • toString

      public String toString()
      Overrides:
      toString in class Object