org.keycloak.models.dblock

## Interface DBLockProvider

- All Superinterfaces:
    Provider
  All Known Implementing Classes:
    LiquibaseDBLockProvider, MongoDBLockProvider

      public interface DBLockProvider
      extends Provider

  Global database lock to ensure that some actions in DB can be done just be one cluster node at a time.
  Author:
    Marek Posolda

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `destroyLockInfo()` Will destroy whole state of DB lock (drop table/collection to track locking).
    `boolean` | `hasLock()` Check if I have lock
    `void` | `releaseLock()` Release previously acquired lock
    `boolean` | `supportsForcedUnlock()`
    `void` | `waitForLock()` Try to retrieve DB lock or wait if retrieve was unsuccessful.

    - ### Methods inherited from interface org.keycloak.provider.Provider

      `close`

- - ### Method Detail

    - #### waitForLock

          void waitForLock()

      Try to retrieve DB lock or wait if retrieve was unsuccessful. Throw exception if lock can't be retrieved within specified timeout (900 seconds by default)

    - #### releaseLock

          void releaseLock()

      Release previously acquired lock

    - #### hasLock

          boolean hasLock()

      Check if I have lock
      Returns:

    - #### supportsForcedUnlock

          boolean supportsForcedUnlock()

      Returns:
        true if provider supports forced unlock at startup

    - #### destroyLockInfo

          void destroyLockInfo()

      Will destroy whole state of DB lock (drop table/collection to track locking).

Copyright © 2016 JBoss by Red Hat. All rights reserved.