Class IdempotencyProperties

java.lang.Object
io.github.ravocode.avoonce.spring.IdempotencyProperties

@ConfigurationProperties(prefix="avoonce.idempotency") public class IdempotencyProperties extends Object
Configuration properties for the AvoOnce idempotency library.
  • Constructor Details

    • IdempotencyProperties

      public IdempotencyProperties()
      Creates a new properties instance with the default settings.
  • Method Details

    • getHeaderName

      public String getHeaderName()
      Returns the request header used to carry the idempotency key.
      Returns:
      the header name
    • setHeaderName

      public void setHeaderName(String headerName)
      Sets the request header used to carry the idempotency key.
      Parameters:
      headerName - the header name to use
    • getTtl

      public long getTtl()
      Returns the configured cache TTL value.
      Returns:
      the TTL value
    • setTtl

      public void setTtl(long ttl)
      Sets the configured cache TTL value.
      Parameters:
      ttl - the TTL value to use
    • getTtlUnit

      public TimeUnit getTtlUnit()
      Returns the time unit for the cache TTL.
      Returns:
      the TTL time unit
    • setTtlUnit

      public void setTtlUnit(TimeUnit ttlUnit)
      Sets the time unit for the cache TTL.
      Parameters:
      ttlUnit - the TTL time unit to use
    • getLockTimeout

      public long getLockTimeout()
      Returns the maximum duration a lock may remain active before it is considered stale.
      Returns:
      the lock timeout value
    • setLockTimeout

      public void setLockTimeout(long lockTimeout)
      Sets the maximum duration a lock may remain active before it is considered stale.
      Parameters:
      lockTimeout - the lock timeout value to use
    • getLockTimeoutUnit

      public TimeUnit getLockTimeoutUnit()
      Returns the time unit for the lock timeout.
      Returns:
      the lock timeout time unit
    • setLockTimeoutUnit

      public void setLockTimeoutUnit(TimeUnit lockTimeoutUnit)
      Sets the time unit for the lock timeout.
      Parameters:
      lockTimeoutUnit - the lock timeout time unit to use
    • isHashBody

      public boolean isHashBody()
      Returns whether request bodies should be hashed for payload mismatch detection.
      Returns:
      true when request bodies are hashed
    • setHashBody

      public void setHashBody(boolean hashBody)
      Sets whether request bodies should be hashed for payload mismatch detection.
      Parameters:
      hashBody - true to hash request bodies
    • isEnforce

      public boolean isEnforce()
      Returns whether requests missing the idempotency key are rejected.
      Returns:
      true when missing keys are enforced
    • setEnforce

      public void setEnforce(boolean enforce)
      Sets whether requests missing the idempotency key are rejected.
      Parameters:
      enforce - true to reject missing keys
    • getStore

      public String getStore()
      Returns the selected backing store name.
      Returns:
      the store selection value
    • setStore

      public void setStore(String store)
      Sets the selected backing store name.
      Parameters:
      store - the store selection value
    • getJdbc

      Returns the JDBC-specific configuration properties.
      Returns:
      the JDBC configuration object
    • setJdbc

      public void setJdbc(IdempotencyProperties.JdbcProperties jdbc)
      Sets the JDBC-specific configuration properties.
      Parameters:
      jdbc - the JDBC configuration object