1 6 7 package com.sun.enterprise.config.backup.phase; 8 9 import com.sun.enterprise.config.backup.status.UndoRestoreStatus; 10 import com.sun.enterprise.config.backup.status.Status; 11 import com.sun.enterprise.config.backup.status.StatusConstants; 12 import com.sun.enterprise.config.backup.StatusRegistry; 13 import com.sun.enterprise.config.backup.utils.LocalStringsHelper; 14 import com.sun.enterprise.config.backup.utils.LoggerHelper; 15 import com.sun.enterprise.config.backup.pluggable.BackupStorage; 16 import com.sun.enterprise.config.backup.BackupAbortException; 17 import com.sun.enterprise.config.backup.BackupException; 18 import com.sun.enterprise.config.backup.utils.BackupHelper; 19 import com.sun.enterprise.config.backup.utils.FactoryHelper; 20 import java.io.File ; 21 22 26 public class UndoRestorePhases extends PhasesBase { 27 28 29 public UndoRestorePhases() { 30 } 31 32 public void assertStatusNotNull(UndoRestoreStatus rs) { 33 if(rs == null) { 34 LoggerHelper.info("null_status_in_restore"); 35 UndoRestoreStatus rs1 = new UndoRestoreStatus(); 37 Exception e = new BackupException( 38 "error_invoking_restore", 39 LocalStringsHelper.getString("error_invoking_restore")); 40 BackupHelper.setExceptionInStatus(rs1, e); 41 setStatusInRegistry(rs1); 42 throw new BackupAbortException( 43 "restore_status_null", 44 LocalStringsHelper.getString("restore_status_null")); 45 } 46 } 47 48 public UndoRestoreStatus getStatus() { 49 return (UndoRestoreStatus)getStatusFromRegistry(); 50 } 51 52 64 65 67 71 97 public void performUndoRestore(File f, UndoRestoreStatus rs) { 98 try { 99 FactoryHelper.getStorage().restore(f); 100 rs.setStatusCode(StatusConstants.STATUS_SUCCESS); 101 } catch(Exception e){ 102 LoggerHelper.error("error_performing_undo_restore", e); 103 } 105 } 106 107 111 public void deleteTarget() { 112 } 114 } 115 | Popular Tags |