org.helidb.backend
Interface DatabaseFiles

All Known Implementing Classes:
SingleAndProxiedDatabaseFile, SingleDatabaseFile

public interface DatabaseFiles

This interface defines the set of files (one or several) that is used by a database backend.

Since:
1.0
Author:
Karl Gustafsson
In_jar:
helidb-core

Method Summary
 void delete()
          Delete the database file(s).
 void replaceContents(DatabaseFiles dbf)
          Replace the contents of the database file(s) with the contents of the supplied file(s).
 

Method Detail

delete

void delete()
            throws WrappedIOException
Delete the database file(s).

Throws:
WrappedIOException - On I/O errors.

replaceContents

void replaceContents(DatabaseFiles dbf)
                     throws WrappedIOException
Replace the contents of the database file(s) with the contents of the supplied file(s). The implementation of this method should be able to assume that the supplied object is of the same implementation as itself. (It is up to the database backend implementation to guarantee that.)

The contents of the database files should be replaced using the ReadWritableFile.replaceContents(org.entityfs.ReadWritableFile) method. A consequence of that is that the source files should be deleted.

Parameters:
dbf - The file(s) containing the data.
Throws:
WrappedIOException - On I/O errors.