org.keycloak.connections.jpa.updater.liquibase.lock

## Class LiquibaseDBLockProvider

- java.lang.Object
- - org.keycloak.connections.jpa.updater.liquibase.lock.LiquibaseDBLockProvider

- All Implemented Interfaces:
    DBLockProvider, Provider

      public class LiquibaseDBLockProvider
      extends Object
      implements DBLockProvider

  Author:
    Marek Posolda

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.keycloak.models.dblock.DBLockProvider

      `DBLockProvider.Namespace`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `LiquibaseDBLockProvider(LiquibaseDBLockProviderFactory factory, KeycloakSession session)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `void` | `destroyLockInfo()` Will destroy whole state of DB lock (drop table/collection to track locking).
    `DBLockProvider.Namespace` | `getCurrentLock()` Returns the current provider namespace locked or null
    `void` | `releaseLock()` Release previously acquired lock by this provider.
    `boolean` | `supportsForcedUnlock()`
    `void` | `waitForLock(DBLockProvider.Namespace lock)` Try to retrieve DB lock or wait if retrieve was unsuccessful.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### LiquibaseDBLockProvider

          public LiquibaseDBLockProvider(LiquibaseDBLockProviderFactory factory,
                                         KeycloakSession session)

  - ### Method Detail

    - #### waitForLock

          public void waitForLock(DBLockProvider.Namespace lock)

      Description copied from interface: `DBLockProvider`
      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) Throw exception if a different namespace has already been locked by this provider.
      Specified by:
        `waitForLock` in interface `DBLockProvider`
      Parameters:
        `lock` - The namespace to lock

    - #### releaseLock

          public void releaseLock()

      Description copied from interface: `DBLockProvider`
      Release previously acquired lock by this provider.
      Specified by:
        `releaseLock` in interface `DBLockProvider`

    - #### getCurrentLock

          public DBLockProvider.Namespace getCurrentLock()

      Description copied from interface: `DBLockProvider`
      Returns the current provider namespace locked or null
      Specified by:
        `getCurrentLock` in interface `DBLockProvider`
      Returns:
        The namespace locked or null if there is no lock

    - #### supportsForcedUnlock

          public boolean supportsForcedUnlock()

      Specified by:
        `supportsForcedUnlock` in interface `DBLockProvider`
      Returns:
        true if provider supports forced unlock at startup

    - #### destroyLockInfo

          public void destroyLockInfo()

      Description copied from interface: `DBLockProvider`
      Will destroy whole state of DB lock (drop table/collection to track locking).
      Specified by:
        `destroyLockInfo` in interface `DBLockProvider`

    - #### close

          public void close()

      Specified by:
        `close` in interface `Provider`

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