クラス org.objectweb.cjdbc.controller.backup.BackupManager

すべてのメンバ一覧

説明

This class defines a BackupManager

作者:
Nicolas Modrzyk
バージョン:
1.0

BackupManager.java49 行で定義されています。

Public メソッド

 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 ()

スタティック変数

Trace logger

Private 変数

String backupDir = ControllerConstants.DEFAULT_BACKUP_DIR
boolean cleanBackupFiles = true
boolean zipBackupFiles = true
int numberOfBackups = -1
Hashtable threads


コンストラクタとデストラクタ

org.objectweb.cjdbc.controller.backup.BackupManager.BackupManager String  backupDir,
boolean  cleanBackupFiles,
boolean  zipBackupFiles,
int  numberOfBackups
 

Creates a new BackupManager object

引数:
backupDir the directory used for backup
cleanBackupFiles should we clean temp backup files
zipBackupFiles should we zip backup files
numberOfBackups number of backups before deleting others, not used
BackupManager.java68 行で定義されています。
00070 { 00071 this(); 00072 this.backupDir = backupDir; 00073 this.cleanBackupFiles = cleanBackupFiles; 00074 this.zipBackupFiles = zipBackupFiles; 00075 this.numberOfBackups = numberOfBackups; 00076 00077 }

org.objectweb.cjdbc.controller.backup.BackupManager.BackupManager  ) 
 

Creates a new BackupManager object BackupManager.java82 行で定義されています。

参照先 org.objectweb.cjdbc.controller.backup.BackupManager.threads.

00083 { 00084 threads = new Hashtable(); 00085 }


メソッド

void org.objectweb.cjdbc.controller.backup.BackupManager.backup DatabaseBackend  backend,
String  checkpoint,
ArrayList  tables,
BackupListener  listener
throws BackupException
 

Create a backup from the content of a backend

引数:
backend the target backend to backup from
checkpoint the checkpoint name of the backup to create
tables the list of tables to consider for backup
listener handback object to notify
例外:
BackupException if backup fails for unknown reasons
BackupManager.java96 行で定義されています。

参照先 org.objectweb.cjdbc.controller.backup.BackupManager.logger.

00098 { 00099 logger.info(Translate.get("backup.manager.backuping.backend", new String[]{ 00100 backend.getName(), checkpoint})); 00101 Octopus octopus = new Octopus(backend, checkpoint, tables); 00102 octopus.setZipOctopus(zipBackupFiles); 00103 octopus.setCleanOctopus(cleanBackupFiles); 00104 octopus.setOctopusMode(true); 00105 if(listener!=null) 00106 octopus.setListener(listener); 00107 threads.put(backend, octopus); 00108 octopus.start(); 00109 }

String org.objectweb.cjdbc.controller.backup.BackupManager.getBackupDir  ) 
 

Returns the backupDir value.

戻り値:
Returns the backupDir.
BackupManager.java202 行で定義されています。
00203 { 00204 return backupDir; 00205 }

int org.objectweb.cjdbc.controller.backup.BackupManager.getNumberOfBackups  ) 
 

Returns the numberOfBackups value.

戻り値:
Returns the numberOfBackups.
BackupManager.java242 行で定義されています。
00243 { 00244 return numberOfBackups; 00245 }

synchronized void org.objectweb.cjdbc.controller.backup.BackupManager.getResult DatabaseBackend  backend,
long  waitTime
throws BackupException, OctopusException
 

Get the result of the backup/recovery process for the given backend

引数:
backend the backend we started a backup recovery process on
waitTime the time to wait to join the octopus thread
例外:
BackupException if backup fails for unknown reasons
OctopusException if backup fails because of Octopus
BackupManager.java119 行で定義されています。
00121 { 00122 logger.info(Translate.get("backup.manager.waiting.backend.result", 00123 new String[]{backend.getName(), "" + (waitTime / 1000)})); 00124 Octopus backup = (Octopus) threads.get(backend); 00125 try 00126 { 00127 backup.join(waitTime); 00128 } 00129 catch (InterruptedException e) 00130 { 00131 logger.error("Interrupted while joining on backend:"+backend.getName(),e); 00132 } 00133 Exception e = backup.getRunException(); 00134 if (e != null) 00135 { 00136 if (e instanceof BackupException) 00137 throw (BackupException) e; 00138 else if (e instanceof OctopusException) 00139 throw (OctopusException) e; 00140 } 00141 00142 }

String org.objectweb.cjdbc.controller.backup.BackupManager.getXml  ) 
 

参照:
org.objectweb.cjdbc.common.xml.XmlComponent.getXml()
BackupManager.java280 行で定義されています。
00281 { 00282 return "<" + DatabasesXmlTags.ELT_BACKUP + " " 00283 + DatabasesXmlTags.ATT_BACKUP_DIR + "=\"" + backupDir + "\" " 00284 + DatabasesXmlTags.ATT_BACKUP_CLEAN + "=\"" + cleanBackupFiles + "\" " 00285 + DatabasesXmlTags.ATT_BACKUP_ZIP + "=\"" + zipBackupFiles + "\" " 00286 + "/>"; 00287 }

boolean org.objectweb.cjdbc.controller.backup.BackupManager.isCleanBackupFiles  ) 
 

Returns the cleanBackupFiles value.

戻り値:
Returns the cleanBackupFiles.
BackupManager.java222 行で定義されています。
00223 { 00224 return cleanBackupFiles; 00225 }

boolean org.objectweb.cjdbc.controller.backup.BackupManager.isZipBackupFiles  ) 
 

Returns the zipBackupFiles value.

戻り値:
Returns the zipBackupFiles.
BackupManager.java262 行で定義されています。
00263 { 00264 return zipBackupFiles; 00265 }

File [] org.objectweb.cjdbc.controller.backup.BackupManager.listAvailableDumpFiles  ) 
 

List all the files this backup manager has access to.

戻り値:
a File[] object that can be empty, but cannot be null

参照:
java.io.FilenameFilter#accept(java.io.File, java.lang.String)
BackupManager.java174 行で定義されています。
00175 { 00176 File f = new File(backupDir); 00177 if (f.exists()) 00178 { 00179 return f.listFiles(new FilenameFilter() 00180 { 00184 public boolean accept(File dir, String name) 00185 { 00186 if (name.endsWith(ZipMe.ZIP_EXT)) 00187 return true; 00188 else 00189 return false; 00190 } 00191 }); 00192 } 00193 else 00194 return new File[0]; 00195 }

void org.objectweb.cjdbc.controller.backup.BackupManager.restore DatabaseBackend  backend,
String  checkpoint,
ArrayList  tables,
BackupListener  listener
throws BackupException
 

Restore the content of a backup onto a specific backend

引数:
backend the target backend to restore to
checkpoint the checkpoint name of the backup to restore
tables the list of tables to consider for restore
listener handback object to notify
例外:
BackupException if backup fails for unknown reasons
BackupManager.java153 行で定義されています。
00155 { 00156 logger.info(Translate.get("backup.manager.restoring.backend", new String[]{ 00157 backend.getName(), checkpoint})); 00158 Octopus octopus = new Octopus(backend, checkpoint, tables); 00159 octopus.setZipOctopus(zipBackupFiles); 00160 octopus.setCleanOctopus(cleanBackupFiles); 00161 if(listener!=null) 00162 octopus.setListener(listener); 00163 octopus.setOctopusMode(false); 00164 threads.put(backend, octopus); 00165 octopus.start(); 00166 }

void org.objectweb.cjdbc.controller.backup.BackupManager.setBackupDir String  backupDir  ) 
 

Sets the backupDir value.

引数:
backupDir The backupDir to set.
BackupManager.java212 行で定義されています。
00213 { 00214 this.backupDir = backupDir; 00215 }

void org.objectweb.cjdbc.controller.backup.BackupManager.setCleanBackupFiles boolean  cleanBackupFiles  ) 
 

Sets the cleanBackupFiles value.

引数:
cleanBackupFiles The cleanBackupFiles to set.
BackupManager.java232 行で定義されています。
00233 { 00234 this.cleanBackupFiles = cleanBackupFiles; 00235 }

void org.objectweb.cjdbc.controller.backup.BackupManager.setNumberOfBackups int  numberOfBackups  ) 
 

Sets the numberOfBackups value.

引数:
numberOfBackups The numberOfBackups to set.
BackupManager.java252 行で定義されています。
00253 { 00254 this.numberOfBackups = numberOfBackups; 00255 }

void org.objectweb.cjdbc.controller.backup.BackupManager.setZipBackupFiles boolean  zipBackupFiles  ) 
 

Sets the zipBackupFiles value.

引数:
zipBackupFiles The zipBackupFiles to set.
BackupManager.java272 行で定義されています。
00273 { 00274 this.zipBackupFiles = zipBackupFiles; 00275 }


変数

String org.objectweb.cjdbc.controller.backup.BackupManager.backupDir = ControllerConstants.DEFAULT_BACKUP_DIR [private]
 

BackupManager.java53 行で定義されています。

boolean org.objectweb.cjdbc.controller.backup.BackupManager.cleanBackupFiles = true [private]
 

BackupManager.java54 行で定義されています。

Trace org.objectweb.cjdbc.controller.backup.BackupManager.logger [static, package]
 

初期値:

Trace.getLogger(BackupManager.class .getName())
BackupManager.java51 行で定義されています。

参照元 org.objectweb.cjdbc.controller.backup.BackupManager.backup().

int org.objectweb.cjdbc.controller.backup.BackupManager.numberOfBackups = -1 [private]
 

BackupManager.java56 行で定義されています。

Hashtable org.objectweb.cjdbc.controller.backup.BackupManager.threads [private]
 

BackupManager.java58 行で定義されています。

参照元 org.objectweb.cjdbc.controller.backup.BackupManager.BackupManager().

boolean org.objectweb.cjdbc.controller.backup.BackupManager.zipBackupFiles = true [private]
 

BackupManager.java55 行で定義されています。


このクラスの説明は次のファイルから生成されました:
CJDBCversion1.0.4に対してTue Oct 12 15:16:36 2004に生成されました。 doxygen 1.3.8