KickJava   Java API By Example, From Geeks To Geeks.

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


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

6
7 package com.sun.enterprise.config.backup;
8
9 import com.sun.enterprise.config.backup.status.BackupStatus;
10 import com.sun.enterprise.config.backup.status.RemoveStatus;
11 import com.sun.enterprise.config.backup.status.RestoreStatus;
12 import com.sun.enterprise.config.backup.status.UndoRestoreStatus;
13
14 /**
15  * This Interface is exposed by the mbean and also
16  * by the backupRestore utility.
17  * This class has all methods required to implement
18  * backup-restore functionality
19  *
20  * @author sridatta
21  */

22 public interface BackupRestore {
23     
24     /**
25      * Backsup the configuration into a default location
26      * DefaultLocation is specified by $DomainRoot/backup
27      * Use the other method backup(String targetFileName) if
28      * you need to specify the source file
29      *
30      * @param userInfo is a string entered by the user. It can
31      * be null.
32      *
33      * @return BackupRestoreStatus Detailed backup information
34      */

35     BackupStatus backup(String JavaDoc userInfo);
36     
37     /**
38      * backs up the configuration to the target filename
39      * @return BackupRestoreStatus Detailed backup information
40      */

41     BackupStatus backup(String JavaDoc targetFileName, String JavaDoc userInfo);
42     
43     /**
44      * Restores the configuration from the last backup file
45      *
46      * @return RestoreStatus Detailed Status Information
47      */

48     RestoreStatus restore();
49     
50     /**
51       * restores the configuration from the specified file
52      * Note that this can be a backup from this domain OR
53      * from other domain!! Hence it can be used to replicate
54      * servers
55      * @return RestoreStatus detailed status information
56      */

57     RestoreStatus restore(String JavaDoc backupFileName);
58     
59     /**
60      * This method can be used to undo a just performed restore.
61      * Every restore keeps the information before restoring in
62      * a file. So that restore can be undone.
63      *
64      * @UndoRestoreStatus status of the undo restore operation
65      */

66     UndoRestoreStatus undoRestore();
67     
68     /**
69      * Get a report of all available backups
70      */

71     BackupStatus[] listBackups();
72     
73     /**
74      * remove by specifying a file name
75      */

76     RemoveStatus removeBackup(String JavaDoc backupFileName);
77     
78     /**
79      * Get a report of previous history
80      *
81      */

82     BackupHistory getBackupHistory(int number) throws BackupException;
83     
84     /**
85      * cleanup the history
86      * A best effort solution. Does not throw exception.
87      */

88     BackupHistory clearBackupHistory();
89 }
Popular Tags