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 void
clearAllCheckSums()
void
destroy()
void
generateDeploymentId()
String
getDeploymentId()
int
getNextSequenceValue()
int
getPriority()
RanChangeSet
getRanChangeSet(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().Date
getRanDate(ChangeSet changeSet)
Returns the date the given changeSet was ran.ChangeSet.RunStatus
getRunStatus(ChangeSet changeSet)
void
init()
Ensures the change log history container is correctly initialized for use.boolean
isDatabaseChecksumsCompatible()
This method should return true if all checksums in dbcl table have the same version as {@link liquibase.ChecksumVersion#latest().getVersion()}.void
removeFromHistory(ChangeSet changeSet)
void
reset()
void
resetDeploymentId()
void
setDatabase(Database database)
void
setExecType(ChangeSet changeSet, ChangeSet.ExecType execType)
boolean
supports(Database database)
void
tag(String tagString)
boolean
tagExists(String tag)
void
upgradeChecksums(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:
getPriority
in interfaceChangeLogHistoryService
-
supports
public boolean supports(Database database)
- Specified by:
supports
in interfaceChangeLogHistoryService
-
setDatabase
public void setDatabase(Database database)
- Specified by:
setDatabase
in interfaceChangeLogHistoryService
-
reset
public void reset()
- Specified by:
reset
in interfaceChangeLogHistoryService
-
init
public void init() throws DatabaseException
Description copied from interface:ChangeLogHistoryService
Ensures 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:
init
in interfaceChangeLogHistoryService
- Throws:
DatabaseException
-
upgradeChecksums
public void upgradeChecksums(DatabaseChangeLog databaseChangeLog, Contexts contexts, LabelExpression labels) throws DatabaseException
Description copied from interface:ChangeLogHistoryService
Updates null checksum values- Specified by:
upgradeChecksums
in interfaceChangeLogHistoryService
- Throws:
DatabaseException
-
getRanChangeSets
public List<RanChangeSet> getRanChangeSets() throws DatabaseException
- Specified by:
getRanChangeSets
in interfaceChangeLogHistoryService
- Throws:
DatabaseException
-
getRanChangeSets
public List<RanChangeSet> getRanChangeSets(boolean a) throws DatabaseException
Description copied from interface:ChangeLogHistoryService
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().- Specified by:
getRanChangeSets
in interfaceChangeLogHistoryService
- Throws:
DatabaseException
-
getRanChangeSet
public RanChangeSet getRanChangeSet(ChangeSet changeSet) throws DatabaseException, DatabaseHistoryException
- Specified by:
getRanChangeSet
in interfaceChangeLogHistoryService
- Throws:
DatabaseException
DatabaseHistoryException
-
getRunStatus
public ChangeSet.RunStatus getRunStatus(ChangeSet changeSet) throws DatabaseException, DatabaseHistoryException
- Specified by:
getRunStatus
in interfaceChangeLogHistoryService
- Throws:
DatabaseException
DatabaseHistoryException
-
getRanDate
public Date getRanDate(ChangeSet changeSet) throws DatabaseException, DatabaseHistoryException
Description copied from interface:ChangeLogHistoryService
Returns the date the given changeSet was ran. Returns null if changeSet was not null.- Specified by:
getRanDate
in interfaceChangeLogHistoryService
- Throws:
DatabaseException
DatabaseHistoryException
-
setExecType
public void setExecType(ChangeSet changeSet, ChangeSet.ExecType execType) throws DatabaseException
- Specified by:
setExecType
in interfaceChangeLogHistoryService
- Throws:
DatabaseException
-
removeFromHistory
public void removeFromHistory(ChangeSet changeSet) throws DatabaseException
- Specified by:
removeFromHistory
in interfaceChangeLogHistoryService
- Throws:
DatabaseException
-
getNextSequenceValue
public int getNextSequenceValue() throws LiquibaseException
- Specified by:
getNextSequenceValue
in interfaceChangeLogHistoryService
- Throws:
LiquibaseException
-
tag
public void tag(String tagString) throws DatabaseException
- Specified by:
tag
in interfaceChangeLogHistoryService
- Throws:
DatabaseException
-
tagExists
public boolean tagExists(String tag) throws DatabaseException
- Specified by:
tagExists
in interfaceChangeLogHistoryService
- Throws:
DatabaseException
-
clearAllCheckSums
public void clearAllCheckSums() throws LiquibaseException
- Specified by:
clearAllCheckSums
in interfaceChangeLogHistoryService
- Throws:
LiquibaseException
-
destroy
public void destroy() throws DatabaseException
- Specified by:
destroy
in interfaceChangeLogHistoryService
- Throws:
DatabaseException
-
getDeploymentId
public String getDeploymentId()
- Specified by:
getDeploymentId
in interfaceChangeLogHistoryService
-
resetDeploymentId
public void resetDeploymentId()
- Specified by:
resetDeploymentId
in interfaceChangeLogHistoryService
-
generateDeploymentId
public void generateDeploymentId()
- Specified by:
generateDeploymentId
in interfaceChangeLogHistoryService
-
isDatabaseChecksumsCompatible
public boolean isDatabaseChecksumsCompatible()
Description copied from interface:ChangeLogHistoryService
This 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:
isDatabaseChecksumsCompatible
in interfaceChangeLogHistoryService
- Returns:
- false if we have checksums different from {@link liquibase.ChecksumVersion#latest().getVersion()} in the dbcl table.
-
-