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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classScheduled eviction configuration (avoonce.idempotency.jdbc.eviction.*).static classJDBC-specific configuration properties (avoonce.idempotency.jdbc.*). -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new properties instance with the default settings. -
Method Summary
Modifier and TypeMethodDescriptionReturns the request header used to carry the idempotency key.getJdbc()Returns the JDBC-specific configuration properties.longReturns the maximum duration a lock may remain active before it is considered stale.Returns the time unit for the lock timeout.getStore()Returns the selected backing store name.longgetTtl()Returns the configured cache TTL value.Returns the time unit for the cache TTL.booleanReturns whether requests missing the idempotency key are rejected.booleanReturns whether request bodies should be hashed for payload mismatch detection.voidsetEnforce(boolean enforce) Sets whether requests missing the idempotency key are rejected.voidsetHashBody(boolean hashBody) Sets whether request bodies should be hashed for payload mismatch detection.voidsetHeaderName(String headerName) Sets the request header used to carry the idempotency key.voidSets the JDBC-specific configuration properties.voidsetLockTimeout(long lockTimeout) Sets the maximum duration a lock may remain active before it is considered stale.voidsetLockTimeoutUnit(TimeUnit lockTimeoutUnit) Sets the time unit for the lock timeout.voidSets the selected backing store name.voidsetTtl(long ttl) Sets the configured cache TTL value.voidsetTtlUnit(TimeUnit ttlUnit) Sets the time unit for the cache TTL.
-
Constructor Details
-
IdempotencyProperties
public IdempotencyProperties()Creates a new properties instance with the default settings.
-
-
Method Details
-
getHeaderName
Returns the request header used to carry the idempotency key.- Returns:
- the header name
-
setHeaderName
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
-
setTtlUnit
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
Returns the time unit for the lock timeout.- Returns:
- the lock timeout time unit
-
setLockTimeoutUnit
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:
truewhen request bodies are hashed
-
setHashBody
public void setHashBody(boolean hashBody) Sets whether request bodies should be hashed for payload mismatch detection.- Parameters:
hashBody-trueto hash request bodies
-
isEnforce
public boolean isEnforce()Returns whether requests missing the idempotency key are rejected.- Returns:
truewhen missing keys are enforced
-
setEnforce
public void setEnforce(boolean enforce) Sets whether requests missing the idempotency key are rejected.- Parameters:
enforce-trueto reject missing keys
-
getStore
Returns the selected backing store name.- Returns:
- the store selection value
-
setStore
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
Sets the JDBC-specific configuration properties.- Parameters:
jdbc- the JDBC configuration object
-