Package com.coditory.sherlock
Class ReactiveMongoSherlockBuilder
java.lang.Object
com.coditory.sherlock.ReactiveMongoSherlockBuilder
Builds
ReactiveSherlock
that uses MongoDB for locking mechanism.-
Method Summary
Modifier and TypeMethodDescriptioncom.coditory.sherlock.ReactiveSherlock
build()
<R extends Object>
RbuildWithApi
(com.coditory.sherlock.ReactiveSherlockWithConnectorBuilder.ReactiveSherlockApiMapper<R> arg0) static ReactiveMongoSherlockBuilder
static com.coditory.sherlock.ReactiveSherlock
reactiveMongoSherlock
(com.mongodb.reactivestreams.client.MongoCollection<org.bson.Document> collection) withLockDuration
(Duration arg0) withLocksCollection
(com.mongodb.reactivestreams.client.MongoCollection<org.bson.Document> collection) withOwnerId
(String arg0)
-
Method Details
-
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
- Parameters:
clock
- time provider used in locking mechanism. Default:SherlockDefaults.DEFAULT_CLOCK
- Returns:
- the instance
-
build
public com.coditory.sherlock.ReactiveSherlock build() -
withLockDuration
-
withOwnerId
-
withUniqueOwnerId
-
withStaticUniqueOwnerId
-
buildWithApi
public <R extends Object> R buildWithApi(com.coditory.sherlock.ReactiveSherlockWithConnectorBuilder.ReactiveSherlockApiMapper<R> arg0)
-