OpenAB
1.0.1
|
Documentation for Storage plugin interface. Generic interface is modeled over Sync Plugin specific requirements, it define a palceholder for all the functionalities required by the Sync Plugins. More...
#include <Storage.hpp>
Public Types | |
enum | eAddItem { eAddItemOk, eAddItemFail } |
enum | eModifyItem { eModifyItemOk, eModifyItemFail } |
enum | eRemoveItem { eRemoveItemOk, eRemoveItemFail } |
enum | eGetItem { eGetItemOk, eGetItemFail } |
enum | eGetSyncToken { eGetSyncTokenOk, eGetSyncTokenFail } |
enum | eGetRevisions { eGetRevisionsOk, eGetRevisionsFail } |
Public Types inherited from OpenAB_Source::Source | |
enum | eInit { eInitOk, eInitFail } |
enum | eSuspendRet { eSuspendRetOk, eSuspendRetFail, eSuspendRetNotSupported } |
enum | eResumeRet { eResumeRetOk, eResumeRetFail, eResumeRetNotSupported } |
enum | eCancelRet { eCancelRetOk, eCancelRetFail, eCancelRetNotSupported } |
enum | eGetItemRet { eGetItemRetOk, eGetItemRetEnd, eGetItemRetError } |
Public Member Functions | |
Storage (OpenAB::PIMItemType t) | |
Constructor. More... | |
virtual | ~Storage () |
Destructor, virtual by default. More... | |
virtual enum eAddItem | addItem (const OpenAB::SmartPtr< OpenAB::PIMItem > &item, OpenAB::PIMItem::ID &newId, OpenAB::PIMItem::Revision &revision)=0 |
Adds a new item (OpenAB::PIMItem) to the Storage. More... | |
virtual enum eAddItem | addItems (const std::vector< OpenAB::SmartPtr< OpenAB::PIMItem > > &items, OpenAB::PIMItem::IDs &newIds, OpenAB::PIMItem::Revisions &revisions)=0 |
Adds new items (OpenAB::PIMItem) to the Storage. More... | |
virtual enum eModifyItem | modifyItem (const OpenAB::SmartPtr< OpenAB::PIMItem > &item, const OpenAB::PIMItem::ID &id, OpenAB::PIMItem::Revision &revision)=0 |
Modifies item (OpenAB::PIMItem) in the Storage. More... | |
virtual enum eModifyItem | modifyItems (const std::vector< OpenAB::SmartPtr< OpenAB::PIMItem > > &items, const OpenAB::PIMItem::IDs &ids, OpenAB::PIMItem::Revisions &revisions)=0 |
Modifies items (OpenAB::PIMItem) in the Storage. More... | |
virtual enum eRemoveItem | removeItem (const OpenAB::PIMItem::ID &id)=0 |
Removes item from the Storage. More... | |
virtual enum eRemoveItem | removeItems (const OpenAB::PIMItem::IDs &ids)=0 |
Removes items from the Storage. More... | |
virtual enum eGetItemRet | getItem (OpenAB::SmartPtr< OpenAB::PIMItem > &item)=0 |
Gets PIM Item from Source. If Source is suspended getItem() should block until Source will be resumed or cancelled. More... | |
virtual enum eGetItem | getItem (const OpenAB::PIMItem::ID &id, OpenAB::SmartPtr< OpenAB::PIMItem > &item)=0 |
Get the item from the Storage. More... | |
virtual enum eGetItem | getItems (const OpenAB::PIMItem::IDs &ids, std::vector< OpenAB::SmartPtr< OpenAB::PIMItem > > &items)=0 |
Get the items from the Storage. More... | |
virtual OpenAB_Storage::Storage::eGetSyncToken | getLatestSyncToken (std::string &token)=0 |
If storage supports tracking of items changes, it returns latest status identifier of the storage. More... | |
virtual OpenAB_Storage::Storage::eGetRevisions | getRevisions (std::map< std::string, std::string > &revisions)=0 |
Gets revision of the items from the Storage. More... | |
virtual OpenAB_Storage::Storage::eGetRevisions | getChangedRevisions (const std::string &token, std::map< std::string, std::string > &revisions, std::vector< OpenAB::PIMItem::ID > &removed)=0 |
Gets revisions of items changed since Storage was in state identified by token. More... | |
virtual StorageItemIterator * | newStorageItemIterator ()=0 |
Retrieve an new Iterator to quickly parse the list of items. More... | |
Public Member Functions inherited from OpenAB_Source::Source | |
Source (OpenAB::PIMItemType t) | |
Constructor. More... | |
virtual | ~Source () |
Destructor, virtual by default. More... | |
virtual enum eInit | init ()=0 |
Initializes Source. More... | |
virtual enum eSuspendRet | suspend ()=0 |
Suspends Source, if such operation is supported. More... | |
virtual enum eResumeRet | resume ()=0 |
Resumes Source, if such operation is supported. More... | |
virtual enum eCancelRet | cancel ()=0 |
Cancels Source, if such operation is supported. After canceling Source next call to getVCard() should return eGetItemRetError status. More... | |
virtual int | getTotalCount () const =0 |
Returns total count of items available from Source, if such information is available. More... | |
OpenAB::PIMItemType | getItemType () const |
Returns type of PIM Item supported by Source. More... | |
Documentation for Storage plugin interface. Generic interface is modeled over Sync Plugin specific requirements, it define a palceholder for all the functionalities required by the Sync Plugins.
|
inline |
Constructor.
[in] | t | type of provided PIM item (OpenAB::PIMItem) |
|
inlinevirtual |
Destructor, virtual by default.
|
pure virtual |
Adds a new item (OpenAB::PIMItem) to the Storage.
[in] | item | PIMItem that should be added (PIMItem type needs to be the same as type of item supported by Storage (Storage::getItemType()). |
[out] | newId | The newly added item ID. |
[out] | revision | The revision of newly added item - can be empty if revisions are not supported. |
Implemented in OpenAB_Storage::CalendarStorage, and OpenAB_Storage::ContactsStorage.
|
pure virtual |
Adds new items (OpenAB::PIMItem) to the Storage.
[in] | items | The vector of items that should be added. (PIMItem type needs to be the same as type of item supported by Storage (Storage::getItemType()). |
[out] | newIds | The newly added items ID in the same order as provided items. |
[out] | revisions | The revisions of newly added items (in the same order as provided items). |
Implemented in OpenAB_Storage::CalendarStorage, and OpenAB_Storage::ContactsStorage.
|
pure virtual |
Gets revisions of items changed since Storage was in state identified by token.
[in] | token | database token since changes should be returned (getLatestSyncToken()) |
[out] | revisions | revisions map containing items IDs and their current revisions |
[out] | removed | IDs vector of removed items |
Implemented in CalDAVStorage, CardDAVStorage, EDSCalendarStorage, and EDSContactsStorage.
|
pure virtual |
Get the item from the Storage.
[in] | id | The ID of the item that must be retrieved. |
[out] | item | The item that was retrieved. |
Implemented in OpenAB_Storage::CalendarStorage, and OpenAB_Storage::ContactsStorage.
|
pure virtual |
Gets PIM Item from Source. If Source is suspended getItem() should block until Source will be resumed or cancelled.
[out] | item | item received from Source |
Implements OpenAB_Source::Source.
Implemented in CalDAVStorage, CardDAVStorage, EDSCalendarStorage, and EDSContactsStorage.
|
pure virtual |
Get the items from the Storage.
[in] | ids | The IDs of the items that must be retrieved. |
[out] | items | The items that was retrieved. |
Implemented in OpenAB_Storage::CalendarStorage, and OpenAB_Storage::ContactsStorage.
|
pure virtual |
If storage supports tracking of items changes, it returns latest status identifier of the storage.
[out] | token | latest status identifier |
Implemented in CalDAVStorage, CardDAVStorage, EDSCalendarStorage, and EDSContactsStorage.
|
pure virtual |
Gets revision of the items from the Storage.
[out] | revisions | map containing items IDs and their current revisions. |
Implemented in CalDAVStorage, CardDAVStorage, EDSCalendarStorage, and EDSContactsStorage.
|
pure virtual |
Modifies item (OpenAB::PIMItem) in the Storage.
[in] | item | The item that should be modified. (PIMItem type needs to be the same as type of item supported by Storage (Storage::getItemType()). |
[in] | id | The ID of the item that should be modified. |
[out] | revision | The updated revision of modified items. |
Implemented in OpenAB_Storage::CalendarStorage, and OpenAB_Storage::ContactsStorage.
|
pure virtual |
Modifies items (OpenAB::PIMItem) in the Storage.
[in] | items | The vector of items to be modified. (PIMItem type needs to be the same as type of item supported by Storage (Storage::getItemType()). |
[in] | ids | The vector of ID of the items that must be modified (in the same order as provided items). |
[out] | revisions | The updated revisions of modified items (in the same order as provided items). |
Implemented in OpenAB_Storage::CalendarStorage, and OpenAB_Storage::ContactsStorage.
|
pure virtual |
Retrieve an new Iterator to quickly parse the list of items.
Implemented in CalDAVStorage, CardDAVStorage, EDSCalendarStorage, and EDSContactsStorage.
|
pure virtual |
Removes item from the Storage.
[in] | id | The ID of the item that must be removed. |
Implemented in OpenAB_Storage::CalendarStorage, and OpenAB_Storage::ContactsStorage.
|
pure virtual |
Removes items from the Storage.
[in] | ids | The vector of ID of the items that must be removed. |
Implemented in OpenAB_Storage::CalendarStorage, and OpenAB_Storage::ContactsStorage.