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  
12  public class PhysicalFlatFileInformation {
13      private String fileName;
14      private List<String[]> messages;
15      private List<FlatFileInformation> flatFileInfomationList;
16      
17      
18  
19  
20  
21      public PhysicalFlatFileInformation(String fileName) {
22          this.fileName = fileName;
23          messages = new ArrayList<String[]>();
24          flatFileInfomationList = new ArrayList<FlatFileInformation>();
25      }
26      
27      public void addFileErrorMessages(List<String> messages) {
28          for(String message : messages) {
29              this.messages.add(new String[] { FlatFileTransactionInformation.getEntryTypeString(FlatFileTransactionInformation.EntryType.ERROR), message });
30          }
31      }
32      
33      
34  
35  
36  
37      public void addFileErrorMessage(String message) {
38          this.messages.add(new String[] { FlatFileTransactionInformation.getEntryTypeString(FlatFileTransactionInformation.EntryType.ERROR), message });
39      }
40      
41      public void addFileInfoMessage(List<String> messages) {
42          for(String message : messages) {
43              this.messages.add(new String[] { FlatFileTransactionInformation.getEntryTypeString(FlatFileTransactionInformation.EntryType.INFO), message });
44          }
45      }
46  
47      
48  
49  
50  
51      public void addFileInfoMessage(String message) {
52          this.messages.add(new String[] { FlatFileTransactionInformation.getEntryTypeString(FlatFileTransactionInformation.EntryType.INFO), message });
53      }
54  
55      
56  
57  
58      public String getFileName() {
59          return fileName;
60      }
61  
62      
63  
64  
65  
66      public void setFileName(String fileName) {
67          this.fileName = fileName;
68      }
69  
70      
71  
72  
73      public List<String[]> getMessages() {
74          return messages;
75      }
76      
77      public String getAllMessages() {
78          StringBuffer message = new StringBuffer();
79          for(String[] resultMessage : getMessages()) {
80              message.append(resultMessage[1]);
81              message.append("\n");
82          }
83          return message.toString();
84      }
85      
86      
87  
88  
89  
90      public void setMessages(List<String[]> messages) {
91          this.messages = messages;
92      }
93  
94  
95      
96  
97  
98      public List<FlatFileInformation> getFlatFileInfomationList() {
99          return flatFileInfomationList;
100     }
101 
102 
103     
104 
105 
106 
107     public void setFlatFileInfomationList(List<FlatFileInformation> flatFileInfomationList) {
108         this.flatFileInfomationList = flatFileInfomationList;
109     }
110 }