Class LiquibaseContext

  • All Implemented Interfaces:
    AutoCloseable

    public class LiquibaseContext
    extends liquibase.Liquibase
    implements AutoCloseable
    The quarkus liquibase context
    • Field Summary

      • Fields inherited from class liquibase.Liquibase

        CHANGESET_ID_AUTHOR_PART, CHANGESET_ID_CHANGELOG_PART, CHANGESET_ID_CHANGESET_PART, CHANGESET_ID_NUM_PARTS, database, MSG_COULD_NOT_RELEASE_LOCK
    • Constructor Summary

      Constructors 
      Constructor Description
      LiquibaseContext​(LiquibaseConfig config, liquibase.resource.ResourceAccessor resourceAccessor, liquibase.database.Database database)
      The default constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void changeLogSync()
      Implementation of the Liquibase.changeLogSync(Contexts, LabelExpression) method.
      void changeLogSync​(Writer output)
      Implementation of the Liquibase.changeLogSync(Contexts, LabelExpression, Writer) method.
      void checkLiquibaseTables​(boolean updateExistingNullChecksums, liquibase.changelog.DatabaseChangeLog databaseChangeLog)
      Implementation of the Liquibase.checkLiquibaseTables(boolean, DatabaseChangeLog, Contexts, LabelExpression) method.
      void close()
      Close the database connection for the liquibase instance.
      liquibase.Contexts createContexts()
      Creates the default contexts base on the configuration
      liquibase.LabelExpression createLabels()
      Creates the default labels base on the configuration
      void futureRollbackSQL​(Integer count, Writer output, boolean checkLiquibaseTables)
      Implementation of the Liquibase.futureRollbackSQL(Integer, Contexts, LabelExpression, Writer, boolean) method.
      void futureRollbackSQL​(String tag, Writer output)
      Implementation of the Liquibase.futureRollbackSQL(String, Contexts, LabelExpression, Writer) method.
      String getChangeLog()
      Gets the change log file path
      List<liquibase.changelog.ChangeSetStatus> getChangeSetStatuses()
      Implementation of the Liquibase.getChangeSetStatuses(Contexts, LabelExpression, boolean) method
      LiquibaseConfig getConfiguration()
      Gets the liquibase configuration
      Collection<liquibase.changelog.RanChangeSet> listUnexpectedChangeSets()
      Implementation of the Liquibase.listUnexpectedChangeSets(Contexts, LabelExpression) method.
      List<liquibase.changelog.ChangeSet> listUnrunChangeSets()
      Implementation of the Liquibase.listUnrunChangeSets(Contexts, LabelExpression, boolean) method
      void markNextChangeSetRan()
      Implementation of the Liquibase.markNextChangeSetRan(Contexts, LabelExpression) method.
      void markNextChangeSetRan​(Writer output)
      Implementation of the Liquibase.markNextChangeSetRan(Contexts, LabelExpression, Writer) method.
      void reportStatus​(boolean verbose, Writer output)
      Implementation of the Liquibase.reportStatus(boolean, Contexts, Writer) method.
      void reportUnexpectedChangeSets​(boolean verbose, Writer output)
      Implementation of the Liquibase.reportStatus(boolean, Contexts, LabelExpression, Writer) method
      void rollback​(int changesToRollback, String rollbackScript)
      Implementation of the Liquibase.rollback(int, String, Contexts, LabelExpression) method.
      void rollback​(int changesToRollback, String rollbackScript, Writer output)
      Implementation of the Liquibase.rollback(int, String, Contexts, LabelExpression, Writer) method.
      void rollback​(String tagToRollBackTo, String rollbackScript)
      Implementation of the Liquibase.rollback(String, String, Contexts, LabelExpression) method.
      void rollback​(String tagToRollBackTo, String rollbackScript, Writer output)
      Implementation of the Liquibase.rollback(String, String, Contexts, LabelExpression, Writer) method.
      void rollback​(Date dateToRollBackTo, String rollbackScript)
      Implementation of the Liquibase.rollback(Date, String, Contexts, LabelExpression) method.
      void rollback​(Date dateToRollBackTo, String rollbackScript, Writer output)
      Implementation of the Liquibase.rollback(Date, String, Contexts, LabelExpression, Writer) method.
      void rollback​(Date dateToRollBackTo, String rollbackScript, liquibase.Contexts contexts, liquibase.LabelExpression labelExpression, Writer output)
      Implementation of the Liquibase.rollback(Date, String, Contexts, LabelExpression, Writer) method.
      void update()
      Implementation of the Liquibase.update(Contexts, LabelExpression) method
      void update​(int changesToApply)
      Implementation of the Liquibase.rollback(int, String, Contexts, LabelExpression) method.
      void update​(int changesToApply, Writer output)
      Implementation of the Liquibase.rollback(int, String, Contexts, LabelExpression, Writer) method.
      void update​(String tag, Writer output)
      Implementation of the Liquibase.update(String, Contexts, LabelExpression, Writer) method
      void updateTestingRollback()
      Implementation of the Liquibase.updateTestingRollback(String, Contexts, LabelExpression) method.
      • Methods inherited from class liquibase.Liquibase

        buildChangeLogIterator, buildRawSQLChange, calculateCheckSum, calculateCheckSum, changeLogSync, changeLogSync, changeLogSync, changeLogSync, changeLogSync, changeLogSync, changeLogSync, changeLogSync, changeLogSync, checkLiquibaseTables, clearCheckSums, createRollbackVisitor, createUpdateVisitor, diff, dropAll, dropAll, executeRollbackScript, forceReleaseLocks, futureRollbackSQL, futureRollbackSQL, futureRollbackSQL, futureRollbackSQL, futureRollbackSQL, futureRollbackSQL, futureRollbackSQL, futureRollbackSQL, futureRollbackSQL, futureRollbackSQL, generateChangeLog, generateChangeLog, generateDocumentation, generateDocumentation, generateDocumentation, getChangeLogFile, getChangeLogParameters, getChangeSetStatuses, getChangeSetStatuses, getChangeSetStatuses, getConnection, getDatabase, getDatabaseChangeLog, getHubConnectionId, getLog, getResourceAccessor, getStandardChangelogIterator, isSafeToRunUpdate, listLocks, listUnexpectedChangeSets, listUnexpectedChangeSets, listUnrunChangeSets, listUnrunChangeSets, listUnrunChangeSets, markNextChangeSetRan, markNextChangeSetRan, markNextChangeSetRan, markNextChangeSetRan, outputHeader, removeRunStatus, reportLocks, reportStatus, reportStatus, reportStatus, reportUnexpectedChangeSets, reportUnexpectedChangeSets, resetServices, rollback, rollback, rollback, rollback, rollback, rollback, rollback, rollback, rollback, rollback, rollback, rollback, rollback, rollback, rollback, rollback, rollback, rollback, rollback, rollback, rollback, rollback, rollback, setChangeExecListener, setChangeLogParameter, setChangeLogSyncListener, setHubConnectionId, tag, tagExists, update, update, update, update, update, update, update, update, update, update, update, update, update, update, update, update, update, updateTestingRollback, updateTestingRollback, updateTestingRollback, validate
    • Constructor Detail

      • LiquibaseContext

        public LiquibaseContext​(LiquibaseConfig config,
                                liquibase.resource.ResourceAccessor resourceAccessor,
                                liquibase.database.Database database)
        The default constructor
        Parameters:
        config - the liquibase configuration
        resourceAccessor - the liquibase resource accessor
        database - the liquibase database
    • Method Detail

      • getConfiguration

        public LiquibaseConfig getConfiguration()
        Gets the liquibase configuration
        Returns:
        the liquibase configuration
      • getChangeLog

        public String getChangeLog()
        Gets the change log file path
        Returns:
        the change log file path
      • createLabels

        public liquibase.LabelExpression createLabels()
        Creates the default labels base on the configuration
        Returns:
        the label expression
      • createContexts

        public liquibase.Contexts createContexts()
        Creates the default contexts base on the configuration
        Returns:
        the contexts
      • getChangeSetStatuses

        public List<liquibase.changelog.ChangeSetStatus> getChangeSetStatuses()
                                                                       throws liquibase.exception.LiquibaseException
        Implementation of the Liquibase.getChangeSetStatuses(Contexts, LabelExpression, boolean) method
        Returns:
        the list of change set
        Throws:
        liquibase.exception.LiquibaseException - if the method fails
      • update

        public void update()
                    throws liquibase.exception.LiquibaseException
        Implementation of the Liquibase.update(Contexts, LabelExpression) method
        Throws:
        liquibase.exception.LiquibaseException - if the method fails
      • listUnrunChangeSets

        public List<liquibase.changelog.ChangeSet> listUnrunChangeSets()
                                                                throws liquibase.exception.LiquibaseException
        Implementation of the Liquibase.listUnrunChangeSets(Contexts, LabelExpression, boolean) method
        Returns:
        the list of change set
        Throws:
        liquibase.exception.LiquibaseException - if the method fails
      • update

        public void update​(String tag,
                           Writer output)
                    throws liquibase.exception.LiquibaseException
        Implementation of the Liquibase.update(String, Contexts, LabelExpression, Writer) method
        Overrides:
        update in class liquibase.Liquibase
        Parameters:
        tag - the tag
        output - the output
        Throws:
        liquibase.exception.LiquibaseException - if the method fails
      • update

        public void update​(int changesToApply)
                    throws liquibase.exception.LiquibaseException
        Implementation of the Liquibase.rollback(int, String, Contexts, LabelExpression) method.
        Parameters:
        changesToApply - changes to apply
        Throws:
        liquibase.exception.LiquibaseException - if the method fails
      • update

        public void update​(int changesToApply,
                           Writer output)
                    throws liquibase.exception.LiquibaseException
        Implementation of the Liquibase.rollback(int, String, Contexts, LabelExpression, Writer) method.
        Parameters:
        changesToApply - changes to apply
        output - the output
        Throws:
        liquibase.exception.LiquibaseException - if the method fails
      • rollback

        public void rollback​(int changesToRollback,
                             String rollbackScript,
                             Writer output)
                      throws liquibase.exception.LiquibaseException
        Implementation of the Liquibase.rollback(int, String, Contexts, LabelExpression, Writer) method.
        Overrides:
        rollback in class liquibase.Liquibase
        Parameters:
        changesToRollback - changes to roll back
        rollbackScript - the rollback script
        output - the output
        Throws:
        liquibase.exception.LiquibaseException - if the method fails
      • rollback

        public void rollback​(int changesToRollback,
                             String rollbackScript)
                      throws liquibase.exception.LiquibaseException
        Implementation of the Liquibase.rollback(int, String, Contexts, LabelExpression) method.
        Overrides:
        rollback in class liquibase.Liquibase
        Parameters:
        changesToRollback - changes to roll back
        rollbackScript - the rollback script
        Throws:
        liquibase.exception.LiquibaseException - if the method fails
      • rollback

        public void rollback​(String tagToRollBackTo,
                             String rollbackScript,
                             Writer output)
                      throws liquibase.exception.LiquibaseException
        Implementation of the Liquibase.rollback(String, String, Contexts, LabelExpression, Writer) method.
        Overrides:
        rollback in class liquibase.Liquibase
        Parameters:
        tagToRollBackTo - tag to roll back to
        rollbackScript - the rollback script
        output - the output
        Throws:
        liquibase.exception.LiquibaseException - if the method fails
      • rollback

        public void rollback​(String tagToRollBackTo,
                             String rollbackScript)
                      throws liquibase.exception.LiquibaseException
        Implementation of the Liquibase.rollback(String, String, Contexts, LabelExpression) method.
        Overrides:
        rollback in class liquibase.Liquibase
        Parameters:
        tagToRollBackTo - tag to roll back to
        rollbackScript - the rollback script
        Throws:
        liquibase.exception.LiquibaseException - if the method fails
      • rollback

        public void rollback​(Date dateToRollBackTo,
                             String rollbackScript,
                             Writer output)
                      throws liquibase.exception.LiquibaseException
        Implementation of the Liquibase.rollback(Date, String, Contexts, LabelExpression, Writer) method.
        Overrides:
        rollback in class liquibase.Liquibase
        Parameters:
        output - the output
        dateToRollBackTo - date to roll back to
        rollbackScript - the rollback script
        Throws:
        liquibase.exception.LiquibaseException - if the method fails
      • rollback

        public void rollback​(Date dateToRollBackTo,
                             String rollbackScript,
                             liquibase.Contexts contexts,
                             liquibase.LabelExpression labelExpression,
                             Writer output)
                      throws liquibase.exception.LiquibaseException
        Implementation of the Liquibase.rollback(Date, String, Contexts, LabelExpression, Writer) method.
        Overrides:
        rollback in class liquibase.Liquibase
        Parameters:
        output - the output
        dateToRollBackTo - date to roll back to
        rollbackScript - the rollback script
        contexts - the contexts
        labelExpression - the label expression
        Throws:
        liquibase.exception.LiquibaseException - if the method fails
      • rollback

        public void rollback​(Date dateToRollBackTo,
                             String rollbackScript)
                      throws liquibase.exception.LiquibaseException
        Implementation of the Liquibase.rollback(Date, String, Contexts, LabelExpression) method.
        Overrides:
        rollback in class liquibase.Liquibase
        Parameters:
        dateToRollBackTo - date to roll back to
        rollbackScript - the rollback script
        Throws:
        liquibase.exception.LiquibaseException - if the method fails
      • changeLogSync

        public void changeLogSync()
                           throws liquibase.exception.LiquibaseException
        Implementation of the Liquibase.changeLogSync(Contexts, LabelExpression) method.
        Throws:
        liquibase.exception.LiquibaseException - if the method fails
      • changeLogSync

        public void changeLogSync​(Writer output)
                           throws liquibase.exception.LiquibaseException
        Implementation of the Liquibase.changeLogSync(Contexts, LabelExpression, Writer) method.
        Parameters:
        output - the output
        Throws:
        liquibase.exception.LiquibaseException - if the method fails
      • markNextChangeSetRan

        public void markNextChangeSetRan​(Writer output)
                                  throws liquibase.exception.LiquibaseException
        Implementation of the Liquibase.markNextChangeSetRan(Contexts, LabelExpression, Writer) method.
        Parameters:
        output - the output
        Throws:
        liquibase.exception.LiquibaseException - if the method fails
      • markNextChangeSetRan

        public void markNextChangeSetRan()
                                  throws liquibase.exception.LiquibaseException
        Implementation of the Liquibase.markNextChangeSetRan(Contexts, LabelExpression) method.
        Throws:
        liquibase.exception.LiquibaseException - if the method fails
      • futureRollbackSQL

        public void futureRollbackSQL​(String tag,
                                      Writer output)
                               throws liquibase.exception.LiquibaseException
        Implementation of the Liquibase.futureRollbackSQL(String, Contexts, LabelExpression, Writer) method.
        Overrides:
        futureRollbackSQL in class liquibase.Liquibase
        Parameters:
        tag - the tag
        output - the output
        Throws:
        liquibase.exception.LiquibaseException - if the method fails
      • futureRollbackSQL

        public void futureRollbackSQL​(Integer count,
                                      Writer output,
                                      boolean checkLiquibaseTables)
                               throws liquibase.exception.LiquibaseException
        Implementation of the Liquibase.futureRollbackSQL(Integer, Contexts, LabelExpression, Writer, boolean) method.
        Parameters:
        count - the count
        output - the output
        checkLiquibaseTables - check liquibase tables
        Throws:
        liquibase.exception.LiquibaseException - if the method fails
      • updateTestingRollback

        public void updateTestingRollback()
                                   throws liquibase.exception.LiquibaseException
        Implementation of the Liquibase.updateTestingRollback(String, Contexts, LabelExpression) method.
        Throws:
        liquibase.exception.LiquibaseException - if the method fails.
      • checkLiquibaseTables

        public void checkLiquibaseTables​(boolean updateExistingNullChecksums,
                                         liquibase.changelog.DatabaseChangeLog databaseChangeLog)
                                  throws liquibase.exception.LiquibaseException
        Implementation of the Liquibase.checkLiquibaseTables(boolean, DatabaseChangeLog, Contexts, LabelExpression) method.
        Parameters:
        updateExistingNullChecksums - update existing null checksums
        databaseChangeLog - database change log
        Throws:
        liquibase.exception.LiquibaseException - if the method fails.
      • reportStatus

        public void reportStatus​(boolean verbose,
                                 Writer output)
                          throws liquibase.exception.LiquibaseException
        Implementation of the Liquibase.reportStatus(boolean, Contexts, Writer) method.
        Parameters:
        verbose - the verbose flag
        output - the output
        Throws:
        liquibase.exception.LiquibaseException - if the method fails.
      • listUnexpectedChangeSets

        public Collection<liquibase.changelog.RanChangeSet> listUnexpectedChangeSets()
                                                                              throws liquibase.exception.LiquibaseException
        Implementation of the Liquibase.listUnexpectedChangeSets(Contexts, LabelExpression) method.
        Returns:
        the collection of the ran change sets
        Throws:
        liquibase.exception.LiquibaseException - if the method fails.
      • reportUnexpectedChangeSets

        public void reportUnexpectedChangeSets​(boolean verbose,
                                               Writer output)
                                        throws liquibase.exception.LiquibaseException
        Implementation of the Liquibase.reportStatus(boolean, Contexts, LabelExpression, Writer) method
        Parameters:
        verbose - the verbose flag
        output - the writer output
        Throws:
        liquibase.exception.LiquibaseException - if the method fails.
      • close

        public void close()
                   throws liquibase.exception.LiquibaseException
        Close the database connection for the liquibase instance.
        Specified by:
        close in interface AutoCloseable
        Overrides:
        close in class liquibase.Liquibase
        Throws:
        liquibase.exception.LiquibaseException - if the method fails