KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > config > backup > BackupHistory


1 /*
2  * BackupStatus.java
3  *
4  * Created on December 13, 2000, 6:52 AM
5  */

6
7 package com.sun.enterprise.config.backup;
8
9 import java.io.Serializable JavaDoc;
10 import java.util.ArrayList JavaDoc;
11
12 /**
13  *
14  * @author sridatta
15  */

16 public class BackupHistory implements Serializable JavaDoc, EnvironmentConstants {
17     
18    private final HistoryEntry[] _historyEntries;
19    private final String JavaDoc _historyFileName;
20     /** Creates a new instance of BackupHistory */
21     public BackupHistory(String JavaDoc fileName) {
22         _historyEntries = null;
23         _historyFileName = fileName;
24     }
25     
26     public BackupHistory(HistoryEntry[] historyEntries, String JavaDoc fileName) {
27         _historyEntries = historyEntries;
28         _historyFileName = fileName;
29
30     }
31     
32     public HistoryEntry[] getHistoryEntries() {
33         return _historyEntries;
34     }
35     
36     public int size() {
37         if(_historyEntries == null) return 0;
38         return _historyEntries.length;
39     }
40     
41     public String JavaDoc getBackupHistoryFile() {
42         return _historyFileName;
43     }
44     
45     public String JavaDoc toString() {
46         String JavaDoc res = "";
47         if(_historyEntries == null) return res;
48         
49         for(int i = 0; i < _historyEntries.length; i++ ) {
50             if(res != "") {
51                 res+=DefaultConstants.NEWLINE_CHARACTER;
52             }
53             res += _historyEntries[i];
54         }
55         return res;
56     }
57 }
Popular Tags