001 package org.kuali.ole.docstore.process.batch;
002
003 import java.util.List;
004 import javax.jcr.Session;
005
006 import org.kuali.ole.docstore.model.xmlpojo.ingest.RequestDocument;
007 import org.kuali.ole.docstore.transaction.TransactionManager;
008 import org.kuali.ole.docstore.utility.BulkIngestStatistics;
009
010 /**
011 * Contains the information related to a batch process.
012 * User: tirumalesh.b
013 * Date: 14/9/12 Time: 1:29 PM
014 */
015 public class BulkProcessRequest {
016 protected String user;
017 protected BulkProcessOperation operation;
018 protected BulkProcessAction action;
019 protected String docCategory;
020 protected String docType;
021 protected String docFormat;
022 protected BulkIngestDataFormat dataFormat;
023 protected String dataFolder;
024 protected boolean doIndex; // whether to do indexing along with ingesting.
025 protected int commitSize;
026
027 protected TransactionManager transactionManager;
028 protected Session session;
029 protected BulkProcessStatus status;
030 protected BulkIngestStatistics bulkIngestStatistics = BulkIngestStatistics.getInstance();
031 protected List<RequestDocument> previousBatchDocuments;
032
033 public enum BulkIngestDataFormat {
034 DOCSTORE, STANDARD
035 }
036
037 public enum BulkProcessAction {
038 START, STOP, STATUS, CLEAR
039 }
040
041 public enum BulkProcessStatus {
042 STARTED, STOPPED, DONE
043 }
044
045 public enum BulkProcessOperation {
046 INGEST, REINDEX, LINK
047 }
048
049 public String getUser() {
050 return user;
051 }
052
053 public void setUser(String user) {
054 this.user = user;
055 }
056
057 public BulkProcessOperation getOperation() {
058 return operation;
059 }
060
061 public void setOperation(BulkProcessOperation operation) {
062 this.operation = operation;
063 }
064
065 public BulkProcessAction getAction() {
066 return action;
067 }
068
069 public void setAction(BulkProcessAction action) {
070 this.action = action;
071 }
072
073 public String getDocCategory() {
074 return docCategory;
075 }
076
077 public void setDocCategory(String docCategory) {
078 this.docCategory = docCategory;
079 }
080
081 public String getDocType() {
082 return docType;
083 }
084
085 public void setDocType(String docType) {
086 this.docType = docType;
087 }
088
089 public String getDocFormat() {
090 return docFormat;
091 }
092
093 public void setDocFormat(String docFormat) {
094 this.docFormat = docFormat;
095 }
096
097 public BulkIngestDataFormat getDataFormat() {
098 return dataFormat;
099 }
100
101 public void setDataFormat(BulkIngestDataFormat dataFormat) {
102 this.dataFormat = dataFormat;
103 }
104
105 public BulkProcessStatus getStatus() {
106 return status;
107 }
108
109 public void setStatus(BulkProcessStatus status) {
110 this.status = status;
111 }
112
113 public int getCommitSize() {
114 return commitSize;
115 }
116
117 public void setCommitSize(int commitSize) {
118 this.commitSize = commitSize;
119 }
120
121 public boolean isDoIndex() {
122 return doIndex;
123 }
124
125 public void setDoIndex(boolean doIndex) {
126 this.doIndex = doIndex;
127 }
128
129 public BulkIngestStatistics getBulkIngestStatistics() {
130 return bulkIngestStatistics;
131 }
132
133 public void setBulkIngestStatistics(BulkIngestStatistics bulkIngestStatistics) {
134 this.bulkIngestStatistics = bulkIngestStatistics;
135 }
136
137 public String getDataFolder() {
138 return dataFolder;
139 }
140
141 public void setDataFolder(String dataFolder) {
142 this.dataFolder = dataFolder;
143 }
144
145 public Session getSession() {
146 return session;
147 }
148
149 public void setSession(Session session) {
150 this.session = session;
151 }
152
153 public List<RequestDocument> getPreviousBatchDocuments() {
154 return previousBatchDocuments;
155 }
156
157 public void setPreviousBatchDocuments(List<RequestDocument> previousBatchDocuments) {
158 this.previousBatchDocuments = previousBatchDocuments;
159 }
160
161 public TransactionManager getTransactionManager() {
162 return transactionManager;
163 }
164
165 public void setTransactionManager(TransactionManager transactionManager) {
166 this.transactionManager = transactionManager;
167 }
168 }