Public Member Functions | |
BackupManager (String backupDir, boolean cleanBackupFiles, boolean zipBackupFiles, int numberOfBackups) | |
BackupManager () | |
void | backup (DatabaseBackend backend, String checkpoint, ArrayList tables, BackupListener listener) throws BackupException |
synchronized void | getResult (DatabaseBackend backend, long waitTime) throws BackupException, OctopusException |
void | restore (DatabaseBackend backend, String checkpoint, ArrayList tables, BackupListener listener) throws BackupException |
File[] | listAvailableDumpFiles () |
String | getBackupDir () |
void | setBackupDir (String backupDir) |
boolean | isCleanBackupFiles () |
void | setCleanBackupFiles (boolean cleanBackupFiles) |
int | getNumberOfBackups () |
void | setNumberOfBackups (int numberOfBackups) |
boolean | isZipBackupFiles () |
void | setZipBackupFiles (boolean zipBackupFiles) |
String | getXml () |
Static Package Attributes | |
Trace | logger |
Definition at line 50 of file BackupManager.java.
|
Creates a new
Definition at line 69 of file BackupManager.java. 00071 { 00072 this(); 00073 this.backupDir = backupDir; 00074 this.cleanBackupFiles = cleanBackupFiles; 00075 this.zipBackupFiles = zipBackupFiles; 00076 this.numberOfBackups = numberOfBackups; 00077 00078 }
|
|
Creates a new Definition at line 83 of file BackupManager.java. 00084 {
00085 threads = new Hashtable();
00086 }
|
|
Create a backup from the content of a backend
Definition at line 97 of file BackupManager.java. 00099 { 00100 logger.info(Translate.get("backup.manager.backuping.backend", new String[]{ 00101 backend.getName(), checkpoint})); 00102 Octopus octopus = new Octopus(backend, checkpoint, tables); 00103 octopus.setZipOctopus(zipBackupFiles); 00104 octopus.setCleanOctopus(cleanBackupFiles); 00105 octopus.setOctopusDirectory(backupDir); 00106 octopus.setOctopusMode(Octopus.MODE_BACKUP); 00107 if (listener != null) 00108 octopus.setListener(listener); 00109 threads.put(backend, octopus); 00110 octopus.start(); 00111 }
|
|
Returns the backupDir value.
Definition at line 206 of file BackupManager.java. 00207 {
00208 return backupDir;
00209 }
|
|
Returns the numberOfBackups value.
Definition at line 246 of file BackupManager.java. 00247 {
00248 return numberOfBackups;
00249 }
|
|
Get the result of the backup/recovery process for the given backend
Definition at line 121 of file BackupManager.java. 00123 { 00124 logger.info(Translate.get("backup.manager.waiting.backend.result", 00125 new String[]{backend.getName(), String.valueOf((waitTime / 1000))})); 00126 Octopus backup = (Octopus) threads.get(backend); 00127 try 00128 { 00129 backup.join(waitTime); 00130 } 00131 catch (InterruptedException e) 00132 { 00133 logger.error("Interrupted while joining on backend:" + backend.getName(), 00134 e); 00135 } 00136 Exception e = backup.getRunException(); 00137 if (e != null) 00138 { 00139 if (e instanceof BackupException) 00140 throw (BackupException) e; 00141 else if (e instanceof OctopusException) 00142 throw (OctopusException) e; 00143 } 00144 00145 }
|
|
Definition at line 284 of file BackupManager.java. 00285 { 00286 return "<" + DatabasesXmlTags.ELT_Backup + " " + DatabasesXmlTags.ATT_dir 00287 + "=\"" + backupDir + "\" " + DatabasesXmlTags.ATT_clean + "=\"" 00288 + cleanBackupFiles + "\" " + DatabasesXmlTags.ATT_zip + "=\"" 00289 + zipBackupFiles + "\" " + "/>"; 00290 }
|
|
Returns the cleanBackupFiles value.
Definition at line 226 of file BackupManager.java. 00227 {
00228 return cleanBackupFiles;
00229 }
|
|
Returns the zipBackupFiles value.
Definition at line 266 of file BackupManager.java. 00267 {
00268 return zipBackupFiles;
00269 }
|
|
List all the files this backup manager has access to.
Definition at line 178 of file BackupManager.java. 00179 { 00180 File f = new File(backupDir); 00181 if (f.exists()) 00182 { 00183 return f.listFiles(new FilenameFilter() 00184 { 00185 /** 00186 * @see java.io.FilenameFilter#accept(java.io.File, java.lang.String) 00187 */ 00188 public boolean accept(File dir, String name) 00189 { 00190 if (name.endsWith(Constants.ZIP_EXT)) 00191 return true; 00192 else 00193 return false; 00194 } 00195 }); 00196 } 00197 else 00198 return new File[0]; 00199 }
|
|
Restore the content of a backup onto a specific backend
Definition at line 156 of file BackupManager.java. 00158 { 00159 logger.info(Translate.get("backup.manager.restoring.backend", new String[]{ 00160 backend.getName(), checkpoint})); 00161 Octopus octopus = new Octopus(backend, checkpoint, tables); 00162 octopus.setZipOctopus(zipBackupFiles); 00163 octopus.setCleanOctopus(cleanBackupFiles); 00164 octopus.setOctopusDirectory(backupDir); 00165 if (listener != null) 00166 octopus.setListener(listener); 00167 octopus.setOctopusMode(Octopus.MODE_RECOVERY); 00168 threads.put(backend, octopus); 00169 octopus.start(); 00170 }
|
|
Sets the backupDir value.
Definition at line 216 of file BackupManager.java. 00217 {
00218 this.backupDir = backupDir;
00219 }
|
|
Sets the cleanBackupFiles value.
Definition at line 236 of file BackupManager.java. 00237 {
00238 this.cleanBackupFiles = cleanBackupFiles;
00239 }
|
|
Sets the numberOfBackups value.
Definition at line 256 of file BackupManager.java. 00257 {
00258 this.numberOfBackups = numberOfBackups;
00259 }
|
|
Sets the zipBackupFiles value.
Definition at line 276 of file BackupManager.java. 00277 {
00278 this.zipBackupFiles = zipBackupFiles;
00279 }
|
|
Initial value: Trace.getLogger(BackupManager.class .getName()) Definition at line 52 of file BackupManager.java. |