Interface IndexLockService

All Known Implementing Classes:
DefaultIndexLockService

public interface IndexLockService
Confluence has multiple indexes and some operations on them are mutually exclusive. This component is designed to help managing the state of the indexing processes. Each index has a lock which can be acquired and released. It is meant to be used by index managers (IncrementalIndexManager, FullReindexManager, not directly by the client code).
Since:
7.9.0
  • Method Details

    • tryLock

      boolean tryLock(SearchIndex index, long duration, TimeUnit timeUnit)
      Tries to acquire a lock on the index in given time limit.
      Returns:
      true if the lock was successfully acquired
    • tryLock

      boolean tryLock(EnumSet<SearchIndex> indices, long duration, TimeUnit timeUnit)
      Tries to acquire a lock on indices in given time limit. The invocation of this method should work in all-or-nothing way, no partial subset of the locks should be acquired.
      Returns:
      true if all locks were successfully acquired.
    • lock

      void lock(SearchIndex index)
      Blocks to acquire a lock on index.
    • lock

      void lock(EnumSet<SearchIndex> indices)
      Blocks to acquire a lock on indices. The invocation of this method should work in all-or-nothing way, no partial subset of the locks should be acquired.
    • unlock

      void unlock(SearchIndex index)
      Releases the lock held on index
      Throws:
      IllegalMonitorStateException - if the lock on the index has is not being held
    • unlock

      void unlock(EnumSet<SearchIndex> indices)
      Releases the lock held on indices. The invocation of this method should work in all-or-nothing way, no partial subset of the locks should be released.
      Throws:
      IllegalMonitorStateException - if the lock on one of the provided indices is not being held