Buteo Synchronization Framework
Public Member Functions | Protected Member Functions | List of all members
Buteo::DeletedItemsIdStorage Class Reference

Persistent storage for storing deleted item IDs. More...

#include <DeletedItemsIdStorage.h>

Public Member Functions

 DeletedItemsIdStorage ()
 Contructor.
 
 ~DeletedItemsIdStorage ()
 Destructor.
 
bool init (const QString &aDbFile)
 Initializes backend. More...
 
bool uninit ()
 Uninitializes backend. More...
 
bool getSnapshot (QList< QString > &aItems, QList< QDateTime > &aCreationTimes) const
 Retrieves persistently stored snapshot of item id's. More...
 
bool setSnapshot (const QList< QString > &aItems, const QList< QDateTime > &aCreationTimes)
 Store a snapshot of item id's persistently. More...
 
void addDeletedItem (const QString &aItem, const QDateTime &aCreationTime, const QDateTime &aDeleteTime)
 Adds a deleted item to backend. More...
 
void addDeletedItems (const QList< QString > &aItems, const QList< QDateTime > &aCreationTimes, const QList< QDateTime > &aDeleteTimes)
 Adds deleted items to backend. More...
 
bool getDeletedItems (QList< QString > &aItems, const QDateTime &aTime)
 Returns the deleted items after given time. More...
 

Protected Member Functions

bool ensureItemSnapshotExists ()
 Checks whether snapshot table exists and creates it if needed. More...
 
bool ensureDeletedItemsExists ()
 Checks whether item id table exists and creates it if needed. More...
 

Detailed Description

Persistent storage for storing deleted item IDs.

Member Function Documentation

◆ addDeletedItem()

void DeletedItemsIdStorage::addDeletedItem ( const QString &  aItem,
const QDateTime &  aCreationTime,
const QDateTime &  aDeleteTime 
)

Adds a deleted item to backend.

Parameters
aItemItem Id
aCreationTimeTime when item was initially created
aDeleteTimeTime of deletion

◆ addDeletedItems()

void DeletedItemsIdStorage::addDeletedItems ( const QList< QString > &  aItems,
const QList< QDateTime > &  aCreationTimes,
const QList< QDateTime > &  aDeleteTimes 
)

Adds deleted items to backend.

Parameters
aItemsItems Ids
aCreationTimesTimes when the items were initially created
aDeleteTimesTimes of deletion

◆ ensureDeletedItemsExists()

bool DeletedItemsIdStorage::ensureDeletedItemsExists ( )
protected

Checks whether item id table exists and creates it if needed.

Returns
True on success, otherwise false

◆ ensureItemSnapshotExists()

bool DeletedItemsIdStorage::ensureItemSnapshotExists ( )
protected

Checks whether snapshot table exists and creates it if needed.

Returns
True on success, otherwise false

◆ getDeletedItems()

bool DeletedItemsIdStorage::getDeletedItems ( QList< QString > &  aItems,
const QDateTime &  aTime 
)

Returns the deleted items after given time.

Parameters
aItemsReturned deleted items
aTimeItems deleted after this time are considered deleted
Returns
True on success, otherwise false

◆ getSnapshot()

bool DeletedItemsIdStorage::getSnapshot ( QList< QString > &  aItems,
QList< QDateTime > &  aCreationTimes 
) const

Retrieves persistently stored snapshot of item id's.

Parameters
aItemsItems of the snapshot
aCreationTimesCreation times of the items
Returns
True on success, otherwise false

◆ init()

bool DeletedItemsIdStorage::init ( const QString &  aDbFile)

Initializes backend.

Parameters
aDbFilePath to database to use as persistent storage
Returns
True on success, otherwise false

◆ setSnapshot()

bool DeletedItemsIdStorage::setSnapshot ( const QList< QString > &  aItems,
const QList< QDateTime > &  aCreationTimes 
)

Store a snapshot of item id's persistently.

Parameters
aItemsItem id's to store
aCreationTimesCreation times of the items
Returns
True on success, otherwise false

◆ uninit()

bool DeletedItemsIdStorage::uninit ( )

Uninitializes backend.

Returns
True on success, otherwise false

The documentation for this class was generated from the following files: