1 package org.kuali.ole.docstore.process.batch;
2
3 import java.util.HashSet;
4 import java.util.List;
5 import java.util.Set;
6 import javax.jcr.Session;
7
8 import org.kuali.ole.docstore.model.xmlpojo.ingest.RequestDocument;
9 import org.kuali.ole.docstore.transaction.TransactionManager;
10 import org.kuali.ole.docstore.utility.BulkIngestStatistics;
11
12
13
14
15
16
17 public class BulkProcessRequest {
18
19 public static Set<String> validOperationSet = getValidOperationSet();
20 protected String user;
21 protected BulkProcessOperation operation;
22 protected BulkProcessAction action;
23 protected String docCategory;
24 protected String docType;
25 protected String docFormat;
26 protected BulkIngestDataFormat dataFormat;
27 protected String dataFolder;
28 protected boolean doIndex;
29 protected int commitSize;
30
31 protected TransactionManager transactionManager;
32 protected Session session;
33 protected BulkProcessStatus status;
34 protected BulkIngestStatistics bulkIngestStatistics = BulkIngestStatistics.getInstance();
35 protected List<RequestDocument> previousBatchDocuments;
36
37 protected String bulkIngestFolder;
38
39 public enum BulkIngestDataFormat {
40 DOCSTORE, STANDARD
41 }
42
43 public enum BulkProcessAction {
44 START, STOP, STATUS, CLEAR
45 }
46
47 public enum BulkProcessStatus {
48 STARTED, STOPPED, DONE
49 }
50
51 public enum BulkProcessOperation {
52 INGEST, REINDEX, LINK
53 }
54
55 public String getUser() {
56 return user;
57 }
58
59 public void setUser(String user) {
60 this.user = user;
61 }
62
63 public BulkProcessOperation getOperation() {
64 return operation;
65 }
66
67 public void setOperation(BulkProcessOperation operation) {
68 this.operation = operation;
69 }
70
71 public BulkProcessAction getAction() {
72 return action;
73 }
74
75 public void setAction(BulkProcessAction action) {
76 this.action = action;
77 }
78
79 public String getDocCategory() {
80 return docCategory;
81 }
82
83 public void setDocCategory(String docCategory) {
84 this.docCategory = docCategory;
85 }
86
87 public String getDocType() {
88 return docType;
89 }
90
91 public void setDocType(String docType) {
92 this.docType = docType;
93 }
94
95 public String getDocFormat() {
96 return docFormat;
97 }
98
99 public void setDocFormat(String docFormat) {
100 this.docFormat = docFormat;
101 }
102
103 public BulkIngestDataFormat getDataFormat() {
104 return dataFormat;
105 }
106
107 public void setDataFormat(BulkIngestDataFormat dataFormat) {
108 this.dataFormat = dataFormat;
109 }
110
111 public BulkProcessStatus getStatus() {
112 return status;
113 }
114
115 public void setStatus(BulkProcessStatus status) {
116 this.status = status;
117 }
118
119 public int getCommitSize() {
120 return commitSize;
121 }
122
123 public void setCommitSize(int commitSize) {
124 this.commitSize = commitSize;
125 }
126
127 public boolean isDoIndex() {
128 return doIndex;
129 }
130
131 public void setDoIndex(boolean doIndex) {
132 this.doIndex = doIndex;
133 }
134
135 public BulkIngestStatistics getBulkIngestStatistics() {
136 return bulkIngestStatistics;
137 }
138
139 public void setBulkIngestStatistics(BulkIngestStatistics bulkIngestStatistics) {
140 this.bulkIngestStatistics = bulkIngestStatistics;
141 }
142
143 public String getDataFolder() {
144 return dataFolder;
145 }
146
147 public void setDataFolder(String dataFolder) {
148 this.dataFolder = dataFolder;
149 }
150
151 public Session getSession() {
152 return session;
153 }
154
155 public void setSession(Session session) {
156 this.session = session;
157 }
158
159 public List<RequestDocument> getPreviousBatchDocuments() {
160 return previousBatchDocuments;
161 }
162
163 public void setPreviousBatchDocuments(List<RequestDocument> previousBatchDocuments) {
164 this.previousBatchDocuments = previousBatchDocuments;
165 }
166
167 public TransactionManager getTransactionManager() {
168 return transactionManager;
169 }
170
171 public void setTransactionManager(TransactionManager transactionManager) {
172 this.transactionManager = transactionManager;
173 }
174
175 public String getBulkIngestFolder() {
176 return bulkIngestFolder;
177 }
178
179 public void setBulkIngestFolder(String bulkIngestFolder) {
180 this.bulkIngestFolder = bulkIngestFolder;
181 }
182
183 private static Set<String> getValidOperationSet() {
184 validOperationSet = new HashSet<String>();
185 validOperationSet.add(BulkProcessOperation.INGEST.toString());
186 validOperationSet.add(BulkProcessOperation.REINDEX.toString());
187 validOperationSet.add(BulkProcessOperation.LINK.toString());
188 return validOperationSet;
189 }
190 }