FileDocCategorySizeDatePackage
BackupRestoreManager.javaAPI DocGlassfish v2 API3645Fri May 04 22:23:14 BST 2007com.sun.enterprise.config.backup

BackupRestoreManager

public abstract class BackupRestoreManager extends Object
Baseclass for BackupManager and RestoreManager. Common code between the two goes in here.
author
Byron Nevins

Fields Summary
BackupRequest
request
private boolean
wasInitialized
Constructors Summary
public BackupRestoreManager(BackupRequest req)

		if(req == null)
			throw new BackupException("backup-res.InternalError", getClass().getName() + ".ctor: null BackupRequest object");
		
		this.request = req;
		init();
		LoggerHelper.finest("Request DUMP **********\n" + req);
	
Methods Summary
voidinit()

		// only do once!
		if(wasInitialized)
			return;
		
		if(request == null)
			throw new BackupException("backup-res.InternalError", "null BackupRequest reference");
		
		// add a timestamp
		request.timestamp = System.currentTimeMillis();
		
		if(request.description == null || request.description.length() <= 0)
			request.description = "" + request.timestamp;
		// validate domains dir
		if(request.domainsDir == null || !FileUtils.safeIsDirectory(request.domainsDir))
			throw new BackupException("backup-res.NoDomainsDir", request.domainsDir);
		
		// validate the domain-name
		if(!StringUtils.ok(request.domainName))
			throw new BackupException("backup-res.InternalError", "No domain-name was specified");

		request.domainDir = new File(request.domainsDir, request.domainName);
		
		LoggerHelper.setLevel(request);