liquibase/liquibase — pull request #236 by nvoxland (2014-02-03 22:24:29+00:00)
Title: CORE-1751 More detailed API for returning changeSet statuses

Changed ChangeSetFilter.accepts interface to return a ChangeSetFilterResult object which includes on only whether the filter accepts the chagneSet but also the reason to accept it or not and the class of the filter.

Changed the ChangeSetVisitor.visit() implementation to take an additional attribute of the filter results.

Added a new SkippedChangeSetVisitor method like ChangeSetVisitor but with a skipped() method called by ChangeLogIterator when the changeSet is skipped.

With these new methods, created a StatusVisitor that will not execute changeSets but instead collect the status of each, including changeSets ran against the database that are no longer in the changelog. This class can be used with any combination of filters to report on what changesets will run and which will not.

Added a new Liquibase.getChangeSetStatuses() method which calls StatusVisitor() and returns the ChangeSetStatus objects.

An integration with StatusVisitor can inspect the ChangeSetStatus objects to determine if a changeSet was ran before, will run now, and the reasons for running or not. The reasons for running or not are free-text messages, but the type of the filter is stored in the ChangeSetStatus so it is possible to programatically check for the filter type that allowed it to be run or not (DbmsChangeSetFilter, ContexctChangeSetFilter, etc.)