001    /*
002     * Copyright 2011 The Kuali Foundation.
003     * 
004     * Licensed under the Educational Community License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     * 
008     * http://www.opensource.org/licenses/ecl2.php
009     * 
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013     * See the License for the specific language governing permissions and
014     * limitations under the License.
015     */
016    package org.kuali.kfs.module.cab.batch;
017    
018    import java.sql.Timestamp;
019    import java.util.ArrayList;
020    import java.util.Collection;
021    import java.util.List;
022    
023    import org.kuali.kfs.gl.businessobject.Entry;
024    
025    public class ExtractProcessLog {
026        private Timestamp startTime;
027        private Timestamp finishTime;
028        private Timestamp lastExtractTime;
029        private List<Entry> ignoredGLEntries;
030        private List<Entry> duplicateGLEntries;
031        private List<Entry> mismatchedGLEntries;
032        private String errorMessage;
033        private boolean success = true;
034        private Integer totalGlCount = 0;
035        private Integer nonPurApGlCount = 0;
036        private Integer purApGlCount = 0;
037        private String statusMessage;
038    
039        /**
040         * Gets the ignoredGLEntries attribute.
041         * 
042         * @return Returns the ignoredGLEntries.
043         */
044        public List<Entry> getIgnoredGLEntries() {
045            return ignoredGLEntries;
046        }
047    
048        /**
049         * Sets the ignoredGLEntries attribute value.
050         * 
051         * @param ignoredGLEntries The ignoredGLEntries to set.
052         */
053        public void setIgnoredGLEntries(List<Entry> ignoredGLEntries) {
054            this.ignoredGLEntries = ignoredGLEntries;
055        }
056    
057        /**
058         * Gets the duplicateGLEntries attribute.
059         * 
060         * @return Returns the duplicateGLEntries.
061         */
062        public List<Entry> getDuplicateGLEntries() {
063            return duplicateGLEntries;
064        }
065    
066        /**
067         * Sets the duplicateGLEntries attribute value.
068         * 
069         * @param duplicateGLEntries The duplicateGLEntries to set.
070         */
071        public void setDuplicateGLEntries(List<Entry> duplicateGLEntries) {
072            this.duplicateGLEntries = duplicateGLEntries;
073        }
074    
075        /**
076         * Gets the mismatchedGLEntries attribute.
077         * 
078         * @return Returns the mismatchedGLEntries.
079         */
080        public List<Entry> getMismatchedGLEntries() {
081            return mismatchedGLEntries;
082        }
083    
084        /**
085         * Sets the mismatchedGLEntries attribute value.
086         * 
087         * @param mismatchedGLEntries The mismatchedGLEntries to set.
088         */
089        public void setMismatchedGLEntries(List<Entry> mismatchedGLEntries) {
090            this.mismatchedGLEntries = mismatchedGLEntries;
091        }
092    
093        /**
094         * Adds a collection of entries to ignoredGLEntries
095         * 
096         * @param add ignoredGLEntries
097         */
098        public void addIgnoredGLEntries(Collection<Entry> add) {
099            if (this.ignoredGLEntries == null) {
100                this.ignoredGLEntries = new ArrayList<Entry>();
101            }
102            this.ignoredGLEntries.addAll(add);
103        }
104    
105        /**
106         * Adds a collection of entries to duplicateGLEntries
107         * 
108         * @param add duplicateGLEntries
109         */
110        public void addDuplicateGLEntries(Collection<Entry> add) {
111            if (this.duplicateGLEntries == null) {
112                this.duplicateGLEntries = new ArrayList<Entry>();
113            }
114            this.duplicateGLEntries.addAll(add);
115        }
116    
117        /**
118         * Adds a collection of entries to mismatchedGLEntries
119         * 
120         * @param add mismatchedGLEntries
121         */
122        public void addMismatchedGLEntries(Collection<Entry> add) {
123            if (this.mismatchedGLEntries == null) {
124                this.mismatchedGLEntries = new ArrayList<Entry>();
125            }
126            this.mismatchedGLEntries.addAll(add);
127        }
128    
129        /**
130         * Add a GL entry to ignoredGLEntries
131         * 
132         * @param add Entry
133         */
134        public void addIgnoredGLEntry(Entry add) {
135            if (this.ignoredGLEntries == null) {
136                this.ignoredGLEntries = new ArrayList<Entry>();
137            }
138            this.ignoredGLEntries.add(add);
139        }
140    
141        /**
142         * Add a GL entry to duplicateGLEntries
143         * 
144         * @param add Entry
145         */
146        public void addDuplicateGLEntry(Entry add) {
147            if (this.duplicateGLEntries == null) {
148                this.duplicateGLEntries = new ArrayList<Entry>();
149            }
150            this.duplicateGLEntries.add(add);
151        }
152    
153        /**
154         * Add a GL entry to mismatchedGLEntries
155         * 
156         * @param add Entry
157         */
158        public void addMismatchedGLEntry(Entry add) {
159            if (this.mismatchedGLEntries == null) {
160                this.mismatchedGLEntries = new ArrayList<Entry>();
161            }
162            this.mismatchedGLEntries.add(add);
163        }
164    
165        /**
166         * Gets the startTime attribute.
167         * 
168         * @return Returns the startTime.
169         */
170        public Timestamp getStartTime() {
171            return startTime;
172        }
173    
174        /**
175         * Sets the startTime attribute value.
176         * 
177         * @param startTime The startTime to set.
178         */
179        public void setStartTime(Timestamp startTime) {
180            this.startTime = startTime;
181        }
182    
183        /**
184         * Gets the lastExtractTime attribute.
185         * 
186         * @return Returns the lastExtractTime.
187         */
188        public Timestamp getLastExtractTime() {
189            return lastExtractTime;
190        }
191    
192        /**
193         * Sets the lastExtractTime attribute value.
194         * 
195         * @param lastExtractTime The lastExtractTime to set.
196         */
197        public void setLastExtractTime(Timestamp lastExtractTime) {
198            this.lastExtractTime = lastExtractTime;
199        }
200    
201        /**
202         * Gets the success attribute.
203         * 
204         * @return Returns the success.
205         */
206        public boolean isSuccess() {
207            return success;
208        }
209    
210        /**
211         * Sets the success attribute value.
212         * 
213         * @param success The success to set.
214         */
215        public void setSuccess(boolean success) {
216            this.success = success;
217        }
218    
219        /**
220         * Gets the finishTime attribute.
221         * 
222         * @return Returns the finishTime.
223         */
224        public Timestamp getFinishTime() {
225            return finishTime;
226        }
227    
228        /**
229         * Sets the finishTime attribute value.
230         * 
231         * @param finishTime The finishTime to set.
232         */
233        public void setFinishTime(Timestamp finishTime) {
234            this.finishTime = finishTime;
235        }
236    
237        /**
238         * Gets the errorMessage attribute.
239         * 
240         * @return Returns the errorMessage.
241         */
242        public String getErrorMessage() {
243            return errorMessage;
244        }
245    
246        /**
247         * Sets the errorMessage attribute value.
248         * 
249         * @param errorMessage The errorMessage to set.
250         */
251        public void setErrorMessage(String errorMessage) {
252            this.errorMessage = errorMessage;
253        }
254    
255        /**
256         * Gets the totalGlCount attribute.
257         * 
258         * @return Returns the totalGlCount.
259         */
260        public Integer getTotalGlCount() {
261            return totalGlCount;
262        }
263    
264        /**
265         * Sets the totalGlCount attribute value.
266         * 
267         * @param totalGlCount The totalGlCount to set.
268         */
269        public void setTotalGlCount(Integer totalGlCount) {
270            this.totalGlCount = totalGlCount;
271        }
272    
273        /**
274         * Gets the nonPurApGlCount attribute.
275         * 
276         * @return Returns the nonPurApGlCount.
277         */
278        public Integer getNonPurApGlCount() {
279            return nonPurApGlCount;
280        }
281    
282        /**
283         * Sets the nonPurApGlCount attribute value.
284         * 
285         * @param nonPurApGlCount The nonPurApGlCount to set.
286         */
287        public void setNonPurApGlCount(Integer nonPurApGlCount) {
288            this.nonPurApGlCount = nonPurApGlCount;
289        }
290    
291        /**
292         * Gets the purApGlCount attribute.
293         * 
294         * @return Returns the purApGlCount.
295         */
296        public Integer getPurApGlCount() {
297            return purApGlCount;
298        }
299    
300        /**
301         * Sets the purApGlCount attribute value.
302         * 
303         * @param purApGlCount The purApGlCount to set.
304         */
305        public void setPurApGlCount(Integer purApGlCount) {
306            this.purApGlCount = purApGlCount;
307        }
308    
309        /**
310         * Gets the statusMessage attribute.
311         * 
312         * @return Returns the statusMessage.
313         */
314        public String getStatusMessage() {
315            if (this.statusMessage == null) {
316                return success ? "Success" : this.errorMessage == null ? "" : this.errorMessage;
317            }
318            return statusMessage;
319        }
320    
321        /**
322         * Sets the statusMessage attribute value.
323         * 
324         * @param statusMessage The statusMessage to set.
325         */
326        public void setStatusMessage(String statusMessage) {
327            this.statusMessage = statusMessage;
328        }
329    
330    
331    }