Class ReactiveMongoSherlockBuilder


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

      • 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)