Package liquibase.changelog
Class MockChangeLogHistoryService
- java.lang.Object
-
- liquibase.changelog.MockChangeLogHistoryService
-
- All Implemented Interfaces:
ChangeLogHistoryService,Plugin
public class MockChangeLogHistoryService extends Object implements ChangeLogHistoryService
-
-
Field Summary
Fields Modifier and Type Field Description List<RanChangeSet>ranChangeSets-
Fields inherited from interface liquibase.plugin.Plugin
PRIORITY_DATABASE, PRIORITY_DEFAULT, PRIORITY_NOT_APPLICABLE, PRIORITY_SPECIALIZED
-
-
Constructor Summary
Constructors Constructor Description MockChangeLogHistoryService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearAllCheckSums()voiddestroy()voidgenerateDeploymentId()StringgetDeploymentId()intgetNextSequenceValue()intgetPriority()RanChangeSetgetRanChangeSet(ChangeSet changeSet)List<RanChangeSet>getRanChangeSets()List<RanChangeSet>getRanChangeSets(boolean a)This method was created to clear out MD5sum for upgrade purpose but after some refactoring the logic was moved to Update commands and it should have been removed as everywhere it is called only with boolean false, so for core it is the same as getRanChangeSets().DategetRanDate(ChangeSet changeSet)Returns the date the given changeSet was ran.ChangeSet.RunStatusgetRunStatus(ChangeSet changeSet)voidinit()Ensures the change log history container is correctly initialized for use.booleanisDatabaseChecksumsCompatible()This method should return true if all checksums in dbcl table have the same version as {@link liquibase.ChecksumVersion#latest().getVersion()}.voidremoveFromHistory(ChangeSet changeSet)voidreset()voidresetDeploymentId()voidsetDatabase(Database database)voidsetExecType(ChangeSet changeSet, ChangeSet.ExecType execType)booleansupports(Database database)voidtag(String tagString)booleantagExists(String tag)voidupgradeChecksums(DatabaseChangeLog databaseChangeLog, Contexts contexts, LabelExpression labels)Updates null checksum values-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface liquibase.changelog.ChangeLogHistoryService
replaceChecksum
-
-
-
-
Field Detail
-
ranChangeSets
public List<RanChangeSet> ranChangeSets
-
-
Method Detail
-
getPriority
public int getPriority()
- Specified by:
getPriorityin interfaceChangeLogHistoryService
-
supports
public boolean supports(Database database)
- Specified by:
supportsin interfaceChangeLogHistoryService
-
setDatabase
public void setDatabase(Database database)
- Specified by:
setDatabasein interfaceChangeLogHistoryService
-
reset
public void reset()
- Specified by:
resetin interfaceChangeLogHistoryService
-
init
public void init() throws DatabaseExceptionDescription copied from interface:ChangeLogHistoryServiceEnsures the change log history container is correctly initialized for use. This method may be called multiple times so it should check state as needed.- Specified by:
initin interfaceChangeLogHistoryService- Throws:
DatabaseException
-
upgradeChecksums
public void upgradeChecksums(DatabaseChangeLog databaseChangeLog, Contexts contexts, LabelExpression labels) throws DatabaseException
Description copied from interface:ChangeLogHistoryServiceUpdates null checksum values- Specified by:
upgradeChecksumsin interfaceChangeLogHistoryService- Throws:
DatabaseException
-
getRanChangeSets
public List<RanChangeSet> getRanChangeSets() throws DatabaseException
- Specified by:
getRanChangeSetsin interfaceChangeLogHistoryService- Throws:
DatabaseException
-
getRanChangeSets
public List<RanChangeSet> getRanChangeSets(boolean a) throws DatabaseException
Description copied from interface:ChangeLogHistoryServiceThis method was created to clear out MD5sum for upgrade purpose but after some refactoring the logic was moved to Update commands and it should have been removed as everywhere it is called only with boolean false, so for core it is the same as getRanChangeSets().- Specified by:
getRanChangeSetsin interfaceChangeLogHistoryService- Throws:
DatabaseException
-
getRanChangeSet
public RanChangeSet getRanChangeSet(ChangeSet changeSet) throws DatabaseException, DatabaseHistoryException
- Specified by:
getRanChangeSetin interfaceChangeLogHistoryService- Throws:
DatabaseExceptionDatabaseHistoryException
-
getRunStatus
public ChangeSet.RunStatus getRunStatus(ChangeSet changeSet) throws DatabaseException, DatabaseHistoryException
- Specified by:
getRunStatusin interfaceChangeLogHistoryService- Throws:
DatabaseExceptionDatabaseHistoryException
-
getRanDate
public Date getRanDate(ChangeSet changeSet) throws DatabaseException, DatabaseHistoryException
Description copied from interface:ChangeLogHistoryServiceReturns the date the given changeSet was ran. Returns null if changeSet was not null.- Specified by:
getRanDatein interfaceChangeLogHistoryService- Throws:
DatabaseExceptionDatabaseHistoryException
-
setExecType
public void setExecType(ChangeSet changeSet, ChangeSet.ExecType execType) throws DatabaseException
- Specified by:
setExecTypein interfaceChangeLogHistoryService- Throws:
DatabaseException
-
removeFromHistory
public void removeFromHistory(ChangeSet changeSet) throws DatabaseException
- Specified by:
removeFromHistoryin interfaceChangeLogHistoryService- Throws:
DatabaseException
-
getNextSequenceValue
public int getNextSequenceValue() throws LiquibaseException- Specified by:
getNextSequenceValuein interfaceChangeLogHistoryService- Throws:
LiquibaseException
-
tag
public void tag(String tagString) throws DatabaseException
- Specified by:
tagin interfaceChangeLogHistoryService- Throws:
DatabaseException
-
tagExists
public boolean tagExists(String tag) throws DatabaseException
- Specified by:
tagExistsin interfaceChangeLogHistoryService- Throws:
DatabaseException
-
clearAllCheckSums
public void clearAllCheckSums() throws LiquibaseException- Specified by:
clearAllCheckSumsin interfaceChangeLogHistoryService- Throws:
LiquibaseException
-
destroy
public void destroy() throws DatabaseException- Specified by:
destroyin interfaceChangeLogHistoryService- Throws:
DatabaseException
-
getDeploymentId
public String getDeploymentId()
- Specified by:
getDeploymentIdin interfaceChangeLogHistoryService
-
resetDeploymentId
public void resetDeploymentId()
- Specified by:
resetDeploymentIdin interfaceChangeLogHistoryService
-
generateDeploymentId
public void generateDeploymentId()
- Specified by:
generateDeploymentIdin interfaceChangeLogHistoryService
-
isDatabaseChecksumsCompatible
public boolean isDatabaseChecksumsCompatible()
Description copied from interface:ChangeLogHistoryServiceThis method should return true if all checksums in dbcl table have the same version as {@link liquibase.ChecksumVersion#latest().getVersion()}. This method is used by Update command family in order to know if there are old checksum versions in the database that should be updated or if it can proceed with fast checksum update process. IF your implementation does not validate dbcl table then return false.- Specified by:
isDatabaseChecksumsCompatiblein interfaceChangeLogHistoryService- Returns:
- false if we have checksums different from {@link liquibase.ChecksumVersion#latest().getVersion()} in the dbcl table.
-
-