Package com.coditory.sherlock
Class SherlockWithConnectorBuilder<T extends SherlockWithConnectorBuilder<?>>
java.lang.Object
com.coditory.sherlock.SherlockWithConnectorBuilder<T>
public abstract class SherlockWithConnectorBuilder<T extends SherlockWithConnectorBuilder<?>>
extends Object
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract @NotNull Sherlockbuild()withLockDuration(@NotNull Duration duration) withOwnerId(@NotNull String ownerId) withOwnerIdPolicy(@NotNull com.coditory.sherlock.OwnerIdPolicy ownerIdPolicy)
-
Constructor Details
-
SherlockWithConnectorBuilder
public SherlockWithConnectorBuilder()
-
-
Method Details
-
withLockDuration
- Parameters:
duration- how much time a lock should be active. When time passes lock is expired and becomes released. Default:SherlockDefaults.DEFAULT_LOCK_DURATION- Returns:
- the instance
-
withOwnerId
- Parameters:
ownerId- owner id used to specify who can release an acquired lock- Returns:
- the instance
-
withOwnerIdPolicy
@NotNull public T withOwnerIdPolicy(@NotNull @NotNull com.coditory.sherlock.OwnerIdPolicy ownerIdPolicy) -
build
- Returns:
- sherlock instance
- Throws:
IllegalArgumentException- when some required values are missing
-