package gettasky.storage;
import gettasky.storage.mongodb.MongoTaskStorage;
/**
* Factory for storage objects.
* Abstracts away which underlying storage mechanism is in use.
*/
public class StorageFactory
{
private static TaskStorage taskStorageInstance;
/**
* Return the task storage singleton instance.
*/
public static TaskStorage getTaskStorage()
{
if (taskStorageInstance == null)
{
// Eventually the storage mechanism would be configurable, rather than hard-coded.
taskStorageInstance = new MongoTaskStorage();
}
return taskStorageInstance;
}
}