01: package liquibase.change.custom;
02:
03: import liquibase.FileOpener;
04: import liquibase.database.Database;
05: import liquibase.database.structure.DatabaseObject;
06: import liquibase.exception.CustomChangeException;
07: import liquibase.exception.RollbackImpossibleException;
08: import liquibase.exception.SetupException;
09: import liquibase.exception.UnsupportedChangeException;
10:
11: import java.util.Set;
12:
13: public class ExampleCustomTaskChange implements CustomTaskChange,
14: CustomTaskRollback {
15:
16: private String helloTo;
17:
18: @SuppressWarnings({"UnusedDeclaration","FieldCanBeLocal"})
19: private FileOpener fileOpener;
20:
21: public String getHelloTo() {
22: return helloTo;
23: }
24:
25: public void setHelloTo(String helloTo) {
26: this .helloTo = helloTo;
27: }
28:
29: public void execute(Database database)
30: throws CustomChangeException, UnsupportedChangeException {
31: System.out.println("Hello " + getHelloTo());
32: }
33:
34: public void rollback(Database database)
35: throws CustomChangeException, UnsupportedChangeException,
36: RollbackImpossibleException {
37: System.out.println("Goodbye " + getHelloTo());
38: }
39:
40: public String getConfirmationMessage() {
41: return "Said Hello";
42: }
43:
44: public void setUp() throws SetupException {
45: ;
46: }
47:
48: public Set<DatabaseObject> getAffectedDatabaseObjects() {
49: return null;
50: }
51:
52: public void setFileOpener(FileOpener fileOpener) {
53: this.fileOpener = fileOpener;
54: }
55: }
|