org.helidb.backend
Class SingleAndProxiedDatabaseFile

java.lang.Object
  extended by org.helidb.backend.SingleAndProxiedDatabaseFile
All Implemented Interfaces:
DatabaseFiles

public class SingleAndProxiedDatabaseFile
extends Object
implements DatabaseFiles

This DatabaseFiles implementation contains a single ReadWritableFile and a proxied DatabaseFiles object.

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

Constructor Summary
SingleAndProxiedDatabaseFile(DatabaseFiles proxied, ReadWritableFile f)
          Create a SingleAndProxiedDatabaseFile object.
 
Method Summary
 void delete()
          Delete the database file(s).
 ReadWritableFile getFile()
          Get the file.
 DatabaseFiles getProxied()
          Get the proxied DatabaseFiles object.
 void replaceContents(DatabaseFiles f)
          Replace the contents of the database file(s) with the contents of the supplied file(s).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SingleAndProxiedDatabaseFile

public SingleAndProxiedDatabaseFile(DatabaseFiles proxied,
                                    ReadWritableFile f)
Create a SingleAndProxiedDatabaseFile object.

Parameters:
proxied - The proxied DatabaseFiles object.
f - The ReadWritableFile.
Method Detail

getFile

public ReadWritableFile getFile()
Get the file.

Returns:
The file.

getProxied

public DatabaseFiles getProxied()
Get the proxied DatabaseFiles object.

Returns:
The proxied DatabaseFiles object.

delete

public void delete()
Description copied from interface: DatabaseFiles
Delete the database file(s).

Specified by:
delete in interface DatabaseFiles

replaceContents

public void replaceContents(DatabaseFiles f)
Description copied from interface: DatabaseFiles
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.

Specified by:
replaceContents in interface DatabaseFiles
Parameters:
f - The file(s) containing the data.