1 /*
2 * Copyright 2007 The Kuali Foundation
3 *
4 * Licensed under the Educational Community License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.opensource.org/licenses/ecl2.php
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package org.kuali.ole.gl.service.impl;
17
18 import java.io.File;
19 import java.util.List;
20
21 import org.kuali.ole.gl.batch.service.impl.EnterpriseFeederStatus;
22 import org.kuali.ole.sys.Message;
23
24 /**
25 * This class serves as a wrapper containing references to the feeder status and error messages list. This works around java's
26 * inability to return a value and throw an exception at the same time. Exceptions in OLE are generally needed to force the
27 * framework to rollback a transaction.
28 */
29 public class EnterpriseFeederStatusAndErrorMessagesWrapper {
30 private List<Message> errorMessages;
31 private EnterpriseFeederStatus status;
32 private String doneFileName;
33 private String reconFileName;
34 private String dataFileName;
35
36 /**
37 * Constructs a EnterpriseFeederStatusAndErrorMessagesWrapper, initializing values to null
38 */
39 public EnterpriseFeederStatusAndErrorMessagesWrapper() {
40 errorMessages = null;
41 status = null;
42 }
43
44 /**
45 * Gets the errorMessages attribute.
46 *
47 * @return Returns the errorMessages.
48 */
49 public List<Message> getErrorMessages() {
50 return errorMessages;
51 }
52
53 /**
54 * Sets the errorMessages attribute value.
55 *
56 * @param errorMessages The errorMessages to set.
57 */
58 public void setErrorMessages(List<Message> errorMessages) {
59 this.errorMessages = errorMessages;
60 }
61
62 /**
63 * Gets the status attribute.
64 *
65 * @return Returns the status.
66 */
67 public EnterpriseFeederStatus getStatus() {
68 return status;
69 }
70
71 /**
72 * Sets the status attribute value.
73 *
74 * @param status The status to set.
75 */
76 public void setStatus(EnterpriseFeederStatus status) {
77 this.status = status;
78 }
79
80 public void setFileNames(File dataFile, File reconFile, File doneFile) {
81 if (dataFile != null) {
82 dataFileName = dataFile.getName();
83 }
84 if (reconFile != null) {
85 reconFileName = reconFile.getName();
86 }
87 if (doneFile != null) {
88 doneFileName = doneFile.getName();
89 }
90 }
91
92 /**
93 * Gets the doneFileName attribute.
94 * @return Returns the doneFileName.
95 */
96 public String getDoneFileName() {
97 return doneFileName;
98 }
99
100 /**
101 * Gets the reconFileName attribute.
102 * @return Returns the reconFileName.
103 */
104 public String getReconFileName() {
105 return reconFileName;
106 }
107
108 /**
109 * Gets the dataFileName attribute.
110 * @return Returns the dataFileName.
111 */
112 public String getDataFileName() {
113 return dataFileName;
114 }
115 }