Package com.coditory.sherlock
Class ReactiveMongoSherlockBuilder
- java.lang.Object
-
- com.coditory.sherlock.ReactiveMongoSherlockBuilder
-
public final class ReactiveMongoSherlockBuilder extends java.lang.Object
BuildsReactiveSherlock
that uses MongoDB for locking mechanism.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.coditory.sherlock.ReactiveSherlock
build()
<R extends java.lang.Object>
RbuildWithApi(com.coditory.sherlock.ReactiveSherlockWithConnectorBuilder.ReactiveSherlockApiMapper<R> arg0)
static ReactiveMongoSherlockBuilder
reactiveMongoSherlock()
static com.coditory.sherlock.ReactiveSherlock
reactiveMongoSherlock(com.mongodb.reactivestreams.client.MongoCollection<org.bson.Document> collection)
ReactiveMongoSherlockBuilder
withClock(java.time.Clock clock)
T
withLockDuration(java.time.Duration arg0)
ReactiveMongoSherlockBuilder
withLocksCollection(com.mongodb.reactivestreams.client.MongoCollection<org.bson.Document> collection)
T
withOwnerId(java.lang.String arg0)
T
withStaticUniqueOwnerId()
T
withUniqueOwnerId()
-
-
-
Method Detail
-
reactiveMongoSherlock
public static ReactiveMongoSherlockBuilder reactiveMongoSherlock()
- Returns:
- new instance of the builder
-
reactiveMongoSherlock
public static com.coditory.sherlock.ReactiveSherlock reactiveMongoSherlock(com.mongodb.reactivestreams.client.MongoCollection<org.bson.Document> collection)
- Parameters:
collection
- mongo collection to be used for locking- Returns:
- new instance of mongo sherlock with default configuration
-
withLocksCollection
public ReactiveMongoSherlockBuilder withLocksCollection(com.mongodb.reactivestreams.client.MongoCollection<org.bson.Document> collection)
- Parameters:
collection
- mongo collection to be used for locking- Returns:
- the instance
-
withClock
public ReactiveMongoSherlockBuilder 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.ReactiveSherlock build()
-
withLockDuration
public T withLockDuration(java.time.Duration arg0)
-
withOwnerId
public T withOwnerId(java.lang.String arg0)
-
withUniqueOwnerId
public T withUniqueOwnerId()
-
withStaticUniqueOwnerId
public T withStaticUniqueOwnerId()
-
buildWithApi
public <R extends java.lang.Object> R buildWithApi(com.coditory.sherlock.ReactiveSherlockWithConnectorBuilder.ReactiveSherlockApiMapper<R> arg0)
-
-