net.sourceforge.jdbdump.dump
Class BinaryFileManager

java.lang.Object
  extended by net.sourceforge.jdbdump.dump.BinaryFileManager
All Implemented Interfaces:
DumpFileManager

public class BinaryFileManager
extends java.lang.Object
implements DumpFileManager

An implementation of DumpFileManager which saves dump objects in binary (serialized) form.

Author:
jsuder
See Also:
DumpFileManager

Nested Class Summary
 
Nested classes/interfaces inherited from interface net.sourceforge.jdbdump.dump.DumpFileManager
DumpFileManager.CompressionMethod
 
Constructor Summary
BinaryFileManager()
           
 
Method Summary
 void exportDump(Dump dump, java.io.File file, DumpFileManager.CompressionMethod compress)
          Saves a backup of the database represented in the dump object into the specified file.
 Dump importDump(java.io.File file, DumpFileManager.CompressionMethod compress)
          Loads the database structure as a Dump object from the specified file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BinaryFileManager

public BinaryFileManager()
Method Detail

exportDump

public void exportDump(Dump dump,
                       java.io.File file,
                       DumpFileManager.CompressionMethod compress)
Saves a backup of the database represented in the dump object into the specified file. First it saves the database structure which is already contained in the Dump, then uses the Dump to download all the data, table by table, record by record, and saves it into the file as soon as it's downloaded.

Specified by:
exportDump in interface DumpFileManager
Parameters:
dump - a database dump created using DatabaseConnector.dump() method
file - a file in which the backup will be stored
compress - compression method used to compress the file (zip, gzip or none)

importDump

public Dump importDump(java.io.File file,
                       DumpFileManager.CompressionMethod compress)
Loads the database structure as a Dump object from the specified file.
This method doesn't load any data (i.e. table records) from the file yet. Data should be loaded by DatabaseConnector.restore() when the dump returned by this function is passed to it. The dump stores a reference to the input stream from this file to be able to read the data later; when it is no longer needed, it should be closed by calling closeFileReader() on the Dump (but that shouldn't be called until all data is read in DatabaseConnector.restore()).

Specified by:
importDump in interface DumpFileManager
Parameters:
file - a file from which the backup should be read
compress - compression method used to decompress the file (zip, gzip or none)
Returns:
a database dump that can be uploaded using DatabaseConnector.restore() method


Copyright © 2005-2006 AGH International University of Science and Technology. All Rights Reserved.