Package liquibase.changelog
Class StandardChangeLogHistoryService
- java.lang.Object
-
- liquibase.changelog.AbstractChangeLogHistoryService
-
- liquibase.changelog.StandardChangeLogHistoryService
-
- All Implemented Interfaces:
ChangeLogHistoryService
,Plugin
public class StandardChangeLogHistoryService extends AbstractChangeLogHistoryService
-
-
Field Summary
Fields Modifier and Type Field Description protected static String
CONTEXTS_SIZE
protected static String
LABELS_SIZE
-
Fields inherited from interface liquibase.plugin.Plugin
PRIORITY_DATABASE, PRIORITY_DEFAULT, PRIORITY_NOT_APPLICABLE, PRIORITY_SPECIALIZED
-
-
Constructor Summary
Constructors Constructor Description StandardChangeLogHistoryService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canCreateChangeLogTable()
void
clearAllCheckSums()
void
destroy()
protected String
getCharTypeName()
protected String
getContextsSize()
String
getDatabaseChangeLogTableName()
protected String
getLabelsSize()
String
getLiquibaseCatalogName()
String
getLiquibaseSchemaName()
int
getNextSequenceValue()
int
getPriority()
RanChangeSet
getRanChangeSet(ChangeSet changeSet)
List<RanChangeSet>
getRanChangeSets()
Returns the ChangeSets that have been run against the current getDatabase().boolean
hasDatabaseChangeLogTable()
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()}.List<Map<String,?>>
queryDatabaseChangeLogTable(Database database)
void
removeFromHistory(ChangeSet changeSet)
void
reset()
void
setExecType(ChangeSet changeSet, ChangeSet.ExecType execType)
boolean
supports(Database database)
void
tag(String tagString)
Tags the database changelog with the given string.boolean
tagExists(String tag)
void
upgradeChecksums(DatabaseChangeLog databaseChangeLog, Contexts contexts, LabelExpression labels)
Updates null checksum values-
Methods inherited from class liquibase.changelog.AbstractChangeLogHistoryService
generateDeploymentId, getDatabase, getDeploymentId, getLastDeploymentId, getRanDate, getRunStatus, replaceChecksum, resetDeploymentId, setDatabase
-
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
getRanChangeSets
-
-
-
-
Field Detail
-
LABELS_SIZE
protected static final String LABELS_SIZE
- See Also:
- Constant Field Values
-
CONTEXTS_SIZE
protected static final String CONTEXTS_SIZE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getPriority
public int getPriority()
-
supports
public boolean supports(Database database)
-
getDatabaseChangeLogTableName
public String getDatabaseChangeLogTableName()
-
getLiquibaseSchemaName
public String getLiquibaseSchemaName()
-
getLiquibaseCatalogName
public String getLiquibaseCatalogName()
-
canCreateChangeLogTable
public boolean canCreateChangeLogTable()
-
reset
public void reset()
- Specified by:
reset
in interfaceChangeLogHistoryService
- Overrides:
reset
in classAbstractChangeLogHistoryService
-
hasDatabaseChangeLogTable
public boolean hasDatabaseChangeLogTable()
-
getCharTypeName
protected String getCharTypeName()
-
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.- 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
- Overrides:
upgradeChecksums
in classAbstractChangeLogHistoryService
- Throws:
DatabaseException
-
getRanChangeSets
public List<RanChangeSet> getRanChangeSets() throws DatabaseException
Returns the ChangeSets that have been run against the current getDatabase().- Throws:
DatabaseException
-
queryDatabaseChangeLogTable
public List<Map<String,?>> queryDatabaseChangeLogTable(Database database) throws DatabaseException
- Throws:
DatabaseException
-
getRanChangeSet
public RanChangeSet getRanChangeSet(ChangeSet changeSet) throws DatabaseException, DatabaseHistoryException
- Specified by:
getRanChangeSet
in interfaceChangeLogHistoryService
- Overrides:
getRanChangeSet
in classAbstractChangeLogHistoryService
- Throws:
DatabaseException
DatabaseHistoryException
-
setExecType
public void setExecType(ChangeSet changeSet, ChangeSet.ExecType execType) throws DatabaseException
- Throws:
DatabaseException
-
removeFromHistory
public void removeFromHistory(ChangeSet changeSet) throws DatabaseException
- Throws:
DatabaseException
-
getNextSequenceValue
public int getNextSequenceValue() throws LiquibaseException
- Throws:
LiquibaseException
-
tag
public void tag(String tagString) throws DatabaseException
Tags the database changelog with the given string.- Throws:
DatabaseException
-
tagExists
public boolean tagExists(String tag) throws DatabaseException
- Throws:
DatabaseException
-
clearAllCheckSums
public void clearAllCheckSums() throws LiquibaseException
- Throws:
LiquibaseException
-
destroy
public void destroy() throws DatabaseException
- Throws:
DatabaseException
-
getLabelsSize
protected String getLabelsSize()
-
getContextsSize
protected String getContextsSize()
-
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.- Returns:
- false if we have checksums different from {@link liquibase.ChecksumVersion#latest().getVersion()} in the dbcl table.
-
-