1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.common.impex.schema.service;
17
18 import org.kuali.common.impex.model.Schema;
19 import org.kuali.common.impex.schema.service.impl.DefaultExtractSchemaService;
20 import org.kuali.common.util.execute.Executable;
21 import org.springframework.util.Assert;
22
23 public class ExtractSchemaExecutable implements Executable {
24
25 public static final boolean DEFAULT_SKIP = false;
26 public static final ExtractSchemaService DEFAULT_SERVICE = new DefaultExtractSchemaService();
27
28 boolean skip = DEFAULT_SKIP;
29 ExtractSchemaService service = DEFAULT_SERVICE;
30
31
32 ExtractSchemaContext context;
33
34
35 ExtractSchemaResult result;
36
37 @Override
38 public void execute() {
39
40 if (skip) {
41 return;
42 }
43
44 Assert.notNull(service, "service is null");
45 Assert.notNull(context, "context is null");
46
47 Schema schema = service.getSchema(context);
48 this.result = new ExtractSchemaResult(schema);
49 }
50
51
52
53
54 public ExtractSchemaResult getResult() {
55 return result;
56 }
57
58 public ExtractSchemaContext getContext() {
59 return context;
60 }
61
62 public void setContext(ExtractSchemaContext context) {
63 this.context = context;
64 }
65
66 public ExtractSchemaService getService() {
67 return service;
68 }
69
70 public void setService(ExtractSchemaService service) {
71 this.service = service;
72 }
73
74 public boolean isSkip() {
75 return skip;
76 }
77
78 public void setSkip(boolean skip) {
79 this.skip = skip;
80 }
81 }