Package com.coditory.sherlock
Class SqlSherlock
- java.lang.Object
-
- com.coditory.sherlock.SqlSherlock
-
public final class SqlSherlock extends java.lang.Object
BuildsSherlock
that uses SQL database for locking mechanism.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.coditory.sherlock.Sherlock
build()
static SqlSherlock
builder()
SqlSherlock
withClock(java.time.Clock clock)
SqlSherlock
withConnection(java.sql.Connection connection)
T
withLockDuration(java.time.Duration arg0)
SqlSherlock
withLocksTable(java.lang.String tableName)
T
withOwnerId(java.lang.String arg0)
T
withStaticUniqueOwnerId()
T
withUniqueOwnerId()
-
-
-
Method Detail
-
builder
public static SqlSherlock builder()
- Returns:
- new instance of the builder
-
withConnection
public SqlSherlock withConnection(java.sql.Connection connection)
- Parameters:
connection
- the connection to the database- Returns:
- the instance
-
withLocksTable
public SqlSherlock withLocksTable(java.lang.String tableName)
- Parameters:
tableName
- the name of the table that stores locks- Returns:
- the instance
-
withClock
public SqlSherlock withClock(java.time.Clock clock)
- Parameters:
clock
- time provider used in locking mechanism. Default:SherlockDefaults.DEFAULT_CLOCK
- Returns:
- the instance
-
build
public com.coditory.sherlock.Sherlock build()
- Returns:
- sherlock instance
- Throws:
java.lang.IllegalArgumentException
- when some required values are missing
-
withLockDuration
public T withLockDuration(java.time.Duration arg0)
-
withOwnerId
public T withOwnerId(java.lang.String arg0)
-
withUniqueOwnerId
public T withUniqueOwnerId()
-
withStaticUniqueOwnerId
public T withStaticUniqueOwnerId()
-
-