1 package org.kuali.ole.sys.batch;
2
3 import java.util.ArrayList;
4 import java.util.HashMap;
5 import java.util.List;
6 import java.util.Map;
7
8
9
10
11 public class FlatFileInformation {
12 private String fileName;
13 private List<String[]> messages;
14 private Map<String, FlatFileTransactionInformation> flatFileIdentifierToTransactionInfomationMap;
15
16
17
18
19 public FlatFileInformation() {
20 messages = new ArrayList<String[]>();
21 flatFileIdentifierToTransactionInfomationMap = new HashMap<String, FlatFileTransactionInformation>();
22 }
23
24
25
26
27
28 public FlatFileInformation(String fileName) {
29 this.fileName = fileName;
30 messages = new ArrayList<String[]>();
31 flatFileIdentifierToTransactionInfomationMap = new HashMap<String, FlatFileTransactionInformation>();
32 }
33
34
35
36
37
38
39
40 public FlatFileTransactionInformation getOrAddFlatFileData(String flatFileDataIdentifier, FlatFileTransactionInformation flatFileTransactionInformation) {
41 if (!flatFileIdentifierToTransactionInfomationMap.containsKey(flatFileDataIdentifier)) {
42 flatFileIdentifierToTransactionInfomationMap.put(flatFileDataIdentifier, flatFileTransactionInformation);
43 }
44 return (FlatFileTransactionInformation) flatFileIdentifierToTransactionInfomationMap.get(flatFileDataIdentifier);
45 }
46
47
48
49
50
51 public void addFileErrorMessage(String message) {
52 this.messages.add(new String[] { FlatFileTransactionInformation.getEntryTypeString(FlatFileTransactionInformation.EntryType.ERROR), message });
53 }
54
55
56
57
58
59 public void addFileInfoMessage(String message) {
60 this.messages.add(new String[] { FlatFileTransactionInformation.getEntryTypeString(FlatFileTransactionInformation.EntryType.INFO), message });
61 }
62
63
64
65
66 public String getFileName() {
67 return fileName;
68 }
69
70
71
72
73
74 public void setFileName(String fileName) {
75 this.fileName = fileName;
76 }
77
78
79
80
81 public List<String[]> getMessages() {
82 return messages;
83 }
84
85
86
87
88
89 public void setMessages(List<String[]> messages) {
90 this.messages = messages;
91 }
92
93
94
95
96 public Map<String, FlatFileTransactionInformation> getFlatFileIdentifierToTransactionInfomationMap() {
97 return flatFileIdentifierToTransactionInfomationMap;
98 }
99
100
101
102
103
104 public void setFlatFileIdentifierToTransactionInfomationMap(Map<String, FlatFileTransactionInformation> flatFileIdentifierToTransactionInfomationMap) {
105 this.flatFileIdentifierToTransactionInfomationMap = flatFileIdentifierToTransactionInfomationMap;
106 }
107 }