Interface DistributedLockConnector


public interface DistributedLockConnector
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull io.reactivex.rxjava3.core.Single<com.coditory.sherlock.connector.AcquireResult>
    acquire(@NotNull com.coditory.sherlock.LockRequest lockRequest)
    Acquire a lock.
    @NotNull io.reactivex.rxjava3.core.Single<com.coditory.sherlock.connector.AcquireResult>
    acquireOrProlong(com.coditory.sherlock.LockRequest lockRequest)
    Acquire a lock or prolong it if it was acquired by the same instance.
    @NotNull io.reactivex.rxjava3.core.Single<com.coditory.sherlock.connector.AcquireResult>
    forceAcquire(@NotNull com.coditory.sherlock.LockRequest lockRequest)
    Acquire a lock even if it was already acquired by someone else
    @NotNull io.reactivex.rxjava3.core.Single<com.coditory.sherlock.connector.ReleaseResult>
    forceRelease(@NotNull String lockId)
    Release a lock without checking its owner or release date.
    @NotNull io.reactivex.rxjava3.core.Single<com.coditory.sherlock.connector.ReleaseResult>
    Release all locks without checking their owners or release dates.
    @NotNull io.reactivex.rxjava3.core.Single<com.coditory.sherlock.connector.InitializationResult>
    Initializes underlying infrastructure for locks.
    @NotNull io.reactivex.rxjava3.core.Single<com.coditory.sherlock.connector.ReleaseResult>
    release(@NotNull String lockId, @NotNull String ownerId)
    Unlock a lock if wat acquired by the same instance.
  • Method Details

    • initialize

      @NotNull @NotNull io.reactivex.rxjava3.core.Single<com.coditory.sherlock.connector.InitializationResult> initialize()
      Initializes underlying infrastructure for locks. Most frequently triggers database table creation and index creation.

      If it is not executed explicitly, connector may execute it during first acquire acquisition or release.

    • acquire

      @NotNull @NotNull io.reactivex.rxjava3.core.Single<com.coditory.sherlock.connector.AcquireResult> acquire(@NotNull @NotNull com.coditory.sherlock.LockRequest lockRequest)
      Acquire a lock.
    • acquireOrProlong

      @NotNull @NotNull io.reactivex.rxjava3.core.Single<com.coditory.sherlock.connector.AcquireResult> acquireOrProlong(com.coditory.sherlock.LockRequest lockRequest)
      Acquire a lock or prolong it if it was acquired by the same instance.
    • forceAcquire

      @NotNull @NotNull io.reactivex.rxjava3.core.Single<com.coditory.sherlock.connector.AcquireResult> forceAcquire(@NotNull @NotNull com.coditory.sherlock.LockRequest lockRequest)
      Acquire a lock even if it was already acquired by someone else
    • release

      @NotNull @NotNull io.reactivex.rxjava3.core.Single<com.coditory.sherlock.connector.ReleaseResult> release(@NotNull @NotNull String lockId, @NotNull @NotNull String ownerId)
      Unlock a lock if wat acquired by the same instance.
    • forceRelease

      @NotNull @NotNull io.reactivex.rxjava3.core.Single<com.coditory.sherlock.connector.ReleaseResult> forceRelease(@NotNull @NotNull String lockId)
      Release a lock without checking its owner or release date.
    • forceReleaseAll

      @NotNull @NotNull io.reactivex.rxjava3.core.Single<com.coditory.sherlock.connector.ReleaseResult> forceReleaseAll()
      Release all locks without checking their owners or release dates.