Package liquibase.nosql.lockservice
Class AbstractNoSqlLockService<D extends AbstractNoSqlDatabase>
- java.lang.Object
-
- liquibase.nosql.lockservice.AbstractNoSqlLockService<D>
-
- All Implemented Interfaces:
liquibase.lockservice.LockService,liquibase.servicelocator.PrioritizedService
- Direct Known Subclasses:
CosmosLockService
public abstract class AbstractNoSqlLockService<D extends AbstractNoSqlDatabase> extends Object implements liquibase.lockservice.LockService
-
-
Constructor Summary
Constructors Constructor Description AbstractNoSqlLockService()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanacquireLock()protected abstract voidadjustRepository()protected abstract voidcreateRepository()voiddestroy()protected abstract voiddropRepository()protected abstract BooleanexistsRepository()voidforceReleaseLock()LonggetChangeLogLockRecheckTime()LonggetChangeLogLockWaitTime()DgetDatabase()StringgetDatabaseChangeLogLockTableName()NoSqlExecutorgetExecutor()protected abstract liquibase.logging.LoggergetLogger()intgetPriority()booleanhasChangeLogLock()voidinit()protected abstract BooleanisLocked()liquibase.lockservice.DatabaseChangeLogLock[]listLocks()protected abstract List<liquibase.lockservice.DatabaseChangeLogLock>queryLocks()voidreleaseLock()protected abstract intreplaceLock(boolean locked)voidreset()voidsetChangeLogLockRecheckTime(long changeLogLockRecheckTime)voidsetChangeLogLockWaitTime(long changeLogLockWaitTime)voidsetDatabase(liquibase.database.Database database)voidwaitForLock()
-
-
-
Method Detail
-
getPriority
public int getPriority()
- Specified by:
getPriorityin interfaceliquibase.servicelocator.PrioritizedService
-
setDatabase
public void setDatabase(liquibase.database.Database database)
- Specified by:
setDatabasein interfaceliquibase.lockservice.LockService
-
getDatabase
public D getDatabase()
-
getExecutor
public NoSqlExecutor getExecutor()
-
init
public void init() throws liquibase.exception.DatabaseException- Specified by:
initin interfaceliquibase.lockservice.LockService- Throws:
liquibase.exception.DatabaseException
-
hasChangeLogLock
public boolean hasChangeLogLock()
- Specified by:
hasChangeLogLockin interfaceliquibase.lockservice.LockService
-
waitForLock
public void waitForLock() throws liquibase.exception.LockException- Specified by:
waitForLockin interfaceliquibase.lockservice.LockService- Throws:
liquibase.exception.LockException
-
acquireLock
public boolean acquireLock() throws liquibase.exception.LockException- Specified by:
acquireLockin interfaceliquibase.lockservice.LockService- Throws:
liquibase.exception.LockException
-
releaseLock
public void releaseLock() throws liquibase.exception.LockException- Specified by:
releaseLockin interfaceliquibase.lockservice.LockService- Throws:
liquibase.exception.LockException
-
listLocks
public liquibase.lockservice.DatabaseChangeLogLock[] listLocks() throws liquibase.exception.LockException- Specified by:
listLocksin interfaceliquibase.lockservice.LockService- Throws:
liquibase.exception.LockException
-
forceReleaseLock
public void forceReleaseLock() throws liquibase.exception.LockException, liquibase.exception.DatabaseException- Specified by:
forceReleaseLockin interfaceliquibase.lockservice.LockService- Throws:
liquibase.exception.LockExceptionliquibase.exception.DatabaseException
-
reset
public void reset()
- Specified by:
resetin interfaceliquibase.lockservice.LockService
-
destroy
public void destroy()
- Specified by:
destroyin interfaceliquibase.lockservice.LockService
-
getDatabaseChangeLogLockTableName
public String getDatabaseChangeLogLockTableName()
-
getChangeLogLockRecheckTime
public Long getChangeLogLockRecheckTime()
-
setChangeLogLockRecheckTime
public void setChangeLogLockRecheckTime(long changeLogLockRecheckTime)
- Specified by:
setChangeLogLockRecheckTimein interfaceliquibase.lockservice.LockService
-
getChangeLogLockWaitTime
public Long getChangeLogLockWaitTime()
-
setChangeLogLockWaitTime
public void setChangeLogLockWaitTime(long changeLogLockWaitTime)
- Specified by:
setChangeLogLockWaitTimein interfaceliquibase.lockservice.LockService
-
getLogger
protected abstract liquibase.logging.Logger getLogger()
-
existsRepository
protected abstract Boolean existsRepository() throws liquibase.exception.DatabaseException
- Throws:
liquibase.exception.DatabaseException
-
createRepository
protected abstract void createRepository() throws liquibase.exception.DatabaseException- Throws:
liquibase.exception.DatabaseException
-
adjustRepository
protected abstract void adjustRepository() throws liquibase.exception.DatabaseException- Throws:
liquibase.exception.DatabaseException
-
dropRepository
protected abstract void dropRepository() throws liquibase.exception.DatabaseException- Throws:
liquibase.exception.DatabaseException
-
isLocked
protected abstract Boolean isLocked() throws liquibase.exception.DatabaseException
- Throws:
liquibase.exception.DatabaseException
-
replaceLock
protected abstract int replaceLock(boolean locked) throws liquibase.exception.DatabaseException- Throws:
liquibase.exception.DatabaseException
-
queryLocks
protected abstract List<liquibase.lockservice.DatabaseChangeLogLock> queryLocks() throws liquibase.exception.DatabaseException
- Throws:
liquibase.exception.DatabaseException
-
-