Class LiquibaseContext

java.lang.Object
liquibase.Liquibase
io.quarkus.liquibase.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

    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

    Modifier and Type
    Method
    Description
    void
    Implementation of the Liquibase.changeLogSync(Contexts, LabelExpression) method.
    void
    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 the database connection for the liquibase instance.
    liquibase.Contexts
    Creates the default contexts base on the configuration
    liquibase.LabelExpression
    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
    Implementation of the Liquibase.futureRollbackSQL(String, Contexts, LabelExpression, Writer) method.
    Gets the change log file path
    List<liquibase.changelog.ChangeSetStatus>
    Implementation of the Liquibase.getChangeSetStatuses(Contexts, LabelExpression, boolean) method
    Gets the liquibase configuration
    Collection<liquibase.changelog.RanChangeSet>
    Implementation of the Liquibase.listUnexpectedChangeSets(Contexts, LabelExpression) method.
    List<liquibase.changelog.ChangeSet>
    Implementation of the Liquibase.listUnrunChangeSets(Contexts, LabelExpression, boolean) method
    void
    Implementation of the Liquibase.markNextChangeSetRan(Contexts, LabelExpression) method.
    void
    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
    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
    Implementation of the Liquibase.updateTestingRollback(String, Contexts, LabelExpression) method.

    Methods inherited from class liquibase.Liquibase

    calculateCheckSum, calculateCheckSum, changeLogSync, changeLogSync, changeLogSync, changeLogSync, changeLogSync, changeLogSync, changeLogSync, changeLogSync, changeLogSync, checkLiquibaseTables, clearCheckSums, diff, dropAll, dropAll, forceReleaseLocks, futureRollbackSQL, futureRollbackSQL, futureRollbackSQL, futureRollbackSQL, futureRollbackSQL, futureRollbackSQL, futureRollbackSQL, futureRollbackSQL, futureRollbackSQL, futureRollbackSQL, generateChangeLog, generateChangeLog, generateDocumentation, generateDocumentation, generateDocumentation, generateDocumentation, getChangeLogFile, getChangeLogParameters, getChangeSetStatuses, getChangeSetStatuses, getChangeSetStatuses, getDatabase, getDatabaseChangeLog, getDefaultChangeExecListener, getLog, getResourceAccessor, getStandardChangelogIterator, isSafeToRunUpdate, isUpToDateFastCheck, listLocks, listUnexpectedChangeSets, listUnexpectedChangeSets, listUnrunChangeSets, listUnrunChangeSets, listUnrunChangeSets, markNextChangeSetRan, markNextChangeSetRan, markNextChangeSetRan, markNextChangeSetRan, outputHeader, 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, setShowSummary, setShowSummaryOutput, tag, tagExists, update, update, update, update, update, update, update, update, update, update, update, update, update, update, update, update, update, updateTestingRollback, updateTestingRollback, updateTestingRollback, validate

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • 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 Details

    • 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
      Overrides:
      update in class liquibase.Liquibase
      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