1 23 24 package com.sun.enterprise.config.backup; 25 26 import com.sun.enterprise.config.backup.util.*; 27 import java.io.*; 28 import java.util.*; 29 30 35 36 abstract class BackupRestoreManager 37 { 38 public BackupRestoreManager(BackupRequest req) throws BackupException 39 { 40 if(req == null) 41 throw new BackupException("backup-res.InternalError", getClass().getName() + ".ctor: null BackupRequest object"); 42 43 this.request = req; 44 init(); 45 LoggerHelper.finest("Request DUMP **********\n" + req); 46 } 47 48 50 void init() throws BackupException 51 { 52 if(wasInitialized) 54 return; 55 56 if(request == null) 57 throw new BackupException("backup-res.InternalError", "null BackupRequest reference"); 58 59 request.timestamp = System.currentTimeMillis(); 61 62 if(request.description == null || request.description.length() <= 0) 63 request.description = "" + request.timestamp; 64 if(request.domainsDir == null || !FileUtils.safeIsDirectory(request.domainsDir)) 66 throw new BackupException("backup-res.NoDomainsDir", request.domainsDir); 67 68 if(!StringUtils.ok(request.domainName)) 70 throw new BackupException("backup-res.InternalError", "No domain-name was specified"); 71 72 request.domainDir = new File(request.domainsDir, request.domainName); 73 74 LoggerHelper.setLevel(request); 75 } 76 77 79 BackupRequest request; 80 private boolean wasInitialized = false; 81 } 82 | Popular Tags |