View Javadoc

1   /* $Id: PlainTextFileManager.java,v 1.6 2006/01/10 16:00:08 psionides Exp $ */
2   package net.sourceforge.jdbdump.dump;
3   
4   import java.io.File;
5   
6   import org.apache.log4j.Logger;
7   
8   /***
9    * An implementation of DumpFileManager which saves dump objects in plain text form as SQL commands.
10   * 
11   * @todo this class is not implemented yet
12   * @see DumpFileManager
13   * @author jsuder
14   */
15  
16  public class PlainTextFileManager implements net.sourceforge.jdbdump.dump.DumpFileManager {
17  	
18  	/*** A log4j logger for this class. */
19  	private static Logger logger = Logger.getLogger(PlainTextFileManager.class);
20  
21  	/***
22  	 * Saves a backup of the database represented in the dump object into the specified file.
23  	 * First it saves the database structure which is already contained in the Dump, then
24  	 * uses the Dump to download all the data, table by table, record by record, and saves it
25  	 * into the file as soon as it's downloaded.
26  	 * 
27  	 * @todo this method is not implemented yet
28  	 * @param dump a database dump created using DatabaseConnector.dump() method
29  	 * @param file a file in which the backup will be stored
30  	 * @param compress compression method used to compress the file (zip, gzip or none)
31  	 */
32  
33  	public void exportDump(Dump dump, File file, CompressionMethod compress) {
34  		// TODO: implement exportDump()
35  	}
36  	
37  	/***
38  	 * Loads the database structure as a Dump object from the specified file.
39  	 * <br />
40  	 * This method doesn't load any data (i.e. table records) from the file yet. Data should be
41  	 * loaded by DatabaseConnector.restore() when the dump returned by this function is passed to
42  	 * it. The dump stores a reference to the input stream from this file to be able to read the data
43  	 * later; when it is no longer needed, it should be closed by calling closeFileReader() on the
44  	 * Dump (but that shouldn't be called until all data is read in DatabaseConnector.restore()).
45  	 * 
46  	 * @todo this method is not implemented yet
47  	 * @param file a file from which the backup should be read
48  	 * @param compress compression method used to decompress the file (zip, gzip or none)
49  	 * @return a database dump that can be uploaded using DatabaseConnector.restore() method
50  	 */
51  
52  	public Dump importDump(File file, CompressionMethod compress) {
53  		// TODO: implement importDump()
54  		return null;
55  	}
56  }