Class ReactiveMongoSherlockBuilder

java.lang.Object
com.coditory.sherlock.ReactiveMongoSherlockBuilder

public final class ReactiveMongoSherlockBuilder extends Object
Builds ReactiveSherlock that uses MongoDB for locking mechanism.
  • Method Details

    • 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(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 ReactiveMongoSherlockBuilder withLockDuration(Duration arg0)
    • withOwnerId

      public ReactiveMongoSherlockBuilder withOwnerId(String arg0)
    • withUniqueOwnerId

      public ReactiveMongoSherlockBuilder withUniqueOwnerId()
    • withStaticUniqueOwnerId

      public ReactiveMongoSherlockBuilder withStaticUniqueOwnerId()
    • buildWithApi

      public <R extends Object> R buildWithApi(com.coditory.sherlock.ReactiveSherlockWithConnectorBuilder.ReactiveSherlockApiMapper<R> arg0)