1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.common.impex.database;
17
18 import org.kuali.common.impex.data.DumpDataExecutable;
19 import org.kuali.common.impex.model.Schema;
20 import org.kuali.common.impex.schema.execute.DumpSchemaExecutable;
21 import org.kuali.common.impex.schema.service.ExtractSchemaExecutable;
22 import org.kuali.common.util.Assert;
23 import org.kuali.common.util.execute.Executable;
24
25
26
27
28 public class DumpDatabaseExecutable implements Executable {
29
30 boolean skip;
31 Executable showConfigExecutable;
32 ExtractSchemaExecutable extractSchemaExecutable;
33 DumpSchemaExecutable dumpSchemaExecutable;
34 DumpDataExecutable dumpDataExecutable;
35
36 @Override
37 public void execute() {
38
39
40 if (skip) {
41 return;
42 }
43
44
45 Assert.notNull(showConfigExecutable, "showConfigExecutable is null");
46 Assert.notNull(extractSchemaExecutable, "extractSchemaExecutable is null");
47 Assert.notNull(dumpSchemaExecutable, "dumpSchemaExecutable is null");
48 Assert.notNull(dumpDataExecutable, "dumpDataExecutable is null");
49
50
51 showConfigExecutable.execute();
52
53
54 extractSchemaExecutable.execute();
55
56
57 Schema schema = extractSchemaExecutable.getResult().getSchema();
58
59
60 Assert.notNull(schema, "schema is null");
61
62
63 dumpSchemaExecutable.getRequest().setSchema(schema);
64 dumpSchemaExecutable.execute();
65
66
67 dumpDataExecutable.setSchema(schema);
68 dumpDataExecutable.execute();
69 }
70
71 public boolean isSkip() {
72 return skip;
73 }
74
75 public void setSkip(boolean skip) {
76 this.skip = skip;
77 }
78
79 public Executable getShowConfigExecutable() {
80 return showConfigExecutable;
81 }
82
83 public void setShowConfigExecutable(Executable showConfigExecutable) {
84 this.showConfigExecutable = showConfigExecutable;
85 }
86
87 public ExtractSchemaExecutable getExtractSchemaExecutable() {
88 return extractSchemaExecutable;
89 }
90
91 public void setExtractSchemaExecutable(ExtractSchemaExecutable extractSchemaExecutable) {
92 this.extractSchemaExecutable = extractSchemaExecutable;
93 }
94
95 public DumpSchemaExecutable getDumpSchemaExecutable() {
96 return dumpSchemaExecutable;
97 }
98
99 public void setDumpSchemaExecutable(DumpSchemaExecutable dumpSchemaExecutable) {
100 this.dumpSchemaExecutable = dumpSchemaExecutable;
101 }
102
103 public DumpDataExecutable getDumpDataExecutable() {
104 return dumpDataExecutable;
105 }
106
107 public void setDumpDataExecutable(DumpDataExecutable dumpDataExecutable) {
108 this.dumpDataExecutable = dumpDataExecutable;
109 }
110
111 }