OpenAB  1.0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
OpenAB_Storage::Storage Class Referenceabstract

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>

Inheritance diagram for OpenAB_Storage::Storage:
Collaboration diagram for OpenAB_Storage::Storage:

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 StorageItemIteratornewStorageItemIterator ()=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...
 

Detailed Description

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.

Member Enumeration Documentation

Enumerator
eAddItemOk 

Item/Items correctly added.

eAddItemFail 

Failure during the operation.

Enumerator
eGetItemOk 

Item was correctly found.

eGetItemFail 

Failure during the operation.

Enumerator
eGetRevisionsOk 

Revisions was correctly retrieved.

eGetRevisionsFail 

Failure during the operation.

Enumerator
eGetSyncTokenOk 

Token was correctly retrieved.

eGetSyncTokenFail 

Failure during the operation, or tokens are not supported.

Enumerator
eModifyItemOk 

Item was correctly modified.

eModifyItemFail 

Failure during the operation.

Enumerator
eRemoveItemOk 

Item was correctly removed.

eRemoveItemFail 

Failure during the operation.

Constructor & Destructor Documentation

OpenAB_Storage::Storage::Storage ( OpenAB::PIMItemType  t)
inline

Constructor.

Parameters
[in]ttype of provided PIM item (OpenAB::PIMItem)
virtual OpenAB_Storage::Storage::~Storage ( )
inlinevirtual

Destructor, virtual by default.

Member Function Documentation

virtual enum eAddItem OpenAB_Storage::Storage::addItem ( const OpenAB::SmartPtr< OpenAB::PIMItem > &  item,
OpenAB::PIMItem::ID newId,
OpenAB::PIMItem::Revision revision 
)
pure virtual

Adds a new item (OpenAB::PIMItem) to the Storage.

Parameters
[in]itemPIMItem that should be added (PIMItem type needs to be the same as type of item supported by Storage (Storage::getItemType()).
[out]newIdThe newly added item ID.
[out]revisionThe revision of newly added item - can be empty if revisions are not supported.
Returns
the status code

Implemented in OpenAB_Storage::CalendarStorage, and OpenAB_Storage::ContactsStorage.

virtual enum eAddItem OpenAB_Storage::Storage::addItems ( const std::vector< OpenAB::SmartPtr< OpenAB::PIMItem > > &  items,
OpenAB::PIMItem::IDs newIds,
OpenAB::PIMItem::Revisions revisions 
)
pure virtual

Adds new items (OpenAB::PIMItem) to the Storage.

Parameters
[in]itemsThe vector of items that should be added. (PIMItem type needs to be the same as type of item supported by Storage (Storage::getItemType()).
[out]newIdsThe newly added items ID in the same order as provided items.
[out]revisionsThe revisions of newly added items (in the same order as provided items).
Returns
the status code

Implemented in OpenAB_Storage::CalendarStorage, and OpenAB_Storage::ContactsStorage.

virtual OpenAB_Storage::Storage::eGetRevisions OpenAB_Storage::Storage::getChangedRevisions ( const std::string &  token,
std::map< std::string, std::string > &  revisions,
std::vector< OpenAB::PIMItem::ID > &  removed 
)
pure virtual

Gets revisions of items changed since Storage was in state identified by token.

Parameters
[in]tokendatabase token since changes should be returned (getLatestSyncToken())
[out]revisionsrevisions map containing items IDs and their current revisions
[out]removedIDs vector of removed items
Returns
the status code

Implemented in CalDAVStorage, CardDAVStorage, EDSCalendarStorage, and EDSContactsStorage.

virtual enum eGetItem OpenAB_Storage::Storage::getItem ( const OpenAB::PIMItem::ID id,
OpenAB::SmartPtr< OpenAB::PIMItem > &  item 
)
pure virtual

Get the item from the Storage.

Parameters
[in]idThe ID of the item that must be retrieved.
[out]itemThe item that was retrieved.
Returns
the status code

Implemented in OpenAB_Storage::CalendarStorage, and OpenAB_Storage::ContactsStorage.

virtual enum eGetItemRet OpenAB_Storage::Storage::getItem ( OpenAB::SmartPtr< OpenAB::PIMItem > &  item)
pure virtual

Gets PIM Item from Source. If Source is suspended getItem() should block until Source will be resumed or cancelled.

Parameters
[out]itemitem received from Source
Returns
the status code
Note
item is returned as smart pointer, its contents will be deleted automatically when no more references to it will exist, it's not advised to dereference and use direct pointer

Implements OpenAB_Source::Source.

Implemented in CalDAVStorage, CardDAVStorage, EDSCalendarStorage, and EDSContactsStorage.

virtual enum eGetItem OpenAB_Storage::Storage::getItems ( const OpenAB::PIMItem::IDs ids,
std::vector< OpenAB::SmartPtr< OpenAB::PIMItem > > &  items 
)
pure virtual

Get the items from the Storage.

Parameters
[in]idsThe IDs of the items that must be retrieved.
[out]itemsThe items that was retrieved.
Returns
the status code

Implemented in OpenAB_Storage::CalendarStorage, and OpenAB_Storage::ContactsStorage.

virtual OpenAB_Storage::Storage::eGetSyncToken OpenAB_Storage::Storage::getLatestSyncToken ( std::string &  token)
pure virtual

If storage supports tracking of items changes, it returns latest status identifier of the storage.

Parameters
[out]tokenlatest status identifier
Returns
eGetSyncTokenFail if storage does not supports changes tracking, eGetSyncTokenOk otherwise.

Implemented in CalDAVStorage, CardDAVStorage, EDSCalendarStorage, and EDSContactsStorage.

virtual OpenAB_Storage::Storage::eGetRevisions OpenAB_Storage::Storage::getRevisions ( std::map< std::string, std::string > &  revisions)
pure virtual

Gets revision of the items from the Storage.

Parameters
[out]revisionsmap containing items IDs and their current revisions.
Returns
the status code

Implemented in CalDAVStorage, CardDAVStorage, EDSCalendarStorage, and EDSContactsStorage.

virtual enum eModifyItem OpenAB_Storage::Storage::modifyItem ( const OpenAB::SmartPtr< OpenAB::PIMItem > &  item,
const OpenAB::PIMItem::ID id,
OpenAB::PIMItem::Revision revision 
)
pure virtual

Modifies item (OpenAB::PIMItem) in the Storage.

Parameters
[in]itemThe item that should be modified. (PIMItem type needs to be the same as type of item supported by Storage (Storage::getItemType()).
[in]idThe ID of the item that should be modified.
[out]revisionThe updated revision of modified items.
Returns
the status code

Implemented in OpenAB_Storage::CalendarStorage, and OpenAB_Storage::ContactsStorage.

virtual enum eModifyItem OpenAB_Storage::Storage::modifyItems ( const std::vector< OpenAB::SmartPtr< OpenAB::PIMItem > > &  items,
const OpenAB::PIMItem::IDs ids,
OpenAB::PIMItem::Revisions revisions 
)
pure virtual

Modifies items (OpenAB::PIMItem) in the Storage.

Parameters
[in]itemsThe vector of items to be modified. (PIMItem type needs to be the same as type of item supported by Storage (Storage::getItemType()).
[in]idsThe vector of ID of the items that must be modified (in the same order as provided items).
[out]revisionsThe updated revisions of modified items (in the same order as provided items).
Returns
the status code

Implemented in OpenAB_Storage::CalendarStorage, and OpenAB_Storage::ContactsStorage.

virtual StorageItemIterator* OpenAB_Storage::Storage::newStorageItemIterator ( )
pure virtual

Retrieve an new Iterator to quickly parse the list of items.

Returns
the new Iterator for this Storage

Implemented in CalDAVStorage, CardDAVStorage, EDSCalendarStorage, and EDSContactsStorage.

virtual enum eRemoveItem OpenAB_Storage::Storage::removeItem ( const OpenAB::PIMItem::ID id)
pure virtual

Removes item from the Storage.

Parameters
[in]idThe ID of the item that must be removed.
Returns
the status code

Implemented in OpenAB_Storage::CalendarStorage, and OpenAB_Storage::ContactsStorage.

virtual enum eRemoveItem OpenAB_Storage::Storage::removeItems ( const OpenAB::PIMItem::IDs ids)
pure virtual

Removes items from the Storage.

Parameters
[in]idsThe vector of ID of the items that must be removed.
Returns
the status code

Implemented in OpenAB_Storage::CalendarStorage, and OpenAB_Storage::ContactsStorage.


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