KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > config > backup > status > SnapShotStatus


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

6
7 package com.sun.enterprise.config.backup.status;
8
9 import java.util.Date JavaDoc;
10 import com.sun.enterprise.config.backup.BackupException;
11 import com.sun.enterprise.config.backup.utils.BackupHelper;
12 import com.sun.enterprise.config.backup.utils.FactoryHelper;
13
14 /**
15  * Backup Status is used to keep the status for
16  * the backup action.
17  * @author sridatta
18  */

19 public class SnapShotStatus extends Status {
20
21         
22         /** file used to restore or backed up file name */
23     //private String _snapShotFileName;
24
private String JavaDoc _absSnapShotFileName;
25    
26     /** directory where the backup file is stored .
27      */

28     /** timestamp of the backed up file
29      */

30   // private long _snapShotTimeStamp;
31

32     /** Size of the backup file */
33     private long _snapShotFileSize;
34     
35     /** Creates a new instance of BackupStatus */
36     public SnapShotStatus() {
37     }
38     
39     public SnapShotStatus(boolean init) throws BackupException {
40         super(true);
41         if(init) {
42             init();
43         }
44     }
45     private void init() throws BackupException {
46       // setBackupDirectory(getDirectory());
47
// long ts = System.currentTimeMillis();
48
// setSnapShotTimeStamp(ts);
49
setAbsoluteSnapShotFileName(getAbsoluteName(getCreationTimeStamp()));
50     }
51
52     public String JavaDoc getOperation() {
53         return "snapshot";
54     }
55     
56     /*
57     protected String getDirectory() throws BackupException {
58         return FactoryHelper.getEnv().getDirectoryToStoreSnapshotFile();
59     }
60      */

61     
62     /*
63     protected String getRelativeName(long ts) throws BackupException {
64         return BackupHelper.getRelativeSnapShotFileName(ts);
65     }
66      */

67     
68     protected String JavaDoc thisToString() {
69         return "SnapShotFileName= " + _absSnapShotFileName;
70     }
71     
72     public String JavaDoc getAbsoluteSnapShotFileName() {
73         return _absSnapShotFileName;
74     }
75     
76     private void setAbsoluteSnapShotFileName(String JavaDoc name) {
77         _absSnapShotFileName = name;
78     }
79     
80     private String JavaDoc getAbsoluteName(long ts) {
81         return BackupHelper.getAbsoluteSnapshotFileName(ts);
82     }
83     
84      public String JavaDoc[] getDirectoriesToBackup() {
85         return FactoryHelper.getEnv().getDirectoriesToBackup();
86     }
87      
88 }
89
Popular Tags