Added skeleton of PersistenceManager

Signed-off-by: Jim Martens <github@2martens.de>
This commit is contained in:
2017-05-17 15:13:54 +02:00
parent 3833efa8e8
commit d913c31977

View File

@ -0,0 +1,55 @@
/**
* Persistence manager using the Singleton pattern.
*/
public class PersistenceManager
{
private static PersistenceManager instance = null;
/**
* Returns an instance of the persistence manager.
* @return instance
*/
public static PersistenceManager getInstance()
{
if (instance == null) {
instance = new PersistenceManager();
}
return instance;
}
/**
* private constructor
*/
private PersistenceManager()
{}
/**
* Begins the transaction and returns the transaction ID.
* @return transaction ID
*/
public int beginTransaction()
{
return 0;
}
/**
* Commits the transaction specified by given ID.
* @param taid transaction ID
*/
public void commit(int taid)
{
}
/**
* Writes given data into given page in given transaction.
* @param taid transaction ID
* @param pageid page ID
* @param data data
*/
public void write(int taid, int pageid, String data)
{
}
}